SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Php and Action script

    var getCarListVars = new LoadVars();
    getCarListVars.accountID = _root.accountID;
    getCarListVars.sessionKey = _root.sessionKey;
    getCarListVars.action = "getCarSearchList";
    _root.getCarListLV = getCarListVars.toString();
    _root.getCarListLVFlag = "0";
    getURL("lingo: executeCall \"getCarListLV\"", "");
    loadVariables("http://nittorevelation.com/reve10.php", "POST");
    stop();

    ^^^^^
    Thats my action script. I need a Php made to capture the incoming Variables that the game is sending. This line in the action script, loadVariable("http://nittorevelation.com/reve10.php", "POST"); will be sending it. Can someone help me make the php and then store the Variables its recording to MySQL so i can view it later?

  2. #2
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Come on :/ someone has to know.

  3. #3
    get into it! bigduke's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    //get post variables
    foreach($_POST as $varName=>$value)
        $
    $varName addslashes(trim($value));

    //make a db connection here (i expect you to know this)

    //store the value in the db using mysql_query

    echo "some return message IF you want flash to know the operation's status"
    for all the related functions look up the php manual

  4. #4
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    If you write your own code and need help troubleshooting that's one thing. If you need someone to write the code for you, you'll need to post in the looking to hire forum.

  5. #5
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?php
    $dbpath = "xxxxx";
    $dbname = "xxxxxx";
    $dbuser = "xxxxx";
    $dbpass = "xxxxxx";
    $connection = mysql_connect($dbpath,$dbuser,$dbpass)
    or die("Couldn't make connection.");
    $db = mysql_select_db("$dbname", $connection) or
    die("Couldn't select database.");

    $name = $_POST['name'];
    $header = $_POST['header'];
    $description = $_POST['description'];
    $order = $_POST['order'];

    $query = "INSERT INTO `category` (`id`, `name`,
    `header`, `description`, `order`) VALUES ('',
    '$category_name', '$header', '$description',
    '$order')";
    mysql_query($query) or die("Insert Failed!");
    echo "insert complete";
    ?>


    ive come up with that. but im not sure that its what i need, think its over kill?

  6. #6
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Looks pretty darn simple to me. A nice basic script.

  7. #7
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    'Could use some validation.

    mysql_real_escape_string
    Last edited by Dylan B; Jun 11, 2005 at 21:46.

  8. #8
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ??

  9. #9
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Table 'nittore_phpbb1.category' doesn't exist

    Thats the error im getting. So its saying the table doesn't exist? and if so how do i go about making a table to accept these variables?

  10. #10
    get into it! bigduke's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Nitto1320
    how do i go about making a table to accept these variables?
    nice work on the script nitto. As for the table, you create them with sql data definition statements or just use phpMyAdmin to do it. You'll have to read up a little on this before you can really get something done.

  11. #11
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thank you sir. i was also thinking about php like this, alot more basic, not sure if it will work.

    <?php $a=""; foreach ($_POST as $k => $v) {$a.=$k.": ".$v."\n";} fwrite(fopen("scores.dat", 'a+'), $a) ?>

  12. #12
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    new action script.

    var loginVars = new LoadVars();
    loginVars.sessionKey = _root.sessionKey;
    loginVars.version = _root.version;
    loginVars.action = "login";
    loginVars.password = password;
    _root.password = password;
    loginVars.state = _root.login.varHolder.vault.temp;
    loginVars.username = racername;
    _root.loginLV = loginVars.toString();
    _root.loginLVFlag = "0";
    getURL("lingo: executeCall \"loginLV\"");
    this.loadvariables("http://nittorevelation.com/reve10.php", "POST");
    stop();

  13. #13
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?php $a=""; foreach ($_POST as $k => $v) {$a.=$k.": ".$v."\n";} fwrite(fopen("scores.dat", 'a+'), $a) ?>

    gives me a error 500.

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

  14. #14
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
    $fp 
    fopen ('scores.dat''a+');
    $a='';
    foreach (
    $_POST as $k => $v)
    {
    $a .= $k ': ' $v '\n';
    }
    fwrite($fp$a);
    fclose($fp); 
    ?>

    Try that.

    Also, space out yor code better, it makes it easier to read.

  15. #15
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    still getting 500 error. Nothing is being written to the scores.dat

  16. #16
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone know some php script I should try? im just looking for the php script (this.loadvariables("http://nittorevelation.com/reve10.php", "POST"); that gather the Variables and saves them to a .txt at this point.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •