By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,278 Members | 1,329 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,278 IT Pros & Developers. It's quick & easy.

what has Hostway done to PHP? Form variables suddenly undefined in previously working forms

P: n/a
Hostway swears they didn't do anything but mysterious breakdowns have made
us do the following test:
<?
if ($_POST) {
echo "<h3>name is defined as $name</h3>";
print_r($_POST);
exit;
}
?>

<form name="form1" method="post" action="test.php">
<input name="name" type="text" id="name">
<input type="submit" name="Submit" value="Submit">
</form>
This produces:
name is defined as
Array ( [name] => fellow [Submit] => Submit )

So $_POST has the defined var but $name is no longer automatically defined.
What did they do to the configuration?

TIA!

jg
Jul 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Andy Hassall wrote:
On Wed, 27 Aug 2003 14:48:46 -0500, "jerrygarciuh"
<de*****@no.spam.nolaflash.com> wrote:
echo "<h3>name is defined as $name</h3>";


Search for 'register_globals'.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)


Sod it, I'll do a Wiki at the weekend!

Matt
Jul 16 '05 #2

P: n/a
"jerrygarciuh" <de*****@no.spam.nolaflash.com> schrieb:
So $_POST has the defined var but $name is no longer automatically defined.
What did they do to the configuration?


register_globals = off

Regards,
Matthias
Jul 16 '05 #3

P: n/a
Yep! The jerks had stuck a php.ini in our cgi-bin with one line:
auto_register_globals = off
Arrrrrrrrrrrrgh!! Lost money. Feh!
Thanks all! Much obliged!
jg


"jerrygarciuh" <de*****@no.spam.nolaflash.com> wrote in message
news:vW73b.25806$xf.18726@lakeread06...
Hostway swears they didn't do anything but mysterious breakdowns have made
us do the following test:
<?
if ($_POST) {
echo "<h3>name is defined as $name</h3>";
print_r($_POST);
exit;
}
?>

<form name="form1" method="post" action="test.php">
<input name="name" type="text" id="name">
<input type="submit" name="Submit" value="Submit">
</form>
This produces:
name is defined as
Array ( [name] => fellow [Submit] => Submit )

So $_POST has the defined var but $name is no longer automatically defined. What did they do to the configuration?

TIA!

jg

Jul 16 '05 #4

P: n/a

"jerrygarciuh" <de*****@no.spam.nolaflash.com> wrote in message
news:vW73b.25806$xf.18726@lakeread06...
Hostway swears they didn't do anything but mysterious breakdowns have made
us do the following test:
<?
if ($_POST) {
echo "<h3>name is defined as $name</h3>";
try echo "<h3>name is defined as $_POST["name"]</h3>";

I would say your webhost has just upgraded their version of PHP, to one
which has register_globals set to 'off;' by default. To access form
variables you can use the $_POST and $_GET arrays:

POST method - $_POST["form_element_name"]

GET method - $_GET["forn_element_name"]
<form name="form1" method="post" action="test.php">
<input name="name" type="text" id="name">
<input type="submit" name="Submit" value="Submit">
</form>
jg

Jul 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.