Chief 30 Report post Posted September 3, 2010 (edited) So, not knowing PHP has been holding me back quite a bit on some of my projects. Now that I'm learning it, I can progress on some of my more awesome websites, and pwn everyone lololol! So, today, 9/3/2010, this is my first bit of php: <?php echo "Hello World."; ?> <?php echo "This is my first PHP!"; // this is a line comment /* this is a comment block */ ?> <?php $txt="Hello Variable!"; $x=16; ?> <br /> <?php echo $txt; ?> Doesn't do much, only shows some text. But, Its pretty dang easy! edit, here's more! <br /> <?php echo strlen("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); ?> <br /> <?php echo $x+3; ?> <br /> <?php if($d=="Fri")echo"Have a nice lulz weekend!"; if($m=="Sep")echo"SEPTEMBER!"; if($y=="2010")echo"The Year is 2010"; ?> <br /> Today's date is <?php echo $d; echo ", "; echo $m; echo "/"; echo $n; echo "/"; echo $y; ?> this is what all of that looks like: Hello World. This is my first PHP! Hello Variable! 26 19 Have a nice lulz weekend!The Year is 2010 Today's date is Fri, 09/03/2010 Edited September 3, 2010 by Chief Share this post Link to post Share on other sites
Kiriashi 117 Report post Posted September 3, 2010 : o Pretty cool, matie. Now let's see you make something awesome for our site. :P What are you learning PHP with? Any books in particular? Share this post Link to post Share on other sites
Chief 30 Report post Posted September 3, 2010 No book, just w3schools.com Share this post Link to post Share on other sites
rgangsta 43 Report post Posted September 3, 2010 No book, just w3schools.com That's cool. I used that website to learn HTML. I'm not fully good at it but I know a few things. :biggrin_002: Share this post Link to post Share on other sites
CrimsonInferno 35 Report post Posted September 3, 2010 Wow, nice work, Chief! Keep practicing and training and you'll be a master in no time! :D :alright: Share this post Link to post Share on other sites
Marked 197 Report post Posted September 4, 2010 I quickly gave up on w3schools, the exact tuts you're doing, but I occasionally use the site for reference. I like messing with Php and MySQL. Try this doing this, without trying to comprehend what it does: <?php $y=0; while($x == $x) { $y++; echo $y.'<Br />'; } ?> Share this post Link to post Share on other sites
Chief 30 Report post Posted September 4, 2010 you poop face... I tried to figure out what it did, and all I could come up with is that it made something increase via "$y++"... almost crashed my browser, lol Share this post Link to post Share on other sites
Marked 197 Report post Posted September 4, 2010 Hehe. Mine almost crashed at around 50,000. :) The ++ thingy is pretty useful though. Its common to see $counter=0 followed by a while loop containing $counter++. You know how the news system on the homepage has the avatar on the left, then right, the left etc. That's partly how its done. Another use is the ranks created in the Hall of Fame. I'll try think of another way to crash your browser :) 1 CrimsonInferno reacted to this Share this post Link to post Share on other sites
Chief 30 Report post Posted September 4, 2010 you should post some of your useful snippets so I can learn with some logical code that actual does things, lol Share this post Link to post Share on other sites
clone1018 4 Report post Posted September 4, 2010 Just stop. W3Schools is great for learning HTML. But if you really want to learn PHP learn PHP OOP. Share this post Link to post Share on other sites
Marked 197 Report post Posted September 4, 2010 I'm pretty sure you need to know PHP before doing it in OOP. I didn't quite get far enough to learn it but I know its objects and classes and things. I was going to begin OOP on my exam tracker website on your hosting service Clone, but for some reason it does not seem to be working. But that's another issue. I would like to continue using the hosting service if possible however. Anyway, here's a nice little tutorial on OOP, when you're ready of course Chief: http://www.webdevrefinery.com/forums/topic/2525-getting-started-with-object-oriented-php/ Share this post Link to post Share on other sites
Chief 30 Report post Posted September 4, 2010 Just stop. W3Schools is great for learning HTML. But if you really want to learn PHP learn PHP OOP. gtfo, lulz. w3schools is great for everything. I'ma continue to use it regardless of your irrelevant advice. I don't even know what OOP is. Marked just said you needed to know PHP before OOP anyways. hrmmph. Share this post Link to post Share on other sites
Dark Den 4 Report post Posted September 4, 2010 Good luck chief scripting was way to complicated for me, i might give it another go later though. I learn abit of HTML at school and i found it easy :sweatdrop: but forgot most of it now PHP seems deathly hard looking at the code posted here and OOP just looks like a beggining of OOPS for me Share this post Link to post Share on other sites
rgangsta 43 Report post Posted September 4, 2010 lmao. I went to the website in Marked's post. When I went to the homepage, it said this: Join us to become a better dev.Or leave, and you'll suck at web code. My mom left and she can't make a website for beans. True story. lol. Sorry to be off topic. Share this post Link to post Share on other sites
Marked 197 Report post Posted September 5, 2010 I'ma continue to use it regardless of your irrelevant advice. He was just giving you advice.. its not necessarily irrelevant. @rgangsta: that site has some excellent coders on it. All my topics get answered and pretty quickly too. Anyway Chief. I'm thinking about writing a tutorial, one that covers basically how to create a recent posts module/hook as on our homepage and forums index. It's main emphasis will be PHP and MySQL. What do you think? Share this post Link to post Share on other sites
Chief 30 Report post Posted September 5, 2010 DOOOO ITT!! My main focus of learning will be on mysql, so I want a lot on it. Share this post Link to post Share on other sites
Marked 197 Report post Posted September 6, 2010 I have started, but it will take some time to write up I think. I have constructed a sample database and just started writing the first steps of the tut. I'll try and finish it today, but no promises. EDIT: http://www.rmxpunlimited.net/forums/topic/5581-creating-a-recent-posts-modul/ Goodluck with it, not sure who you will go. You may want to save it for later or something... Share this post Link to post Share on other sites