Jump to content

Recommended Posts

<select>
  <option name="amountonly">Amount ?</option>
  <option>Coffee</option>
  <option>Tea</option>
</select>

 

PHP::

 

if ($ibforums->input['amountonly'])
							   $l = "or LOWER(amount) LIKE '%$search_string%'";
							   else 
							   $l = "5";

 

Am  I missing something? the 5 is to try to see if my input catches it.. it catches if it's like in a submit input type but how do i do it for Value [select] ?

 

Thank!

Link to comment
https://forums.phpfreaks.com/topic/172695-this-stupid-form-lol-easy-tho/
Share on other sites

That is a quote from your post, not a rewrite!

Learn HTML

http://www.w3schools.com/TAGS/tag_Select.asp

<select>
  <option value="amountonly">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>

This good ?

<select>
  <option name="amountonly">Amount ?</option>
  <option>Coffee</option>
  <option>Tea</option>
</select>

 

PHP::

 

if ($ibforums->input['amountonly'])
							   $l = "or LOWER(amount) LIKE '%$search_string%'";
							   else 
							   $l = "5";

 

Am  I missing something? the 5 is to try to see if my input catches it.. it catches if it's like in a submit input type but how do i do it for Value [select] ?

 

Thank!

 

First, your select element should have the name, rather than one of its options.  Second, your options need values.  Third, what is it you're trying to do exactly?  Putting up random code, malformed HTML, and saying it doesn't work isn't much for the rest of us to go on.

<select>
  <option name="amountonly">Amount ?</option>
  <option>Coffee</option>
  <option>Tea</option>
</select>

 

PHP::

 

if ($ibforums->input['amountonly'])
							   $l = "or LOWER(amount) LIKE '%$search_string%'";
							   else 
							   $l = "5";

 

Am  I missing something? the 5 is to try to see if my input catches it.. it catches if it's like in a submit input type but how do i do it for Value [select] ?

 

Thank!

 

First, your select element should have the name, rather than one of its options.  Second, your options need values.  Third, what is it you're trying to do exactly?  Putting up random code, malformed HTML, and saying it doesn't work isn't much for the rest of us to go on.

 

Well my code is:

 

if ($ibforums->input['searchQQ'] == 'amount')
							   $l = "or LOWER(amount) LIKE '%$search_string%'";
							   else 
							   $l = "5";

 

<select name='searchQQ'>
  <option value="amount">Volvo</option>
  <option value="amount5">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select><input type="submit" value="Search" />
</form>

 

it's working now and im gonna finish rest of values,

 

this is for when people search they can choose which table they want to search in

 

i am pretty good not gonna lie i jsut need php freaks help :D

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.