woodsonoversoul Posted August 22, 2007 Share Posted August 22, 2007 Currently when my script starts it checks to see if one "area of information" (what is a more acurate word?) has been posted : // if id provided, then delete that record if (isset($_GET['id'])) { // create query to delete record $query = "DELETE FROM purchase WHERE sale_id = '{$_GET['id']}'"; How can I check to see if any area of information has been posted? Quote Link to comment https://forums.phpfreaks.com/topic/66097-how-do-i-see-if-anything-aww-just-look-i-dont-know-how-to-phrase-this/ Share on other sites More sharing options...
keeB Posted August 22, 2007 Share Posted August 22, 2007 Like.. if a user posts http://url/myphp?heybuddy=2 , you want to dynamically understand which keys were passed via get? <?php foreach($_GET as $k=>$v) { print "Received $k => $v <br />" ; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/66097-how-do-i-see-if-anything-aww-just-look-i-dont-know-how-to-phrase-this/#findComment-330557 Share on other sites More sharing options...
Ken2k7 Posted August 22, 2007 Share Posted August 22, 2007 <?php if (isset($_GET['id'])) mysql_query("DELETE FROM purchase WHERE sale_id = '{$_GET['id']}'") or die(mysql_error()); ?> Quote Link to comment https://forums.phpfreaks.com/topic/66097-how-do-i-see-if-anything-aww-just-look-i-dont-know-how-to-phrase-this/#findComment-330562 Share on other sites More sharing options...
keeB Posted August 22, 2007 Share Posted August 22, 2007 Ken.. that's the exact code he has man.. lol. Read the question first. Quote Link to comment https://forums.phpfreaks.com/topic/66097-how-do-i-see-if-anything-aww-just-look-i-dont-know-how-to-phrase-this/#findComment-330564 Share on other sites More sharing options...
woodsonoversoul Posted August 22, 2007 Author Share Posted August 22, 2007 What I'm trying to figure out is how to see if anything has been posted, etc. to the server/page and alter what the page displays based on that information Quote Link to comment https://forums.phpfreaks.com/topic/66097-how-do-i-see-if-anything-aww-just-look-i-dont-know-how-to-phrase-this/#findComment-330566 Share on other sites More sharing options...
woodsonoversoul Posted August 22, 2007 Author Share Posted August 22, 2007 the main purpose of the page is to display a table and if the user clicks on a cell in the table, refresh the page showing all the records which also contain that information code for the display echo $row[0]; echo "<h1>category location price</h1>"; echo "<table cellpadding=10 border=1>"; while($row = $result->fetch_array()) { echo "<div id=\"navcontainer\">"; echo "<ul>"; echo "<li><a href=#>".$row[2]."</li>"; echo "<li><a href=#>".$row[3]."</li>"; echo "<li><a href=#>$".$row[4]."</li>"; echo "<li><a href=".$_SERVER['PHP_SELF']."?id=".$row[1].">x</a></li>"; echo "</ul>"; echo "</div>"; Quote Link to comment https://forums.phpfreaks.com/topic/66097-how-do-i-see-if-anything-aww-just-look-i-dont-know-how-to-phrase-this/#findComment-330570 Share on other sites More sharing options...
woodsonoversoul Posted August 22, 2007 Author Share Posted August 22, 2007 Gotta step out for a few hours. All help is greatly appreciated Dan Quote Link to comment https://forums.phpfreaks.com/topic/66097-how-do-i-see-if-anything-aww-just-look-i-dont-know-how-to-phrase-this/#findComment-330576 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.