View Full Version : php?
hojo
March 26th, 2003, 05:42 PM
why would you use php over html?
Jubba
March 26th, 2003, 05:43 PM
you can't compare the two. PHP is more powerful. You can use PHP to write HTML. In terms of Flash:
PHP is actionscript and HTML is the motion tweens...
Jubba
March 26th, 2003, 05:45 PM
Here is a good conversation about it over on TF forums:
http://www.tutorialforums.com/showthread.php?threadid=39589&highlight=engine
hojo
March 26th, 2003, 05:48 PM
so i guess what i should say is:
whats the advantage to using php over not using it?
lava
March 26th, 2003, 05:49 PM
well, I'd say that PHP is serverside and html is clientside.
or basically, php is what killed cgi
hojo
March 26th, 2003, 05:52 PM
why would you want to use php in a site over just using html? i understand that php is more powerful, but in what way? what would i benefit to using it when doing a portfolio site?
senocular
March 26th, 2003, 05:56 PM
it lets you re-use single web pages as a template for dynamic content. Things like this page here. Look at the web adress. Every thread you look at is you looking at one PHP page, showthread.php. With that query variable passed in on the end, threadid=18698, the php page is able to get the right info from the server needed to display the page properly, though it is all formed in the same manner, using a similar template as outlined in the showthread.php. Its like a server-side fed javascript (which there is SS JS) that lets you easily manage page content using a small amount of actual web pages.
For typical personal sites, you'd probably have no use for it whatsoever, but the advantages come in when dealing with forums and accessing DBs or dynamically writing files on the server etc.
Jubba
March 26th, 2003, 05:56 PM
you can use it for dynamic content. Easily update things and manipulat a database with it...
Jubba
March 26th, 2003, 05:57 PM
TOO MANY LETTERS!! TOO MUCH READING!!
prstudio
March 26th, 2003, 05:59 PM
ASP is far better ;) Dynamic server content my friend... you need to do some reading!
lava
March 26th, 2003, 06:01 PM
yeah, html is static, php is dynamic.
the main reason for use of php is to create content that's specific to the user... such as an amazon.com page, which keeps track of what you're purchasing and makes a page listing these. If serverside processors didnt exist, you would either have to keep track of everything by cookies, or someone would have to be doing a huge lot of editing. And things like database administration wouldn't be automated.
Jubba
March 26th, 2003, 06:03 PM
PHP is quickly becoming the industry standard. Currently is is more powerful and more popular than ASP, and there is another version PHP 5.0 coming out soon that is more oriented towards OOP and has far supperior error-handling, as well as some other fun stuff. From what I have seen with my experience with ASP and PHP I prefer PHP. It is developed for a UNIX server as opposed to ASP which is made for M$, and we all know how reliable M$ is...
hojo
March 26th, 2003, 06:06 PM
i love m$, they've made everyone of the constant crashing os' that've been on my computers!
senocular
March 26th, 2003, 06:10 PM
and PHP is crossplatform and FREE
Jubba
March 26th, 2003, 06:25 PM
yeah I like PHP. I'm sticking with it... :)
lava
March 26th, 2003, 07:11 PM
I actually like ASP... I love coding in VBscript. However, there aren't that many Windows servers out there, it's mostly Unix... so if you're getting started on server side scripting, don't even bother with ASP.
RenaissanceGirl
March 26th, 2003, 08:02 PM
I, too, would like to join the ranks of PHP lovers! http://www.geocities.com/renaissancegerl/renSmiley.txt
Jubba
March 26th, 2003, 08:07 PM
a great book on PHP is this one:
http://www.amazon.com/exec/obidos/tg/detail/-/0764535617/qid=1048727189/sr=8-1/ref=sr_8_1/102-4629570-6516932?v=glance&s=books&n=507846
It taught me the basics in about 2 days. And it explains everything really really well.. check it out...
mdipi
March 26th, 2003, 08:16 PM
I hate that series of books, well the AS one i have at least. it was just the same thing, they just replaced the thing we were learning, other wise it was
The code for _____ is _____ and example would be_____
and the same for the next page, of corse more print but you get the idea, i mean i suppose i learned some stuff but it was just boring and i know more with the SAMS but i am reading now because Phillip Kermet explains everything, sure its a lot more reading but its just a better book. I dont know if the whole series is like that or not, but that is my opion so far, i will look at it though, but i found this great book from SAMS Publishing, Teach Yourself PHP in 24 Hours, i thought it was well written and easy to understand.
JMHO,
Mike
Jubba
March 26th, 2003, 08:20 PM
I read thru that one too and din't like it that much... the MySQL book from visual blueprint is really good too... I guess I like the boring approach :P
hojo
March 26th, 2003, 08:21 PM
i cant stand reading threw long boring books, i need something visually and literally appealing. like htmlgoodies, very good site, infact...they probahly have php....
RenaissanceGirl
March 26th, 2003, 08:24 PM
Google is your friend:
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=php+tutorials
nobody
March 26th, 2003, 08:24 PM
I have the PHP visual book thingy... i was all excited to get it, and once i did and read like 2 pages i realized i didnt have php support on my server. So then I spent money on a server, got php support, and never looked at the book again. Ya know where the book got me? I figured out you use $ a lot.. lol
Now that you guys are talkin about it, i feel like reading the book tho. Nice pointless post eh?
RenaissanceGirl
March 26th, 2003, 08:30 PM
I have the PHP for the World Wide Web Visual Quickstart Guide. It's a quick and dirty "learn by example" type book.
You might find all PHP books and tutorials boring unless you are excited about coding (like me).
Jubba
March 26th, 2003, 08:36 PM
yeah that book that i posted is a learn by example, gives you real-life examples of stuff that you will need to use...
prstudio
March 26th, 2003, 09:16 PM
asp for life
Jubba
March 26th, 2003, 09:20 PM
PHP OR DEATH!!! :bad:
:P
lava
March 26th, 2003, 10:17 PM
- PHP OR DEATH?
- ah, PHP please
- Very well, Give him php
- Thanks very much, that's very nice!
- YOU! PHP OR DEATH??
- Um, PHP for me too please
- VERY WELL!! Give him PHP too... we're going to run out of PHP at this rate.. YOU! PHP or DEATH?
- Death please... no, PHP! PHP! Sorry, sorry..
- YOU SAID DEATH FIRST!! AA Ah.. You said death first!
- No, I meant PHP..
- Oh, alright. You're lucky I'm church of England. YOU.. PHP OR DEATH?
- PHP for me please..
- Well, WE'RE OUTTA PHP! We only had 3 and we didn't expect such a rush...
Jubba
March 26th, 2003, 10:23 PM
lol I was waiting for that! :P
lava
March 26th, 2003, 10:25 PM
haha, yeah, I was typing it, but then I started watching tv... after that I finished it... haha
Jubba
March 26th, 2003, 10:27 PM
lol well boys and gals, I'm going to sleep. talk to you all tomorrow :P
c!rYx
March 26th, 2003, 10:41 PM
php really kicks a**, especially because everything is for free. Not like that awfull asp.net ...
Marz
March 26th, 2003, 10:58 PM
I'll say this much...
ASP isn't "horrible".. it's just not as well developed as PHP is. :)
playamarz
ahmed
March 27th, 2003, 12:02 AM
im into php, and i love it =)
click here (http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=php+vs+asp), although this thread was about why use php and not php vs asp... :P
prstudio
March 27th, 2003, 03:30 AM
.net
Kitiara
March 27th, 2003, 03:55 AM
I've done a bit of CGI, a bit of PHP, a bit of ASP and I'm currently learning ColdFusion. :)
They're all what I would call server-side programming languages, whereas HTML is client side. I think someone has already pointed this out, but I'm not re-reading 3 pages of posts to find out where. :)
If you just want to display simple things on screen, then you use HTML. The other languages come in when you want or need to generate content dynamically. So a simple example would be displaying the time or date. You have to get this from the server, so you need a different language to do it. More complex examples are things like Shoutboxes.
All of them have pros and cons. ColdFusion is very much like HTML in that it's tag based, and I'm finding that simple to learn. It's powerful too, and integrates with Flash and Dreamweaver.
PHP is good for Tagboxes, email forms etc, although a little more difficult to learn than CF. ASP is a bit more tricky. Plus that will only work on IIS platforms, and there are security issues with those...
RelandR
March 27th, 2003, 03:59 AM
Originally posted by lavaboy
- PHP OR DEATH?
- ah, PHP please
- Very well, Give him php.............(clippedForLength)
- Well, WE'RE OUTTA PHP! We only had 3 and we didn't expect such a rush...
Lavaboy That was fan - phreakin - tastic :!:
veryPythonistic =)
c!rYx
March 27th, 2003, 04:35 AM
hehe, that was really good. Kitira ColdFusion is client sided ? What can you do with it ? Is it a alternative to html ?!?
Kitiara
March 27th, 2003, 04:45 AM
CF is server side... It works with basically any database to pull out informatino and generate pages dynamically. It can also be used as a search engine as it's integrated with Verity Search. It even works with Flash MX - so you can code ColdFusion tags into Actionscript to dynamically generate Flash content. :)
prstudio
March 27th, 2003, 11:04 AM
c! html is not even really considered a programming language...if someone asks you what languages do you know, and you reply html...in this design/web devel. world they aren't going to take it seriously. i'm just being honest with you, I don't mean to be a downer. These languages are of no comparison to html.
lava
March 27th, 2003, 11:17 AM
yeah.. client side and serverside are two completely different worlds... I dont think there's a language out there that can do both.
For example... javascript. I sometimes have to do some back end stuff in javascript (cause here we're still doing stuff with the crappy NS Enterprise server), and it's not regular javascript... it's Server Side javascript... an entirely different animal.
See... a client computer and a server do different things... that's why their languages are different. I 'think' you can do some clientside stuff using VBscript, but even then, the commands are different.
ahmed
March 27th, 2003, 11:52 AM
HTML is a hyper text markup language, not a Programming language :P ;)
c!rYx
March 27th, 2003, 12:56 PM
GEEZ!!!!!! I'm programing in php, and I know that html is not really a programing language....
I was just asking about CF.... *blub*
eyezberg
March 27th, 2003, 01:25 PM
Kiti',
"PHP is good for Tagboxes, email forms etc, although a little more difficult to learn than CF"
is that true? I found PHP to by quite easy, looks a lot like AS..how can CF by easier?
Anyway, almost all hosts now offer PHP support, some even for free, and if you want CF, you gotta search and pay! no?
But: CF is Macromedia, so I guess they'll always favor it over free alternatives, it's native to remoting and stuff..is it worth getting into?
If all you want is Flash + some PHP for mailforms, forums, chats, all these apps that need to store stuff server-side and / or interact with databases, I'd recommend getting "Foundation PHP for Flash" from friends of ED, be quick though coz their out of business since a week or so, don't even know if the book's still available..it's what got me started with php, nice way to learn to integrate the server-side with Flash..also check www.flash-db.com and www.sephiroth.it for some nice examples..
Also, have a read at this:
http://www.actionscript.org/tutorials/intermediate/PHP_Remoting/index.shtml
ahmed
March 27th, 2003, 04:27 PM
this is a CF sample to insert a record into a database
<CFCOMPONENT>
<CFFUNCTION access="remote" name="doInsert" output="false" returntype="boolean">
<CFARGUMENT name="firstName" type="any" required="false" default="">
<CFARGUMENT name="lastName" type="any" required="false" default="">
<CFARGUMENT name="emailAddr" type="any" required="false" default="">
<CFARGUMENT name="isSubscribe" type="any" required="false" default="yes">
<CFARGUMENT name="subscribeType" type="string" required="false" default="html">
<CFARGUMENT name="source" type="any" required="false" default="">
<CFARGUMENT name="comments" type="any" required="false" default="">
<CFQUERY NAME="getData" datasource="mailer">
INSERT INTO tbl_userData (firstName, lastName, emailAddr, isSubscribe,source,
comments) VALUES('#arguments.firstName#','#arguments.lastNam e#','#arguments.emailaddr#',#arguments.isSubscribe #,'#arguments.source#','#arguments.comments#')
</CFQUERY>
</CFFUNCTION>
</CFCOMPONENT>
========================================
and its php semi-equivelent ;)
$firstName = $_GET['firstName'];
$lastName = $_GET['lastName'];
$emailAddr = $_GET['emailAddr'];
$isSubscribe = $_GET['isSubscribe'];
$subscribeType = $_GET['subscribeType'];
$source = $_GET['source'];
$comments = $_GET['comments'];
mysql_connect('localhost', 'root');
mysql_select_db('dbname');
$query = "INSERT INTO tbl_userData (firstName, lastName, emailAddr, isSubscribe, source, comments) VALUES('$firstName','$lastName','$emailaddr','$isS ubscribe','$source','$comments')";
mysql_query($query);
Jubba
March 27th, 2003, 04:43 PM
I'll stick with PHP until I have a need to learn something else...
Mik3
March 27th, 2003, 06:18 PM
php?
Forums!
ahmed
March 27th, 2003, 06:21 PM
Originally posted by Mike
php?
Forums! ?? :trout:
Marz
March 28th, 2003, 03:32 AM
Yeah actually...
http://www.fantom-stranger.com/~mentalconcepts/forum/
That's what I'm currently working on ;)
playamarz
Kitiara
March 28th, 2003, 04:36 AM
Kiti',
"PHP is good for Tagboxes, email forms etc, although a little more difficult to learn than CF"
is that true? I found PHP to by quite easy, looks a lot like AS..how can CF by easier? I guess this is just my opinion. :) Personally I found ColdFusion easy to pick up. I think it might be easier to get started with than PHP, but again that's a subjective viewpoint.
When you compare CF to JavaScript and Perl, that's when you really notice the difference. There's a function on the Churchill site written in JS to get the date. It looks like this:
<script language="JavaScript">
month = Array ("January","February","March","April","May","June","July","August","September", "October","November","December");
var now = new Date();
theDate = now.getDate();
if ((theDate == 1) || (theDate == 31) || (theDate == 21)) theDate += "st";
else if (((theDate > 1) && (theDate < 3)) || ((theDate > 21) && (theDate < 23))) theDate += "nd";
else if (((theDate > 3) && (theDate < 21)) || ((theDate > 23) && (theDate < 31))) theDate += "th";
else if ((theDate == 23) || (theDate == 3)) theDate += "rd";
theDate += " " + month[now.getMonth()];
theDate += ", " + now.getFullYear();
</script> Now a call in ColdFusion to do the same thing looks like this:
<cfoutput>Today's date is #DateFormat(Now(), "mm/dd/yyyy")# </cfoutput> Which one would you choose? :)
Once again though I'll stress that this is my view. PHP is still a great language, and can do a whole load of stuff quickly and easily. :)
lava
March 28th, 2003, 08:07 AM
somehow, I feel that the PHP code you wrote was unnecessarily long...
Kitiara
March 28th, 2003, 08:11 AM
I didn't write that JS date function. An outside company did it a year or so ago. I'm sure there's a better way to do this...
lava
March 28th, 2003, 08:14 AM
whoops... why did I say PHP?
I woke up 2 minutes ago... haha. But wow, that's a long function...
that's one thing I like about VBscript... you can just say:
Response.Write (Now)
Kitiara
March 28th, 2003, 08:51 AM
Probably because that's the format thing I used on it. :)
And you don't even want to ask how much the company paid for that bit of code. Soon as I saw it I thought "hang on a minute". But it does what it's supposed to so they didn't care. Then you see the PHP / CF equivalent and begin to wonder.
lava
March 28th, 2003, 09:47 AM
Believe it or not, I've never done anything in Javascript. But I have a book on it here at work, and I looked it up. try this code:
<script>
now = new Date();
document.write (now.toLocaleString());
</script>
that outputs this:
Friday, March 28, 2003 9:35:55 AM
you can knock off the time if you want to with substring or something like that.
Kitiara
March 28th, 2003, 09:50 AM
Precisely. And this design agency had the gall to charge £2000 for that bit of code I posted up. Two whole grand! And the company paid it!
lava
March 28th, 2003, 09:54 AM
I just love this part of the code...
else if (((theDate > 1) && (theDate < 3)) || ((theDate > 21) && (theDate < 23))) theDate += "nd";
else if (((theDate > 3) && (theDate < 21)) || ((theDate > 23) && (theDate < 31))) theDate += "th";
else if ((theDate == 23) || (theDate == 3)) theDate += "rd";
haha... it's the dumbest thing I've ever seen...
man... they paid 2000 too much...
kirupa
March 28th, 2003, 09:56 AM
Aren't there numerous free scripts on the net that anybody could have found for free and installed to display the date? I think 2000 (about $3500+ USD) is quite a large sum to pay for that.
Cheers!
Kirupa (-:
Kitiara
March 28th, 2003, 09:57 AM
It's so picky... Having to put an extension on to the date... Just adds code. And an array of months... Surely you can get this from the server. But would they listen? Noooo... :sigh:
And you're right, £2000 is a horrendous sum of money to pay for just those few lines of code. I can't believe they fell for it.
lava
March 28th, 2003, 10:01 AM
you don't even need the array of months... toLocaleString() does that for you. But ok, lets suppose you need to have "nd" at the end of the day
else if (((theDate > 1) && (theDate < 3)) || ((theDate > 21) && (theDate < 23))) theDate += "nd";
why didnt they just say,
if (theDate == 2 || theDate == 22)
it's so dumb... maybe they wanted to make it fancier.
Kitiara
March 28th, 2003, 10:02 AM
Maybe they just wanted to make it look more impressive than it actually is, so they could charge more? :sigh:
And this agency is now wondering why we aren't giving a redesign project to them...
lava
March 28th, 2003, 10:04 AM
haha... are you now advising your company on clients?
Kitiara
March 28th, 2003, 10:05 AM
Nope, I'm doing the redesign instead. They worked out that if you have an in-house web developer and designer, you might as well make use of her. :)
I think the design agency are going to be losing one of their big clients. Whoops. :)
lava
March 28th, 2003, 10:12 AM
haha.. that's cool. You should ask for a raise.
Kitiara
March 28th, 2003, 10:15 AM
Actually, I did last week. They're discussing it with HR. :)
Although I think my demand of £35K might be a little too much for someone my age who's only ben here 6 months... :)
lava
March 28th, 2003, 10:35 AM
35K bp's would be about 55K dollars. I'm getting paid only 30,000, which is abotu 20,000 pounds. That's cause I didnt know how much to ask for when they hired me. I just found out that I could be earning around 60K, at least. That's about 38k pounds or so. You should ask for more. (but I dont know how the standard of living is over there, I know your government taxes the hell out of gas)
Kitiara
March 28th, 2003, 10:39 AM
They tax the hell out of <i>everything</i> :sigh:
Most of my money goes on my house. Got a joint mortgage and a lot of decorating. :)
lava
March 28th, 2003, 10:40 AM
yeah, I dont know why taxes are so high over there... and are you guys EVER converting to the euro? I heard things are cheaper in euros than in pounds over there..
Kitiara
March 28th, 2003, 10:42 AM
Most of the country is against the Euro. We like our pounds and pence. I think it was a big enough problem getting us to go metric. :)
Blair wants it, Brown (Chancellor) doesn't, and it's going nowhere fast.
Jubba
March 28th, 2003, 01:31 PM
php for your date:
print date("l, F jS, Y g:i:d a");
outputs:
Friday, March 28th, 2003 10:29:28 am
Marz
March 28th, 2003, 03:09 PM
Gotta love PHP ;) *lol*...
CF... Haven't even dived into it... I never found a use for me to dive in it yet... I've been happy with the way PHP has been treating me... Then again when someone will want a CF enabled front I'll have to learn it *lol*..
playamarz :player:
RenaissanceGirl
March 28th, 2003, 03:51 PM
I've been wanting to learn CF... but as mentioned, a CF enabled server costs extra dough. PHP floats my boat just fine...
Cynegenica
March 28th, 2003, 08:27 PM
ASP is far better Dynamic server content my friend... you need to do some reading!
LOL what a quote. I cant' believe you are comparing the two. One is better at some things, the other is better at others. They are like comparing apples with oranges. hehe. but anyway, i dont want to get into an arguement about the two, to be honest they are miles apart in technology and also in applicability to a situation.
Ok back to the question. most have answered exactly right. The PHP code is Server Side, and HTML is Client side is the most relevant comment. If you know the power of Server side as opposed to client side you can see where PHP is miles ahead of HTML.
However as said by others, it may be over kill for your own site. Whatever the technology... Php, Asp, Html. Dhtml, Flash, Java, whatever... dont use technology for technologies sake. Use what gets the job done. Know your objectives and then customise your solution around those, not around a technology.
RenaissanceGirl
March 28th, 2003, 08:29 PM
Originally posted by Cynegenica
... dont use technology for technologies sake. Use what gets the job done. Know your objectives and then customise your solution around those, not around a technology.
That's excellent... I'm going to be repeating this to others in the future if you don't mind.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.