Jump to content

Recommended Posts

I have a search form on a page(page2.php) that lists the results of the search on the same page after the form is submitted.. When you first visit this page it includes a url parameter (recordid41),that it received from the previous page. Whenever I then do a search, it loses the url parameter. How can I fix this? On the "form" properties I've included page2.php?recordid41=<?php echo $_GET['recordid41']; ?> for the page that it's suppose to go to after submitted but this doesn't work. It errors with:

Notice: Undefined index: recordid41 in c:\test\page2.php on line 340

Link to comment
https://forums.phpfreaks.com/topic/1965-troubles-keeping-the-url-paramter-alive/
Share on other sites

Yes, this has been done already. This is the page number with the parameter added:

 

page2.php?recordid41=<?php echo $_GET['recordid41']; ?>

 

The problem is, is that the url parameter is not submitted, it's lost.

 

When the page reloads with the search I get this url:

 

page2.php?a99b=t&Submit=Search

 

The a99b was a paramter of a query, but the 'recordid41' is nowhere.

Whilst I fail to see why you would want a parameter named recordid41 wouldnt just page2.php?recordid be better. The parameter looks fine and will pass in any browser. Please post the query script so we can see whats going on and how the query is handled.. To test if the parameter passes ok just echo it in the below the querry to see if the true value shows.

 

echo $_GET['recordid41'];

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.