- Home /
Question by
Bluestrike · Oct 06, 2014 at 12:36 PM ·
phpwebsiteformatform
multiple formfields, how does php recieve the data?
I am sending a form with 2 fields to a php script. Something is not working, how do I mimic the data send from the game to the php script? (I want to test the php script without having to start up the game every time)
This does not work to see how the form data looks like:
var form = new WWWForm();
Debug.Log ( form.ToString() );
I know for a single form field the url looks like this:
www.website/script.php?formfield1=value1
But how does it look when there is more then one field?
Unity :
var form = new WWWForm();
form.AddField ( "formfield1", value1 );
form.AddField ( "formfield2", value2 );
I tried these urls:
www.website/script.php?formfield1=value1?formfield2=value2
www.website/script.php?formfield1=value1,?formfield2=value2
www.website/script.php?formfield1=value1,formfield2=value2
Comment
Best Answer
Answer by awest · Oct 07, 2014 at 03:46 AM
The Url syntax would look like this
www.website/script.php?formfield1=value1&formfield2=value2
The "?" starts the string and variables are separated with "&"