View Full Version : PHP on Mac 10.3 problem
sub-spaced
December 8th, 2003, 05:19 PM
Hi,
I have just upgraded to Mac 10.3 and activated the php using the terminal and the conf file, but whenever I test php on my computer, php code working within one page works fine. But if I try to pass variables between pages, nothing is passed!
Now the code worked fine under 10.2.8 but now nothing.
Please any ideas!
Thanks
Captain Code
December 8th, 2003, 08:39 PM
10.3 uses a new version of PHP. You now have to request the data from the GET/POST with $newVar = $_GET['varname'] or $_POST['varname']. This is because they want to save memory so not every single thing posted is automatically stored in a variable.
MAbans
December 8th, 2003, 08:56 PM
I have had the same issue with my coding. What can we door what do we have to keep in mind when coding. Just about all my coding doesn't work. Can you give us an example?
Here is an example?
This is for a side menu of a project I'm working with..
<?php
if (!IsSet($display))
{ //start of if
// If nothing is selected you should see a blank page //
echo"
<html>
<head>
<title>Dina Art Company</title>
<meta http-equiv=Content-Type content=text/html; charset=iso-8859-1>
</head>
<body text=#333333 leftmargin=0 topmargin=0 link=#666600 vlink=#660000 alink=#660000 bgcolor=#CCCC99>
Testing 1 2 1 2 <br>
</body>
</html>
";
// If nothing is selected you should see a blank page //
} //end of if
elseif ($display==1)
{
echo"
<html>
<head>
<title>Dina Art Company</title>
<meta http-equiv=Content-Type content=text/html; charset=iso-8859-1>
</head>
<body text=#333333 leftmargin=0 topmargin=0 link=#666600 vlink=#660000 alink=#660000 bgcolor=#CCCC99>
This is for posters
</body>
</html>
";
}
?>
When I try to display the lower menupage.php?display=1 locally it comes up with the initial page. What can I do? This is the way I've always done things like this..
sub-spaced
December 9th, 2003, 02:57 AM
Great, thanks very much for your quick response Captain Code.
I have the necessary changes and all is woeking!
Thanks you.
Pengu
December 9th, 2003, 03:45 AM
Look in the PHP documentation under REGISTER_GLOBALS, or for global variables. Probably the new version of PHP has register_globals turned off, meaning you have to access the variables as if they were arrays, ie: $_SESSION[variableName], $_POST[], $_GET[], etc. This is more a security issue than a memory issue. the variable is still stored, it just means people can't type something into the address bar, and have your script thing it's a session or post variable, etc.
MAbans
December 9th, 2003, 01:54 PM
Can you give us an practical example. *looking through PHP Docs* Just wanna make sure I understand this right..
BitWit
December 9th, 2003, 02:09 PM
Another way is using $_REQUEST[variableName] if you have register_globals on.
Pengu
December 9th, 2003, 03:51 PM
By "PHP Docs" I mean the online documentation.
www..php.net/docs/en/
As for having register_globals turned on, I suggest against it. it generates sloppy/insecure coding techniques.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by
vBSEO 3.3.2