Jump to content

Posting to the URL is always 1 selection behind


coupe-r

Recommended Posts

When I search for something from a search drop down box, the URL reads:

 

delprod.php?search=

 

BUT, the correct items are displaying.

 

Now, if I select a different option from the drop down, the first selection I made displays in the URL but the correct items were queried and displayed on screen.

 

Seems like the URL is always 1 behind the selection.

 

Below is the form action code, which will echo perfectly, but for some reason doesnt go directly to the URL. 

 

Let me know if you need a different part of the code.

 

action="delticket.php?search=<?php echo $search; ?>"

It is difficult to tell from just that however I assume that the $search is a posted value from the form meaning that you are posting the data to the last post location. Can you check what $search is defined at and whether or not you have a 'method=' in your form tag.

if(isset($_POST['go_btn']))
{
	$search = $_POST['search_box'];

 

<form id="form3" name="form3" method="post" action="delticket.php?search=<?php echo $search; ?>">

 

The name of the drop down box is search_box.

 

if I echo $search, it shows the correct value.  But when I echo it in the URL, its always 1 behind.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.