<?php
session_start();
include "conn.php";
if (isset($_POST['submit']) && $_POST['billno']!='' )
{
$bill = $_POST['billno'];
$query = mysql_query("SELECT bill_no, tag_no FROM tbl_cargo_details WHERE bill_no='$bill' or tag_no ='$bill'")
or die(mysql_error());
while ($row = mysql_fetch_assoc($query))
{
if($bill == $row['bill_no'] || $bill == $row['tag_no'])
{
header("location:true.php?bill=$bill");
}
else
{
header("location:false.php?bill=$bill");
}
}
else
{
?>
i am not able to get the false page location when the condition fails. it only points to the first header location. i think first header is not passing the control when the condition is false. can any one help me out with this. Thanks..
naresh.giri.146
0
Newbie Poster
Recommended Answers
Jump to PostHi,
I think that you dont need the while loop because an if is more than enough :)
Try this :$query = mysql_query("SELECT bill_no, tag_no FROM tbl_cargo_details WHERE bill_no='$bill' or tag_no ='$bill'") or die(mysql_error()); $num_rows = mysql_num_rows($query); if($num_rows > 0){ // we are sure here …
All 2 Replies
akmozo
5
Light Poster
Biiim
commented:
good
+5
Biiim
182
Junior Poster
naresh.giri.146
commented:
thank you so so much... u saved me..
+0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.