امتحان کردم نشد.
<?php ?> <html> <STYLE> BODY { SCROLLBAR-ARROW-COLOR: #000; SCROLLBAR-TRACK-COLOR: #fffbf1; SCROLLBAR-BASE-COLOR: #ffc999 } BODY { FONT-SIZE: 11px; LINE-HEIGHT: 150%; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #fffbf1 } #Header { BORDER-RIGHT: #ffbf00 1px solid; BORDER-TOP: #ffbf00 1px solid; BACKGROUND-IMAGE: url(top.jpg); BORDER-LEFT: #ffbf00 1px solid; WIDTH: 950px; BORDER-BOTTOM: #ffbf00 1px solid; HEIGHT: 100px } #Body { BORDER-RIGHT: #ffbf00 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #ffbf00 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffbf00 1px solid; WIDTH: 950px; DIRECTION: rtl; PADDING-TOP: 10px; BORDER-BOTTOM: #ffbf00 1px solid; BACKGROUND-COLOR: #fff1cc } #Left { FLOAT: left; WIDTH: 160px } #Left .Top { BORDER-RIGHT: #ffbf00 1px solid; BORDER-TOP: #ffbf00 1px solid; FONT-WEIGHT: bold; FONT-SIZE: 11px; BACKGROUND-IMAGE: url(10.gif); BORDER-LEFT: #ffbf00 1px solid; WIDTH: 195px; COLOR: #888; LINE-HEIGHT: 100%; PADDING-TOP: 5px; BORDER-BOTTOM: #ffbf00 1px solid; FONT-FAMILY: Tahoma; HEIGHT: 25px } #Left .Down { BORDER-TOP-WIDTH: 1px; BORDER-RIGHT: #ffbf00 1px solid; PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-SIZE: 11px; MARGIN-BOTTOM: 7px; PADDING-BOTTOM: 4px; BORDER-LEFT: #ffbf00 1px solid; WIDTH: 195px; COLOR: #2e41cb; PADDING-TOP: 4px; BORDER-BOTTOM: #ffbf00 1px solid; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #fff; TEXT-ALIGN: right } #Left .Page { DIRECTION: ltr; TEXT-ALIGN: left } #Left .Pool { DIRECTION: ltr; TEXT-ALIGN: right } #Right { FLOAT: right; WIDTH: 160px } #Right .Top { BORDER-RIGHT: #ffbf00 1px solid; BORDER-TOP: #ffbf00 1px solid; FONT-WEIGHT: bold; FONT-SIZE: 11px; BACKGROUND-IMAGE: url(10.gif); BORDER-LEFT: #ffbf00 1px solid; WIDTH: 195px; COLOR: #888; LINE-HEIGHT: 100%; PADDING-TOP: 5px; BORDER-BOTTOM: #ffbf00 1px solid; FONT-FAMILY: Tahoma; HEIGHT: 25px } #Right .Down { BORDER-TOP-WIDTH: 1px; BORDER-RIGHT: #ffbf00 1px solid; PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-SIZE: 11px; MARGIN-BOTTOM: 7px; PADDING-BOTTOM: 4px; BORDER-LEFT: #ffbf00 1px solid; WIDTH: 195px; COLOR: #2e41cb; PADDING-TOP: 4px; BORDER-BOTTOM: #ffbf00 1px solid; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #fff; TEXT-ALIGN: right } #Post { WIDTH: 450px } #Post .Top { BORDER-RIGHT: #ffbf00 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #ffbf00 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 11px; BACKGROUND-IMAGE: url(10.gif); BORDER-LEFT: #ffbf00 1px solid; WIDTH: 525px; COLOR: #888888; DIRECTION: rtl; LINE-HEIGHT: 100%; PADDING-TOP: 5px; BORDER-BOTTOM: #ffbf00 1px solid; FONT-FAMILY: Tahoma; HEIGHT: 25px; TEXT-ALIGN: right } #Post .Down { BORDER-TOP-WIDTH: 1px; BORDER-RIGHT: #ffbf00 1px solid; PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-SIZE: 11px; MARGIN-BOTTOM: 7px; PADDING-BOTTOM: 4px; BORDER-LEFT: #ffbf00 1px solid; WIDTH: 525px; COLOR: #000; PADDING-TOP: 4px; BORDER-BOTTOM: #ffbf00 1px solid; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #fff; TEXT-ALIGN: right } .CopyRight { FONT-SIZE: 11px; WIDTH: 750px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma; TEXT-ALIGN: center } A { COLOR: #2e41cb; FONT-FAMILY: Tahoma; TEXT-DECORATION: none } A:visited { COLOR: #2e41cb; FONT-FAMILY: Tahoma; TEXT-DECORATION: none } A:hover { COLOR: #0099FF } P { MARGIN-TOP: 2px; MARGIN-BOTTOM: 2px; LINE-HEIGHT: 150% } FORM { MARGIN: 0px; LINE-HEIGHT: 150% } .Span { COLOR: #3300CC } INPUT { BORDER-RIGHT: #ffbf00 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #ffbf00 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 11px; BORDER-LEFT: #ffbf00 1px solid; COLOR: #777; BORDER-BOTTOM: #ffbf00 1px solid; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #f8f8f8 } .style1 {color: #660099} .CopyRight1 { FONT-SIZE: 11px; WIDTH: 750px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma; TEXT-ALIGN: center } .CopyRight11 {FONT-SIZE: 11px; WIDTH: 750px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma; TEXT-ALIGN: center } .style3 { font-size: x-large; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; } </STYLE> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <P align=center> <DIV align=center> <DIV id="</div"> <DIV id=Body> <form name="form1" method="post" action=""> <p align="center" class="Top style3">قیمت قطعات </p> <table width="254" border="1" align="right"> <tr> <td width="253"><p> <label> <select name="select_sh" id="select_sh"> <option selected>کد تدارکاتی</option> <option>شرح قطعه</option> </select> = <input name="serch" type="text" id="del2"> <br> </label><input name="Submit" type="submit" id="Submit2" value="جستجو"> </p> </td> </tr> </table> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <table width="940" border="1"> <tr class="CopyRight11"> <td width="162"><span class="style1">کد تدارکاتی </span></td> <td width="277" class="style1"> شرح کالا</td> <td width="313" class="style1">توضیحات </td> <td width="160"><span class="style1">قیمت</span></td> </tr> <?php $a=$_POST[submit]; $b=$_POST[type_search]; $s=$_POST[serch]; $s1=$_SESSION[serch]; $sqlcon=mysql_connect ("localhost", "root", "") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db (traffic) or die ('I cannot open to the database because: ' . mysql_error()); if ($a=='جستجو') { if ($_POST[select_sh]=='کد تدارکاتی') { $sql ="SELECT * FROM hwe74_jshopping_products"." WHERE `product_ean` LIKE '$s'".''; $res = mysql_query($sql,$sqlcon) or die ( mysql_error()); $numrow = mysql_num_rows($res); while($row = mysql_fetch_array($res)) { print("<tr> <td>".$row[2] ."</td> <td>".$row[41] ."</td> <td>".$row[43] ."</td> <td>".$row[16] ."</td> </tr>".''); } } if ($_POST[select_sh]=='شرح قطعه') { $sql ="SELECT * FROM hwe74_jshopping_products"." WHERE `name_fa-IR` LIKE'%$_POST[serch]'".''; $res = mysql_query($sql,$sqlcon) or die ( mysql_error()); $numrow = mysql_num_rows($res); print($row[2]); while($row = mysql_fetch_array($res)) { print("<tr> <td>".$row[2] ."</td> <td>".$row[41] ."</td> <td>".$row[43] ."</td> <td>".$row[16] ."</td> </tr>".''); } } } ?> </table> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </form> </body> </html>