Author Topic: PHP First Page [EASY]  (Read 461 times)

Winning

  • Hero Member
  • *****
  • Posts: 1632
  • Reputation: 26
  • I think I saw this in a movie
  • Computers: Toshiba Thrive Tablet
  • iDevices: iPod touch 4G
PHP First Page [EASY]
« on: August 28, 2012, 01:09:10 pm »
Your first sample page

Ok now that you have your development area set up (if you don't go here- https://ininjas.com/forum/index.php?topic=4146.0) it's time to make your first sample page, which much like any programing language, will be a 'hello world' page. Open up you're text editor and create a new project/ file. For eclipse you start a new php project, call it simple_project then a new file in the project. For this tutorial we will name the file "test.php" which will open up to a blank file. In the file we will put this code:
<?php
   echo "Hello, World!";
?>


(note: for some people this script will not work, if that is the case, you can always writhe a simple HTML script to say hello world that would look something like this:
<html>
  <head>
    <title>HelloWorld</title>
  </head>
  <body>
    <h1>HelloWorld</h1>
  </body>
</html>


Save the file then open up XAMPP control panel and turn on MySQL and apache. Next, open up your browser and go to http://localhost/simple_project/test.php

If the page says 'hello world' congratulations the page is working and you have your first PHP file set up.

Once again all credit for this goes to the book PHP for absolute beginners by Jason Lengstorf. I couldn't have made this or learned PHP without that.
« Last Edit: August 28, 2012, 06:25:23 pm by Winning »

[null]

  • Hero Member
  • *****
  • Posts: 646
  • Reputation: 42
  • the halloween jack is a real cool cat
  • Computers: I have a PC running Windows 7 that was built by my uncle. I also have a Newsmy T3 Android Tablet.
  • iDevices: iPod Touch 4G
Re: PHP First Page [MEDIUM]
« Reply #1 on: August 28, 2012, 03:05:59 pm »
Awesome, I had no idea you made php tuts!! Great job and I look forward to reading more! +1
__  __           ___    ___          
/\ \/\ \         /\_ \  /\_ \          
\ \ `\\ \  __  __\//\ \ \//\ \     
 \ \ , ` \/\ \/\ \ \ \ \  \ \ \          
  \ \ \`\ \ \ \_\ \ \_\ \_ \_\ \_
   \ \_\ \_\ \____/ /\____\/\____\
    \/_/\/_/\/___/  \/____/\/____/

Ironman

  • Administrator
  • Hero Member
  • *****
  • Posts: 5096
  • Reputation: 251
  • Badges:
  • Computers: ASUS UL50VT
  • iDevices: iPhone 5, iPhone 4S, iPhone 4, iPhone 3GS
Re: PHP First Page [MEDIUM]
« Reply #2 on: August 28, 2012, 05:38:36 pm »
Another good one dude!! +1
Click for How to Add Our Repo
If you're going to ask questions....
At least make them good ones.

Knowledge is the one thing that can never be taken from you

A3MIRAL

  • Leader
  • Hero Member
  • *****
  • Posts: 2899
  • Reputation: 105
  • A3MIRAL -- Reporting for Duty
    • A3MIRAL
  • Badges:
  • Computers: Dell XPS15 (6 GB ram, Core i7 @ 2.0 GHz, 750 GB HDD @ 7200 RPM)
  • iDevices: iPod touch 3G 32GB, iPhone 5 32GB
Re: PHP First Page [MEDIUM]
« Reply #3 on: August 28, 2012, 06:22:40 pm »
Might i suggest changing the [MEDIUM] ? This was easier than the first tutorial. Also, PHP is my best language by far, so I can help you sometimes or w/e.

Winning

  • Hero Member
  • *****
  • Posts: 1632
  • Reputation: 26
  • I think I saw this in a movie
  • Computers: Toshiba Thrive Tablet
  • iDevices: iPod touch 4G
Re: PHP First Page [EASY]
« Reply #4 on: August 28, 2012, 06:28:19 pm »
You have no idea how many times I read that while wondering why you wanted to change it to medium when it already was.

Yah I changed it to easy, my original reasoning was that this wasn't just downloading and installing it was actually some scripting but looking back your probably right.

Thanks for the offer I'm realitivly new myself and I would love any help I can get.

Don't like seeing ads? Click here to register!

A3MIRAL

  • Leader
  • Hero Member
  • *****
  • Posts: 2899
  • Reputation: 105
  • A3MIRAL -- Reporting for Duty
    • A3MIRAL
  • Badges:
  • Computers: Dell XPS15 (6 GB ram, Core i7 @ 2.0 GHz, 750 GB HDD @ 7200 RPM)
  • iDevices: iPod touch 3G 32GB, iPhone 5 32GB
Re: PHP First Page [EASY]
« Reply #5 on: August 28, 2012, 06:29:54 pm »
Ok, just let me know. I have picked up some useful tricks over the past couple of years, and have been using it a lot recently (SMF mods) so I am "in shape"