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 = "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!');
}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.