View Full Version : Can I use an Intermediate page on a form submit?

12-15-2008, 11:13 PM
To see my work in progress, click here (http://www.voyagercomponents.com/download/bgTest/template.php).

I am currently working with the Part Search form at the top right.

More-so the back story than a quote. Years ago, we purchased a "Lifetime" service providing the ability to search this outside database. This service was a branch that the company attempted to diversify into, but has since stopped persueing, and as such, we can't get support any longer even though the service is still running.

I am submitting the form to the appropriate page, and getting appropriate results (try searching "1N4001"), but they are obviously displayed with a style inconsistent to the rest of the site (because it's not our site).

Is there a way I can have this form submit to a page within our site, then just forward the request to an iFrame for the results?
Something like having the "action" value pointing to a local page which would then pass the POST values to a different action?
My goal is to list the results, and have them look native.

Any advice?

~ Mo

12-16-2008, 12:26 PM
Try submitting the page to one of your own storing the values in a session/cookie var and in that page set an iframe passing the session/cookie var. hope this helps :)

12-16-2008, 01:10 PM
This discussion may be pertinent:

12-16-2008, 02:30 PM
Hmmm do you mean having the search feature only on your website and use like

search.php?do=search:$search ?

12-16-2008, 05:39 PM
Try ... storing the values in a session/cookie var and ... passing the session/cookie var... :)
This is kinda what I was hoping to achieve, but as I'm pretty much a newbie, could someone please shed a little light on how to do this?


12-16-2008, 05:42 PM
Hmmm do you mean having the search feature only on your website and use like
search.php?do=search:$search ?

As just now stated above, I'm more-or-less a newbie.
Please explain what this search.php?do=search:$search does.

It may be my best option, but I wouldn't recognize it as I've never come across the do=search: before.


12-17-2008, 08:10 AM
Basically, you have a file called search.php, and the extra bit after the ? [question mark] is called the query string. In this case, the easiest method would be to use the 'GET method' which basically appends ?var=val&var2=val2... etcetera.

In the example that masterofollies used, your variable would be do, and your value would be 'search:$search'. Notice that it is a string though; the syntax that masterofollies uses is simply something of preference which varies from individual to individual.

In PHP to use the information in the query string, see below. (Note that I'm using masterofollies' example)
URL: search.php?do=search:1N4001

$qstr = $_GET['do']; // where 'do' is the name of the variable
$q = explode(':',$qstr); //separates the type of action and the input for the action
switch ($q[0])
case 'search':


12-17-2008, 10:16 PM
Thanks, the colon ":" is where I was getting lost.
Do I understand your example correctly that it doesn't have any inherent value?
Was it simply used as a delimiter?

Still, how would this get the query submitted to the outside page?

~ Mo