Jump to content

[SOLVED] $_GET variable multiple word...only one word is showing up


networkthis

Recommended Posts

Ok I have a question.  I am autofilling a drop menu from a mysql table.  It auto fills great.  Prints out all the html properly and everything.  However when I try to get the value of the select box... I am only getting the first word everytime.(Most words are single words...but it really screws up my results for searching.  Does anyone have any ideas?  Here is my code and the ways I have tried to pull the value from the drop menu.

 

<?php
$search=mysql_query("SELECT DISTINCT position_type FROM db WHERE status LIKE '%current%' ORDER BY position_type ASC"); 

while ($row = mysql_fetch_array($search)) {		
	echo '<option value=' . $row[position_type] .'>' .  $row[position_type] .  '</option>';	
}

?>

</select>

 

Ways I've tried to $_GET the value of the drop menu...I don't have this problem by the way on anything else besides my drop menus and the form is set to GET.

 

<?php

//This only shows one word
$position_type;
echo $postition_type;

//This only shows one word
$position_type=$_GET['position_type'];
echo $postition_type;

//This only shows one word
$position_type = @$_GET['position_type'] ;
echo $postition_type;

//This only shows one word
$pt=split(" ",$position_type);
echo $pt[0] . "<br>";
echo $pt[1];

?>

 

The value is always correct when it is only one word.  I can't figure it out I'm sure it can't be that difficult, but I'm running out of options.  Any ideas are appreciated.  Thank you!

Link to comment
Share on other sites

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.