Jump to content

Recommended Posts

I've been offline for about a year, took a break.  I am now back and building a website, but I find that a few things seemed to have changed.  Here is a small snip of code that does not work.  From what I see, form handling has changed.  Can someone fill me in?

<?PHP
IF ($B1)
echo "yes";
ELSE
echo "no";
?>

<form method="POST" action="http://www.the-home-decor-store.com/test.php">
<p><input type="submit" value="Submit" name="B1"></p>
</form>


This returns no every time.  Its VERY simple, and just by clicking the button, it should return yes.  I have found that nothing entered into a form is being passed to the PHP code on the next page.  I've tried with both the "post" and "get" methods of creating a form.  Someone please help!

Sean
Link to comment
https://forums.phpfreaks.com/topic/13597-what-happened-with-forms-and-php/
Share on other sites

What you're seeing is the direct result of register_globals being disabled (good) instead of enabled (bad). Please read the section in the on-line PHP manual on [url=http://www.php.net/register_globals]www.php.net/register_globals[/url]

You should use $_POST['B1'] instead.

Ken
Guest
This topic is now closed to further replies.
×
×
  • 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.