Can't assign $_post / $_get
Posted by: g/marry (---.cable.mindspring.com)
Date: August 04, 2009 06:18AM

if (isset($_POST["proid"]))

{
$id = $_POST["proid"];
}
elseif (isset($_GET["proid"]))
{
$id = $_GET["proid"];
}
else {
echo "not set";

}
.....

I see the variable in the address bar but can't assign



Edited 1 time(s). Last edit at 08/05/2009 06:16AM by g/marry.

Options: ReplyQuote
Re: Can't assign $_post / $_get
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: August 04, 2009 10:21AM

Superglobal variables such as _post and _get need to be in capitals

$_POST['proid']
$_GET['proid']

Options: ReplyQuote
Re: Can't assign $_post / $_get
Posted by: toumimi (---.11.115-78.rev.gaoland.net)
Date: August 04, 2009 11:24AM

You can get value from superglobals, but you can't assign them a value manually.
Your changes won't be saved...
But here, your code is just to get a value from superglobals...

Note that you made a mistake in the second part :
elseif (isset($_GET["proid"])) 
{
$id = $_GET["proid"];

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote


Sorry, only registered users may post in this forum.