SRL Archive - Web Development

HTML Forms Questions


Neehosoft

2009-11-17 19:31:57

Hi, I have a google search here and i want to add underneath it radio buttons and depending on which one it will take you to a different place (i.e. google, tpb ect).
So, how would i do this? If there is a search button, what would i do to now what to put in der?
Also, how would i index multiple sites?
Like, torrentz.com does.
You dont have to tell me in a super big post but links to a tut?
Thanks
Donnie(NeehoSoft)

Daniel

2009-11-17 23:08:57

[php]
<form>
<input type="radio" name="tehgoogle" value="1" /> The Web
<input type="radio" name="tehgoogle" value="2" /> Only NeehoSoft.com
<br />
</form>
[/php]
Do you mean something like that?

Neehosoft

2009-11-18 20:01:11

[QUOTE=Dan's The Man;656875][php]
<form>
<input type="radio" name="tehgoogle" value="1" /> The Web
<input type="radio" name="tehgoogle" value="2" /> Only NeehoSoft.com
<br />
</form>
[/php]
Do you mean something like that?[/QUOTE]

Yes, i know how to do that, but how do i make it so the search's action URL changes to which radio is clicked?

CowFish

2009-11-18 20:15:42


<form action="search.php" method="POST">
<input type="radio" name="tehgoogle" value="1" /> The Web
<input type="radio" name="tehgoogle" value="2" /> Only NeehoSoft.com
<input type="submit" name="submit" value="submit">
<br />
</form>

Search.php

[PHP]
<?php

$googlez = $_POST['tehgoogle'];

//example

function search($params, $site) {
//second variable is more important here

//actual function here including a filter for only the specified site

}

search($input, $googlez);

?>[/PHP]

Maybe…