okay...seem to be experiencing some problem here....in my pc, the web application is running perfectly....but when i run it from my handheld, its showing error...

this is my code

<?php
session_start();                                        //starting session
$host="localhost";      // Host name
$username="";           // Mysql username
$password="";           // Mysql password
$db_name="test";        // Database name
$tbl_name="test3";      // Table name
$customerno=$_POST['customerno'];   
$_SESSION['customer_no']=$customerno;                         <--------error is here

$dbh1=mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die(mysql_error());

$result = mysql_query("SELECT DISTINCT invoice_no FROM $tbl_name where customer_no='$customerno' and status='Unscanned'");
?>

<title>Shipping Verification System</title>
<link rel="stylesheet" href="web.css" type="text/css" media="handheld" />
<FORM method="post" name="form">
<h1>Enter your Invoice Number</h1>            <!--Creating a form with actions-->
<table>
<tr>
<td>Invoice No. :</td>
<td>
<select name="invoiceno">
<?php
//for each row we get from mysql, echo a form input
while ($row = mysql_fetch_array($result)) {
echo "<option>$row[invoice_no]</option>\n";
}
?>
</select></td>
</tr>
</table>
<input type="submit" name="submit" value="Back" onclick="form.action='customercode.php';"></input>    
<input type="submit" name="submit" value="Submit" onclick="form.action='shipmentchecker.php';"></input>       
</FORM>

shipmentchecker.php

<?php
session_start();                                        //starting session
$host="localhost";      // Host name
$username="";           // Mysql username
$password="";           // Mysql password
$db_name="test";        // Database name
$tbl_name="test3";      // Table name
$tbl_name1="scan";      // Table name
$invoiceno=$_POST['invoiceno'];
$_SESSION['invoice_no']=$invoiceno;
$dbh1=mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die(mysql_error());
$sql="SELECT * FROM $tbl_name WHERE invoice_no = '$invoiceno'" ;            //the sql query
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
$sql1="SELECT * FROM $tbl_name1 WHERE invoice_no = '$invoiceno'" ;          //the sql query
$result1 = mysql_query($sql1) or die(mysql_error());
$row1 = mysql_num_rows($result1);

if($row1>0)
{
    echo "Shipment exists";
    header("refresh:1;url=checker.php" );
}
else
{
    echo "New shipment found";
    header("refresh:1;url=display.php" );
}

?>

checker.php

<?php
session_start();                                        //starting session
$host="localhost";      // Host name
$username="";           // Mysql username
$password="";           // Mysql password
$db_name="test";        // Database name
$tbl_name="test3";      // Table name
$tbl_name2="scan";
$db_name1="test1";      // Database name
$tbl_name1="test2";     // Table name

// Connect to server and select database.
$dbh1=mysql_connect("$host", "$username", "$password")or die("cannot connect");
$dbh2=mysql_connect("$host", "$username", "$password",true)or die("cannot connect");

mysql_select_db("$db_name", $dbh1)or die(mysql_error());
mysql_select_db("$db_name1", $dbh2)or die(mysql_error());

$invoiceno=$_SESSION['invoice_no'];                         // session invoice no. <---------error is here

okay....i have already marked the error spot....now, the first time i run there is no problem, after entering the invoice_no i'm geting a promp saying, undefine index invoice_no and the same error for customer_no...(i'm using wifi to communicate to the server )

I'm not sure whether this will work, but on line 19 you have this:

<FORM method="post" name="form">

try changing the Submit and Back buttons so they do not POST the data. Change line 19 to this:

<FORM method="post" name="form" action="shipmentchecker.php">

Also you could try sqeezing all of the files into one, Using a switch/get system:

<?php

$page = (isset($_GET['page']) && !empty($_GET['page'])) ? $_GET['page'] : 'error';

switch($page)
{
    case 'other':

    //other page (example.php?page=other)

    break;


    default:

    //home page (example.php)

    break;
}

?>
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.