Jump to content

Can't assign data $_post/$_get


Fanta

Recommended Posts

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

        {

    $id = $_post["proid"];

    }

elseif (isset($_get["proid"]))

{

$id = $_get["proid"];

}

else {

echo "not set"; 

 

Ican see the data in the address bar but always comes out

  not set

the code below is where the variable is sent

<a href="edit.php?proid = <?php print $row["prod_id"]; ?>">EDIT | DELETE</a>;

I use php/5.2.6 wamp server

Link to comment
https://forums.phpfreaks.com/topic/168752-cant-assign-data-_post_get/
Share on other sites

 

 <a href="edit.php?proid = <?php print '1'; ?>">EDIT | DELETE</a>; 

 

 

 

to

 

 

 <a href="edit.php?proid=<?php print '1'; ?>">EDIT | DELETE</a>; 

 

 

 

FINAL PRODUCT

 

 

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.