Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

If you speak ActionScript,help me pass my variable to Php

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:

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 🤝
(Aug 3, 2014 01:42 PM)luigi14061982 Wrote:  hi bro pls help me i have buy u crypter so have problem pls send me you contact skipe
No sir.,you are mistaking.I sold you no crypter.Please double check your post.
Did you set these variables:
Code
URLRequest.method = URLRequestMethod.POST;
URLLoader.dataFormat = URLLoaderDataFormat.VARIABLES;

If so, please post your sendAndLoad function or even better the LoadVars class. We can't really help you with this as you haven't provided all the code we need to find the solution, you are assuming the method sendAndLoad is correctly working, but is it?

Also, this thread shouldn't be in this section as it belongs in Coding and Programming.
FR1908
(Aug 5, 2014 10:47 AM)The-One Wrote:  Did you set these variables:
Code
URLRequest.method = URLRequestMethod.POST;
URLLoader.dataFormat = URLLoaderDataFormat.VARIABLES;

If so, please post your sendAndLoad function or even better the LoadVars class. We can't really help you with this as you haven't provided all the code we need to find the solution, you are assuming the method sendAndLoad is correctly working, but is it?

Also, this thread shouldn't be in this section as it belongs in Coding and Programming.
Firstly, my apologies for posting in the wrong section.Meanwhile,you seem to be offering me AS3 solution.However,i am coding in AS2 which in my case will only need a simple Loadvars() class as stated in my original post.I ve been doing some research and have been able to improve the above code by adding an onload() event yet,no joy.if you still wanna see my latest AS2 approach, i ll be more than glad to display it on here. Thank U Thank U Thank U! 🤝

EDIT: atm,im leaving out mysql to figure HOW flash n php would handle data(to n fro)
AS:
Code
var vars:LoadVars = new LoadVars();
vars.myName = collect_numba_txt.text;
vars.send("goto.php", "vars", "POST");

goto.php:
Code
<?php

if(isset($_POST['myName'])) {

mysql_connect("host","user","pw");
mysql_select_db("db");
mysql_query = "INSERT INTO Dumps(Numbaz) VALUES('$peeps')";

}

?>
WoWoX: Your AS code although very correct but will not deliver any data to php because you are only using the send() instead of sendAndLoad().Plus i am sending to a server,it will require the .onLoad() (which makes the data available to php).
I'm glad you have taken time out of your schedule to go through my codes and come up with an idea.. Thank you WoWoX.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by FailzorroFeb 24, 2017 11:02 AM 0 97 Feb 24, 2017 11:02 AM
Last Post: Failzorro
[Help] by CompozeApr 5, 2015 04:16 AM 0 61 Apr 5, 2015 04:16 AM
Last Post: Compoze
by ClumzyMar 4, 2015 11:09 AM 0 56 Mar 4, 2015 11:09 AM
Last Post: Clumzy