Jump to content

m118

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

Everything posted by m118

  1. I try to publish my web site today . I choose www.netfirm.com to store my web pages. However , this is not working. I get error message. Cannot read /mnt/w0500/d04/s15/b0322718/www/ptiimaging.ca/.htaccess. I do not know how to fix this problem . Please tell me how to fix it . Thank you very much.
  2. 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
  3. hello I mean the program ,it is woking now . When the program run the second time, it tries to trun the page. The variable is null. Therefore. the mysql commond can not find anything. I do not know how to solve this problem.
  4. I am working on one web site. <li><a href="table.php?id=<?php echo "Brother" ;?>&cd=<?php echo "Inkjet"; ?>">Brother</a></li> <?php include("connection.php"); $cd=$_GET["cd"]; $id=$_GET["id"]; if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }; $start_from = ($page-1) * 12; $select="select * from $chun where brand = '$id' and kind ='$cd' LIMIT $start_from, 12"; $result2=mysql_query($select, $connection) or die (mysql_error()); ?> <?php $sql = "select count(*) from $chun where brand = '$_GET[id]' and kind ='$_GET[cd]'"; $rs_result = mysql_query($sql,$connection); $row = mysql_fetch_row($rs_result); $total_records = $row[0]; $total_pages = ceil($total_records / 12); for ($i=1; $i<=$total_pages; $i++) { echo "<a href='table.php?page=".$i."'>".$i."</a> "; }; ?> This problem can only can display one page, the second page can not display. I think the reason is that the get[] function can get data when I trun the page. Please tell me how to keep data at command line. $select="select * from $chun where brand = '$id' and kind ='$cd' LIMIT $start_from, 12"; When I try to trun the page, the brand and kind can not get the data. Thank you very much.
  5. I am working for a company, the program i am working on is not right. Please help find the problem. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> .box1 { background:#00CC99; width:980px; height:800px; margin:20px auto;} .box2 { margin-left:60px; float:left; margin-top:30px;} </style> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>&#26080;&#26631;&#39064;&#25991;&#26723;</title> </head> <body> <div class="box1"> <div class="box2"> <form action="jobnew.php" method="post" > <p><strong>Kind</strong><br /> Lazer <input type="radio" name="kind" value="Laser"/> Inkjet <input type="radio" name="kind" value="Inkjet" /> </p> <p><strong>Brand</strong> <br /> <select name="brand"> <option value="Apple">Apple</option> <option value="brother">Brother</option> <option value="Canon">Canon</option> <option value="Dell">Dell</option> <option value="Epson">Epson</option> <option value="HP">HP</option> <option value="lexmark">Lexmark</option> <option value="Samsung">Samsung</option> <option value="Sharp">Sharp</option> <option value="IBM">IBM</option> <option value="Lenovo">Lenovo</option> <option value="Konica-Minolta">Konica-Minolta</option> <option value="QMS">QMS</option> <option value="okidata">okidata</option> <option value="Mita">Mita</option> <option value="Ricoh">Ricoh</option> <option value="Source technology">Source technology</option> <option value="Standard Register">Standard Register</option> <option value="Tally Genicom">Tally Genicom</option> <option value="Tektronix">Tektronix</option> <option value="Toshiba">Toshiba</option> <option value="Unisys">Unisys</option> <option value="Xerox">Xerox</option> <option value="Xerox Ink Stricks">Xerox Ink Sticks</option> <option value="kyocera">kyocera</option> <option value="Postage Meters">Postage Meters</option> </select> </p> <p><strong>PTi item#</strong><Br /> <input type="text" name="item" /> </p> <p><strong>PTI stock#</strong><br /> <input type="text" name="PTISTOCK" size="30" /> </p> <p><strong>Machine Compatibility</strong><br /> <input type="text" name="MC" size="30" /> </p> <p><strong>OEM Part#</strong><br /> <input type="text" name="OEMPART" size="30" /> </p> <p><strong>Color</strong><br /> <select name="colorful" > <option value="red" >red</option> <option value="black" >black</option> <option value="Cyan" >Cyan</option> <option value="Yellow" >Yellow</option> <option value="Magenta" >Magenta</option> <option value="Tri-color">Tri-color</option> <option value="Photo">Photo</option> <option value="Photo Cyan">Photo Cyan</option> <option value="Photo Gray">Photo Grey</option> <option value="Photoblack">Photoblack</option> <option value="Matte Black">Matte Black</option> <option value="Lt.Cyan">Lt.Cyan</option> <option value="Lt.Magenta">Lt.Magenta</option> <option value="Light Cyan">Light Cyan</option> <option value="Light Magenta">Light Magenta</option> <option value="Gray">Gray</option> <option value="Photo Magenta">Photo Magenta</option> <option value="Black/Color">Black/Color</option> <option value="CMKYLtCLtM">CMKYLtCLtM</option> <option value="blue">blue</option> <option value="color">color</option> <option value="Photo-Gray">Photo-Gray</option> <option value="white">white</option> <option value="Photo Tri-color">Photo Tri-color</option> <option value="color Photo">color Photo</option> <option value="Green">Green</option> </select> </p> <p><strong>OEM Price</strong><br /> <input type="text" name="OEMPRICE" size="30" /> </p> <p><strong>Compatibility Price</strong><br /> <input type="text" name="CP" size="30" /> </p> <p><strong>Picture</strong><br /> <input type="file" name="dd" /> </p> <p> <input type="submit" value="submit"> </p> <p></p> </form> </div> </div> <?php $host="localhost"; $user="root"; $password=""; $tianjin="pti"; $tab= "table"; $kind=$_POST['kind']; $brand=$_POST['brand']; $ptistork=$_POST['PTISTOCK']; $item=$_POST['item']; $compatibility=$_POST['MC']; $OEM=$_POST['OEMPART']; $color=$_POST['colorful']; $oemprice=$_POST['OEMPRICE']; $comp=$_POST['CP']; $image=$_POST['dd']; $connection=mysql_connect($host,$user,$password)or die (mysql_error()); echo "1"; $db=mysql_select_db($tianjin,$connection)or die (mysql_error()); echo "2"; $file=$_FILES['dd']['tmp_name']; $insert="INSERT INTO $tab (kind,brand,ptiitem,stock,compatibility,oempart,color,oemprice,comprice,picture) VALUES ('$kind','$brand','$item','$ptistork','$compatibility','$OEM','$color','$oemprice','$comp','$image')"; $result=mysql_query($insert,$connection) or die (mysql_error()); echo "you win " ; ?> </body> </html>
×
×
  • 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.