unemployment Posted March 31, 2011 Share Posted March 31, 2011 How can I echo the $id? Every time I post approved it refreshes my page and I can see the echoed out ID. I need to know what the ID value is. if (isset($_POST['approve'])) { if(is_array($_POST['approve'])) { $keys = array_keys($_POST['approve']); $id = $keys[0]; echo $id; die(); //$sql = "UPDATE `blog_comments` SET `approved` = 1 WHERE `post_id` = '$id'"; //header("Location: " . $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'] ); } } Quote Link to comment https://forums.phpfreaks.com/topic/232284-echo-posted-array/ Share on other sites More sharing options...
blacknight Posted March 31, 2011 Share Posted March 31, 2011 echo '<pre>'; print_r($keys); that what your looking for? Quote Link to comment https://forums.phpfreaks.com/topic/232284-echo-posted-array/#findComment-1194923 Share on other sites More sharing options...
unemployment Posted March 31, 2011 Author Share Posted March 31, 2011 This is not really working. The keys wont echo when I click the approve button. if (isset($_POST['approve'])) { if(is_array($_POST['approve'])) { $keys = array_keys($_POST['approve']); $id = $keys[0]; echo '<pre>'; print_r($keys); } } Quote Link to comment https://forums.phpfreaks.com/topic/232284-echo-posted-array/#findComment-1194925 Share on other sites More sharing options...
unemployment Posted March 31, 2011 Author Share Posted March 31, 2011 Nevermind... I got it to print. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/232284-echo-posted-array/#findComment-1194928 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.