How do I?

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

Coolprogram

Established Member
Impact
7
Okay i want to know how to get like a search thing on my website. ummm a search bar. I just want a google search bar and a search bar for my site. How do i do this. NO ASP.
Thanks,
-Coolprogram
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Here is the php code followed by html code.

Search.php

PHP:
<?php
/* Created by iNod */
// Check to see if search was received. Declare google url
if(isset($search)) {

// Declare url. And replace + for all spaces
$url = 'http://www.google.ca/search?q='.$search.'&hl=en&lr=&start=10&sa=N';
$url = str_replace(' ','+',$url);

header('location: $url');
}else{
print 'No submit was found';
}
?>

HTML
Code:
<form method="post" action="search.php">
Search: <input type="text" name="search" value="search"><br>
<input type="submit" name="submit" value="Search!">

Thanks,
iNod
 
Last edited:
0
Close
You forgot to make a $url.
 
0
Close
0
Close
Nvm
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back