Need help in PHP???

Thread Solved

Join Date: Feb 2009
Posts: 130
Reputation: gagan22 is an unknown quantity at this point 
Solved Threads: 0
gagan22 gagan22 is offline Offline
Junior Poster

Need help in PHP???

 
0
  #1
Jun 6th, 2009
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
Last edited by gagan22; Jun 6th, 2009 at 3:02 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 21
Reputation: Baldy76 is an unknown quantity at this point 
Solved Threads: 3
Baldy76 Baldy76 is offline Offline
Newbie Poster

Re: Need help in PHP???

 
0
  #2
Jun 6th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 13
Reputation: Joyce Sullivan is an unknown quantity at this point 
Solved Threads: 2
Joyce Sullivan Joyce Sullivan is offline Offline
Newbie Poster

Re: Need help in PHP???

 
0
  #3
Jun 6th, 2009
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>
Last edited by peter_budo; Jun 6th, 2009 at 3:45 am. Reason: Keep It On The Site - Do not manually post "fake" signatures in your posts.
-------------------------------------
Web Design Company Texas & web design Dallas
" We never know the worth of water till the well is dry."
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 130
Reputation: gagan22 is an unknown quantity at this point 
Solved Threads: 0
gagan22 gagan22 is offline Offline
Junior Poster

Re: Need help in PHP???

 
0
  #4
Jun 6th, 2009
Originally Posted by Baldy76 View Post
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.
  1. echo " <select name=state>";
  2. echo "<option value='$row[statename]'>$row[statename]</option>";
  3. 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
Last edited by peter_budo; Jun 6th, 2009 at 3:44 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 21
Reputation: Baldy76 is an unknown quantity at this point 
Solved Threads: 3
Baldy76 Baldy76 is offline Offline
Newbie Poster

Re: Need help in PHP???

 
0
  #5
Jun 6th, 2009
try
  1. echo "<option value='" . urlencode($row['statename']) . "'>" . $row['statename'] . "</option>";
Last edited by Baldy76; Jun 6th, 2009 at 3:27 am.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 130
Reputation: gagan22 is an unknown quantity at this point 
Solved Threads: 0
gagan22 gagan22 is offline Offline
Junior Poster

Re: Need help in PHP???

 
0
  #6
Jun 6th, 2009
Originally Posted by Baldy76 View Post
try
  1. 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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 21
Reputation: Baldy76 is an unknown quantity at this point 
Solved Threads: 3
Baldy76 Baldy76 is offline Offline
Newbie Poster

Re: Need help in PHP???

 
0
  #7
Jun 6th, 2009
in your query, use
  1. $query = "insert into blah blah blah values('" . urldecode($_POST['selectname']) . "')";
Last edited by Baldy76; Jun 6th, 2009 at 3:47 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 21
Reputation: Baldy76 is an unknown quantity at this point 
Solved Threads: 3
Baldy76 Baldy76 is offline Offline
Newbie Poster

Re: Need help in PHP???

 
0
  #8
Jun 6th, 2009
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.
Last edited by Baldy76; Jun 6th, 2009 at 3:51 am.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 130
Reputation: gagan22 is an unknown quantity at this point 
Solved Threads: 0
gagan22 gagan22 is offline Offline
Junior Poster

SOLVED: Need help in PHP???

 
0
  #9
Jun 6th, 2009
Originally Posted by Baldy76 View Post
in your query, use
  1. $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.............
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 21
Reputation: Baldy76 is an unknown quantity at this point 
Solved Threads: 3
Baldy76 Baldy76 is offline Offline
Newbie Poster

Re: SOLVED: Need help in PHP???

 
0
  #10
Jun 6th, 2009
Originally Posted by gagan22 View Post
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.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC