Aug 2, 2014 02:49 AM
(This post was last modified: Aug 2, 2014 02:54 AM by Killa Priest.)
I'm trying soo hard not to be a noob. Unfortunately i cant seem to find easy help on how to understand what it is i may be doing wrongly.
I am trying to pass a variable from flash Actionscript to a Database using Php. I may not have declared/define the variable properly in Actionscritp because each time i make an entry on the website(by passing the variable), Php does not update nor enter the entry(passed variable) into my database. Please see my Flash Actionscript code below:
In the above, collect_numba_txt.text is the container holding user entry(from webpage).. Meanwhile, here is what is going on in the Php script below
In the above Php code, this --> $peeps = $_POST['theName']; is suppose to receive the stupid entry sent by Flash Actionscript but, 😟 I ve been rapping my search button on HF looking for similar isssh with no luck finding a flash lesson. Please help me fellas.. You ll' never know how much i appreciate it. Thanks in advance 🤝
I am trying to pass a variable from flash Actionscript to a Database using Php. I may not have declared/define the variable properly in Actionscritp because each time i make an entry on the website(by passing the variable), Php does not update nor enter the entry(passed variable) into my database. Please see my Flash Actionscript code below:
Code
stop();
submit_btn.onRelease = function() {
if (collect_numba_txt.text != '') {
error_box.text = 'Thanks and GoodLuck winning!';
} else {
error_box.text = 'Enter no. properly';
}
MyLoadVars=new LoadVars();
MyLoadVars.onLoad=Function(ok) //assuming all went well
MyLoadVars.theName=collect_numba_txt.text
MyLoadVars.sendAndLoad('goto.php',MyLoadVars,'POST');
};In the above, collect_numba_txt.text is the container holding user entry(from webpage).. Meanwhile, here is what is going on in the Php script below
Code
<?Php
Define('DB_NAME', 'database');
Define('DB_USER', 'root');
Define('DB_PASSWORD', 'password123');
Define('DB_HOST', 'localhost');
[code]
$Con = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
IF(!$con){
Die('Could not connect to DataBase');}
$Dbchosen = mysql_select_db(DB_NAME,$Con);
IF(!Dbchosen){
Die('Could not establish a connection');}
Echo 'Connection Successful!';
//extract data from the post. this data comes from flash
$peeps = $_POST['theName'];
$shoot = "INSERT INTO Dumps(Numbaz) VALUES('$peeps')";
IF(!mysql_query($shoot)){
Die ('Error:'.mysql_error());
}
?>In the above Php code, this --> $peeps = $_POST['theName']; is suppose to receive the stupid entry sent by Flash Actionscript but, 😟 I ve been rapping my search button on HF looking for similar isssh with no luck finding a flash lesson. Please help me fellas.. You ll' never know how much i appreciate it. Thanks in advance 🤝

