sobhan 0 Report post Posted October 1, 2005 Nice tutorial! Share this post Link to post Share on other sites
sobhan 0 Report post Posted October 1, 2005 Wow, seems very complicated. Is there a powerful software that let's you create PHP easily. Something easy to use. what's the difference between PHP and CGI? 189492[/snapback] CGI is a Perl (Im am not shure) or Python script. I think its perl! Share this post Link to post Share on other sites
Spectre 0 Report post Posted October 2, 2005 This is getting slightly off topic. But anyway, Perl is a CGI; so is Python. PHP can be run as a CGI, but most people usually favor the module (for security and other reasons - but not all web servers support this). CGI stands for common gateway interface, and is basically a server-side program that the web server can interface with, allowing for certain scripts to be executed on the server. Anyway, thanks for all your comments. Maybe I'll get around to writing up a second part some time. And HmmZ, feel free to expand on it. Share this post Link to post Share on other sites
mendezgarcia 0 Report post Posted October 5, 2005 PHP started as a Perl module. Now it may be installed independently; as a apache mod.A few notes:1. Instead of using <? ?>, which is a shortcut (and may not work in some servers), use <?php ?>2. Try to improve your indentation. 3. There are major differences between the comparision operator "==" (equal) and "===" (identical).For example, "php" == 0 returns true, but "php" === 0 doesn't. Share this post Link to post Share on other sites
grnjd 0 Report post Posted October 5, 2005 thx for the tut, im just starting out so it was very helpful. however, is there a way to make is easier? like some sort of php software? there are like html software and html editing, so there may be a php thinga miggy Share this post Link to post Share on other sites
Gyad 0 Report post Posted October 5, 2005 Wow, this is really complicated stuff. This is a really great tutorial but I think its Aimed more at the users who know the really basic stuff about PHP. I'm not really sure, but I think theres more basic stuff to PHP than what is already stated in this section of the guide. Also, just really curious, but do you actually have to know HTML first to learn PHP? Share this post Link to post Share on other sites
Spectre 0 Report post Posted October 5, 2005 mendezgarcia, I'll assume that was directed at me. PHP started as a Perl module. Now it may be installed independently; as a apache mod.That was a long time ago - when PHP first came about. It moved to an executable CGI after that, and is now available in various forms, including an Apache module (although it is in no way limited to this). 1. Instead of using <? ?>, which is a shortcut (and may not work in some servers), use <?php ?>I do always use <?php ?> in scripts. In the beginning of the tutorial, I noted that anything outside of the <? ?> tags will be ignored - but this isn't unique to PHP. There are numerous scripting engines (some more widely used than otehrs) that use <?(.*?) ?> to determine what should be processed and what shouldn't. It is true, however, that using <?php ?> is best practise and should always be compatible. 2. Try to improve your indentation.Normally, indentation is up to 9 blank spaces, whether they are actually 9 consecutive instances of 0x20 or a single 0x9 (incrementing each level - or least, that's how I do it); IPB trims the character 0x09, and I -think- it trims more than a few consecutive spaces or character 0x20. As such, code in this post is not particularly well indented. That aside, it is only concept code - most of the code posted here would not actually work anyway (or would have very little value) in the form in which it currently exists (eg. '} else { statement; }' - obviously, not a real statement). Structure is not incredibly important in this particular tutorial (and the only reason it matters elsewhere is for ease of readibility, something which, for one reason or another, is not always wanted). 3. There are major differences between the comparision operator "==" (equal) and "===" (identical). For example, "php" == 0 returns true, but "php" === 0 doesn't. I already mentioned this in 'if...then..else'. There are not major differences - the former checks only the value, the latter both value and type (eg. $x == 4 would match a string value of '4'; $x === 4 would not). See: 'It is also possible to set explicit condition requirements by using an additional equals symbol...'. I didn't cover it in great detail, but it was mentioned. Share this post Link to post Share on other sites
Unregistered 015 0 Report post Posted October 5, 2005 Just to answer to those of you who are looking for "php visual programs". There is NO such a thing. PHP is programming language and you can see its results only after execution (somtimes compilation). Anyway, to learn PHP you must learn the language itself, you cant "draw" it or anything like that, just simple coding. And you dont have to know HTML to write PHP code, but it's highly recommended, so you can implement what you create with PHP into the real world project. Share this post Link to post Share on other sites
Sprnknwn 0 Report post Posted October 5, 2005 Wow, I found this tutorial amazing for a beginer like me. I just have bookmarked it because I think it will help me in the future. I?m trying to learn php and although I don?t have too much free time I hope to get it finally. Maybe some day I could make my own scripts without disturbing my friends constantly with code issues. Thanks a lot. Share this post Link to post Share on other sites
DreamCore 0 Report post Posted October 6, 2005 Nice tutorial, I will take my time to read it. A lot of text....I will see If I learn something. Share this post Link to post Share on other sites
mendezgarcia 0 Report post Posted October 12, 2005 That was a long time ago - when PHP first came about. It moved to an executable CGI after that, and is now available in various forms, including an Apache module (although it is in no way limited to this).Yes, I was answering him: PHP started as a Perl module and now MAY be installed as an Apache module.I didn't know IPB would mess the indentation About the equal and identical operators, although they are apparently the same thing, they are very different. There was a security flaw in phpBB (security flaw number 6.57 x 10^6) that was fixed changing == to === Share this post Link to post Share on other sites
Avalon 1 Report post Posted October 12, 2005 I already mentioned this in 'if...then..else'. There are not major differences - the former checks only the value, the latter both value and type (eg. $x == 4 would match a string value of '4'; $x === 4 would not). See: 'It is also possible to set explicit condition requirements by using an additional equals symbol...'. I didn't cover it in great detail, but it was mentioned. 192088[/snapback] I thought I was fairly good with PHP, by no means an expert but knew enough to get by. I learnt something from the tutorial, I wasn't aware of '===' until now. Thanks! Excellent tutorial Spectre, you obviously spent a lot of time putting it together, well done! I hope you decide to complete the "To be continued..." section soon. P.S. While it is true you cannot just preview a PHP script in action in your browser like you can HTML, you can set up your own personal web server with PHP running and test scripts that way. That's what I do, you just need to remember to change the server parameters (if any) in the script, such as connection parameters for a mysql database, when you finally upload to an online server. Share this post Link to post Share on other sites
mendezgarcia 0 Report post Posted October 15, 2005 P.S. While it is true you cannot just preview a PHP script in action in your browser like you can HTML, you can set up your own personal web server with PHP running and test scripts that way. That's what I do, you just need to remember to change the server parameters (if any) in the script, such as connection parameters for a mysql database, when you finally upload to an online server. 194381[/snapback] Yes, use something like XAMPPhttps://sourceforge.net/projects/xampp/ Another create a config file (which will be required every time). For example: define ("MYSQL_USER", "mendez"); and: require 'config.php'; mysql_connect("localhost", MYSQL_USER, ...); Easy... Share this post Link to post Share on other sites
acumentech 0 Report post Posted October 18, 2005 really nice attempt and should be praised. You should also mention some thing about sessions and cookies.thanksacumentech Notice from wassie: please dont quote such long posts Share this post Link to post Share on other sites
tajimd 0 Report post Posted October 20, 2005 This guide is pretty good for me. Actually it has helped me a lot to start in PHP Thanks Spectre . Share this post Link to post Share on other sites