Welcome, Guest
  • Author Topic: Guestbook V2, Problem with PHP to Flash  (Read 5875 times)

    elMahmood

    • Server what's that
    • *
    • Posts: 1
      • View Profile
    Guestbook V2, Problem with PHP to Flash
    « on: 04/12/06, 15:23 »
    Hi,

    i just downloaded the newest XAMPP version, importetd the database and tried to work the guestbook,
    but the php script does not pass the parameters like "entries" or "totalEntries" correctly to flash.
    when i use the script in the browser:
    Quote
    http://localhost/geist/GuestBook.php?action=read&NumLow=0
    then i get
    Quote
    &totalEntries=0&
    &entries=No entries in the guestbook, as yet..
    so that should work.
    but when i try to work the swf i get this in the textarea
    Code: [Select]
    ";



    if($numallComments == 0) {

        print "No entries in the guestbook, as yet..";

    } else {

        while ($array = mysql_fetch_array($fewComments)) {

       $name = mysql_result($fewComments, $i, 'name');

       $email = mysql_result($fewComments, $i, 'email');

       $comments = mysql_result($fewComments, $i, 'comments');

       $time = mysql_result($fewComments, $i, 'time');



       print 'Name: ' . $name . '
    Email: ' . $email . '
    Comments: ' . $comments . '
    Date: ' . $time . '

    ';

       $i  ;

        }

    }

    // Print this only when there aren't any more entries..

    if($_GET['NumLow'] > $numallComments) {

       print 'No More Entries!

    instead of just
    Quote
    No entries in the guestbook, as yet..

    does anybode has an idea? i am using flash mx 2004 professional?
    thanks for any advice!

    ElMahmood

    nothingGrinder

    • Mods
    • Systems Administrator
    • *****
    • Posts: 823
    • Automatic websites with social media distribution
      • View Profile
      • nothingGrinder
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #1 on: 04/12/06, 18:51 »
    seems the quotation marks are in the wrong place and that line of code is being echoed to flash, if you could open the script i dreamweaver or a code editor with some sort of code hinting, like

    blue for quotes
    red for method
    green for string
    black for variable...

    etc.

    that would show you if the quotations were incorrect, you would see a large block of blue text that shouldnt be blue.

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #2 on: 04/16/06, 14:44 »
    This looks very much like your hosting server does not support php.

    Make sure there is php installed at the server and running.
    happy flashing
    8)
    Ronald

    koko2

    • Server what's that
    • *
    • Posts: 21
      • View Profile
      • Email
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #3 on: 04/29/06, 15:12 »
    Hi,

    I have the same problem as ElMahmood.

    I'm using the original guestbook v2 source files, didn't make any changes to it
    I tried to run it local with the WAMP5 server, but it doesn work.

    Guestbook version 1 works fine by the way.....

    so can anybody please help me?

    What do I have to do to fix this?

    nothingGrinder

    • Mods
    • Systems Administrator
    • *****
    • Posts: 823
    • Automatic websites with social media distribution
      • View Profile
      • nothingGrinder
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #4 on: 04/29/06, 18:39 »
    make sure PHP is installed.

    run a simple PHP script like..

    <?PHP
    phpinfo();
    ?>

    that should tell you if its installed.

    make sure MySQL is installed and working.

    koko2

    • Server what's that
    • *
    • Posts: 21
      • View Profile
      • Email
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #5 on: 04/30/06, 13:38 »
    I have installed the WAMP5 server, so shouldn't they all be installad? (apache, MySQL and PHP)

    I tried the PHP info file and it works..... but how can I know if MySQL is working?

    nothingGrinder

    • Mods
    • Systems Administrator
    • *****
    • Posts: 823
    • Automatic websites with social media distribution
      • View Profile
      • nothingGrinder
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #6 on: 04/30/06, 19:00 »
    use this to create a database... see if it works.
    if it works, it will show

    it worked

    in the browser window
    if it doesnt work
    it will show

    no dice

    Code: [Select]
    <?PHP
    <?PHP
    $link = mysql_connect('localhost', 'username', 'pass');
    $query = "CREATE DATABASE bob;";
    $result = mysql_query($query);
    if($result)
    {
    echo "it worked";
    }else {
    echo "no dice";
    }
    mysql_close($link);
    ?>

    be sure to enter the proper username and password and host for you database

    koko2

    • Server what's that
    • *
    • Posts: 21
      • View Profile
      • Email
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #7 on: 05/08/06, 12:50 »
    I'm sorry but I don't really understand. (I'm not good at this)

    Could you be more specific with the steps I have to take,

    Do I have to save the code as a SQL-file?.... and then what?

    Thanks,

    nothingGrinder

    • Mods
    • Systems Administrator
    • *****
    • Posts: 823
    • Automatic websites with social media distribution
      • View Profile
      • nothingGrinder
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #8 on: 05/08/06, 20:47 »
    just copy and paste the code below into a code or plain text editor and save it as a .php file. put that file on your server, then go to the address for that file,

    http://www.mydomain.com/thisFileName.php

    the file will try to create a database,
    if MySQL is working, the web browser will read "it worked"

    if not, it will read "no dice"

    koko2

    • Server what's that
    • *
    • Posts: 21
      • View Profile
      • Email
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #9 on: 05/09/06, 12:44 »
    I get this in my browser window:

    Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:\wamp\www\index.php on line 2

    Warning: mysql_query() [function.mysql-query]: Can't connect to MySQL server on 'localhost' (10061) in C:\wamp\www\index.php on line 4

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\index.php on line 4
    no dice
    Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\index.php on line 11

    nothingGrinder

    • Mods
    • Systems Administrator
    • *****
    • Posts: 823
    • Automatic websites with social media distribution
      • View Profile
      • nothingGrinder
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #10 on: 05/09/06, 16:51 »
    ok,
    so, either MySQL is not installed or its not running.

    koko2

    • Server what's that
    • *
    • Posts: 21
      • View Profile
      • Email
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #11 on: 05/11/06, 14:12 »
    I gues your richt. but it's weird..... because in my WAMP5 options it say's it's running.

    Thanks for your help, I'll use the guestbook v1 anyway, v2 has a lot of errors.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #12 on: 05/11/06, 15:52 »
    To drive a new car you should master the old one  ;)

    Jorge

    SRLdesign

    • Server what's that
    • *
    • Posts: 8
      • View Profile
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #13 on: 06/27/06, 06:01 »
    To drive a new car you should master the old one  ;)

    Jorge

    new to the forum here...  So I got V1 to work....but im using flash 8 and publishing flash 8....so no dice with v1......it will only work if published 6 or less.

    found V2 and trying to test it.  Not sure I got everything right, but based on the above posts, is mySQL not installed?

    i get this in my browser:  Parse error: parse error, unexpected '<' in /home/virtual/site129/fst/var/www/html/testSQL.php on line 2.......

    From the looks of it, its not.  But i just created a new database.....  Im sure user error is upon me ;D .

    New to using mySQL so sorry for the ignorance :-\

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Guestbook V2, Problem with PHP to Flash
    « Reply #14 on: 06/27/06, 06:16 »
    Is testSQL.php part of the app download?

    Jorge