Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 05:21:57 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155544 Posts in 21714 Topics by 7736 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Search > PHP  (Read 202 times)
bupaje

Offline Offline

Posts: 519


WWW
« on: April 07, 2011, 10:11:10 PM »

Stricly speaking this isn't a WB only issue but I'm hoping for a tiny bit of PHP help.

I'm having some persistent problems with my search box and decided to finally rip it out and replace with Google Search.

I have this code

Code:
        <form action="http://stormvisions.com/pages/search.php" method="post">
          <input type="text" name="q"  class="searchtextbox">
          <input type="submit" name="submit" value="Search" class="searchsubmitbutton" />
          <br />
        </form>

I want to add 2 radio buttons and change the action based on these choices.

One action would be

Code:
http://stormvisions.com/pages/search.php

and the other

Code:
http://stormvisions.com/pages/go/artsearch.php

Can this be done with PHP or I guess it might need javascript?

Your help appreciated.



Logged

My Blog, My Site
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2297



WWW
« Reply #1 on: April 07, 2011, 10:33:51 PM »

It will have to be javascript. PHP (server-side) can only act on what the browser sends.
Changing the action with javascript is not that hard to do.

Lots of examples found through google
Logged

Professional WebsiteBaker Solutions
bupaje

Offline Offline

Posts: 519


WWW
« Reply #2 on: April 07, 2011, 10:59:14 PM »

Thank you. I was having problems which is why I asked, thought I was doing something wrong, but then I found that the code sample I selected had a small error - wrong value assigned to radio button. Once I changed that I was able to modify the rest.
Logged

My Blog, My Site
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!