Thanks for everyones, help, but I was wondering if someone could help me with simple issue.. I don't get what is going through my head.. I've read my PHP tutorials... And I've done this before, but I'm not sure... Info*
What I'm trying to do is have the pagenation recognize the form imput box so when they press on next they will see their customized input be carried onto the next page, so basically, I thought it wuold be something like ?page=2&$fonttext but this isn't working... The input box only shows the information on the first page, not on any other page... Any help would be great thanks so much!
Here is the code if it helps you, i know it's bad :S and I thank everyone for their help and support. Cheers!
<?php
echo('<center><p><br><p>' . $abclinks) . '<FORM action="zfonts.php?page="' . $i . '" method="get">Font Text: <INPUT type="text" name="fonttext"><INPUT type="submit" value="Send"></form><BR></FORM>';
// Connect to the database server
$dbcnx = @mysql_connect("localhost",
"aliandad", "tutu123~");
if (!$dbcnx) {
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" );
exit();
}
// Select the jokes database
if (! @mysql_select_db("aliandad_fonts") ) {
echo( "<P>Unable to locate the fonts " .
"database at this time.</P>" );
exit();
}
// If a joke has been submitted,
// add it to the database.
if ("SUBMIT" == $submitfont) {
$sql = "INSERT INTO zfonts SET " .
"fontname='$fonttext', " .
"fontaddress='$fontaddress', " .
"fontimage='$fontimage', " .
"fontdate=CURDATE()";
if (mysql_query($sql)) {
echo("<P>Your font has been added.</P>");
} else {
echo("<P>Error adding submitted font: " .
mysql_error() . "</P>");
}
}
echo("<P> Here are the fonts " .
"in our Z Fonts database: </P>");
// Request the text of all the jokes
$page_number = (is_numeric(@$_GET['page']) ? $_GET['page'] : 1);
$result = mysql_query(
'SELECT fontname FROM zfonts ORDER BY fontname ASC LIMIT ' . (($page_number - 1) * 20) . ', 20');
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>");
exit();
}
// Display the text of each joke in a paragraph
while ( $row = mysql_fetch_array($result) ) {
echo("<BR>" . '<a href="http://1-800-fonts.com/winfonts/Z-Fonts/' . $row["fontname"] . '.zip"><img src=font.php?text=' . $fonttext . '&font=/Z-Fonts/' . $row["fontname"] . '&size=36&color=#ff3333></a><BR>');
}
/* Set current, prev and next page */
$page = (!isset($_GET['page']))? 1 : $_GET['page'];
$prev = ($page - 1);
$next = ($page + 1);
/* Max results per page */
$max_results = mysql_num_rows($result);
/* Calculate the offset */
$from = (($page * $max_results) - $max_results);
/* Query the db for total results. You need to edit the sql to fit your needs */
$result = mysql_query("select fontname from zfonts");
$total_results = mysql_num_rows($result);
$total_pages = ceil($total_results / $max_results);
$pagination = '';
/* Create a PREV link if there is one */
if($page > 1)
{
$pagination .= ' <a href="zfonts.php?page='.$prev.'">Previous</a> ';
}
/* Loop through the total pages */
for($i = 1; $i <= $total_pages; $i++)
{
if(($page) == $i)
{
$pagination .= $i;
}
else
{
$pagination .= ' <a href="zfonts.php?page=' . $i . '">' . $i . '</a> ';
}
}
/* Print NEXT link if there is one */
if($page < $total_pages)
{
$pagination .= ' <a href="zfonts.php?page=' .$next . '&' .$fonttext . '">Next</a>" ';
}
/* Now we have our pagination links in a variable($pagination) ready to print to the page. I pu it in a variable because you may want to show them at the top and bottom of the page */
/* Below is how you query the db for ONLY the results for the current page */
while ($i = mysql_fetch_array($result))
{
/* This is where you print your current results to the page */
}
echo('<p><center>' . $pagination);
echo('<p>' . $abclinks . '</center>');
?>