Collegeboox Posted February 28, 2011 Share Posted February 28, 2011 I am trying to put a next and prev link at the bottom of a search page which shows the next ten results and the prev ten results...I have looked this up for a long time now and i honestly can not figure it out. If someone can please help me I would really appreciate it. The code I have now (which is below) when you hit the next button it refreshes the page and the php check that I made comes up and says please fill in all fields... SOMEONE PLEASE HELP!!! <?php $firstname = $_POST['firstname']; $question = $_POST['question']; $username = $_SESSION['username']; $submit = $_POST['submit']; if ($submit) { //connect to database $connect = mysql_connect("db","user","pass") or die("Not connected"); mysql_select_db("userr") or die("could not log in"); //grab email from database $query = "SELECT * FROM table WHERE username='$username'"; $result = mysql_query($query); $row = mysql_fetch_array($result); //set email to variable name $email = $row['email']; //set SMTP $server = "smtp.gmail.com"; ini_set("SMTP",$server); //existance check if ($firstname&&$question) { //setup variables $to = "collegebooxstore@gmail.com"; $subject = "Activate Account"; $headers = "From:$email"; $server = "smtp.gmail.com"; ini_set("SMTP",$server); $body = "Register $firstname,\n\n Username = $username\n www.Collegebooxstore.com/activate.php?id=$lastid&code=$random\n\n"; //function to send email mail("Collegebooxstore@gmail.com", $subject, $body, $headers); } else die('Please make sure your filled in your first Name as well as a Question/Comment!'); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/229135-next-prev-page/ 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.