sanchez77 Posted August 8, 2009 Share Posted August 8, 2009 What is the best way to pass variables from one php page to another? For Ex: page1.php queries a table, retrieves the value, sets it to $field1, how do you pass $field1 to page2.php? page 1 $sql = "SELECT field1 FROM table WHERE `id` = 1"; $result = mysql_fetch_array($result); $field1 = $result[field1]; What is the best way to pass $field1 to page2.php? Link to comment https://forums.phpfreaks.com/topic/169407-passing-variables/ Share on other sites More sharing options...
zq29 Posted August 8, 2009 Share Posted August 8, 2009 Based on the limited information you have provided, you could use one of the following methods: $_GET $_POST $_SESSION $_COOKIE Link to comment https://forums.phpfreaks.com/topic/169407-passing-variables/#findComment-893817 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.