Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 17th, 2013, 12:06 PM   #1
oneshot2shots
Newbie
 
Join Date: Jul 2013
Posts: 14
Rep Power: 0 oneshot2shots is on a distinguished road
PHP form to access multiple pages

Hi guys, first post

I am trying to build a metasearch engine. I need a form which will access three php pages and display the results.

So i have a simple form like so

</head> <body> <h1>alln1(Basic)</h1>
 

 
    <form method="POST" action="bing_basic.php"> 
 <label for="service_op">Service Operation</label><br/>
  <input name="service_op" type="radio" value="Web" CHECKED />
   Web <input name="service_op" type="radio" value="Image" />
    Image <br/> <label for="query">Query</label><br/>
     <input name="query" type="text" size="60" maxlength="60" 
     value="" /><br /><br /> <input name="bt_search" type="submit"
      value="Search" /> </form> <h2>Results</h1> 
      {RESULTS}

and i need it to access 2 others Simply putting in 2 more
<form method="POST" action="google_basic.php"> 

<form method="POST" action="faroo_basic.php">

doesen't work but I am looking for something like this.

Any ideas??
oneshot2shots is offline   Reply With Quote
Old Jul 27th, 2013, 6:14 AM   #2
pritaeas
mod_pritaeas
 
Join Date: May 2009
Location: The Netherlands
Posts: 251
Rep Power: 8 pritaeas is on a distinguished road
Re: PHP form to access multiple pages

Do you want to post to all three with a single click?
pritaeas is offline   Reply With Quote
Old Jul 27th, 2013, 2:39 PM   #3
oneshot2shots
Newbie
 
Join Date: Jul 2013
Posts: 14
Rep Power: 0 oneshot2shots is on a distinguished road
Re: PHP form to access multiple pages

Quote:
Originally Posted by pritaeas View Post
Do you want to post to all three with a single click?
Yes but i have since found out that its not possible to give a form more than one post or get action. I've put the 3 separate files into one so now the effect is the same as if there was 3 post actions. However I wanted a feature so that if a user ticked the radio buttons for two search engines it would "action" those two engines by sending the post to 2 separate files and output the results. I can't do this now, only action to the one search engine or else the php file containing the code for all three engines, but no option to access two.
oneshot2shots is offline   Reply With Quote
Old Jul 27th, 2013, 5:08 PM   #4
pritaeas
mod_pritaeas
 
Join Date: May 2009
Location: The Netherlands
Posts: 251
Rep Power: 8 pritaeas is on a distinguished road
Re: PHP form to access multiple pages

Am sure there is a way if you use three checkboxes, and execute the code according to what's checked.
pritaeas is offline   Reply With Quote
Old Jul 29th, 2013, 3:10 PM   #5
oneshot2shots
Newbie
 
Join Date: Jul 2013
Posts: 14
Rep Power: 0 oneshot2shots is on a distinguished road
Re: PHP form to access multiple pages

Quote:
Originally Posted by pritaeas View Post
Am sure there is a way if you use three checkboxes, and execute the code according to what's checked.
Spot on used radio buttons with onclick="searchbox.action=''urlname"

<form id ='searchbox' method = "POST" >
<input type = 'text' id='search' required placeholder = 'enter query' value = 'query'>
<input type = 'submit' id ='submit' value = 'query' ><br />
<input name="blekko" type="radio" value="query"id='query'onclick="searchbox.action='blekko3.php';" />Blekko<br \>
<input name="query" type="radio" value="query" id='query'onclick="searchbox.action='bing_basic.php';"/>Bing<br \>
<input name="faroo" type="radio" value="faroo" id='query'onclick="searchbox.action='faroo_basic2.php';"/>Faroo<br \>
<input name="aggregated" type="radio" value="aggregated"id='query' onclick="searchbox.action='aggregated.php';"/>Aggregated<br \>
<input name="non-aggregated" type="radio" value="non-aggregated"id='query'onclick="searchbox.action='non-aggregated.php';" />Non-aggregated<br \>
oneshot2shots is offline   Reply With Quote
Old Aug 7th, 2013, 9:29 AM   #6
macky
Programmer
 
Join Date: Nov 2010
Location: Cebu City Philippines
Posts: 60
Rep Power: 0 macky is an unknown quantity at this point
Re: PHP form to access multiple pages

use jquery here ill show you a sample code
$("#form_log1").click(function(){
				$("#form_log").attr("action", "login.php");
				$("#form_log").submit();
		});
		
		$("#form_register").click(function(){
				$("#form_log").attr("action", "register.php");
				$("#form_log").submit();
		});
there!

Last edited by pritaeas; Aug 7th, 2013 at 10:04 AM. Reason: Added code tags.
macky is offline   Reply With Quote
Reply

Bookmarks

Tags
form, html, php, search-engine

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Contact Form bscyb PHP 1 May 29th, 2011 7:36 AM
c#.net form with access database johnnyred1 C# 3 Jan 13th, 2010 5:50 AM
Read access to a locked filed in c++ (Windows XP), How to get multiple access to a file Birdy233 C++ 0 Dec 1st, 2009 2:03 PM
PHP Contact form bernie777 PHP 9 Oct 31st, 2008 1:10 AM
PHP form processing script wont work MovingShadow PHP 4 Aug 17th, 2008 11:33 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:44 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC