Jump to content

Pass parameter from HTML form to PHP


lucerias

Recommended Posts

I have created one parameter.html and parameter.php as the following, but i can't pass the parameter from html to php. I have gone through the code for many times and there is no spelling error.

parameter.html
<HTML>
<HEAD></HEAD>
<BODY>
<FORM METHOD=GET ACTION="parameter.php">
Who is your favourite author?
<INPUT NAME="Author" TYPE="TEXT">
<BR>
<BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>

parameter.php
<HTML>
<HEAD></HEAD>
<BODY>
Your favourite author is:
<?php
echo $Author;
?>
</BODY>
</HTML>


Link to comment
Share on other sites

[code]parameter.html
<HTML>
<HEAD></HEAD>
<BODY>
<FORM METHOD="post" ACTION="parameter.php">
Who is your favourite author?
<INPUT NAME="Author" TYPE="TEXT">
<BR>
<BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>

parameter.php
<HTML>
<HEAD></HEAD>
<BODY>
Your favourite author is:
<?php
echo $Author;
?>
</BODY>
</HTML>
[/code]
Link to comment
Share on other sites

Its to do with global register settings
In older versions of php, global_register used to be turned on, there for, you can call $_POST, $GET, $_SESSIONS by using the name
but this is now turned off, and I believe in V5 (maybe V6) You dont even have an option to turn it on

The reason being, is it opens you up to hack attempts
So the book your reading was probs created when using the older versions of PHP
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.