User Tag List

Results 1 to 8 of 8

Thread: A little help with MooSock

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A little help with MooSock

    Hi everybody!

    I'm not sure if the problem has to do with MooSock or my php code. My php scrip says:

    <?php
    $fp=fopen($filename,"a")
    or die("Can't open file");
    $today=date("Y-m-d-H.i.s");
    $line="\n";
    $insert=fputs($fp,$line);
    $write_donnee=fputs($fp,$datas);
    fclose($fp);
    ?>

    And my MMF2 application says:

    Send text "GET "+"http://my_site"+"/tstphp/test.php"
    Send text "?filename="
    Send text "test.txt"
    Send text "&datas="
    Send text "1234"
    Send text " HTTP/1.0"+string$( "LF" )+"From: []mehere@now.com"+string$([/] "LF" )+"User-Agent: HTTPTool/1.0"+string$( "LF" )+string$( "LF" )

    My app connects with the site and loads the php file without problem. But I get that message:

    <b>Notice</b>: Undefined variable: filename in <b>E:\Web\localuser\My_name\tstphp\test.php& lt;/b> on line <b>9</b><br />

    If I write the filename in the php code, I will have a message that the variable $datas is not defined...

    Any idea?

    Thanks!

    MB

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A little help with MooSock

    Hi everybody!

    I'm not sure if the problem has to do with MooSock or my php code. My php scrip says:

    <?php
    $fp=fopen($filename,"a")
    or die("Can't open file");
    $today=date("Y-m-d-H.i.s");
    $line="\n";
    $insert=fputs($fp,$line);
    $write_donnee=fputs($fp,$datas);
    fclose($fp);
    ?>

    And my MMF2 application says:

    Send text "GET "+"http://my_site"+"/tstphp/test.php"
    Send text "?filename="
    Send text "test.txt"
    Send text "&datas="
    Send text "1234"
    Send text " HTTP/1.0"+string$( "LF" )+"From: []mehere@now.com"+string$([/] "LF" )+"User-Agent: HTTPTool/1.0"+string$( "LF" )+string$( "LF" )

    My app connects with the site and loads the php file without problem. But I get that message:

    <b>Notice</b>: Undefined variable: filename in <b>E:\Web\localuser\My_name\tstphp\test.php& lt;/b> on line <b>9</b><br />

    If I write the filename in the php code, I will have a message that the variable $datas is not defined...

    Any idea?

    Thanks!

    MB

  3. #3
    No Products Registered

    Join Date
    Jul 2006
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: A little help with MooSock

    You have superglobals off - these are also bad, dont use them.

    $filename = $_GET['filename'];

    Place this before you open the file in order to put the GET request variable 'filename' into the php variable, $filename.

    Also, thats terribly insecure - anyone can put any random filename in there (including directory traversal) in order to open and overwrite any file they wish.

  4. #4
    No Products Registered

    Join Date
    Jul 2006
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: A little help with MooSock

    You have superglobals off - these are also bad, dont use them.

    $filename = $_GET['filename'];

    Place this before you open the file in order to put the GET request variable 'filename' into the php variable, $filename.

    Also, thats terribly insecure - anyone can put any random filename in there (including directory traversal) in order to open and overwrite any file they wish.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: A little help with MooSock

    Thanks, Plasma! It works!

    But now, it's the $datas variable that is not defined:

    <b>Notice</b>: Undefined variable: datas in <b>E:\Web\localuser\Myname\tstphp\test.php&l t;/b> on line <b>15</b><br />

    I believe I must place a similar line to put the variable datas into the php variable $datas. Can you tell me how?

    About security: yes indeed, it is insecure. As soon as I see everything can work, I will take care of the security issue.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: A little help with MooSock

    Thanks, Plasma! It works!

    But now, it's the $datas variable that is not defined:

    <b>Notice</b>: Undefined variable: datas in <b>E:\Web\localuser\Myname\tstphp\test.php&l t;/b> on line <b>15</b><br />

    I believe I must place a similar line to put the variable datas into the php variable $datas. Can you tell me how?

    About security: yes indeed, it is insecure. As soon as I see everything can work, I will take care of the security issue.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: A little help with MooSock

    Ah! I used the same instruction $_GET with the datas variable and it works!

    Thanks again, Plasma!

    MB

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: A little help with MooSock

    Ah! I used the same instruction $_GET with the datas variable and it works!

    Thanks again, Plasma!

    MB

Similar Threads

  1. About MooSock
    By Locaz00 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 13th February 2008, 04:51 PM
  2. moosock.mfx-???
    By mmf2 in forum File Archive
    Replies: 6
    Last Post: 5th January 2008, 03:42 PM
  3. moosock.mfx-bug
    By mmf2 in forum File Archive
    Replies: 0
    Last Post: 8th November 2007, 11:10 AM
  4. Moosock
    By Guitaristinmakin in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 23rd August 2007, 10:57 PM

Posting Permissions

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