I'm currently learning PHP through a book (Beginning PHP4) and I've gotten to the point where I'm using PHP with with HTML forms to show simple things in the browser after submitting the form...
The examples have all been working fine locally on my machine with Apache2, but when uploaded to a server I'm testing them on (a server which hosts a site I work on with a few other people) it doesnt work correctly.
I know the code is right because it works perfectly on my PC, and I know the server supports PHP4 because the first few examples I uploaded worked fine too - it's just the form ones I'm having trouble with.
I have this in a file called text.html
<HTML>
<HEAD></HEAD>
<BODY>
<FORM METHOD=GET ACTION="text.php">
Who is your favourite author?
<INPUT NAME="Author" TYPE="TEXT">
<BR>
<BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>
And then this in a file called text.php
<HTML>
<HEAD></HEAD>
<BODY>
Your favourite author is:
<?php
echo $Author;
?>
</BODY>
</HTML>
Like I said it works fine on my PC, but when uploaded to the actual server, the text.php page just brings up "Your favourite author is:" when submitted from text.html.... no variable is showing up, no matter what is typed in the form.
It's probably the way PHP is set up on the server with the config file, right? If this is so - how would I go about finding the config file and which part would need to be changed? From what I've learned so far I'm guessing it may be the register_globals expression.... I remember having to enable that on my local machine before trying the examples.
Question
MrXBob
I'm currently learning PHP through a book (Beginning PHP4) and I've gotten to the point where I'm using PHP with with HTML forms to show simple things in the browser after submitting the form...
The examples have all been working fine locally on my machine with Apache2, but when uploaded to a server I'm testing them on (a server which hosts a site I work on with a few other people) it doesnt work correctly.
I know the code is right because it works perfectly on my PC, and I know the server supports PHP4 because the first few examples I uploaded worked fine too - it's just the form ones I'm having trouble with.
I have this in a file called text.html
And then this in a file called text.php
Like I said it works fine on my PC, but when uploaded to the actual server, the text.php page just brings up "Your favourite author is:" when submitted from text.html.... no variable is showing up, no matter what is typed in the form.
It's probably the way PHP is set up on the server with the config file, right? If this is so - how would I go about finding the config file and which part would need to be changed? From what I've learned so far I'm guessing it may be the register_globals expression.... I remember having to enable that on my local machine before trying the examples.
Link to comment
Share on other sites
15 answers to this question
Recommended Posts