View previous topic :: View next topic |
Author |
Message |
Jack Guest
|
Posted: Fri May 24, 2002 8:36 am Post subject: Passing variable values between php pages... |
|
|
Hi,
I'm making php pages that connect to a MySQL database and return records. This all works fine, Abyss is doing a good job so far.
However, when I try to pass variables between pages like so:
http://mysite.com/index.php?variable=value
and then call them in the php page with $variable it does not have the value that was given to it. Now I'm not sure if what I am doing is wrong or if this is a server problem, the page works fine if I set the variable on the same page with
$variable=value;
but passing it using the address line does not work.
??? |
|
Back to top |
|
|
Jack Guest
|
Posted: Fri May 24, 2002 12:58 pm Post subject: There is a way to do it... |
|
|
Ok,
the problem has nothing to do with the web server, Abyss in this case. It is actually a PHP thing. The newer versions handle form variables through the URL line in a different way. You have to call them using the following:
$_GET - contains form variables sent through GET
$_POST - contains form variables sent through POST
$_COOKIE - contains HTTP cookie variables
$_SERVER - contains server variables (e.g., REMOTE_ADDR)
$_ENV - contains the environment variables
$_REQUEST - a merge of the GET variables, POST variables and Cookie variables. In other words - all the information that is coming from the user, and that from a security point of view, cannot be trusted.
$_SESSION - contains HTTP variables registered by the session module
So what you do is use the line:
print $_GET["name"];
where name is the name of the variable that was in the URL line sent by a GET form. To use the variable in a MySQL query you need to use another variable like so:
$value = $_GET["name"];
where $value gets the value that was submitted by the form as variable name.
thank you, and good bye...
Eagerly awaiting Abyss 1.1 |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri May 24, 2002 11:10 pm Post subject: Re: Passing variable values between php pages... |
|
|
Jack wrote: | Hi,
I'm making php pages that connect to a MySQL database and return records. This all works fine, Abyss is doing a good job so far.
However, when I try to pass variables between pages like so:
http://mysite.com/index.php?variable=value
and then call them in the php page with $variable it does not have the value that was given to it. Now I'm not sure if what I am doing is wrong or if this is a server problem, the page works fine if I set the variable on the same page with
$variable=value;
but passing it using the address line does not work.
??? |
Please read http://www.aprelium.com/forum/viewtopic.php?t=85 for a workaround. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|