PHP on Mac 10.3 problem

sub-spaced

Registered
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
 
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.
 
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..




Code:
<?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..
 
Great, thanks very much for your quick response Captain Code.

I have the necessary changes and all is woeking!

Thanks you.
 
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.
 
Can you give us an practical example. *looking through PHP Docs* Just wanna make sure I understand this right..
 
Another way is using $_REQUEST[variableName] if you have register_globals on.
 
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.
 
Back
Top