Jump to content


Photo

Php4games


  • Please log in to reply
82 replies to this topic

#1 ..::Origin::..

..::Origin::..

    GMC Member

  • New Member
  • 435 posts

Posted 02 July 2006 - 03:14 AM

I've been away from this community for quite sometime. Due to many requests i'm restoring a URL to the DLL. If It doesn't function correctly with the new Game Maker 7 / PHP, there Isn't much I can do about It as I'm no longer an active game maker user.

I wont be able to support this thread much or at all, so please don't expect help.


Description:
PHP4Games is a wrapper for PHP that gives Gamemaker 5.*, 6.* and 7.* (?) full access to the PHP Compiler, including CGI/CLI compilation, saving compiled scripts straight to file/returning them directly to gamemaker, with great simplicity.

Why PHP in games?
- SQL Access for Highscore tables
- XML capabilities for loading/saving
- Plenty more, see for yourself!

* Accepting suggestions for future updates.

Note: This DLL does not create HTML headers.

Download

*PHP4Games Is no longer supported by the Author. As a result of this you may modify and redistribute this to your hearts consent.
(If you have a mirror you would kindly like to share, please just drop a URL In this thread)

Documentation included in Zip File.

Happy programming.

Edited by ..::Origin::.., 04 May 2008 - 05:58 AM.

  • 0

#2 Smarttart62

Smarttart62

    designFUSION™

  • New Member
  • 2619 posts

Posted 02 July 2006 - 03:28 AM

Although PromaneX's had more functionality, this one seems pretty cool -_-.

XML Reader EXAMPLE: Download (Thanks Celebraces)
-Steve

Edited by Smarttart62, 22 August 2006 - 12:09 PM.

  • 0

#3 Quimp

Quimp

    Pretzel fanatic

  • New Member
  • 275 posts

Posted 02 July 2006 - 03:33 AM

The third argument is where your working directory of PHP-CGI.exe is.

I could not try the DLL, but might I suggest getting rid of argument2? There's a function in GM to get the directory of a file, which if I recall correctly is filename_dir(<file>); so this might be easy to do directly from the DLL.

Regards,
Quimp
  • 0

#4 celebraces

celebraces

    GMC Member

  • GMC Member
  • 956 posts

Posted 02 July 2006 - 03:54 AM

What function are we supposed to call?
  • 0

#5 ..::Origin::..

..::Origin::..

    GMC Member

  • New Member
  • 435 posts

Posted 02 July 2006 - 03:57 AM

READ POST ONE CELEBRACES. I cannot sweat enough that people don't READ.

Thankyou all for the postive comments, and Quimp, i think you mean argument 3? I didn't write an example, i suppose i should.. I'll include that, thanks.

Thankyou SmartArt, i purposely just designed this for the use of PHP for any version. I'll get to work on an example now.
  • 0

#6 celebraces

celebraces

    GMC Member

  • GMC Member
  • 956 posts

Posted 02 July 2006 - 04:01 AM

global.php_call=external_define("PHPDll.DLL","<< WHAT GOES HERE??? >>",dll_stdcall,0,3,ty_string,ty_string,ty_strin
g);

I read the post a couple of times before I posted
  • 0

#7 ..::Origin::..

..::Origin::..

    GMC Member

  • New Member
  • 435 posts

Posted 02 July 2006 - 04:04 AM

Oh, I apologise, i have added it to post one, i am sorry.

It is "ExecuteFileCB" anyway. Will write an example now.

Edit: Examples out.

Please, give me suggestions for what i should add.

Edited by ..::Origin::.., 02 July 2006 - 04:09 AM.

  • 0

#8 Smarttart62

Smarttart62

    designFUSION™

  • New Member
  • 2619 posts

Posted 02 July 2006 - 04:09 AM

You know we really can extend GM into php... I might get working on some small things with php, but i mean we can do things like FTP, MySQL, OGG Vorbis, Mail, etc all from my favorite programming language...
-Steve
  • 0

#9 FreeEverything

FreeEverything

    GMC Member

  • New Member
  • 3 posts

Posted 02 July 2006 - 04:12 AM

i hate to ask... but what is the use of php thorugh gm? this surely isnt a game devoping thing, and if your needing php, i'd just suggest another language -_-
  • 0

#10 ..::Origin::..

..::Origin::..

    GMC Member

  • New Member
  • 435 posts

Posted 02 July 2006 - 04:14 AM

Indeed, unfortunatly we wont be able to post them here as its nothing game related for those things you listed. If you want more functions, do tell, i'll kindly add them.

@FreeEverything

I already have quite a few uses. You could use the php functions to host a server, or a client, you can search directories etc for player settings.. List goes on.
  • 0

#11 Smarttart62

Smarttart62

    designFUSION™

  • New Member
  • 2619 posts

Posted 02 July 2006 - 04:14 AM

Did you even read my last post?

PHP is so chock full of things that even games would find usefull. Heres some examples:

1. XML Reader/Writer (Make save files games in XML)
2. OGG Vorbis (Decode OGG files and show information about them in game)
3. MySQL (MySQL connectivitiy to store stats on the player

... Must i continue?
-Steve
  • 0

#12 FreeEverything

FreeEverything

    GMC Member

  • New Member
  • 3 posts

Posted 02 July 2006 - 04:15 AM

but the client will very RARELY have php installed so... yeah... i love php myself im just finding it hard to see the functionality of it...
  • 0

#13 Smarttart62

Smarttart62

    designFUSION™

  • New Member
  • 2619 posts

Posted 02 July 2006 - 04:16 AM

Err... Yet again have you read anything?

Include the CGI version of php (the executable) packaged with your game. Thats all you need for PHP functionality.
-Steve
  • 0

#14 FreeEverything

FreeEverything

    GMC Member

  • New Member
  • 3 posts

Posted 02 July 2006 - 04:17 AM

ugh... i dont want to argue... i know what you mean.... but im not sure how to say what i mean :S
  • 0

#15 ..::Origin::..

..::Origin::..

    GMC Member

  • New Member
  • 435 posts

Posted 02 July 2006 - 04:19 AM

(Whoa we're nearly at page 2)

I could try include it in the dll, but is it even legal to do this? If so, i'll have a go at it. The CGI version is only 36 KB so i don't think it would hurt to include it.
  • 0

#16 celebraces

celebraces

    GMC Member

  • GMC Member
  • 956 posts

Posted 02 July 2006 - 04:20 AM

It's not returning anything for me -_-

I set up my own, then tried your example, they both return nothing. BTW, want another host?

PS: I know it works, it performs a system() call.

Edited by celebraces, 02 July 2006 - 04:21 AM.

  • 0

#17 Smarttart62

Smarttart62

    designFUSION™

  • New Member
  • 2619 posts

Posted 02 July 2006 - 04:20 AM

Its fine to just include it with the game. Why package it with the dll?
-Steve
  • 0

#18 ..::Origin::..

..::Origin::..

    GMC Member

  • New Member
  • 435 posts

Posted 02 July 2006 - 04:33 AM

Celebraces, yes another host would be cool. I just use wormholes as its easy to upload, and its not bad for speed.

If your using my example, update your scripts, i screwed the return type up.

Everyone update your DLL, i fixed it.

Sorry for the issues, don't know why it worked when i first tried it.

@SmartArt

Well, i thought it would save some loading time (not much) and would get extracted quicker(not much). Hmm, maybe your right.

I'm now adding write to file to the DLL. This will still support the output returned to GM, i will also add CLI to the dll.

Thanks for the comments, Origin.
  • 0

#19 celebraces

celebraces

    GMC Member

  • GMC Member
  • 956 posts

Posted 02 July 2006 - 04:41 AM

Version 1 Mirror
Version 1.1 Mirror

Smarttart62' XML Example

EDIT: Sorry the links were broken, got banned by host. They're back up now :blink:

Still not returning anything -_-

Edited by celebraces, 20 August 2006 - 08:07 AM.

  • 0

#20 ..::Origin::..

..::Origin::..

    GMC Member

  • New Member
  • 435 posts

Posted 02 July 2006 - 05:04 AM

You didn't download php.dll, phpdll.dll is the old one. Re-download it, delete phpdll.dll, and add php.dll, then modify your coding.

- Origin
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users