User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26

Thread: How would I get data from a php script?

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

    Join Date
    Jul 2006
    Location
    England
    Posts
    820
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How would I get data from a php script?

    In my new game it requires users to register to submit their scores. I want the registration process to happen in the game and check the MySQL database on my web server and if a username doesn't already exist for what they have chosen insert it in to the database.

    If the query is successful then I want the game to display a message to that effect and likewise if the query fails.

    Any ideas anyone?

    Many thanks in advance!

    Steve

  2. #2
    No Products Registered

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

    Re: How would I get data from a php script?

    The download object lets you specify a URL to download from; just include the usual HTTP headers in the URL and have the PHP generate the info you need.

    Basically, you would tell the Download Object "Download 'HTTP://www.whatever.com/highscores.php?myusername=username&mypassword=pass word&myhighscore=highscore'"

    Then write the PHP script to take that information and output a file which you can then read from inside MMF using either the .ini object or another file extension. That file will be downloaded and you can give the user the appropriate message.

  3. #3
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How would I get data from a php script?

    That's a decent idea, actually - I hadn't thought of doing it that way, but outputting a file readable by INI might be a lot easier than directly calling the PHP page with the MooSock object if you need to return a lot of information.

    My high score tutorial describes the MooSock method of communicating with MySQL databases through PHP pages.

    http://www.clickteam.com/eng/resources/online_score/onlinescoreboards.html
    http://www.clickteam.com/eng/resources/online_score/dxn-scoreboards.zip

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    England
    Posts
    820
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How would I get data from a php script?

    The download object doesn't let you download any dynamic URL? There was a post in the bugs forum and i'm having the same problem.

  5. #5
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How would I get data from a php script?

    Ah... that would spoil it a bit. Nice idea, though.

  6. #6
    No Products Registered

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

    Re: How would I get data from a php script?

    Yeah, that would pooch it. Is that a bug or is it a security feature? I was planning to use it that way myself in the future...

  7. #7
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: How would I get data from a php script?

    MooSock or another socket extension would be easy to use.
    I think DavidN's tutorial goes thru all of that.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export Module

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

    Re: How would I get data from a php script?

    MooSock does the job quite well but its stability is questionable on some machines from the testing I have done. Sometimes after extended use the extension just stops responding. The best answer I have been able to come up with is a possible memory leek that creeps up over time. Is there anyone we can report MooSock bugs to now that 3ee is gone?

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    England
    Posts
    820
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How would I get data from a php script?

    Moosock worked a treat, thanks DavidN.

    @ Maggott: I'm not sure to be honest but it was posted as a bug somewhere on here.

    I found that if you don't include any HTML stuff like <head> <body> etc in the PHP script then you don't even have to do any parsing.

  10. #10
    No Products Registered

    Join Date
    Jun 2006
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How would I get data from a php script?

    Even if you get no Html headers, you'll get HTTP, don't you ?

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Replies: 17
    Last Post: 10th July 2013, 01:46 PM
  2. exchange data with HTTP server - sending/receiving values from a php script
    By Chokito in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th November 2012, 08:58 PM
  3. retrieve data from python script
    By cel in forum Python Scripting
    Replies: 2
    Last Post: 8th July 2010, 09:40 PM
  4. how I can use the VB .NET with .net script
    By FARAWAY_HELP in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd May 2009, 04:22 AM
  5. Dot Net Script
    By danjo in forum Extension Development
    Replies: 44
    Last Post: 16th October 2008, 10:37 AM

Posting Permissions

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