doforumda Posted October 16, 2009 Share Posted October 16, 2009 i have a php variable on one page $lastId = mysql_insert_id($db); echo $lastId; i want to send this variable and the value in it to second page when i click on submit button i already tried this but it is not working $lastId = $_POST["lastId"]; this displays this error Notice: Undefined index: lastId in D:\wamp\www\dynamic\quiz2action.php on line 30 how can this be solved Link to comment https://forums.phpfreaks.com/topic/177900-need-help-in-php-variable/ Share on other sites More sharing options...
isedeasy Posted October 16, 2009 Share Posted October 16, 2009 You could add a hidden field in your form like this... <input type="hidden" name="lastId" value="<?php echo $lastId ?>"/> Link to comment https://forums.phpfreaks.com/topic/177900-need-help-in-php-variable/#findComment-937990 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.