Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Can't Get Apache To Run PHP Inside Html From Localhost - Works Fine From /var/ww/html


I had a look at the stantonfinley fedora core 5 instructions and robooted but to no avail. PHP scripts work fine from var/www/html whether the suffix is .php or .htm but not from localhost. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Html Within Works, But Within Html Doesnt
Below are two different ways of writing the same script. The top one works
but the bottom one displays nothing in the list. Code:

View Replies !
Session Don't Works Fine
I've got my intranet running in a server with XP, apache and PHP. When i'm testing my apps, sessions work fine, but when I upload it to the server they don't work. My app checks users against Active Direcory and save some data to session variables. I show this variables in a frame and check some times if user is logged to show some info. Someone know's what's the matter with it?

View Replies !
Mail() Function Always Works Fine, But Hangs.
Just the simplest invocation with hard coded parameters, followed
by echoing a message, hangs for exactly 1 minute. ("defaulttimeout"
in php.ini is set to 30 (seconds)). If I don't wait, and immediately
hit the browser's "stop" button I get that "transfer interrupted"
message, but the email still gets sent and received just fine.
Sendmail is not running, "sendmail_path" is not set in php.ini, and
the email headers look as if the email was sent from the command line
using /bin/mail.

View Replies !
HTML Works Same
If this question has been asked before I am really sorry. but right now i am really amazed since I see all my html files work as same as php files. I use bunch if include codes on my pages and therefore i use php to make the server recognize. First I create the file as html file and I convert it to php and thats how the server reads.
If there is only html file uploaded it was not reading the include files and all the include sections used to be blank since it is html.

Couple mins ago i was trying something and i saw that html files read as same php. widget.html is same widget.php and even more interesting if you want to reach the content from widget.html it goes to widget.html?subaction=etc.etc. it used to widget.php?subaction-etc.etc.

Is this normal? was I sleeping when this thing came out ages ago? Last time about coupke months ago there wasn;t such thing and now I am really surprised, I would appreciate if anyone can comment on this.

View Replies !
Isset($_REQUEST['var']) Works Fine On One Server But Not On Another
The isset($_REQUEST['var']) works okay on other servers but not on
mine. The way the application works is the links are provided as:

http://url.com/cc.php?page=currencies&new

And then in cc.php the code is

if isset($_REQUEST['new']) {
...
}

The problem is with the above code it sees new as not set and the if
statement isn't exectuted. The same code on other servers works OK.

If I change the url to:
http://url.com/cc.php?page=currencies&new=
or
http://url.com/cc.php?page=currencies&new=something

Then the isset($_REQUEST['new']) will be true.

Is there any setting in my php config to make php see 'new' variable
as set as I've shown in the first url in this message?

View Replies !
Works Fine On Home Server But Not On Hosting Package!
He the following code works on my apache machine but not on my purchased webspace! it gives the error ... Error, insert query failed ....

View Replies !
Counter Works Fine But Just Checked The W3c Validation Site
I have just built my first website but have added a couple of php scripts (include files) for a counter etc (until I can write my own).

My site is in xhtml 1.0 transitional and the counter works fine but just checked the w3c validation site and it shows errors against my line 129 which is as follows:

<div id="counter"> <span class="countertext">you are visitor</span>
<?php include("counter.php");?>
<span class="countertext"> thank you.</span> </div>

My question is this: If php is a server side language why do I get xhtml errors. I take it the errors are in the counter.php file.

View Replies !
Have A Website Running In IIS Which Works Fine Except Can't Connect To Mysql
what I can do to fix this error? 

Call to undefined function mysqli_connect() in C:Inetpubwwwrootemail_username.php on line

I have these extensions enabled:

extension=php_mysql.dll
extension=php_mysqli.dll

I am not sure what else to do?"?

View Replies !
Weirdness: Mysql Query Works Fine On Netscape, Access Denied On IE
The error is the common "access denied to user@localhost on database,"
or whatever the exact language is. (I email from Linux so can't copy
the exact wordage right now.) But like I say, it only occurs on IE
running on the woeful Windows ME. I haven't tried it on another flavor
of Windows. Netscape works just fine on whatever both OSes I have.

Here's the code, short and sweet:

// database variables
$userName = GetDBUserName();
$password = GetDBPassword();
$dbName = GetDBName();
$hostName = GetDBHostName();

$db = mysql_pconnect($hostName, $userName, $password);

View Replies !
Page Coming Up Blank/white Online, But Works Fine Locally...
I'm going to start off making this question very vague and general (as to not over-clutter it with needless info), but if you want more details I can provide them...

Basically, I have a PHP page (that serves to update a table on a SQL database) that works fine locally. But when posted online, the page doesn't even show up. There's no error or anything - the page is just blank (white). It displays this way both on IE and Firefox...

It is one of many pages in the site.  The site itself has the user log in, and then they can post a new record to the database, delete a record, or update/edit a current record.

All other pages are working/displaying fine, but it's just that "update/edit" page that comes up blank (and again - it works fine locally, just not online).

View Replies !
Php Inside Html Or Html Inside Php
To have a big (complete file) php tag and print the html code, or to have a html file and just insert php code when necesary ?
I would like to know this from the programming point of view and from the performance.

For example, I have big and complicated tables that I would like to write in plain html and insert some php variables, so, I'll had to open a tag, print a variable and close it a lot of time.
If there's is any other thing that I didn't mention about this, please tell me.

View Replies !
Inside HTML
According to accessibility rules. One problem (among others) i found is, i get an error using php files as src in iframes. According to the site here i test it i sould use HTML files in it. So after i searched the forum, and semm's like there's no way to include php code inside html files if you don't change your apache (n/a). Does this

<script language='php'>...</script>

also works only in php files.

View Replies !
How Can I Put XSL Tag Inside HTML Form Tag?
Sorry I couldn't find a XML/XSL group
I can only post these groups close to my subject.

In JSP (Java Server Page) you can do something
like this

<%
String v = myBean.getValue();
%>

<form .... >
<input name="myTag" value="<%= v %>">
</form>

You can do the similar thing in PHP.

But when I try in XSL I got error.

I have an XML file

<myTag attribute1="value1" />

Now I want to transform it into HTML form tag used XSL template
But XSL doesn't like this

<input name="myTag" value='
<xsl:value-of select="@attribute1" />
'></input>

How can I solve this problem?

View Replies !
IF Inside HTML Echo
I'm echoing the HTML which makes a checkbox, how can I make it checked based on an IF inside the echo itself? It works fine if I code it HTML with a nested php line. This works: PHP Code:

View Replies !
Script From Inside An HTML Page
To call a php script from inside an HTML page I use the href tag with a
link like http://www.mydomain.com/script.php. This works but is it the
best way / only way?

View Replies !
Executing HTML Inside An Email
I want to display my contents in tabular form inside an email. my code is ...

$tab1 = "<table><tr></tr></table>";

mail ("xyz@gmail.com"," ", $tab1, " ");

But i m getting all the tags as they are in tab1 instead of a table !

View Replies !
Escaping Inside Mail() To Add Html
I'm using mail() and am trying to email the contents of a form. I can do this successfully until I try and make what is emailed from that form a little more complicated. Right now I have:

mail( "me@myemail.com", "This is a test",
  "Message goes here",
"From:$first_name $last_name <$email>
Content-type: text/html; charset=us-ascii");

This works as it should. In my "Message goes here", section I have listed the vars and text, as you might expect, and I am formatting it very basically with simple tags for line break, and strong text etc. The problem I have comes when I am trying to have it send the results of a number of checkboxes. I had a similar problem the other day, and when this problem arose I was offered this

code: foreach ($_POST['checkboxname'] as $value) {
echo "$value " ;
}

This worked fine, but I cannot get it to work within my page that has mail() in it. I'm sure this is not right, but I put this entire code inline where I wanted the checkbox array to be displayed. Should I put foreach ($_POST['checkboxname'] as $value) somewhere else, and then just reference the array with $value inside the mail() code with the other variables? I did try this, but it didn't work for some reason.

My other thought was to escape out of "Message goes here", and just put html code in, but if I do this, I get no message content at all.

View Replies !
PHP Code Inside Html Textbox
I am trying to be able to display a texbox with a default value from php. I also want a function to run when the textbox is selected to tell the user what format the data should be entered in. I am trying. Code:

<td><input name="sdate" type="text" maxlength="11" value=<?php echo '"'.date("Y")."-01-01"; ?> onfocus="dateHelp()"/></td>

But it isn't working and is displaying "2006-01-01 onfocus=" inside the text box, and not running the dataHelp. If I remove the php and use. Code:

<td><input name="sdate" type="text" maxlength="11" value="" onfocus="dateHelp()"/></td>

it works fine, but with no default value from php. How can I get them both to work together? I am sure I am missing out something silly like double quotes.

View Replies !
Counter Script Inside Normal Html
I am trying to include a counter script inside normal html. I have my counter php script called counter.php i then have a index.html file that i would like to include the counter in. I have coded like this in the html file:

<?php include("counter.php"); ?>

If I run the counter.php page on it's own, it links to mysql and returns the desired result.

View Replies !
Converting FROM Html Entities Inside TEXT VALUE Parameter
I am experiencing some very odd behaviour using a function that converts from htmlentities unhtmlentites() - equivalent to pre-made html_entity_decode() in more recent versions of php. The function works fine, but when I echo inside a form, something goes wrong. Please look at the following code, in particular the output near the bottom.

This is a survey that saves form POST information in a mysql database, that is called back to the, rather long form, to show the user what they have already answered (by outputting answers back to the form). PHP Code:

View Replies !
Php Code Embedded Inside Html Page Not Working.
How do I make or workaround in my Apache server to parse *.html files
for
<?php ?> code embedded in it?

Currently php recognises <?php ?> tag only if the file has a *.php
extension. Any php code inside *.html or *.htm is ignored.

Since I dont have admin access to the server or admin person, changing
the php configuration is out of choice. Now I have to go thru echo
and print statemnets to get it work. But it looks very cumbersome and
prone to errors.

View Replies !
Paste HTML Page Inside Text Area
i want to create a newsletter or emailer form sender. and that form has a text area. can be an ordinary text area or can also be tinymce.

i want to have the text area in such a way that an HTML page can be pasted in the text area (let say the html page is jobpost.html) and send it to the email address that i specified.

View Replies !
Echo Result Set As HTML Image Source Inside Javascript
I'm attempting to echo an HTML table with images in one cell and data in the other.
The data shows fine but the images do not. When I view the echoed HTML source I have nothing between my "". Code:

View Replies !
Regex Question - Can't Get Unclosed Quote Marks Inside Of HTML Tags
I do not know much about regex.

I'm worried about lines like this:

<a href="myFile>my file</a>

There is only one quote mark in that html.

I wanted to fix this problem, so I tried this:

function command($string=false) {
$pattern = '/(.*)<a (.*)"(.*)>/i'
$replacement = '$1<$2"$3">'
$newString = preg_replace($pattern, $replacement, $string);
return $newString;
}

View Replies !
Ip Ban Works On Localhost, Not On Www
I have the following page to ban people from viewing my website...

<?php
$iptest = $_SERVER['REMOTE_ADDR'];
$data="";
$fp = @fopen("../ip.txt", "rb") or die("Couldn't open file");
while(!feof($fp))
{
$data .= fgets($fp, 1024);
}
fclose($fp);
$values = explode("", $data);
if(in_array($iptest, $values))
{
die('You have been banned from this site');
}
?>

The contents of ip.txt are in the following format..
81.59.75.xx
81.27.204.#*$!
80.127.6.xxx
212.32.102.xxx

If i add 127.0.0.1 and run this page from a localhost it bans me successfully but as soon as I upload the page it and add my IP to test it, it does not work on the web!

View Replies !
Apache Html And Php Problem
I'm not getting php to do anything in the following index.htm script

Php works fine as a .php script but placing it in a html script yields
zip, nada, zilch.

Is it a httpd problem or php.ini?

View Replies !
Redirect To Html When Apache Is Down
I am running the apache server from home and my website from an php unsupported web server. I need a way to see if the appache is running to access on_air.php, if not redirect to an html page on my webserver. Remember my server doesnt support php, so I am looking for an if then kind of statement.

View Replies !
Can Apache Fire Up PHP In .html Pages
I'd like to know if Apache (under Linux) can be made to pass PHP code over to PHP from within .html file rather that .php. I've tried putting php tags in my .html pages but they get sent straight through to the browser. Is this correct?

View Replies !
Copy A File To Folder In Apache Directory From Html Form
Does anyone have a PHP script that will take a file uploaded by a user via a HTML form, i.e.:

<input type="file" name="filename" id="filename" class="textbox">

Take the file and copy it into the Apache directory on the server?

i.e. on my local machine Apache2.2/htdocs/mini/images/*FILEINHERE*

View Replies !
Image Or File Upload Works On Localhost But Not On Server
I have an upload image page in my site and it works pretty well in my localhost.

However, when i uploaded it in my server, the error message I have in my php is displayed. What seems to be the problem?

View Replies !
How To Store HTML Code (with " ", ' ') Inside A Variable In Php Script?
Assuming i have this simple script :

<?PHP

//Opening tag ='
$html_header='
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
' // Closing tag ='

echo $html_header;

?>

If the opening & closing tags are both ' then it works fine, but if the
html script itself contains a ' then i need some way to escape it, no ?

How should i do it if i had something like <HEAD><TITLE='PHP foo'></HEAD>?

View Replies !
Using Includes: Html Form Parse Data Inside 2nd Form.
i'm coming down the stretch, so to speak. i've got a lot of the separate things settled that i need for my main "date entry" form. due to the several data items which need to be collected by this form, i've decided to try using includes, which i've found isn't that tricky at all really.

however, one of my includes needs itself to parse it's own little form data to result in the final entry to be submitted in the "date entry" form. perhaps doing this particular bit as an "include" is NOT the best option? Code:

View Replies !
Inserting Adsense Code - Html Program That Automatically Coverts All My Text Files To Html Webpages?
I've purchased a text to html program that automatically coverts all my text files to html webpages within a template, but the only problem is how do I insert my adsense code into all 250 pages? I've seen articles regarding PHP includes for page templates, but I'm not sure how this would work inserting my code.

View Replies !
PHP HTML Email Doesn't Format The Text Using The Html Tags
I had a PHP script that sent an html email from a Flash form. It was all working on a Windows based server. Then my server was switched to a Linux based one. It now sends the email, but has a lot of random characters and doesn't format the text using the html tags. Code:

View Replies !
Apache/PHP On Localhost
I installed Apache and PHP and it works then I went to whatismyip.com and gave my IP to someone and he typed it in and the error he recieved was "unable to connect". Am I missing something?

View Replies !
HTML Email Using PHP Problem (Receive Html Tags)
When I send the html email, the only thing I receive is the tags (the
html codes basically). I want to be able to see the email like a html
page, what is wrong with my code? Here is a copy paste of it.

$HTML = "</html><body><img src='http://www.somewebsite.com/
someimage.jpg'></body></html>";

$headers = "From: $from
";
$headers .= "MIME-Version: 1.0
";
$boundary = uniqid("HTMLDEMO");
// Now we attach the HTML version

$headers .= "--$boundary
".
"Content-Type: text/html; charset=ISO-8859-1
".
"Content-Transfer-Encoding: base64

";

$headers .= chunk_split(base64_encode($HTML));

mail($to,$subject,"",$headers);

print "mail Sent<br>";

The email I receive has this as text:

</html><body><img src='http://www.somewebsite.com/someimage.jpg'></
body></html>

View Replies !
PHP And Apache Localhost With Sessions
is it posible to have sessions functioning on localhost with apache ? I get this warning

Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

I am fairly sure I need to edit the relivent line of the php.ini but I dont know in what way.

View Replies !
RemoveHandler .html .htm (parse Php In .html Files)
I want to parse php in .html files.

I put this in .htacces file:

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

Its work, but some of my php aplications have urls:

www.mysite.com/this-is-page

without .html in the end

how to parse that? Which code I must use.

View Replies !
Embed Php Generated Html In Another Html Page
I am trying to include some php generated html in a page that is just a standard html file, NOT a php file. I have seen other html pages do this by including an src to the cgi script in script tags, like this:

<script src="http://someurl.com/somescript.cgi"></script>

the html page loads and the script is executed and the returned html is displayed in the calling page. So, I tried this:

<script src="http://someurl.com/somescript.php"></script>

It doesnt work!!

View Replies !
.html' Page Be Replaced By '.html.php'
Can a '.html' page be replaced by '.html.php' page via RewriteRule? To clarify, I'm using a software that formats the look of the site using .html pages. I'd like to add PHP code to that page but of course, it is not of the right page type.

What I was wondering is Could I create a duplicate of that '.html' page, rename it to .g. '.html.php' and make the revisions and then just create a RewriteRule that redirects the '.html' page to the '.html.php' without generating an error?

The alternative and undesired way of doing it would be to rename the original page to '.html.php' and find and revise ALL of the routines that call that page. That would create a revision nightmare especially upon upgrading the software.

View Replies !
Using 'localhost' With Apache 1.3 HTTP Basic Authentication?
I'm configuring a PHP script to use HTTP Basic Authentication.
Thus, is it possible to test basic authentication using 'localhost'?
If so, could someone send me a working .htaccess file because the
following doesn't seem to launch the login dialog:

AuthType Basic
AuthName "TEST HOST"
AuthUserFile C:/wwwroot/testhost/passwd/.htpasswd
AuthGroupFile /dev/null
<Limit Get>
Require valid-user
Order allow,deny
Deny from all
Satisfy all
</Limit>

View Replies !
Apache Not Recognising Http://localhost From Browser
I have been using a local installment of Apache web server and PHP on
my computer. For some reason it has stopped loading my local web pages
when I enter 'http://localhost' into the browser address bar. For IE it
displays a page not found and Netscape, it redirects me to Netscape
search where it does a search for 'localhost'. I cant understand why it
has been working and all of a sudden just stopped but is there anyway
to fix this in configuration? My knowledge of apache isnt the best so

View Replies !
Access Denied For User 'apache'@'localhost'
I am trying to write a script that will connect to my MySQL database using PHP. The problem is that instead of trying to log in as the user I specified, it is the user 'apache' that is trying to log into the database. Error message: Code:

View Replies !
Can I Run PHP File Inside A HTML File?
I want a count file(PHP) to be executed when a HTML file requested. How can I do this? I have no idea about excuted a PHP file inside a HTML file.

View Replies !
Curl Fails With Apache - But Works In Command Line
I am using PHP 5.1.2 with curl enabled. But whenever I try to use curl
to fetch a url, it fails - 'curl_exec()' returns nothing.

But if I try to execute the same file in CLI - like 'php curl.php', the
script works properly. However if I try it in a browser, nothing is
returned. Code:

View Replies !
Header() Inside Apache SSI
I'm having trouble getting the header() call to work inside an Apache SSI. Basically I'm trying to do some user authentication. I have a login page where users enter id and password. It then directs to a PHP script to lookup the id and password in a MySQL db. If login info is correct, the script sets some PHP session vars.

Then in the page that needs authentication, which uses a SSI header page, I have php code that checks to see if the user has logged in by checking the existence of a session var. If so, the page keeps going, if not, I want to redirect them back to the login page automatically by calling header().

This setup works fine on my Redhat linux box running Apache 2.0 and PHP 4.2.2. Once I move it to another server which is running Apache 1.3.26 and PHP 4.2.2 on FreeBSD, the header() call doesn't work anymore. The session vars seem to all work fine, except the header call. When I try to call header in a pure PHP script that's not part of a SSI, the call also works fine. See below for my sample script: Code:

View Replies !
Extension Loading Works In Command-line, But Not Apache Browser
all I'm trying to do is load the php_mapscript.so library into php.

Here's the php file:
Code:

dl("php_mapscriot.so")
if (extension_loaded("MapScript"))
echo "works!";
else
echo "doesn't work!";
print_r(get_loaded_extensions());

Here's from the command line:
Code:

[edfialk@niceguy mapserver]$ php phpinfo.php
<HTML>
works!
<br>Array
(
[0] =yp [1] =xml [2] =wddx [3] =tokenizer [4]
=sysvshm [5] =sysvsem [6] =>standard [7] =sockets [8]
=shmop [9] =session [10] =pspell [11] =posix [12]
=>pcre [13] =pcntl [14] =overload [15] =mime_magic
[16] =iconv [17] =gmp [18] =gettext [19] =ftp [20]
=exif [21] =dio [22] =dbx [23] =dba [24] =curl
[25] =ctype [26] =calendar [27] =bz2 [28] =bcmath
[29] =zlib [30] =openssl [31] =MapScript [32] =gd
[33] =ldap
)
<br>
Config file:/etc/php.ini

Here's from the browser:
(http://niceguy.wustl.edu/mapserver/phpinfo.php):
Code:

Warning: dl(): Unable to load dynamic library
'/usr/lib64/php4/php_mapscript.so' - /usr/lib64/php4/php_mapscript.so:
cannot open shared object file: Permission denied in
/var/www/html/mapserver/phpinfo.php on line 22
doesn't work!
Array ( [0] =yp [1] =xml [2] =wddx [3] =tokenizer [4] =>
sysvshm [5] =sysvsem [6] =standard [7] =sockets [8] =shmop [9]
=session [10] =pspell [11] =posix [12] =pcre [13] =overload
[14] =mime_magic [15] =iconv [16] =gmp [17] =gettext [18] =>
ftp [19] =exif [20] =dio [21] =dbx [22] =dba [23] =curl [24]
=ctype [25] =calendar [26] =bz2 [27] =bcmath [28] =zlib [29]
=openssl [30] =apache2handler [31] =gd [32] =ldap )

View Replies !
Apache Conf To Make The PHP's System Command Works On Linux.
I've got a big problem to make my code works.
My system() command don't seems to work.

for that code :

$res = system($command);
echo"res = $res<br>";

the result is "res = " and the command is not executed.

I feel that it come from my Apache configuration.
However my safe_mode_exec_dir is pointing on the dir of my exec code. My OS is Unix.

View Replies !
Require_once(&lt;html Fragment File&gt;) Vs Document.write(&lt;html Fragment&gt;)
To reuse common fragments of html on many pages I have used javascript functions, called from a linked .js file, which are precisely one instruction: document.write(<the html>).
I'm starting to learn PHP now and see that a require_once(<url for file containing the html fragment>); will have the same affect.

My question is, which method is more efficient? i.e. renders faster?

P.S. is there a simple way to set up testing-only server-software on my local machine so i can debug php locally before uploading them to site's server?

View Replies !
DOMDocument Thinks "<html></html>" Has Two ChildNodes?
I'm trying to mess around with PHP5's DOM functions and have run into
something that confuses me:

<?php
$dom = new DOMDocument();
$dom->loadHTML('<html></html>');

echo $dom->childNodes->length;
?>

Why is the output 2? Shouldn't it be 1?

View Replies !
$_POST From HTML --> PHP --> HTML
I've read a bunch of threads but I think I'm missing something.

I am using paypal as a payment method for a client.

But I need to do some variable checking before sending the customer to the paypal page.

I want to pass the variables to paypal as post (so the url doen't get crazy).

Is there a way to pass post variables to a PHP page that doesn't ouput anything (expect header redirect), and include those variables so they appear at the page that is redirected to?

View Replies !
HTML With PHP, How I Can Add PHP-code In HTML...
Could you help me. How i can add my PHP script or PHP- code in HTML-file.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved