Solved

Select Menu search options like www.devarticles.com

Posted on 2004-09-15
11
214 Views
Last Modified: 2008-03-03
just like devarticles.com I have an article and a forum system.  The only difference is that I want my search execute for both the articles and the forum...  Currently devarticles.com executes search for only the articles and not the forum.

Problem: My article system search name is q
and my forum search name is search_keywords (PHPBB2)

Requirement:
- just like devarticles.com, I'd like a PHP file to process search queries to the proper search engine.

I don't know if this violates any TOS but here's their form:

                  <form method="post" action="http://www.devarticles.com/search_jump.php">
                        <td height="29">
                        <div align="right">
                              <input class="form" onblur="if(this.value=='')this.value='Search Here';" onfocus="if(this.value=='Search Here')this.value='';" value="Search Here" name="search">
                              <select style="FONT-SIZE: 7pt; COLOR: #333333; FONT-FAMILY: Verdana" name="where">
                              <option value="site" selected>Dev Articles Site</option>
                              <option value="forum">Dev Articles Forums</option>
                              </select>
                              <input class="form" type="submit" value="GO" name="Submit2">
                        </div>
                        </td>
                  </form>

0
Comment
Question by:andreni78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
11 Comments
 
LVL 1

Expert Comment

by:Nezzo
ID: 12069788
I think we need a little clarification.

1. Are you looking for a PHP script to search your forums AND articles at the same time?  Displaying results from both the articles and the forums?

Or

2. Do you want it to be exactly like devarticles.com?

Or

3. Do you want the user to have the choice of the two. To search both or not to search both...that is the question haha :)
0
 

Author Comment

by:andreni78
ID: 12070330
1. how are you going to do that? if you can do that.. that would be awesome!

2. yeah i wanted to be exactly like devarticles.com - but right now their forum search doesn't execute.. it only refers to the forum search page..

3. if you can have it search articles/forum or both.... that would be most ideal.. but how are you going to do that?

would be awesome if you can do #3 =)
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12072176
Why dont you chnage
<option value="site" selected>Dev Articles Site</option>
<option value="forum">Dev Articles Forums</option>

to
<option value="q" selected>My Site</option>
<option value="search_keywords">PHPBB</option>

and on the
search_jump.php
you can decide which searching system to call

It will be exectly like Dev site
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:andreni78
ID: 12073172
you've got it armoghan.. but i don't know how i'd write search_jump.php ?
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12073263
In the search_jump.php
see if the search engine is q

something like

switch($_POST['where']){
            case 'q':
               header("Location: http://www.webpageThatProcessesQ.com/");
               break;
case 'search_keywords':
               header("Location: http://www.webpageThatProcessesSearch_keywords.com/");
               break;

}
and if you need to send the rest of the variables, you can send it using $_POST['form']
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12073265
0
 
LVL 18

Accepted Solution

by:
armoghan earned 500 total points
ID: 12073276
More like this
 header("Location: "http://www.webpageThatProcessesQ.com?form=".$_POST['form'] );
0
 

Author Comment

by:andreni78
ID: 12073354
so this is what i have in my search_jump.php?

<?php
switch($_POST['where']){
            case 'q':
 header("Location: "http://www.webpageThatProcessesQ.com?form=".$_POST['form'] );
               break;
case 'search_keywords':
 header("Location: "http://www.webpageThatProcessesSearch_Keyword.com?form=".$_POST['form'] );
               break;

}
?>
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12073473
something like that.
I dont know where you post in my forum or My article system search name is q

You have to change the URL accordingly
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question