PHP Snippets
Name:Search Google
Description: This will search google with the specified keyword.
Code below...
>
<!--- This is the HTML code! -->
<!--- Save the code below as googlesearch.php -->
<form method="post" action="googleresults.php">
<input type="text" name="google" size="30"/> <input type="submit" name="google_submit" value="Search" style="cursor:pointer;"/></p>
</form>
<!--- This is the PHP code! -->
<!--- Save the code below as googleresults.php -->
<?php
$keyword = $_POST['google'];
$keyword = str_replace(' ', '+', $keyword);
if ($_POST['google_submit']) {
header("Location: http://www.google.com/search?q=$keyword");
}
//Thats it! =)
<!--- Save the code below as googlesearch.php -->
<form method="post" action="googleresults.php">
<input type="text" name="google" size="30"/> <input type="submit" name="google_submit" value="Search" style="cursor:pointer;"/></p>
</form>
<!--- This is the PHP code! -->
<!--- Save the code below as googleresults.php -->
<?php
$keyword = $_POST['google'];
$keyword = str_replace(' ', '+', $keyword);
if ($_POST['google_submit']) {
header("Location: http://www.google.com/search?q=$keyword");
}
//Thats it! =)
Partners: Techgear007 |