943,546 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 489
  • PHP RSS
Jun 6th, 2009
0

Need help in PHP???

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Junior Poster
gagan22 is offline Offline
131 posts
since Feb 2009
Jun 6th, 2009
0

Re: Need help in PHP???

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?
Reputation Points: -1
Solved Threads: 3
Newbie Poster
Baldy76 is offline Offline
21 posts
since Jun 2009
Jun 6th, 2009
0

Re: Need help in PHP???

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.
Reputation Points: 10
Solved Threads: 2
Newbie Poster
Joyce Sullivan is offline Offline
13 posts
since Jan 2009
Jun 6th, 2009
0

Re: Need help in PHP???

Click to Expand / Collapse  Quote originally posted by Baldy76 ...
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.
php Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 0
Junior Poster
gagan22 is offline Offline
131 posts
since Feb 2009
Jun 6th, 2009
0

Re: Need help in PHP???

try
php Syntax (Toggle Plain Text)
  1. echo "<option value='" . urlencode($row['statename']) . "'>" . $row['statename'] . "</option>";
Last edited by Baldy76; Jun 6th, 2009 at 3:27 am.
Reputation Points: -1
Solved Threads: 3
Newbie Poster
Baldy76 is offline Offline
21 posts
since Jun 2009
Jun 6th, 2009
0

Re: Need help in PHP???

Click to Expand / Collapse  Quote originally posted by Baldy76 ...
try
php Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 0
Junior Poster
gagan22 is offline Offline
131 posts
since Feb 2009
Jun 6th, 2009
0

Re: Need help in PHP???

in your query, use
php Syntax (Toggle Plain Text)
  1. $query = "insert into blah blah blah values('" . urldecode($_POST['selectname']) . "')";
Last edited by Baldy76; Jun 6th, 2009 at 3:47 am.
Reputation Points: -1
Solved Threads: 3
Newbie Poster
Baldy76 is offline Offline
21 posts
since Jun 2009
Jun 6th, 2009
0

Re: Need help in PHP???

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.
Reputation Points: -1
Solved Threads: 3
Newbie Poster
Baldy76 is offline Offline
21 posts
since Jun 2009
Jun 6th, 2009
0

SOLVED: Need help in PHP???

Click to Expand / Collapse  Quote originally posted by Baldy76 ...
in your query, use
php Syntax (Toggle Plain Text)
  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.............
Reputation Points: 10
Solved Threads: 0
Junior Poster
gagan22 is offline Offline
131 posts
since Feb 2009
Jun 6th, 2009
0

Re: SOLVED: Need help in PHP???

Click to Expand / Collapse  Quote originally posted by gagan22 ...
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.
Reputation Points: -1
Solved Threads: 3
Newbie Poster
Baldy76 is offline Offline
21 posts
since Jun 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: NEED help please - Parse error
Next Thread in PHP Forum Timeline: fetch_assoc and fetch_object problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC