Jump to content


Passing Variables to PHP


  • You cannot reply to this topic
3 replies to this topic

#1 The Creator

    Young Padawan

  • Members
  • Pip
  • 115 posts
  • Gender:Male
  • Location:England
  • Interests:Computers, Music, Technology, Sport

Posted 14 July 2007 - 04:15 PM

Ok, hi again.

I got an application form for something and i wanna pass the variables to a php file...

heres the code:

on (release) {
	delete change;
	delete searchKey;
	delete taListener;
	var myVars:LoadVars = new LoadVars();
	myVars.apName = _global.apName;
	myVars.apMail = _global.apMail;
	myVars.req = _global.reqData;
	myVars.day = _global.apDay;
	myVars.month = _global.apMonth;
	myVars.apYear = _global.apYear;
	myVars.budget = _global.budgetData;
	myVars.notes = _global.notes;
	
myVars.send("http://www.example.com/page.php", "_self", "POST");
}


The code all works except for one thing...

instead of going to http://www.example.com/page.php and being able to retrieve the variables throught $_POST['variable']. It goes to http://www.example.com/page.php?variable=t...ervariable=that

I'm pretty sure that that's not meant to happen. If that is meant to happen, how would i get it so that the variables can be retrieved through $_POST['variable']. If it isnt, what have i done wrong/ how can i fix it?

#2 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 15 July 2007 - 08:47 PM

Hrm, not sure why it would be doing that. I haven't needed to use LoadVars much at all, but my suggestion would be to try without the "_self" and "POST". Using POST is the default for the send() method. Try both off or one of each off. Sorry I can't be of more help.

#3 The Creator

    Young Padawan

  • Members
  • Pip
  • 115 posts
  • Gender:Male
  • Location:England
  • Interests:Computers, Music, Technology, Sport

Posted 16 July 2007 - 06:58 AM

im not sure why but i had to upload it to my site for it to work... :P

thanks for the help :blink:

The Creator

#4 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 16 July 2007 - 08:12 AM

Oh, that makes sense. I thought you had already done that :P





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users