"Few creatures of the night have captured our imagination like vampires..." Godsmack (c) 2003 DigiCode - My solo company in progress.
🔒 Locked
PHP?
Advertisement
Original Post
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.
"Few creatures of the night have captured our imagination like vampires..." Godsmack (c) 2003 DigiCode - My solo company in progress.
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.
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.
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]
[edited by - Xtremehobo on July 18, 2003 1:27:24 PM]
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]
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]
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]
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]
Wouldn't there be a somewhere in there?
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]
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]
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]
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]
I have a 3 years experience with php (and MySQL), and it''s a great scripting language. Much easier than Perl (since it has a very C like syntax), more supported than Perl, and, in many cases, faster.
If you know C, you should have no problems learning it in a week or so
Height Map Editor | Eternal Lands | Fast User Directory
If you know C, you should have no problems learning it in a week or so
Height Map Editor | Eternal Lands | Fast User Directory
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.
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.
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.
Strengths:
Perl: Text processing, shell scripting, CGI and glue language
Python: Definitly GUI.
PHP: CGI.
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.
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.
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)
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
"A socialist is a communist who didn''t try hard enough."
- Me
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]
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]
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.
Advertisement