html - Pass an id with mysql_insert_id() of a .php to another .php -


i trying create variable 1 id of last insert , trying past page.

in first page code:

$insert= "insert resources (name,description,place,time) values ('$name','$description','$place',curdate())";         mysql_query($insert);         $last_id= mysql_insert_id();         header("location:new_page.php?last_id=$last_id"); 

and in second page code:

<?php     echo "this id of resource : $last_id"; ?> 

i can't work it, solution?

thanks!

regards

you can't pass variable through more pages this.

you need write using $_get, because it's in url.

echo $_get['last_id']; 

if want work later, use session or cookie.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -