Skip to main content
gamedev.net
🔒 Locked

PHP?

Started by Drevay Jul 18, 2003 at 12:03 PM 17 replies 400+ views
Original Post
Drevay
Drevay
I''ve been reading a bit about it - and it seems to be a pretty widely supported scripting language for HTML embedding and other CLI and data base uses. I was just wondering if anyone in here has any experience with PHP. What''s it like? It seems easy to use, is it? Is it buggy, or stable? Any other comments you want to make, sure, go ahead.
"Few creatures of the night have captured our imagination like vampires..." Godsmack (c) 2003 DigiCode - My solo company in progress.
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
Xtremehobo
Xtremehobo
I use php
It''s very easy to use and it''s syntax is much like C++. Variables are a bit different though; they all begin with $''s and you''re not required to declare them before using them. Besides that, the syntax is almost just like C++.
I''ve written lots of stuff in php, I''ve done a rent-a-coder like auction system, a website with automated news and review posting, and I''m currently writing a forum in php.
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
Drevay
Drevay
Kick ass. Sounds like a fun scripting lang to learn to get my site up and going...now ... I wonder if freewebz supports PHP?


"Few creatures of the night have captured our imagination like vampires..." Godsmack
(c) 2003 DigiCode - My solo company in progress.
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
Xtremehobo
Xtremehobo
I wouldn't bother with a free host. I've used too many and they all suck. they all suck. If you've got broadband, host it off your computer! Or if you don't, spend $10 a year like I do for 200mb space, 2 gb bandwidth, and lots of extra stuff (including php, mysql, etc..). I don't think there's many free hosts that support PHP.. or at least php w/o safemode enabled :-\

[edited by - Xtremehobo on July 18, 2003 1:27:24 PM]
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
Drevay
Drevay
PHP safemode? I just know that's a bad thing.

OH! One quick question - can you make a PHP script embedded into your page that logs people's IP's and where they've been last and all that every time they visit? So, in case your site was attacked, you could tell who it was, where they went on your site, what browser, or if they haxx0red teh crapz0rs out of your site for shitezens and gigglemeitens.

Shitezens and gigglemeitens. I will have to remember that one.

...

EDIT - what host do you use Xtremehobo? For 2 dollars a year (I'm assuming US which would be ... 3..4 dollars a year Canadian) that's a damn steal!


"Few creatures of the night have captured our imagination like vampires..." Godsmack
(c) 2003 DigiCode - My solo company in progress.

[edited by - Drevay on July 18, 2003 1:32:36 PM]
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
Nervo
Nervo
Yes you can Drevay. It seems to be bypassed in beginner PHP books like the one I have yet it is still possible. As an example:


session_start();
if(!session_is_registered('counted')){
$agent = $_SERVER['HTTP_USER_AGENT'];
$uri = $_SERVER['REQUEST_URI'];
$user = $_SERVER['PHP_AUTH_USER'];
$ip = $_SERVER['REMOTE_ADDR'];
$ref = $_SERVER['HTTP_REFERER'];
$dtime = date('r');

if($ref == ""){
$ref = "None";
}
if($user == ""){
$user = "None";
}

$entry_line = "$dtime - IP: $ip | Agent: $agent | URL: $uri | Referrer: $ref | Username: $user n";
$fp = fopen("logs.txt", "a");
fputs($fp, $entry_line);
fclose($fp);
session_register('counted');
}
?>


[edited by - nervo on July 18, 2003 1:38:32 PM]
Well, R2D22U2..
Drevay
Drevay
Wouldn't there be a Like, at the top line?

Well, thanks for the script! That's great.

Now...to get a good host for a PHP enabled site...

EDIT - oh yah, where would the script save it's log to? Like...a logfile somwhere hidden on the site where only I could access?


"Few creatures of the night have captured our imagination like vampires..." Godsmack
(c) 2003 DigiCode - My solo company in progress.

[edited by - Drevay on July 18, 2003 1:42:00 PM]
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
Nervo
Nervo
Yeah, you would define the location yourself. Of course you would want it to be in a location away from your root server directory. That one in the script was logs.txt or whatever you want it to be.

EDIT: Oh yeah I forgot, you're not running it on your own home server, so thats a good question for someone else. Just run your own server! You can be teh 1337!!!!11!!!!

[edited by - nervo on July 18, 2003 1:57:57 PM]
Well, R2D22U2..
draqza
draqza
I''ve had a little bit of experience with PHP, picking it up after having been working Coldfusion for about 6 months... pretty good IMO, and the fact that it''s free makes it a winner over CFMX for my personal development stuff anyway.

If you want to tinker with it you can get a free page from www.ionichost.com , they give you 50MB space, unlimited bandwidth, PHP 4.something, a free mysql database if you want it (although it says "if you don''t know what this is then please don''t request one"), the tradeoffs are the fact that it can be ridiculously slow at times, it has a popunder ad, and there are like 2 or 3 functions you can''t use (one of them is phpinfo() though so that''s no great loss).

Of course, if you do have broadband then I''d say go ahead and host it on your own computer, getting it set up with Xitami (free web server) isn''t difficult at all.
WNDCLASSEX Reality;......Reality.lpfnWndProc=ComputerGames;......RegisterClassEx(&Reality);Unable to register Reality...what's wrong?---------Dan Uptonhttp://0to1.orghttp://www20.brinkster.com/draqza
DakeDesu
DakeDesu
Myself, I prefer Perl and Python, and think of PHP as more of a beginner''s language, where it is easy to do small webapps, but anything other than that gets too complicated for my brain in PHP (when compared to other languages). PHP is great for its nitch of web development, however in other applications, such as glue, shell or GUI programming, other scripting langauges mop the floor with PHP.

Strengths:
Perl: Text processing, shell scripting, CGI and glue language
Python: Definitly GUI.
PHP: CGI.
Drevay
Drevay
Hrm, yes, PHP. The only thing I want to do with PHP is well...script in CGI. Python is deffinately for RAD''ing and all that jazz.

Now the big question - I need a host that''s not too expensive and will bill me via my mailing address (not credit card, bill for cash or check at my house, not email). Is that possible?


"Few creatures of the night have captured our imagination like vampires..." Godsmack
(c) 2003 DigiCode - My solo company in progress.
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
Xtremehobo
Xtremehobo
Back to about the price, I pay $10 a year, heh, not two, but I''m about to drop my host and just host from my own server here (once it comes in the mail)
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
AnonymousPosterChild
AnonymousPosterChild
I swear by PHP. Simple to learn and use, plus it is great for mySQL stuff.



"A socialist is a communist who didn''t try hard enough."
- Me
With love, AnonymousPosterChild
Xtremehobo
Xtremehobo
Sure.
pixelwrench.com | [email="matt[nospam]@pixelwrench[nospam]com"]email[/email] lethalhamster: gamedev keeps taking my money, but im too lazy to not let them
deathtrap
deathtrap
Why don't you set up an apache webserver on your own computer at home, and set up PHP and MySQL as well. That's what I did. I also found a hosting provider that gives 50MB, MySQL, PHP, ASP(I think, not sure) and doesn't charge anything, no ads on your site, and no popups or popunders. That provider also offers a PHP MyAdmin administration, and ftp uploading to your site . and yes all of this was free, surprised me also.

send me an email if you want the providers web address.

edit: just checked the provider, they also support SSL, and perl scripting as well as CGI, and a subdomain all on the same free hosting plan.


[edited by - deathtrap on July 18, 2003 12:28:14 AM]
DakeDesu
DakeDesu
quote:
Original post by Cypher Ae
any tutorials out there?


Yes: Mine

Daholygoat''s

(both of these are slightly dated--you use $_REQUEST[] to gather form elements)

html Goodies

More HTML goodies

PHP complete (note: a little in accurate)

And to learn more it is sometimes best to read other people''s code, Hot scripts has plenty of code to read.



"You''re right, Bush has no place in a thread about masturbation." -- griffenjam
Got Immortality?
[edited by - Timestamp_Zero on January 1, 1970 00:00:00 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.