Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP url parameter passing to other php page
    primarykey
    data
    text
    <p>I have problem to pass value via url parameter to other page. I want to reject a booking based on selected bookingID by clicking REJECT button. But the bookingID value do not pass to other page, the url appear like this <a href="http://localhost/tablesortapprovebook/approve_booking.php?bookingID=" rel="nofollow">http://localhost/tablesortapprovebook/approve_booking.php?bookingID=</a></p> <p>Here is my coding segment:</p> <p>index.php</p> <pre><code>&lt;head&gt; &lt;script src="jquery-latest.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="jquery.tablesorter.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $("#myTable").tablesorter({widgets: ['zebra']}); }); $(document).ready(function() { $("#myTable").tablesorter(); } ); $(document).ready(function() { $("#myTable").tablesorter( {sortList: [[0,0], [1,0]]} ); } ); &lt;/script&gt; &lt;link href="style.css" rel="stylesheet" type="text/css"&gt; &lt;link href="stylelogin.css" rel="stylesheet" type="text/css"&gt; &lt;/head&gt; &lt;body&gt; &lt;?php include("dbconfig.php"); $query = "SELECT customer.companyName, customer.contactName, eventinfo.eventTitle,boothAlias,date, testbook.bstatus, testbook.username, bookingID from eventinfo, testbook, customer where testbook.username=customer.username AND testbook.eventID=eventinfo.eventID"; $o = '&lt;table id="myTable" class="tablesorter" width="930px"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Company Name&lt;/th&gt;&lt;th&gt;Contact Name&lt;/th&gt;&lt;th&gt;Event&lt;/th&gt;&lt;th&gt;Booth&lt;/th&gt;&lt;th&gt;Date&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;'; $result = mysql_query($query); while($row=mysql_fetch_array($result)) { $boothAlias=stripslashes($row["boothAlias"]); $eventTitle=stripslashes($row["eventTitle"]); $date=stripslashes($row["date"]); $bstatus=stripslashes($row["bstatus"]); $companyName=stripslashes($row["companyName"]); $contactName=stripslashes($row["contactName"]); $bookingID=stripslashes($row["bookingID"]); if($bstatus==0){ $status="Pending"; }else if($bstatus==1){ $status="Successful"; }else{ $status="Reject"; } $o .= '&lt;tr&gt;&lt;td width="120px"&gt;'.$companyName.'&lt;/td&gt;&lt;td width="120px"&gt;'.$contactName.'&lt;/td&gt;&lt;td width="180px"&gt;'.$eventTitle. '&lt;/td&gt;&lt;td width="70px"&gt;'.$boothAlias.'&lt;/td&gt;&lt;td width="170px"&gt;'.$date.'&lt;/td&gt;&lt;td width="70"&gt;'.$status.'&lt;/td&gt;&lt;td&gt;'.$bookingID.' &lt;/td&gt;&lt;td width="100"&gt;&lt;input type="hidden" name="bookingID" value="&lt;?php echo $bookingID; ?&gt;" &gt;&lt;a href="approve_booking.php?bookingID=".$bookingID. " name="REJECT" id="REJECT"&gt;&lt;input width="100px" name="REJECT" type="submit" id="REJECT" value="Reject"&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;'; } $o .= '&lt;/tbody&gt;&lt;/table&gt;'; echo $o; ?&gt; &lt;/body&gt; </code></pre> <p>approve_booking.php</p> <pre><code>&lt;?php mysql_connect("localhost", "root", "") or die (mysql_error()); mysql_select_db("eventdb") or die (mysql_error()); $booking=$_GET['bookingID']; echo $booking; if(isset($_POST['APPROVED'])) { $query2 = "UPDATE testbook SET bstatus ='0' WHERE bookingID='$booking'"; $result2 = @mysql_query($query2); } if (isset($_POST['REJECT'])) { $query3 = "UPDATE testbook SET bstatus ='2' WHERE bookingID='$booking'"; $result3 = @mysql_query($query3); } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload