-
Posts
4,953 -
Joined
-
Last visited
Everything posted by darkfreaks
-
<?php function array_orderby() { $args = func_get_args(); $data = array_shift($args); foreach ($args as $n => $field) { if (is_string($field)) { $tmp = array(); foreach ($data as $key => $row) $tmp[$key] = $row[$field]; $args[$n] = $tmp; } } $args[] = &$data; call_user_func_array('array_multisort', $args); return array_pop($args); } $sorted= array_orderby($array,'name',SORT_ASC); ?>
-
you might also look at mysqlimport to insert text files into a database. http://dev.mysql.com/doc/refman/5.5/en/mysqlimport.html also as suggested setting a max time limit will help the time out errors from occurring.
-
HELP PHP FORM SHOWING SERVER INFORMATION IN EMAIL?!?
darkfreaks replied to webshark360's topic in PHP Coding Help
you can omit the $from variable and put it in your headers. $headers = 'From: Webshark360.com.com' . "\r\n" . 'Reply-To: Webshark360.com.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); alternately you can use phpmailer which uses SMTP email settings to achieve the same desired result. PHpmailer example: <?php require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "smtp.example.com"; // SMTP server $mail->From = "Webshark360.com.com"; //from your other adress $mail->AddAddress("[email protected]"); //sends the email to you $mail->Subject = "ebshark360.com form has been submitted by $cname"; $mail->Body = "Name -$cname Phone-$cphone Email ID-$cemail Message-$cmessage"; ?> -
HELP PHP FORM SHOWING SERVER INFORMATION IN EMAIL?!?
darkfreaks replied to webshark360's topic in PHP Coding Help
we need to see the code to figure out what is going on. thanks -
php script sending blank info to mysql database
darkfreaks replied to hashstar's topic in PHP Coding Help
you need to concecate your post values in your MYSQL either using doublequotes and dots or curly braces. -
http://php.net/manual/en/function.nl2br.php if you look under this page there are plenty of alt ways to find a break and convert it to a paragraph.
-
put this in your code and tell us exactly what errors you get. ini_set('error_reporting', E_ALL);
-
marked as solved.
-
cleaned up some redundancy in your code. not sure why the backticks are there i took them out. let us know if you have more problems. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ROOMS</title> <?php $arrival = (string) changeFormatDate($_POST['start']); $departure = (string) changeFormatDate($_POST['end']); $adults=6; $child=2; $room_id=101; function changeFormatDate($cdate){ list($day,$month,$year)=explode("/",$cdate); return $year."-".$month."-".$day; } function gen_options($type) { // print "$id"; // print "$type"; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("hotel", $con); $count=0; $result = mysql_query("SELECT * FROM rooms where type='$type'"); while($row = mysql_fetch_array($result)) { $a=$row['room_no']; //print "$a"; // $query1 = mysql_query("SELECT count(*) FROM `room_inventory` WHERE room_no='$a' and status='active'"); // $query=mysql_query("SELECT count(*) FROM `room_inventory` WHERE room_no='$a' and ((arrival<='2012-05-11' AND departure>='2012-05-11')OR(arrival<='2012-05-13' AND departure>='2012-05-13'))"); //$query=mysql_query("SELECT count(*) FROM `room_inventory` WHERE room_no='$a' and ((arrival BETWEEN '2012-05-11' AND '2012-05-13') or (departure BETWEEN '2012-05-11' AND '2012-05-13'))"); //$query=mysql_query("SELECT count(*) FROM `room_inventory` WHERE room_no='$a' and ((arrival<='$arr' AND departure>='$arr')OR(arrival<='$dep' AND departure>='$dep'))"); $quer=sprintf("SELECT count(*) FROM room_inventory WHERE room_no='$a' and ((arrival<='%s' AND departure>='%s')OR(arrival<='%s' AND departure>='%s'))",$arrival,$arrival,$departure,$departure); $query=mysql_query($quer); //$query=mysql_query("SELECT count(*) FROM `room_inventory` WHERE room_no='$a' and ((arrival BETWEEN '$arr' AND '2012-05-13') or (departure BETWEEN '$arr' AND '2012-05-13'))"); $r=mysql_fetch_array($query); $v=$r['count(*)']; // print "$v"; if($v===0) { $count++; // print "$count"; } } echo '<select name="room1" class="ed" id="r1">'; for($i=0;$i<=$count;$i++) { echo '<option>'.$i.'</option>'; } echo '</select>'; mysql_close($con); } ?> <style type="text/css"> <!-- .style2 { font-size: 12px; font-weight: bold; } --> </style> </head> <body> <!-- TOP --> <div id="top1"><a href="index.php"></a></div> <div id="top"> <ul class="menu"> <li class="home"><a href="index.php">Home</a></li> <li class="about"><a href="about.php">About</a></li> <li class="contacts"><a href="contact.php">Contacts</a></li> <li class="renting"><a href="gallery.php">GALLERY</a></li> <li class="selling"><a href="rates.php">RATES</a></li> </ul> </div> <!-- HEADER --> <!-- CONTENT --> <div id="content"> <div id="leftPan"> <div id="services"> <h2>RESERVATION DETAILS </h2> <p> <ul> Check In Date :<?php echo $arrival; ?><br /> Check Out Date :<?php echo $departure; ?> <br /> </ul> </p> </p> </div> </div> <div id="featured"><br /> <div> <form action="personnalinfo.php" method="post" onsubmit="return validateForm()" name="room"> <input name="start" type="hidden" value="<?php echo $arrival; ?>" /> <input name="end" type="hidden" value="<?php echo $departure; ?>" /> <input name="rooms" id="rooms" type="hidden" /> <input name="adult" type="hidden" value="<?php echo $adults; ?>" /> <input name="child" type="hidden" value="<?php echo $child; ?>" /> </div> <table bgcolor="white" border="1" width="100%" style="float:left;table-layout:fixed" cellpadding="10" cellspacing="0" > <col width="70%"> <tr> <th colspan="2" bgcolor="white"><h2><font color=maroon>Room Type</font></h2></th> </tr> <tr> <td> <table border="0" style="float:left;table-layout:fixed" width="100%"> <col width="55%"> <tr> <td valign="top"> <img src="img1/apt.jpg" style="float:left" /> </br> <div style="margin-top:120px;margin-left:5px"> <img src="img1/apt1.jpg" /> <img src="img1/apt2.jpg" /> <img src="img1/apt3.jpg" /> </div> </td> <td> <h3>Appartment</h3> <br> <span class="price">Price:</span> <span class="number">Rs. 5,000.00</span><br /> <a> Apparment in HOTEL BELLA has 2 Rooms with connecting door.It can accomodate 4 Adult and 2 children. And are located on Beach side to give you comfort and a panoramic view so that you can have a luxury accommodation.<br> *Sitting area <br>*jacuzzi shower</br> *Large terrace overlooking the sea *Jacuzzi *Light therapy *Air treatment <a href="#">more...</a></p><br /> </td> </tr> </table> </td> <td valign="top"> <table border=0 width="100%" cellspacing="10"> <tr> <td align="left"> <label><h3>People : </h3></label> </td> <td align="right"> <img src="img1/i1.jpg" /> </td> </tr> <tr> <td align="left" > <label><h3>Rooms : </h3></label> </td> <td align="right" > <?php gen_options("single");?> </td> </tr> </table> </td> </tr> <tr> <td> <table border="0" style="float:left;table-layout:fixed" width="100%"> <col width="55%"> <tr> <td valign="top"> <img src="img1/double.jpg" style="float:left" /> </br> <div id="featured"> <img src="img1/double1.jpg" /> <img src="img1/double2.jpg" /> <img src="img1/double3.jpg" /> </div> </td> <td> <h3>Double</h3> <br> <span class="price">Price:</span> <span class="number">Rs. 3,000.00</span><br /> <a>Double rooms in HOTEL BELLA has Double bed. And can accomodate 2 Adults and 2 kids. It is comfortable and pleasant, with balcony and sea view. We hope that you will enjoy your summer holidays in Bella. BASIC: Telephone. Satellite TV. Safety Deposit Box. Mini Bar - Refrigerator. Air condition. Shower with or without cabin. Hair Dryer. Balcony.<a href="#">more...</a></p><br /> </td> </tr> </table> </td> <td valign="top"> <table border=0 width="100%" cellspacing="10"> <tr> <td align="left"> <label><h3>People : </h3></label> </td> <td align="right"> <img src="img1/i2.jpg" /> </td> </tr> <tr> <td align="left"> <label><h3>Rooms : </h3></label> </td> <td align="right" > <?php gen_options("double");?> </td> </tr> </table> </td> </tr> <tr> <td> <table border="0" style="float:left;table-layout:fixed" width="100%"> <col width="55%"> <tr> <td valign="top"> <img src="img1/single.jpg" style="float:left" /> </br> <div id="featured"> <img src="img1/single1.jpg" /> <img src="img1/single2.jpg" /> <img src="img1/single3.jpg" /> </div> </td> <td> <h3>Single</h3> <br> <span class="price">Price:</span> <span class="number">Rs. 2,000.00</span><br /> <a> Single Room in HOTEL BELLA has single bed, bathroom.Can accomodated single person. is comfortable and pleasant, with balcony and sea view Telephone Satellite TV Safety Deposit Box Mini Bar - Refrigerator Air condition Hair Dryer <a href="#">more...</a></p><br /> </td> </tr> </table> </td> <td valign="top"> <table border=0 width="100%" cellspacing="10"> <tr> <td align="left"> <label><h3>People : </h3></label> </td> <td align="right"> <img src="img1/i3.jpg" /> </td> </tr> <tr> <td align="left"> <label><h3>Rooms : </h3></label> </td> <td align="right" > <?php gen_options("apartment");?> </td> </tr> </table> </td> </tr> </table> <div style="margin-top:1200px;margin-left:5px;text-align:right;"> <input type="image" src="img1/book.jpg" name="book" value="submit"/> </div> <?php // echo "$arrival\n"; // print "$departure\n"; echo "$arrival"; echo "$departure"; // echo date_format($arrival, 'Y-m-d'); ?> <input type="hidden" name="result" id="result" /> </form> </div> <div class="clear"></div> </div> <!-- FOOTER --> <div id="footer"> <p><a href="index.php">HOME</a> |<a href="about.php"> ABOUT US </a>|<a href="contact.php"> CONTACTS </a>|<a href="gallery.php"> GALLERY </a>|<a href="rates.php"> ROOM RATES </a></p> </div> </body> </html>
-
might want to take a look at INNER JOIN it will return one match if there is a match in both tables.
-
mysql_real_escape_string not mysql_escape_string (Deprecated as of PHP 5.3.0) also would it hurt to remove all the white space from your code and make the SQL all on one line?
-
Revised to 4 errors: <form action="<?php echo(htmlentities($_server['PHP_SELF']));?>" method="GET" > <input name="hours" type="text" id="txthours" value="<?php echo $hour; ?>" size="10" maxlength="2"> <input name="minutes" type="text" id="txtminutes" value="<?php echo $minute; ?>" size="10" maxlength="2"> <input name="seconds" type="text" id="txtseconds" value="<?php echo $second; ?>" size="10" maxlength="2"> <select name="select" id="select"> <option value="am">AM</option> <option value="pm">PM</option> </select> <br /> <br /> <input name="Submit" type="submit" value="Submit"> </p> </form> <?php $hour = (string) $_GET["hours"] . htmlentities($hour); $minute = (string) $_GET["minutes"] . htmlentities($minute); $second = (string) $_GET["seconds"] . htmlentities($second); $ampm = (string) $_GET["select"] . htmlentities($ampm); $lenhour = strlen($hour); if ($_GET["Submit"] === "Submit"){ /*Validating the text box to make sure that there are two digits*/ $lenhour = strlen($hour); $lenminute = strlen($minute); $lensecond = strlen($second); if(preg_match("/^[0-24]/", $hour) > 0) { if ($lenhour !== 2 and $hour !== NULL){ $hour = ("0". $hour); } } if(preg_match("/^[0-24]/", $minute) > 0) { if ($lenminute !== 2 and $minute !== NULL){ $minute = ("0" . $minute); } } if(preg_match("/^[0-24]/", $second) > 0) { if ($lensecond !== 2 and $second !== NULL){ $second = ("0" . $second); } } //echo $event_start = $hour . ':' . $minute . ':' . $second . ' ' . $ampm; if ($ampm === "am"){ if (strlen($hour) <= 12){ $event_start = $hour . ':' . $minute . ':' . $second . ' ' . $ampm; print( date("H:i:s", strtotime($event_start))); } else { echo ("The numbers have to be lessa than or equal to 12"); } } elseif ($ampm === "pm"){ if (strlen($hour) <= 23){ echo $event_start = $hour . ':' . $minute . ':' . $second . ' ' . $ampm; print( date("H:i:s", strtotime($event_start))); } else { echo ("make sure that you have selected the pm for the ranges of numbers you have chosen"); } } else { echo ("Please make sure you have enter a number value in each feild"); } }
-
actually in the code it is <= either way it doesnt recognize it as an error. however i think his regex may be off it is telling me it should be a boolean instead of an int. revised code returns 7 errors. <form action="<?php echo(htmlentities($_server['PHP_SELF']));?>" method="GET" > <input name="hours" type="text" id="txthours" value="<?php echo $hour; ?>" size="10" maxlength="2"> <input name="minutes" type="text" id="txtminutes" value="<?php echo $minute; ?>" size="10" maxlength="2"> <input name="seconds" type="text" id="txtseconds" value="<?php echo $second; ?>" size="10" maxlength="2"> <select name="select" id="select"> <option value="am">AM</option> <option value="pm">PM</option> </select> <br /> <br /> <input name="Submit" type="submit" value="Submit"> </p> </form> <?php $hour = (string) $_GET["hours"] . htmlentities($hour); $minute = (string) $_GET["minutes"] . htmlentities($minute); $second = (string) $_GET["seconds"] . htmlentities($second); $ampm = (string) $_GET["select"] . htmlentities($ampm); $lenhour = strlen($hour); if ($_GET["Submit"] === "Submit"){ /*Validating the text box to make sure that there are two digits*/ $lenhour = strlen($hour); $lenminute = strlen($minute); $lensecond = strlen($second); if(preg_match("#^[0-24]/", $hour)) { if ($lenhour !== 2 and $hour !== NULL){ $hour = ("0". $hour); } } if(preg_match("#^[0-24]/", $minute)) { if ($lenminute !== 2 and $minute !== NULL){ $minute = ("0" . $minute); } } if(preg_match("#^[0-24]/", $second)) { if ($lensecond !== 2 and $second !== NULL){ $second = ("0" . $second); } } //echo $event_start = $hour . ':' . $minute . ':' . $second . ' ' . $ampm; if ($ampm === "am"){ if (strlen($hour) <= 12){ $event_start = $hour . ':' . $minute . ':' . $second . ' ' . $ampm; print( date("H:i:s", strtotime($event_start))); } else { echo ("The numbers have to be lessa than or equal to 12"); } } elseif ($ampm === "pm"){ if (strlen($hour) <= 23){ echo $event_start = $hour . ':' . $minute . ':' . $second . ' ' . $ampm; print( date("H:i:s", strtotime($event_start))); } else { echo ("make sure that you have selected the pm for the ranges of numbers you have chosen"); } } else { echo ("Please make sure you have enter a number value in each feild"); } }
-
maybe someone can back me up on this but it seems when i replaced if($hour => 23) with if(strlen($hour) => 23) it reduced so many php lint errors. also using the (string) typecast in front of all the $_GET variables seemed to reduce more warnings and errors. there were some minor errors i don't even understand and they may not be that big of a deal. just a bunch of the echo's it deemed were "not assigned". although i am sure you defined it somewhere else in the code.
-
tr something like this. //looping all rows and setting it as a session foreach($row as $key=>$value) { if(is_string($key)){ //if keys a string set session $_SESSION[$key] = $value; } //echo out the session echo $_SESSION['username']; //should output the session }
-
that is because you are replacing $test_id to an actual existing value $row[0] will return empty|false.
-
$row[0] returns false that’s why
-
it is best if using smarty php yo use the replace function in smarty to accomplish this.
-
Unable to do SELECT function, its strange..
darkfreaks replied to ankur0101's topic in PHP Coding Help
if your using basic prevention check out strip_tags and mysql_real_escape_string but i would recommend using PDO -
Unable to do SELECT function, its strange..
darkfreaks replied to ankur0101's topic in PHP Coding Help
the appendage is not needed you can echo out username and password within double quotes. also to make the code mroe functioning you could change == to === also you have an extra dot like the above user stated in your SQL -
http://thedeadone.net/download/tdo-mini-forms-wordpress-plugin/ i think this is what you are looking for? something where non registered users have the option to edit stuff correct?
-
took my time editing it so it was almost error free the remaining 8 errors are because the resource (connection) has not been defined in mysql_query and mysql_num_rows <?php $checkbox= (int) $_POST["checkbox"]; //==================use for search recordset paging======================== if(isset($_GET["cb1"])) { $checkbox= (int) $_GET["cb1"]; } //======================================================================================== if ($checkbox==="1") { $checkboxDisplay=" and tblModel.A_FN =".$checkbox; } else { $checkboxDisplay=" "; } $checkbox2= (int) $_POST["checkbox2"]; //==================use for search recordset paging======================== if(isset($_GET["cb2"])) { $checkbox2= (int) $_GET["cb2"]; } //======================================================================================== if ($checkbox2==="1") { $checkbox2Display=" and TS =".$checkbox2; } else { $checkbox2Display=" "; } $checkbox3= (int) $_POST["checkbox3"]; //==================use for search recordset paging======================== if(isset($_GET["cb3"])) { $checkbox3= (int) $_GET["cb3"]; } //======================================================================================== if ($checkbox3==="1") { $checkbox3Display=" and CON =".$checkbox3; } else { $checkbox3Display=" "; } $checkbox4= (int) $_POST["checkbox4"]; //==================use for search recordset paging======================== if (isset($_GET["cb4"])) { $checkbox4= (int) $_GET["cb4"]; } //======================================================================================== if ($checkbox4==="1") { $checkbox4Display=" and STI =".$checkbox4; } else { $checkbox4Display=" "; } $checkbox5= (int) $_POST["checkbox5"]; //==================use for search recordset paging======================== if (isset($_GET["cb5"])) { $checkbox5= (int) $_GET["cb5"]; } //======================================================================================== if ($checkbox5==="1") { $checkbox5Display=" and FA =".$checkbox5; } else { $checkbox5Display=" "; } $checkbox6= (int) $_POST["checkbox6"]; //==================use for search recordset paging======================== if(isset($_GET["cb6"])) { $checkbox6= (int) $_GET["cb6"]; } //======================================================================================== if ($checkbox6==="1") { $checkbox6Display=" and VID =".$checkbox6; } else { $checkbox6Display=" "; } $checkbox7= (int) $_POST["checkbox7"]; //==================use for search recordset paging======================== if (isset($_GET["cb7"])) { $checkbox7= (int) $_GET["cb7"]; } //======================================================================================== if ($checkbox7==="1") { $checkbox7Display=" and BGS =".$checkbox7; } else { $checkbox7Display=" "; } $checkbox8= (int) $_POST["checkbox8"]; //==================use for search recordset paging======================== if (isset($_GET["cb8"])) { $checkbox8= (int) $_GET["cb8"]; } //======================================================================================== if ($checkbox8==="1") { $checkbox8Display=" and GGS =".$checkbox8; } else { $checkbox8Display=" "; } $checkbox9= (int) $_POST["checkbox9"]; //==================use for search recordset paging======================== if (isset($_GET["cb9"])) { $checkbox9= (int) $_GET["cb9"]; } //======================================================================================== if ($checkbox9==="1") { $checkbox9Display=" and BGX =".$checkbox9; } else { $checkbox9Display=" "; } $checkbox10= (int) $_POST["checkbox10"]; //==================use for search recordset paging======================== if (isset($_GET["cb10"])) { $checkbox10= (int) $_GET["cb10"]; } //======================================================================================== if ($checkbox10==="1") { $checkbox10Display=" and GGX =".$checkbox10; } else { $checkbox10Display=" "; } //================ end of request.form checkboxes================ //================calculate each range of height================== $height=str_replace("'","''",$_POST["txtHeight"]); //==================use for search recordset paging======================== if (isset($_GET["height"])) { $height=$_GET["height"]; } //======================================================================================== if ($height==="heightA") { $rangeHeight="BETWEEN '4' AND '5'"; $heightDisplay=" and modelHeight ".$rangeHeight." "; } else if ($height==="heightB") { $rangeHeight="BETWEEN '5' AND '6'"; $heightDisplay=" and modelHeight ".$rangeHeight." "; } else if ($height==="heightC") { $rangeHeight="BETWEEN '6' AND '7'"; $heightDisplay=" and modelHeight ".$rangeHeight." "; } else { $rangeHeight=" "; $heightDisplay=$rangeHeight; } //================end of range calculation=========================== //================calculate modelLocation =========================== $location=str_replace("'","''",$_POST["txtLocation"]); //==================use for search recordset paging======================== if (isset($_GET["location"])) { $location=$_GET["location"]; } //======================================================================================== if ($location!=="") { $locationDisplay=" and modelLocation like '%".$location."' "; } else { $locationDisplay=" "; } $hair=str_replace("'","''",$_POST["txtHair"]); //==================use for search recordset paging======================== if (isset($_GET["hair"])) { $hair=$_GET["hair"]; } //======================================================================================== if ($hair!=="") { $hairDisplay=" and modelHair like '%".$hair."%' "; } else { $hairDisplay=" "; } //===============calculate each range of bust size ============= $bSize=str_replace("'","''",$_POST["txtBust"]); //==================use for search recordset paging======================== if (isset($_GET["bSize"])) { $bSize=$_GET["bSize"]; } //======================================================================================== if ($bSize==="bustA") { $rangeBust="BETWEEN '20' AND '24'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustB") { $rangeBust="BETWEEN '25' AND '29'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustC") { $rangeBust="BETWEEN '30' AND '34'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustD") { $rangeBust="BETWEEN '35' AND '39'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustE") { $rangeBust="BETWEEN '40' AND '44'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustF") { $rangeBust="BETWEEN '45' AND '49'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustG") { $rangeBust="> '50'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else { $rangeBust=" "; $bustDisplay=$rangeBust; } //===============end of bust size range=============================== //===============calculate each range of ages====================== $age=str_replace("'","''",$_POST["txtAge"]); //==================use for search recordset paging======================== if(isset($_GET["age"])) { $age= (int) $_GET["age"]; } //======================================================================================== if ($age==="ageA") { $rangeAge="BETWEEN '18' AND '24'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageB") { $rangeAge="BETWEEN '25' AND '29'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageC") { $rangeAge="BETWEEN '30' AND '34'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageD") { $rangeAge="BETWEEN '35' AND '39'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageE") { $rangeAge="BETWEEN '40' AND '44'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageF") { $rangeAge="BETWEEN '45' AND '49'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageG") { $rangeAge="BETWEEN '50' AND '54'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageH") { $rangeAge="BETWEEN '55' AND '59'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageI") { $rangeAge="> '60'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else { $rangeAge=" "; $ageDisplay=$rangeAge; } //=============end of range of ages============================ $eye=str_replace("'","''",$_POST["txtColour"]); //==================use for search recordset paging======================== if(isset($_GET["eye"])) { $eye= (string) $_GET["eye"]; } //======================================================================================== if ($eye!=="") { $eyeDisplay=" and modelEyeColour like '%".(string) $eye."%' "; } else { $eyeDisplay=" "; } //==================calculate range of waist ===================== $waist=str_replace("'","''",$_POST["txtWaist"]); //==================use for search recordset paging======================== if(isset($_GET["waist"])) { $waist= (string) $_GET["waist"]; } //======================================================================================== if ($waist==="waistA") { $rangeWaist="BETWEEN '20' AND '24'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistB") { $rangeWaist="BETWEEN '25' AND '29'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistC") { $rangeWaist="BETWEEN '30' AND '34'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistD") { $rangeWaist="BETWEEN '35' AND '39'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistE") { $rangeWaist="BETWEEN '40' AND '44'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistF") { $rangeWaist="BETWEEN '45' AND '49'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistG") { $rangeWaist=">'50'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else { $rangeWaist=" "; $waistDisplay=$rangeWaist; } //==================end of range of waist ===================== //==================calculate range of dress ================ $dSize=str_replace("'","''",$_POST["txtDress"]); //==================use for search recordset paging======================== if(isset($_GET["dSize"])) { $dSize= (int) $_GET["dSize"]; } //======================================================================================== if ($dSize==="dressA") { $rangeDress="BETWEEN '0' AND '4'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressB") { $rangeDress="BETWEEN '5' AND '9'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressC") { $rangeDress="BETWEEN '10' AND '14'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressD") { $rangeDress="BETWEEN '15' AND '19'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressE") { $rangeDress="BETWEEN '20' AND '24'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressF") { $rangeDress="BETWEEN '25' AND '29'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressG") { $rangeDress=">30"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else { $rangeDress=" "; $dressDisplay=" ".$rangeDress." "; } //==================end of range of dress ===================== $race=str_replace("'","''",(int) $_POST["txtRace"]); //==================use for search recordset paging======================== if(isset($_GET["race"])) { $race= (int) $_GET["race"]; } //======================================================================================== if ($race!=="") { $raceDisplay=" and modelRace like '".(string)$race."%'"; } else { $raceDisplay=" "; } //==================calculate range of hips=================== $hips=str_replace("'","''",(int) $_POST["txtHips"]); //==================use for search recordset paging======================== if (isset($_GET["hips"])) { $hips= (string) $_GET["hips"]; } //======================================================================================== //hips = request.QueryString("hips") if ($hips==="hipsA") { $hipsRange="BETWEEN '25' AND '29'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else if ($hips==="hipsB") { $hipsRange="BETWEEN '30' AND '34'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else if ($hips==="hipsC") { $hipsRange="BETWEEN '35' AND '39'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else if ($hips==="hipsD") { $hipsRange="BETWEEN '40' AND '44'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else if ($hips==="hipsE") { $hipsRange="BETWEEN '45' AND '49'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else if ($hips==="hipsF") { $hipsRange="> '50'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else { $hipsRange=" "; $hipsDisplay=" ".$hipsRange." "; } //==================end of hips calculation=================== //==================calculate range of shoes================== $sSize=str_replace("'","''",(int) $_POST["txtShoe"]); //==================use for search recordset paging======================== if (isset($_GET["sSize"])) { $sSize= (int) $_GET["sSize"]; } //======================================================================================== if ($sSize==="shoeA") { $shoeRange="BETWEEN '0' AND '4'"; $shoeDisplay=" and modelShoeSize ".$shoeRange." "; } else if ($sSize==="shoeB") { $shoeRange="BETWEEN '5' AND '9'"; $shoeDisplay=" and modelShoeSize ".$shoeRange." "; } else if ($sSize==="shoeC") { $shoeRange="BETWEEN '10' AND '14'"; $shoeDisplay=" and modelShoeSize ".$shoeRange." "; } else if ($sSize==="shoeD") { $shoeRange="BETWEEN '15' AND '19'"; $shoeDisplay=" and modelShoeSize ".$shoeRange." "; } else if ($sSize==="shoeE") { $shoeRange=">'20'"; $shoeDisplay=" and modelShoeSize ".$shoeRange." "; } else { $shoeRange=" "; $shoeDisplay=" ".$shoeRange." "; } //==================end of calculation=========================== $remarks=str_replace("'","''",(string) $_POST["txtRemarks"]); if ($remarks!=="") { $remarksDisplay=" and modelRemarks like '%".(string) $remarks."%' "; } else { $remarksDisplay=" "; } $keyword=str_replace("'","''",(string) $_POST["keyword"]); $stageName=str_replace("'","''",(string) $_POST["txtStage"]); if ($stageName!=="") { $stageNameDisplay=" and modelName like '%".(string) $stageName."%' "; } else { $stageNameDisplay=" "; } $kategori=str_replace("'","''",(string) $_POST["txtCategory"]); $abc=substr((string)$kategori,0,12); if (isset($GET["cat"])) { $kategori= (string) $_GET["cat"]; } if ($keyword!=="") { $SQLstmt=" SELECT * FROM tblModel,tblImages "; $SQLstmt=$SQLstmt." WHERE tblModel.modelStatus='Active' "; $SQLstmt=$SQLstmt."AND tblImages.imageTypeID = 1 "; $SQLstmt=$SQLstmt."AND tblModel.modelName LIKE '%".(string) $keyword."%' "; $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID "; $rs=sprintf($SQLstmt); $rs=mysql_query($SQLstmt); if($rs===FALSE) { echo "Your search found no matching results"; } } else { $SQLstmt="Select * from tblModel, tblImages where "; $SQLstmt=$SQLstmt."tblModel.modelCategory like '%".(string)$kategori."%' "; $SQLstmt=$SQLstmt."'".$stageNameDisplay."'"; $SQLstmt=$SQLstmt."'".$heightDisplay."'"; $SQLstmt=$SQLstmt."'".$locationDisplay."'"; $SQLstmt=$SQLstmt."'".$hairDisplay."'"; $SQLstmt=$SQLstmt."'".$bustDisplay."'"; $SQLstmt=$SQLstmt."'".$ageDisplay."'"; $SQLstmt=$SQLstmt."'".$eyeDisplay."'"; $SQLstmt=$SQLstmt."'".$waistDisplay."'"; $SQLstmt=$SQLstmt."'".$dressDisplay."'"; $SQLstmt=$SQLstmt."'".$raceDisplay."'"; $SQLstmt=$SQLstmt."'".$hipsDisplay."'"; $SQLstmt=$SQLstmt."'".$shoeDisplay."'"; $SQLstmt=$SQLstmt."'".$checkboxDisplay."'"; $SQLstmt=$SQLstmt."'".$checkbox2Display."'"; $SQLstmt=$SQLstmt."'".$checkbox3Display."'"; $SQLstmt=$SQLstmt."'".$checkbox4Display."'"; $SQLstmt=$SQLstmt."'".$checkbox5Display."'"; $SQLstmt=$SQLstmt."'".$checkbox6Display."'"; $SQLstmt=$SQLstmt."'".$checkbox7Display."'"; $SQLstmt=$SQLstmt."'".$checkbox8Display."'"; $SQLstmt=$SQLstmt."'".$checkbox9Display."'"; $SQLstmt=$SQLstmt."'".$checkbox10Display."'"; $SQLstmt=$SQLstmt."and modelStatus='Active' "; $SQLstmt=$SQLstmt."and tblImages.imageTypeID = 1 "; $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID "; $SQLstmt=$SQLstmt."ORDER BY tblModel.modelID DESC "; $rs=sprintf($SQLstmt); $rs=mysql_query($SQLstmt); } if (mysql_num_rows($rs) < 1) { $countData="No results found of selected query"; ?> <tr> <td colspan="5" class="text9"><br> <strong>Search Result</strong> </td> </tr> <tr> <td class="text" colspan="4"> <?php echo $countData; echo $SQLstmt;echo mysql_num_rows($rs);?></td> </tr> <tr> <td colspan="5" height="4"><hr /></td> </tr> <?php } else { ?><table width="100%" align="center" cellpadding="0" cellspacing="0"> <tr><td class="text9"><br><strong>Search Result</strong></td><td colspan="3" align="right"></td></tr> <tr> <td width="150" class="text"><div align="center"><strong>Thumbnail</strong></div></td> <td width="150" class="text"><strong>Name</strong></td> <td width="150" class="text"><strong>Age</strong></td> <td width="150" class="text"><strong>Model No</strong></td> <td width="75"></td> </tr> <tr> <td colspan="5" height="4"><hr /></td> </tr> <tr> <?php while ($line = mysql_fetch_assoc($rs)) { if ($line["modelCategory"] === "Couples") { $width = 100; } else { $width = 100; } ?> <td class="text"><div align="center"><a href="../models/model.php?modelID=<?php echo $line["modelID"]; ?>#"><img src="../cms/models/lineup/<?php echo $line["modelID"]; ?>/<?php echo $line["imageFile"]; ?>" height="100" width="<?php echo $width; ?>" border="0"></a></div></td> <td width="100" class="text"><?php echo $line["modelName"]; ?></Td> <td width="100" class="text"><?php echo $line["modelAge"]; ?></Td> <td width="147" class="text"><?php echo $line["modelNo"]; ?></td> <td width="78" class="text"><a href="../models/model.php?modelID=<?php echo $line["modelID"]; ?>#">View</a></td> </tr> <tr> <td colspan="5" height="4"><hr /></td> </tr> <?php } ?> </table></td> <?php } ?>
-
changed strlen to isset this got rid of alot of warnings. also changed = to == and == to === this got rid of the rest of the warnings. also make sure your concecation is properly escaped i still have my doubts about it. if you are not used to doing $variable = mysql_query("INSERT INTO table VALUES('".$GET["something"]."') "; you can always use curly braces {} to concecate (escape) variables in mysql. //================request.form checkboxes============================ <?php $checkbox=$_POST["checkbox"]; //==================use for search recordset paging======================== if(isset($_GET["cb1"])) { $checkbox=$_GET["cb1"]; } //======================================================================================== if ($checkbox==="1") { $checkboxDisplay=" and tblModel.A_FN =".$checkbox; } else { $checkboxDisplay=" "; } $checkbox2=$_POST["checkbox2"]; //==================use for search recordset paging======================== if(isset($_GET["cb2"])) { $checkbox2=$_GET["cb2"]; } //======================================================================================== if ($checkbox2==="1") { $checkbox2Display=" and TS =".$checkbox2; } else { $checkbox2Display=" "; } $checkbox3=$_POST["checkbox3"]; //==================use for search recordset paging======================== if(isset($_GET["cb3"])) { $checkbox3=$_GET["cb3"]; } //======================================================================================== if ($checkbox3==="1") { $checkbox3Display=" and CON =".$checkbox3; } else { $checkbox3Display=" "; } $checkbox4=$_POST["checkbox4"]; //==================use for search recordset paging======================== if (isset($_GET["cb4"])) { $checkbox4=$_GET["cb4"]; } //======================================================================================== if ($checkbox4==="1") { $checkbox4Display=" and STI =".$checkbox4; } else { $checkbox4Display=" "; } $checkbox5=$_POST["checkbox5"]; //==================use for search recordset paging======================== if (isset($_GET["cb5"])) { $checkbox5=$_GET["cb5"]; } //======================================================================================== if ($checkbox5==="1") { $checkbox5Display=" and FA =".$checkbox5; } else { $checkbox5Display=" "; } $checkbox6=$_POST["checkbox6"]; //==================use for search recordset paging======================== if(isset($_GET["cb6"])) { $checkbox6=$_GET["cb6"]; } //======================================================================================== if ($checkbox6==="1") { $checkbox6Display=" and VID =".$checkbox6; } else { $checkbox6Display=" "; } $checkbox7=$_POST["checkbox7"]; //==================use for search recordset paging======================== if (isset($_GET["cb7"])) { $checkbox7=$_GET["cb7"]; } //======================================================================================== if ($checkbox7==="1") { $checkbox7Display=" and BGS =".$checkbox7; } else { $checkbox7Display=" "; } $checkbox8=$_POST["checkbox8"]; //==================use for search recordset paging======================== if (isset($_GET["cb8"])) { $checkbox8=$_GET["cb8"]; } //======================================================================================== if ($checkbox8==="1") { $checkbox8Display=" and GGS =".$checkbox8; } else { $checkbox8Display=" "; } $checkbox9=$_POST["checkbox9"]; //==================use for search recordset paging======================== if (isset($_GET["cb9"])) { $checkbox9=$_GET["cb9"]; } //======================================================================================== if ($checkbox9==="1") { $checkbox9Display=" and BGX =".$checkbox9; } else { $checkbox9Display=" "; } $checkbox10=$_POST["checkbox10"]; //==================use for search recordset paging======================== if (isset($_GET["cb10"])) { $checkbox10=$_GET["cb10"]; } //======================================================================================== if ($checkbox10==="1") { $checkbox10Display=" and GGX =".$checkbox10; } else { $checkbox10Display=" "; } //================ end of request.form checkboxes================ //================calculate each range of height================== $height=str_replace("'","''",$_POST["txtHeight"]); //==================use for search recordset paging======================== if (isset($_GET["height"])) { $height=$_GET["height"]; } //======================================================================================== if ($height==="heightA") { $rangeHeight="BETWEEN '4' AND '5'"; $heightDisplay=" and modelHeight ".$rangeHeight." "; } else if ($height==="heightB") { $rangeHeight="BETWEEN '5' AND '6'"; $heightDisplay=" and modelHeight ".$rangeHeight." "; } else if ($height==="heightC") { $rangeHeight="BETWEEN '6' AND '7'"; $heightDisplay=" and modelHeight ".$rangeHeight." "; } else { $rangeHeight=" "; $heightDisplay=$rangeHeight; } //================end of range calculation=========================== //================calculate modelLocation =========================== $location=str_replace("'","''",$_POST["txtLocation"]); //==================use for search recordset paging======================== if (isset($_GET["location"])) { $location=$_GET["location"]; } //======================================================================================== if ($location!=="") { $locationDisplay=" and modelLocation like '%".$location."' "; } else { $locationDisplay=" "; } $hair=str_replace("'","''",$_POST["txtHair"]); //==================use for search recordset paging======================== if (isset($_GET["hair"])) { $hair=$_GET["hair"]; } //======================================================================================== if ($hair!=="") { $hairDisplay=" and modelHair like '%".$hair."%' "; } else { $hairDisplay=" "; } //===============calculate each range of bust size ============= $bSize=str_replace("'","''",$_POST["txtBust"]); //==================use for search recordset paging======================== if (isset($_GET["bSize"])) { $bSize=$_GET["bSize"]; } //======================================================================================== if ($bSize==="bustA") { $rangeBust="BETWEEN '20' AND '24'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustB") { $rangeBust="BETWEEN '25' AND '29'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustC") { $rangeBust="BETWEEN '30' AND '34'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustD") { $rangeBust="BETWEEN '35' AND '39'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustE") { $rangeBust="BETWEEN '40' AND '44'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustF") { $rangeBust="BETWEEN '45' AND '49'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else if ($bSize==="bustG") { $rangeBust="> '50'"; $bustDisplay=" and modelSize ".$rangeBust." "; } else { $rangeBust=" "; $bustDisplay=$rangeBust; } //===============end of bust size range=============================== //===============calculate each range of ages====================== $age=str_replace("'","''",$_POST["txtAge"]); //==================use for search recordset paging======================== if(isset($_GET["age"])) { $age=$_GET["age"]; } //======================================================================================== if ($age==="ageA") { $rangeAge="BETWEEN '18' AND '24'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageB") { $rangeAge="BETWEEN '25' AND '29'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageC") { $rangeAge="BETWEEN '30' AND '34'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageD") { $rangeAge="BETWEEN '35' AND '39'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageE") { $rangeAge="BETWEEN '40' AND '44'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageF") { $rangeAge="BETWEEN '45' AND '49'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageG") { $rangeAge="BETWEEN '50' AND '54'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageH") { $rangeAge="BETWEEN '55' AND '59'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else if ($age==="ageI") { $rangeAge="> '60'"; $ageDisplay=" and modelAge ".$rangeAge." "; } else { $rangeAge=" "; $ageDisplay=$rangeAge; } //=============end of range of ages============================ $eye=str_replace("'","''",$_POST["txtColour"]); //==================use for search recordset paging======================== if(isset($_GET["eye"])) { $eye=$_GET["eye"]; } //======================================================================================== if ($eye!=="") { $eyeDisplay=" and modelEyeColour like '%".$eye."%' "; } else { $eyeDisplay=" "; } //==================calculate range of waist ===================== $waist=str_replace("'","''",$_POST["txtWaist"]); //==================use for search recordset paging======================== if(isset($_GET["waist"])) { $waist=$_GET["waist"]; } //======================================================================================== if ($waist==="waistA") { $rangeWaist="BETWEEN '20' AND '24'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistB") { $rangeWaist="BETWEEN '25' AND '29'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistC") { $rangeWaist="BETWEEN '30' AND '34'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistD") { $rangeWaist="BETWEEN '35' AND '39'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistE") { $rangeWaist="BETWEEN '40' AND '44'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistF") { $rangeWaist="BETWEEN '45' AND '49'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else if ($waist==="waistG") { $rangeWaist=">'50'"; $waistDisplay=" and modelWaist ".$rangeWaist." "; } else { $rangeWaist=" "; $waistDisplay=$rangeWaist; } //==================end of range of waist ===================== //==================calculate range of dress ================ $dSize=str_replace("'","''",$_POST["txtDress"]); //==================use for search recordset paging======================== if(isset($_GET["dSize"])) { $dSize=$_GET["dSize"]; } //======================================================================================== if ($dSize==="dressA") { $rangeDress="BETWEEN '0' AND '4'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressB") { $rangeDress="BETWEEN '5' AND '9'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressC") { $rangeDress="BETWEEN '10' AND '14'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressD") { $rangeDress="BETWEEN '15' AND '19'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressE") { $rangeDress="BETWEEN '20' AND '24'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressF") { $rangeDress="BETWEEN '25' AND '29'"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else if ($dSize==="dressG") { $rangeDress=">30"; $dressDisplay=" and modelDressSize ".$rangeDress." "; } else { $rangeDress=" "; $dressDisplay=" ".$rangeDress." "; } //==================end of range of dress ===================== $race=str_replace("'","''",$_POST["txtRace"]); //==================use for search recordset paging======================== if(isset($_GET["race"])) { $race=$_GET["race"]; } //======================================================================================== if ($race!=="") { $raceDisplay=" and modelRace like '".$race."%' "; } else { $raceDisplay=" "; } //==================calculate range of hips=================== $hips=str_replace("'","''",$_POST["txtHips"]); //==================use for search recordset paging======================== if (isset($_GET["hips"])) { $hips=$_GET["hips"]; } //======================================================================================== //hips = request.QueryString("hips") if ($hips==="hipsA") { $hipsRange="BETWEEN '25' AND '29'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else if ($hips==="hipsB") { $hipsRange="BETWEEN '30' AND '34'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else if ($hips==="hipsC") { $hipsRange="BETWEEN '35' AND '39'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else if ($hips==="hipsD") { $hipsRange="BETWEEN '40' AND '44'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else if ($hips==="hipsE") { $hipsRange="BETWEEN '45' AND '49'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else if ($hips==="hipsF") { $hipsRange="> '50'"; $hipsDisplay=" and modelHips ".$hipsRange." "; } else { $hipsRange=" "; $hipsDisplay=" ".$hipsRange." "; } //==================end of hips calculation=================== //==================calculate range of shoes================== $sSize=str_replace("'","''",$_POST["txtShoe"]); //==================use for search recordset paging======================== if (isset($_GET["sSize"])) { $sSize=$_GET["sSize"]; } //======================================================================================== if ($sSize==="shoeA") { $shoeRange="BETWEEN '0' AND '4'"; $shoeDisplay=" and modelShoeSize ".$shoeRange." "; } else if ($sSize==="shoeB") { $shoeRange="BETWEEN '5' AND '9'"; $shoeDisplay=" and modelShoeSize ".$shoeRange." "; } else if ($sSize==="shoeC") { $shoeRange="BETWEEN '10' AND '14'"; $shoeDisplay=" and modelShoeSize ".$shoeRange." "; } else if ($sSize==="shoeD") { $shoeRange="BETWEEN '15' AND '19'"; $shoeDisplay=" and modelShoeSize ".$shoeRange." "; } else if ($sSize==="shoeE") { $shoeRange=">'20'"; $shoeDisplay=" and modelShoeSize ".$shoeRange." "; } else { $shoeRange=" "; $shoeDisplay=" ".$shoeRange." "; } //==================end of calculation=========================== $remarks=str_replace("'","''",$_POST["txtRemarks"]); if ($remarks!=="") { $remarksDisplay=" and modelRemarks like '%".$remarks."%' "; } else { $remarksDisplay=" "; } $keyword=str_replace("'","''",$_POST["keyword"]); $stageName=str_replace("'","''",$_POST["txtStage"]); if ($stageName!="") { $stageNameDisplay=" and modelName like '%".$stageName."%' "; } else { $stageNameDisplay=" "; } $kategori=str_replace("'","''",$_POST["txtCategory"]); $abc=substr($kategori,0,12); if (isset($GET["cat"])) { $kategori=$_GET["cat"]; } if ($keyword!=="") { $SQLstmt=" SELECT * FROM tblModel,tblImages "; $SQLstmt=$SQLstmt." WHERE tblModel.modelStatus='Active' "; $SQLstmt=$SQLstmt."AND tblImages.imageTypeID = 1 "; $SQLstmt=$SQLstmt."AND tblModel.modelName LIKE '%".$keyword."%' "; $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID "; $rs=mysql_query($SQLstmt) or die( "Your search found no matching results"); } else { $SQLstmt="Select * from tblModel, tblImages where "; $SQLstmt=$SQLstmt."tblModel.modelCategory like '%".$kategori."%' "; $SQLstmt=$SQLstmt."'".$stageNameDisplay."'"; $SQLstmt=$SQLstmt."'".$heightDisplay."'"; $SQLstmt=$SQLstmt."'".$locationDisplay."'"; $SQLstmt=$SQLstmt."'".$hairDisplay."'"; $SQLstmt=$SQLstmt."'".$bustDisplay."'"; $SQLstmt=$SQLstmt."'".$ageDisplay."'"; $SQLstmt=$SQLstmt."'".$eyeDisplay."'"; $SQLstmt=$SQLstmt."'".$waistDisplay."'"; $SQLstmt=$SQLstmt."'".$dressDisplay."'"; $SQLstmt=$SQLstmt."'".$raceDisplay."'"; $SQLstmt=$SQLstmt."'".$hipsDisplay."'"; $SQLstmt=$SQLstmt."'".$shoeDisplay."'"; $SQLstmt=$SQLstmt."'".$checkboxDisplay."'"; $SQLstmt=$SQLstmt."'".$checkbox2Display."'"; $SQLstmt=$SQLstmt."'".$checkbox3Display."'"; $SQLstmt=$SQLstmt."'".$checkbox4Display."'"; $SQLstmt=$SQLstmt."'".$checkbox5Display."'"; $SQLstmt=$SQLstmt."'".$checkbox6Display."'"; $SQLstmt=$SQLstmt."'".$checkbox7Display."'"; $SQLstmt=$SQLstmt."'".$checkbox8Display."'"; $SQLstmt=$SQLstmt."'".$checkbox9Display."'"; $SQLstmt=$SQLstmt."'".$checkbox10Display."'"; $SQLstmt=$SQLstmt."and modelStatus='Active' "; $SQLstmt=$SQLstmt."and tblImages.imageTypeID = 1 "; $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID "; $SQLstmt=$SQLstmt."ORDER BY tblModel.modelID DESC "; $rs=mysql_query($SQLstmt); } if (!mysql_num_rows($rs) { $countData="No results found of selected query"; ?> <tr> <td colspan="5" class="text9"><br> <strong>Search Result</strong> </td> </tr> <tr> <td class="text" colspan="4"> <?php echo $countData; echo $SQLstmt;echo mysql_num_rows($rs);?></td> </tr> <tr> <td colspan="5" height="4"><hr /></td> </tr> <?php } else { ?><table width="100%" align="center" cellpadding="0" cellspacing="0"> <tr><td class="text9"><br><strong>Search Result</strong></td><td colspan="3" align="right"></td></tr> <tr> <td width="150" class="text"><div align="center"><strong>Thumbnail</strong></div></td> <td width="150" class="text"><strong>Name</strong></td> <td width="150" class="text"><strong>Age</strong></td> <td width="150" class="text"><strong>Model No</strong></td> <td width="75"></td> </tr> <tr> <td colspan="5" height="4"><hr /></td> </tr> <tr> <?php while ($line = mysql_fetch_array($rs)) { if ($line["modelCategory"] === "Couples") { $width = 100; } else { $width = 100; } ?> <td class="text"><div align="center"><a href="../models/model.php?modelID=<?php echo $line["modelID"]; ?>#"><img src="../cms/models/lineup/<?php echo $line["modelID"]; ?>/<? echo $line["imageFile"]; ?>" height="100" width="<?php echo $width; ?>" border="0"></a></div></td> <td width="100" class="text"><?php echo $line["modelName"]; ?></Td> <td width="100" class="text"><?php echo $line["modelAge"]; ?></Td> <td width="147" class="text"><?php echo $line["modelNo"]; ?></td> <td width="78" class="text"><a href="../models/model.php?modelID=<?php echo $line["modelID"]; ?>#">View</a></td> </tr> <tr> <td colspan="5" height="4"><hr /></td> </tr> <?php } ?> </table></td> <?php } ?>
-
once again isSet is not a PHP function however isset is
-
Need help creating an array of mobile useragents
darkfreaks replied to kimosiris's topic in PHP Coding Help
change == to === will solve some of your errors.