djfox Posted July 16, 2007 Share Posted July 16, 2007 I have links set up as thus: explore7.php?id=7&p=4 Where when the link is clicked on, id will always be 7 and p will always be 4. id is being sent fine but p isn`t. How can I get p sent? Here`s ex_thereefs.php: <? $option = "link"; $sites[0] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $sites[1] = array("explore7.php?id=1&p=4", "</a>You Found a Dark Blue Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=1'><img src='collection/darkblueshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 4); $sites[2] = array("explore7.php?id=2&p=1", "</a>You Found a Light Blue Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=2'><img src='collection/lightblueshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 9); $sites[3] = array("explore7.php?id=4&p=1", "</a>You Found a Light Purple Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=4'><img src='collection/lightpurpleshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", ; $sites[4] = array("explore7.php?id=3&p=4", "</a>You Found a Dark Purple Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=3'><img src='collection/darkpurpleshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 4); $sites[5] = array("explore7.php?id=5&p=5", "</a>You Found a Dark Red Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=5'><img src='collection/darkredshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 3); $sites[6] = array("explore7.php?id=6&p=2", "</a>You Found a Light Red Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=6'><img src='collection/lightredshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 7); $sites[7] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $sites[8] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $sites[9] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $sites[10] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $sites[11] = array("explore7.php?id=7&p=4", "</a>You Found a Dark Green Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=7'><img src='collection/darkgreenshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 4); $sites[12] = array("explore7.php?id=8&p=2", "</a>You Found a Light Green Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=8'><img src='collection/lightgreenshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", ; $sites[13] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $sites[14] = array("explore7.php?id=9&p=6", "</a>You Found a Black Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=9'><img src='collection/blackshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 3); $sites[15] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $sites[16] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $sites[17] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $sites[18] = array("explore7.php?id=10&p=10", "</a>You Found a Gold Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=10'><img src='collection/goldshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 1); $sites[19] = array("explore7.php?id=11&p=10", "</a>You Found a Silver Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=11'><img src='collection/silvershell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 1); $sites[20] = array("explore7.php?id=2&p=1", "</a>You Found a Light Blue Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=2'><img src='collection/lightblueshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 9); $sites[21] = array("explore7.php?id=4&p=1", "</a>You Found a Light Purple Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=4'><img src='collection/lightpurpleshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", ; $sites[22] = array("explore7.php?id=6&p=2", "</a>You Found a Light Red Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=6'><img src='collection/lightredshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 7); $sites[23] = array("explore7.php?id=8&p=2", "</a>You Found a Light Green Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=8'><img src='collection/lightgreenshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", ; $sites[24] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $sites[25] = array("javascript:location.reload()", "</a>You found nothing.<p><a href='javascript:location.reload()'>Keep Searching</a>", 10); $countsites = count($sites); for($i=0; $i<$countsites; $i++) { for($x=0; $x<$sites[$i][2]; $x++) { if($option != null) { $mylist[] = array($sites[$i][0],$sites[$i][1],$sites[$i][3]); } else { echo("Error deciding option."); exit(); } } } $countlist = count($mylist); $countlist = $countlist - 1; $picker = rand(0, $countlist); if($option == "link") { echo("<a href='" . $mylist[$picker][0] . "'>" . $mylist[$picker][1] . "</a>"); } else if($option == "banner") { echo("<a href='" . $mylist[$picker][0] . "'><img alt='" . $mylist[$picker][1] . "' src='" . $mylist[$picker][2] . "' /></a>"); } else { echo("Error deciding option."); exit(); } ?> Here is explore7.php: <? include("dbcon.php"); include("func.php"); require_once "auth.php"; require_once "includes/defines.php"; $log = $_SESSION['sess_name']; mysql_query("INSERT INTO coll_inven (user,item,price) VALUES ( '$log', '$id', '$p' )"); header("Location: ex_thereefs.php"); ?> Quote Link to comment Share on other sites More sharing options...
fanfavorite Posted July 16, 2007 Share Posted July 16, 2007 It should sent using &, but try using & instead. Quote Link to comment Share on other sites More sharing options...
djfox Posted July 16, 2007 Author Share Posted July 16, 2007 It should sent using &, but try using & instead. The same thing occurs. id is sent but not p. Quote Link to comment Share on other sites More sharing options...
paul2463 Posted July 16, 2007 Share Posted July 16, 2007 if you have a look here $sites[1] = array("explore7.php?id=1&p=4", "</a>You Found a Dark Blue Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=1'><img src='collection/darkblueshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a>", 4); slot 0 has your link including id=1&p=4 slot 1 has a href link that only includes id=1 without the p=4 try adding the p=4 to each line and it will work for the links if you call echo("<a href='" . $sites[0] . "'>" . $sites[1] . "</a>"); on the above line, the out put is You Found a Dark Blue Shell! Click the image to add it to your inventory. Keep Exploring. but the page source shows <a href='explore7.php?p=1&p=4'></a>You Found a Dark Blue Shell! Click the image to add it to your inventory.<br><a href='explore7.php?id=1'><img src='collection/darkblueshell.png' border=0></a><p><a href='javascript:location.reload()'>Keep Exploring.</a></a> nothing holding the link that was in slot 0 Quote Link to comment Share on other sites More sharing options...
djfox Posted July 16, 2007 Author Share Posted July 16, 2007 My god, I feel incredibly stupid now. But I`m so glad you were able to point that out to me. (Having another set of eyes always helps!) Thanks a lot! Quote Link to comment 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.