Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 08-01-05
Frostie's Avatar
Moderator
 
Join Date: Aug 2003
Location: Wirral
Posts: 3,005
Thanks: 6
Thanked 8 Times in 5 Posts
Frostie is on a distinguished roadFrostie is on a distinguished road
  PHP Search, Form, Method Agghhh

Have major problems, just running a search for some reason, on mySQL database.

This is what I have so far;
Quote:
<FORM NAME="form" action="product_search.php" method="get" >
<input type="text" name="search" size="16">
<input type="submit" name="Submit" value="Go" />
</FORM>
My problem is, when it type in text, and click on the button, it just refreshes the page and doesn't even load up product_search.php as set out in the action - let alone producing any errors

If, however I try going direct such as...
mydomainname.com/product_search.php?search=keyring
....then the page loads all fine and dandy, showing anything with keyring in the description

Where am I going wrong?

__________________
Affiliate Blog | Eco Friendly | Discount Codes - Exclusive codes = Inclusion in newsletter to 26,000 recipients
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-01-05
Super Moderator
 
Join Date: Aug 2003
Posts: 1,984
Thanks: 1
Thanked 0 Times in 0 Posts
Fraser seems to know their stuff
I've just copied and pasted your exact code and it works fine for me. Can't see anything wrong with it either.

Not that this is a particularly helpful reponse, sorry mate!

Is it online somewhere and I could take a look in the context it's being used?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-01-05
Ste's Avatar
Ste Ste is offline
It's a hard life .....
 
Join Date: Apr 2004
Location: Lancashire
Posts: 607
Thanks: 0
Thanked 0 Times in 0 Posts
Ste is an unknown quantity at this point
If your code works on some sites and not on others, then it looks like you have register_globals set to Off, which it should be!

So you will need to add the following line to your product_search.php page before the output:

$name = $_POST[name];

and also change the method=”GET” in your form line to method=”post”

Or if you have to use method="GET then change the above instance to $name = $_GET[name];


Or it could simply be you have the input box name twisted If you are using name="search” This will give the use of product_search.php?search=$name
So you should have the variable $name in your output page. We have all done it backward, by using $search instead!!

Might be worth checking ..
__________________
A World of Poker - Its the Nutz! www.aworldofpoker.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-01-05
Registered User
 
Join Date: Mar 2004
Location: Reading, UK
Posts: 301
Thanks: 0
Thanked 0 Times in 0 Posts
dmorison is an unknown quantity at this point
Quote:
My problem is, when it type in text, and click on the button, it just refreshes the page and doesn't even load up product_search.php as set out in the action
This behaviour could be indicative of a mis-matched <form> tag elsewhere on your page...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-01-05
Frostie's Avatar
Moderator
 
Join Date: Aug 2003
Location: Wirral
Posts: 3,005
Thanks: 6
Thanked 8 Times in 5 Posts
Frostie is on a distinguished roadFrostie is on a distinguished road
  Bingo Slapstick Junkie

Quote:
This behaviour could be indicative of a mis-matched <form> tag elsewhere on your page...
Nail on the head Thank you a gazillion times DM

Ste - cheers for your info. Globals are on and this is what drove me nuts cos I had it working on other sites, using the same server.

Fraser - thanks for just re-confirming that I wasn't infact going mad and missing something blindingly obvious - 6 hours I was at it, if you know what I mean

Cheers all
__________________
Affiliate Blog | Eco Friendly | Discount Codes - Exclusive codes = Inclusion in newsletter to 26,000 recipients
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7