Jump to content

how to keep $_post value


m118

Recommended Posts

I use a form to sent date and  use php to display it . However , the code only can working on one page. I can not turn the page. I do not why . Please tell me reason . Thank you very much.

 

<select name="kind">

  <option >kind</option>

<option value="Copier Toner">Copier Toner</option>

        <option value="Laser Toner">Laser Toner</option>

      <option value="MICR Toner">MICR Toner</option>

      <option value="Inkjet">Inkjet</option>

 

php code

 

if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; };

$start_from = ($page-1) * 18;

 

 

 

$select="select * from $chun where  brand = '$_POST[brand]' or  sort ='$_POST[kind]' or type='$_POST[type]'  LIMIT $start_from, 18";

 

$result2=mysql_query($select, $connection) or die (mysql_error());

 

<?php

$sql = "select count(*) from $chun  where  brand = '$_POST[brand]' or sort='$_POST[kind]' or type='$_POST[type]' ";

 

 

$rs_result = mysql_query($sql,$connection);

$row = mysql_fetch_row($rs_result);

$total_records = $row[0];

$total_pages = ceil($total_records / 18);

 

for ($i=1; $i<=$total_pages; $i++) {

 

 

 

?>

 

 

      <div class="trunpage"><a href='table2.php?page=<?php echo  "$i" ; ?>&id=<?php echo "$_POST[brand]";?>&cd=<?php echo "$_POST[kind]";?>&td=<?php echo "$_POST[type]";?>'  ><?php echo  "$i" ; ?></a>

 

    </div>

   

The first page is working fine. The second page I get error message.

 

Undefined index: brand in C:\wamp\www\php1000\table2.php on line 234

 

 

 

 

 

 

 

 

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.