php - GET POST mysql data on next page -
ok, haven't done of sort of stuff, clueless right now.
on first page hit form submit generates bunch of information/stuff , displays underneath submit button, don't know how take displayed information , use on next page show of code. btw know code bad, ignore fact.
<form name="input" action="slaymonster.php" method="post" id="id"> <div align="center"> <input name="submit" id="submit" type="submit" class="button" value="explore map!"/> </div> </form> if (isset($_post['submit'])) { include 'includes/mapstuff.php'; // here pick random row table pokemon notice order rand $sql23 = "select * map1pokemon order rand() limit 1;"; // check errors $result23 = mysql_query($sql23) or die(mysql_error()); // make result virable called battle_get23 $battle_get23 = mysql_fetch_array($result23); $sql2 = "select * pokemon name='".$battle_get23['pokemon']."'"; $result2 = mysql_query($sql2) or die(mysql_error()); $battle_get2 = mysql_fetch_array($result2); // need make sure image safe use $pic2= mysql_real_escape_string($battle_get2['pic']); $pic = strip_tags($pic2); include 'includes/maptypes.php'; ?> <form name="inputt" action="" method="post"> <div align="center"> <input type="submit" class="catch" value="catch pokemon" name="catch"> </div> </form> <p></p> <?php echo "you have found " ; echo $randomview97[0]; echo " "; echo $battle_get23['pokemon']; $_session['pokemon'] = $battle_get23['pokemon']; $_session['type'] = $randomview97[0]; $_session['pic'] = $battle_get2; $_session['money'] = $randomview2[0]; $_session['level'] = $randomview3[0]; $_session['ticket'] = $randomview4; ?> <p></p> <?php echo "you have gained ".$randomview3[0]." levels" ; echo " "; ?> <p></p> <?php echo "you have received $".$randomview2[0]."" ; echo " "; ?> <p></p> <?php echo "</center>"; } ?> it displays pokemon's picture it's name, type,amount of money got ect...
i need information useable on next page.
any appreciated :)
at top of php code, sure include session_start(); using session variables, should refer here see php session is: php session_start() - manual. makes sure asking (someone may point out in cases session_start(); not necessary, purposes, while learning, stick manual best practices)
this information usable on next 'page', manual describes, , available, until call session_destroy().
Comments
Post a Comment