0

Hello to everyone.Sorry if the question has been already made, but is like i need to waste 1 day to find what i'm lookin for so if someone could tell me please how to pass data from ajax to a php page in resonable way(meaning that i don't need to code a single string in some strange way then to decode it.) i will thank him very much.
I have some inputs, radio ecc with names and when i pass them to php with ajax/js i would like to know how that data belongs to, without encoding and decoding if that is possible.
Regardes to everyone(i'm not english)

2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by xirian
0

make sure all your inputs have ids as well as names:
eg: <input name=foo id=foo>
recommend you use jquery so you can simply serialize the values for posting
eg

var myformdata=$("#myformid").serialize();
0

Thanks for the reply.

I definitely wasn't clear enough, my problem isn't making a string like "username=xirian&age=23&hobbies=coding" to send to the php page(even if i can't use &, don't know why).
My problem is that i don't know how to read the string on php so i can put the data in a mysql databse.

Edited by xirian: n/a

0

Resolved by vsmash, my mistake.

Edited by xirian: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.