473,325 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

AS3 to PHP to MySQL issue

I have searched for a solution over many forums and none of the code seems to work. I cannot get AS3 to work with a php script.
I am trying to create a registration form in AS3
and then have that information go to mysql database when
the submit button is pressed.


Here is part of the AS3 code:

Expand|Select|Wrap|Line Numbers
  1. var variables:URLVariables = new URLVariables;
  2. var varSend:URLRequest = new URLRequest("register.php");
  3. varSend.method = URLRequestMethod.POST;
  4. varSend.data = variables;
  5. var varLoader:URLLoader = new URLLoader;
  6. varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
  7. variables.userName = user_txt.text;
  8. variables.userPass = pass_txt.text;
  9. variables.userEmail = email_txt.text;
  10. varLoader.load(varSend);
  11.  
Here is the php script "register.php":

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.  
  4. $db_host = "localhost";
  5. $db_username = "root"; 
  6. $db_pass = ""; 
  7. $db_name = "userregister";
  8.  
  9.  
  10. mysql_connect("$db_host","$db_username","$db_pass" ) or die ("could not connect to mysql");
  11. mysql_select_db("$db_name") or die ("no database");
  12.  
  13.  
  14. $senderName = $_POST['userName'];
  15. $senderPass = $_POST['userPass'];
  16. $senderEmail = $_POST['userEmail'];
  17.  
  18.  
  19. $sqlCommand = "INSERT INTO user (username, password, email)
  20. VALUES('$senderName','$senderPass','$senderEmail') ";
  21.  
  22.  
  23. $query = mysql_query($sqlCommand) or die (mysql_error());
  24.  
  25.  
  26. $my_msg = "Thanks $senderName, all data has been sent.";
  27.  
  28.  
  29. echo "return_msg=$my_msg";
  30.  
  31.  
  32. ?>
  33.  
Jan 4 '11 #1
0 1454

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Boris Kroeplien | last post by:
Hi all. I am administrating an sgi/apache webserver. Whether we will upgrade our website to contain a mysql-database and a php-module depends on the amount of administrative work necessary for...
3
by: Mark Adams | last post by:
I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail server running for several months. It took me a week or so to get it up and running in September. Now, I did a clean upgrade to...
1
by: slugger | last post by:
Hope this is not OT: I am running into some strange things whenever my ASP pages send out simultaneous requests to another ASP page which in turn gains access to a MySQL database using a DSNless...
4
by: Archibald | last post by:
I want to improve security of a multiplayer online game written in php and mysql. Because I'm new to this stuff I would appreciate some tips. If you have time look here...
2
by: oscar | last post by:
i'm making a mysql call from c# to a mysql database for a windows application. when i try to use the join command it works fine until the column being joined gets to a null character and then the...
3
by: Jacob Lyles | last post by:
Howdy, I'm a but of a newbie and I'd appreciate some help with a MySQL issue I'm having. I'm trying to insert some data into MySQL from a POST form but the query breaks whenever a user fails to...
3
by: csgraham74 | last post by:
Hi Folks, im using MS Access as a front end to link to MYSQL. although this is possibly a MYSQL issue i thought someone would be able to help me. the error message "ODBC--insert on a linked...
1
by: mpar612 | last post by:
Hi everyone, I'm not sure if this is asking too much or not. I am trying to get the following PHP code to work on my website. It utilizes PHP 5, MySQL 4.1 and the PEAR DB module. I am...
1
omerbutt
by: omerbutt | last post by:
hi there i am new to php ,have been working in asp classic and access but now have switched to php and mysql,and for the practice sake i started to convert my asp and access based projects into php...
1
by: vagabond | last post by:
hello all i know this as been posted a billion times but I don't seem to have the same issue as every one else. running mysql server 5.0.19 running iis6.0 on windows server environment installed...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.