Hi All,

I am making an application in PHP using ajax as i dicussed in my last forums about multiple select boxes . Now the problem is coming that my application is running well . Let me explain whole of this:

Like i have made one application for country , state and city. When we select country from list which i am fetching from database after that selecting country list of states will present and after selecting state list of cities will present. This all is running well. But now when i am submitting all selected values in database now the problem is that i am getting not complete value of city or state.

Like i am passing value of city or state is " Los Angales" or " NEW YORK" but in database this after submitting this it is showing first word like this " Los " in place of "Los Angeles " and it should show " NEW YORK " but it is showing only " NEW " .

But i want to show whole value in my database after submitting these value . Is there any function in PHP with which i can show whole values ?

Please Help me.

Thanks,
Gagan

Recommended Answers

All 9 Replies

If you print_r() on $_POST or $_GET, depending on the form method that you are using, are the full values being passed to the page?

Hey, you are right, i don't know which way you are putting in page with all the menu.
All the state and city menu is not consider each other. so might be a problem in menu set up.

-----------------------------------
<URLs SNIPPED>

If you print_r() on $_POST or $_GET, depending on the form method that you are using, are the full values being passed to the page?

Thanks for reply,,

form method post i am using. and i am passing value like this.

echo " <select name=state>";
echo "<option value='$row[statename]'>$row[statename]</option>";
echo " </select>";

Like state name have name "NEW YORK" . As it is showing in form when i am selecting this value and submitting form with value $_POST[state] . But in databse this is showing just " NEW " but this should insert " NEW YORK" . This point is confusing me.

please help me . how i can solve this.
thanks

try

echo "<option value='" . urlencode($row['statename']) . "'>" . $row['statename'] . "</option>";

try

echo "<option value='" . urlencode($row['statename']) . "'>" . $row['statename'] . "</option>";

thanks for reply,

when i am using this code as you suggest me . I am able to show whole value now . But this is showing + sign in both of these word.

Like NEW+YORK in database . But i want to show this should show like this NEW YORK means there should come space between these both words.

How i can insert space in between both of these word. Please help me to solve this issue also.
Thanks for so much help.

in your query, use

$query = "insert into blah blah blah values('" . urldecode($_POST['selectname']) . "')";

This is the most basic, you should also look into mysql_real_escape_string() when inserting any outside submission into a db, but this has nothing to do with the issue in question though.

in your query, use

$query = "insert into blah blah blah values('" . urldecode($_POST['selectname']) . "')";

Thanks for giving so much time .

I have solved this. Now value is going very well as i need it.

Thanks sir.............

Thanks for giving so much time .

I have solved this. Now value is going very well as i need it.

Thanks sir.............

Glad I could help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.