|
|
|
multiple search engine options
|
Original Message
|
Name: BigShow
Date: February 10, 2008 at 11:10:43 Pacific
Subject: multiple search engine optionsOS: xpCPU/Ram: pentium 4Model/Manufacturer: dell |
Comment: I have come across several sites that give you an option of which searchengine to choose. Basically you check a radio button from the one you choose (i.e. google, yahoo) and then put in you search keywords and a seperate page opens up that lists that chosen search engine results. How would I begin to make this type of script. I ahve a couple ideas but one thing I run into is that say google for example, if you have an account with them I am pretty sure you cannot alter the code, Is this correct? Take a look at this site, www.kinglook.com this is an example of what I want to do, this particular site is a little too much but it is along the general lines of what I want to do. Thanks in advance
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: Michael J (by mjdamato)
Date: February 10, 2008 at 21:33:30 Pacific
Subject: multiple search engine options |
Reply: (edit)The process would be slightly different for each search provider. If you were to do a google search on the site you posted you would see a link at the top of the results page that states "What is this page" which will give you enough infformation to do your homework for the google process. The Yahoo results page simply adds the search parameters to the yahoo url and opens it in another window. That took just a few moments to figure out for those two options. Just take each esearch provider one at a time and figure them out. Michael J
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: BigShow
Date: February 10, 2008 at 22:17:42 Pacific
Subject: multiple search engine options |
Reply: (edit)I figured out that part, thanks for the help. I am now trying to manipulate a string and I know there will be a couple things involved here. first the scenerio. Someone types into the text box "2008 democratic winner: in order to put that into the end of a search string, i need to replace the white spaces with "+" signs. I am trying to figure this out. First I think i would have to make sure to eliminate and spaces that might be in the front or back of the string (becuase i dont want a + to appear either place. Then I would need to search the string and replace and white spaces with +. I cannot figure this out. I have an idea but i cant finish it so.... any ideas?
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: BigShow
Date: February 11, 2008 at 19:19:50 Pacific
Subject: multiple search engine options |
Reply: (edit)I figured it out Michael. The sight is working. Let me finish tweaking my first version of it and I will send you a link. Can you help me with one more thing. I need to figure this form email thing out. All the forms, including ones I have written for clients, have that email address in the from area. I need to make this right. Can you post the code you did to fix it so I can fix mine. Thanks
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: Michael J (by mjdamato)
Date: February 11, 2008 at 22:04:36 Pacific
Subject: multiple search engine options |
Reply: (edit)$to = "user@theirdomain.com"; $subject = "SUBJECT"; $msg = "This is the message"; $from = 'From: webmaster@mydomain.com' . "\r\n" . 'Reply-To: webmaster@mydomain.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();$send = mail($to , $subject , $msg , $from);
Michael J
Report Offensive Follow Up For Removal
|
|
Response Number 6
|
Name: BigShow
Date: February 14, 2008 at 04:28:35 Pacific
Subject: multiple search engine options |
Reply: (edit)Hey Michael, check it out and tell me what you think. I will add some things to it later. TrueBrowse.com
Report Offensive Follow Up For Removal
|
|
Response Number 7
|
Name: BigShow
Date: February 17, 2008 at 07:30:21 Pacific
Subject: multiple search engine options |
Reply: (edit)Hi Michael, I did what I wanted to achieve, the only thing is, I dont like that it is in an iframe. While this is a great idea on one hand, ethicly and moraly it is wrong. As a programmer the last thing I want to do is try and take someone elses idea and put my heading on it. My question is this, How can I make it so that when someone picks a button and presses search, it automatically opens in another window to that search site. I think that I would need to put this in the form line and on the sction part put some sort of a script to open the results in a new window. Any ideas.
Report Offensive Follow Up For Removal
|
|
Response Number 9
|
Name: BigShow
Date: February 17, 2008 at 20:29:36 Pacific
Subject: multiple search engine options |
Reply: (edit)Hi Michael, I have spent about 10 hours researching this today. From what I can gather i need to put a javascript call into the for action... form id="search" action="input" onSubmit="javascript:SearchEngine();return false;" But I am having a real hard time figuring this out. When the form is submitted from my index page it goes to a gresults.php page and opens in an iframe. I want it to open in a new window which means that the form cannot submit to a new page. I need to process everything withint the index page. How is this possible?
Report Offensive Follow Up For Removal
|
|
Response Number 10
|
Name: Michael J (by mjdamato)
Date: February 19, 2008 at 00:46:48 Pacific
Subject: multiple search engine options |
Reply: (edit)You're not making any sense. No JavaScript is needed. Simply put a target value in your FORM tag. The target works just like it does in an anchor tag: _blank will always open in a new window, or use a name (any name) and create a new named window instance. [If I was to use JavaScript it would only be to change the named target of the form to coincide with the search the user is doing. That way all Yahoo search results would open in their own window, all Google results in their own window, etc.] Then just change your getresults page to do a header redirect to the appropriate site. FORM PAGE
<html> <body><form method="POST" target="New Window" action="getresults.php"> <input type="radio" name="searchengine" value="google"> Google
<input type="radio" name="searchengine" value="yahoo"> Yahoo
Search string: <input type="text" name="searchStr">
<button type="submit">Send It</button> </form> </body> </html> RESULTS PAGE
<?php$search_str = trim($_POST['searchStr']); $search_engine = trim($_POST['searchengine']); if (empty($search_str)) { echo "No search value entered"; } else { $url_params = preg_replace('/(\ )+/', '+', $search_str); switch ($search_engine) { case 'google': $url = 'http://www.google.com/search?q=' . $url_params; header('Location: ' . $url); break; case 'yahoo': $url = 'http://search.yahoo.com/search?p=' . $url_params; header('Location: ' . $url); break; default: echo 'No search engine selected'; break; } } ?> Michael J
Report Offensive Follow Up For Removal
|
|
Response Number 11
|
Name: BigShow
Date: February 19, 2008 at 14:21:38 Pacific
Subject: multiple search engine options |
Reply: (edit)I tried you code but it only opens a blank page. I want it to open under the selected search engine with the serach put in the parameters and the search query result showing. I am going to try a few things. you did give me an idea.
Report Offensive Follow Up For Removal
|
|
Response Number 12
|
Name: BigShow
Date: February 19, 2008 at 16:25:25 Pacific
Subject: multiple search engine options |
Reply: (edit)I figured it out. The preg_replace was throwing me off but i added my old code with a little of yours and I have it. I was overthinking it. I thought I had to go to the results page then open up another page when in reality I needed only to put the php code into the results page then openn up a blank code. Thanks Michael. Another question not related to this. Have you ever dealt with an .obj file. It is a quick time file that is not a movie but still shots that act interactively with the person viewing the site. I am trying to figure out how to put these on the web page. Any ideas. The actual file is already created but I just dont know the html to place it on a page?
Report Offensive Follow Up For Removal
|
Use following form to reply to current message:
|
|

|