Jump to content

Next & Prev page....


Recommended Posts

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 = "[email protected]";
		$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("[email protected]", $subject, $body, $headers);

	}

	else 
		die('Please make sure your filled in your first Name as well as a Question/Comment!');
}

?>

Link to comment
https://forums.phpfreaks.com/topic/229135-next-prev-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.