Page 1 of 2 12 LastLast
Results 1 to 15 of 26

Thread: Blank Page, but no error (i don't think)

  1. #1
    1,806
    posts
    My Pimp Hand is Strong

    Blank Page, but no error (i don't think)

    I'm just learning flash, and i've set up a guest book in PHP. on Submit i use this code:
    Code:
    sendVars = new LoadVars();
    			sendVars.vname = _root.iname.text;
    			sendVars.vemail = _root.iemail.text;
    			sendVars.vaim = _root.iaim.text;
    			sendVars.vlink = _root.ilink.text;
    			sendVars.vshout = _root.ishout.text;
    			sendVars.vdate = (today.getMonth() + 1) + "/" + today.getDate() + "/" + today.getFullYear();
    			sendVars.send("addEntry.php", "POST");
    PHP Code:
    <?
    $vname 
    $HTTP_POST_VARS['vname'];
    $vemail $HTTP_POST_VARS['vemail'];
    $vaim $HTTP_POST_VARS['vaim'];
    $vlink $HTTP_POST_VARS['vlink'];
    $vshout $HTTP_POST_VARS['vshout'];
    $vdate $HTTP_POST_VARS['vdate'];
    $vip $HTTP_SERVER_VARS['REMOTE_ADDR'];
    if(
    $vname != "" || $vemail != "" || $vshout != ""){
        
    $connection mysql_connect("localhost") or die("Connection Error");
        
    mysql_select_db("guestbook"$connection);
        
    $qString "INSERT INTO `entries` ( `name` , `email` , `aim` , `link` , `shout` , `date`, `ip` ) VALUES ( '$vname', '$vemail','$vaim','$vlink','$vshout','$vdate', '$vip')";
        
    $result mysql_query($qString$connection) or die ("Query Error");
    }else{
        print 
    "PHP ERROR";
    }
    ?>
    it adds the entries into the database fine, but I am left with a blank page with the following code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"></HEAD>
    <BODY></BODY></HTML>

    Anyone know why? or how i can automatically close it after the process is done?

    btw.. WinXP, Apache 2, PHP 4

    thanks
    You're like a program written entirely in c. No Class

  2. #2
    So you want the page to automatically close after all your database entries are complete?

    Just use this method...

    In your if statement in your php line...

    PHP Code:
    $result mysql_query($qString$connection) or die ("Query Error");

    // Place this code in here then...

    print "<SCRIPT LANGUAGE='JavaScript'>";
    print 
    "window.close()";
    print 
    "</SCRIPT>"
    I haven't gotten the chance to check this out yet... It may or may not work.. If I'm correct window.close() is the function that will close a window but for some reason.. I think the only way a window can be closed like this is if a window was opened using JavaScript's window.open() method...

    But you can try it and see if it works out for you buddy
    aiMarz : v. 11.34c - Current Version

  3. #3
    1,806
    posts
    My Pimp Hand is Strong
    thanks for the response buddha, but i don't think you can close a javascript window with out an object, for example:

    win= window.open(params..);
    win.close();
    You're like a program written entirely in c. No Class

  4. #4
    See.. That's what I thought too... ****..

    Hmm.. lemme see here... I don't think there are any PHP commands to do that either.. But there has to be something out there that will allow you to do it..

    Can't you use Javascript commands to open a window in Flash MX? I've seen it somewhere around the forums here... But since I've gotten away from Flash for a little bit.. I'm a tad bit rusty.. *lol*
    aiMarz : v. 11.34c - Current Version

  5. #5
    Code:
    sendVars = new LoadVars();
    sendVars.vname = _root.iname.text;
    sendVars.vemail = _root.iemail.text;
    sendVars.vaim = _root.iaim.text;
    sendVars.vlink = _root.ilink.text;
    sendVars.vshout = _root.ishout.text;
    sendVars.vdate = (today.getMonth() + 1) + "/" + today.getDate() + "/" + today.getFullYear();
    sendVars.send("addEntry.php");
    On your last line in your AS take out the POST parameter. For some reason in Flash if you define the method parameter as "POST" it will open a new page. If you don't specify a parameter it won't open a new page and it defaults to "POST"

    that will (should) stop the page from opening altogether.

  6. #6
    Nice Vash! I might have known that if... I actually did Flash Experiments anymore.. *lmfao*
    aiMarz : v. 11.34c - Current Version

  7. #7
    1,806
    posts
    My Pimp Hand is Strong
    awesome, thanks Vash, you too buddha
    You're like a program written entirely in c. No Class

  8. #8
    actually it was ahmed that brought that to my attention. I was having a similar problem with a guestbook and ahmed pointed that out to me.

    stupid macromedia!

  9. #9
    *lmao*... 10-4 on that big Johhnie-Boy
    aiMarz : v. 11.34c - Current Version

  10. #10
    1,806
    posts
    My Pimp Hand is Strong
    haha, that's what im making, almost finished, just a few finishing touches
    You're like a program written entirely in c. No Class

  11. #11
    awesome. did the fix work then?

  12. #12
    1,806
    posts
    My Pimp Hand is Strong
    nope. Well at least i don't get a blank page any more. But now it's not inserting the values into the database.
    You're like a program written entirely in c. No Class

  13. #13
    are you testing it locally or on the server?

  14. #14
    4,029
    posts
    home cooking is killing the restaurant industry
    you should use $_POST instead of $HTTP_POST_VARS

    I think the longer arrays are officially depreciated now.
    There are only 10 kinds of people in this world:
    Those that might know ternary, those that do, and those that don't
    Say NO to DRM.

  15. #15
    1,806
    posts
    My Pimp Hand is Strong
    locally
    You're like a program written entirely in c. No Class

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012