ryy705 Posted October 31, 2008 Share Posted October 31, 2008 Hello, I am trying to write a script that will do automatic searches on yahoo. But there is something funny in the action url of the form. http://images.search.yahoo.com/images;_ylt=A0geu8wEPwtJ4p0AEVql87UF?ei=UTF-8&fr2=tab-web&fr= I didn't know that you could get away with putting a semi colon in the url. In addition, what is the purpose of the _ylt field? Does anyone know? Link to comment https://forums.phpfreaks.com/topic/130907-solved-yahoo-search-field/ Share on other sites More sharing options...
jonsjava Posted October 31, 2008 Share Posted October 31, 2008 Not quite sure what you're wanting it to do, but the simplistic version of their form is this: <form name="w" action="http://images.search.yahoo.com/search/images;_ylt=A0WTb_4aTgtJBzMAqwOLuLkF"> <input name="ei" value="utf-8" type="hidden"> <input name="fr" value="sfp" type="hidden"> <input name="p" id="yschsp" size="44" maxlength="100" value=""> <input class="ygbt" id="ygbtover" value="Image Search" type="submit"> <input name="iscqry" id="iscqry" type="hidden"></fieldset> </form> Link to comment https://forums.phpfreaks.com/topic/130907-solved-yahoo-search-field/#findComment-679542 Share on other sites More sharing options...
jonsjava Posted October 31, 2008 Share Posted October 31, 2008 a simple solution (if I understand your question): <?php if ($_GET['page'] == "submit"){ $search_string = $_GET['search']; echo<<<CHEESEBURGER <html> </head> </head> <body onload="document.w.submit();"> <form name="w" action="http://images.search.yahoo.com/search/images;_ylt=A0WTb_4aTgtJBzMAqwOLuLkF"> <input name="ei" value="utf-8" type="hidden"> <input name="fr" value="sfp" type="hidden"> <input name="p" id="yschsp" type="hidden" value="$search_string"> <input name="iscqry" id="iscqry" type="hidden"></fieldset> </form> </body> </html> CHEESEBURGER; } else{ $searches = array("test", "microsoft", "ubuntu", "cheeseburger"); foreach ($searches as $value){ print "<a href='?page=submit&search=$value' target='_blank'>$value</a><br />\n"; } } Link to comment https://forums.phpfreaks.com/topic/130907-solved-yahoo-search-field/#findComment-679551 Share on other sites More sharing options...
ryy705 Posted November 7, 2008 Author Share Posted November 7, 2008 Thanks. Link to comment https://forums.phpfreaks.com/topic/130907-solved-yahoo-search-field/#findComment-684601 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.