Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables in PHP 4.2.1 1

Status
Not open for further replies.

PhoenixDown

Programmer
Jul 2, 2001
279
CA
Why don't variables work for me in PHP 4.2.1?

$something = "test";
 
This the sort of thing you mean?

<form method=get action=somewhere.php>
$something=&quot;test&quot;;
</form>

somewhere.php
-----------------------------
<?php
echo $_GET[somewhere];
?>

Variables should be identified by $_POST[] and $_GET[] and all the other funt to write things new to php4.2+

Happy coding :) ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
ah, i see what u mean.

It could be that global variables are set to false in the config file in your php directory. Try opening it and do a search for global, and change it to true if its off.

This should eliminate the need to use those crazy $POST things. Nick (Web Developer)


nick@retrographics.co.uk
 
it eliminates right, but also put a great security breach in your code... What would you prefer?

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
I'm all for crazy $_POST n $_GET things, I know where my info is, and also that it can't be exploited very easily :) ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
This is what I'm trying to do:

$server = &quot;localhost&quot;;
$user = &quot;&quot;;
$pass = &quot;&quot;;

mysql_connect ('$server', '$user ', '$pass') or die ('Error connecting.');

Warning: Unknown MySQL Server Host '$server' (0) in c:\blah\blah\ on line 86
 
Single quotes means &quot;don't interpolate content&quot;. Remove the quotes or replace them with double quotes (&quot;). //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top