10 Replies - 2682 Views - Last Post: 10 October 2010 - 02:17 AM

#1 jin0616  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 12-June 09

Difference between PHP and HTML and creating a website

Posted 07 October 2010 - 03:55 AM

Hi,
I am trying to practice creating a website offline.
How do I start?
Do I have to use apache?
If I do, how do I start?
and also, I have been learning a bit of php and html.
What actually is the difference?
can I make a website just using one of them or do I need both or them?
and if I need both of them, when do I use php and when do I use html?
because I think php can do all the things that html do. (I might be wrong)

thanks

and also javascript

This post has been edited by jin0616: 07 October 2010 - 03:58 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Difference between PHP and HTML and creating a website

#2 Brewer  Icon User is offline

  • Awesome
  • member icon

Reputation: 179
  • View blog
  • Posts: 1,044
  • Joined: 14-June 10

Re: Difference between PHP and HTML and creating a website

Posted 07 October 2010 - 04:46 AM

If you want to use PHP, then yes, I would recommend getting Apache. This will allow you to view PHP functions locally, rather than having to upload the newest revision of your files to the web to view them. This is especially helpful for small changes.

I will also recommend W3Schools. W3Schools is a great resource no matter what your skill level is.
Was This Post Helpful? 1
  • +
  • -

#3 husseycoding  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 52
  • View blog
  • Posts: 174
  • Joined: 23-June 10

Re: Difference between PHP and HTML and creating a website

Posted 07 October 2010 - 07:53 AM

Hi jin0616,

If you are just starting out I would recommend getting to grips with initially HTML and CSS, then when you feel competent with those, you can expand that to Javascript, and then further down the line consider PHP and MySQL.

Until you want database integration you are unlikely to need to delve into PHP, but when you do you will need some kind of web server running if you want to work locally. HTML, CSS and Javascript however are all executed by your browser so you can work with these languages locally and don't need a web server running.
Was This Post Helpful? 0
  • +
  • -

#4 jin0616  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 12-June 09

Re: Difference between PHP and HTML and creating a website

Posted 07 October 2010 - 05:12 PM

Thanks for the reply
Was This Post Helpful? 0
  • +
  • -

#5 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1368
  • View blog
  • Posts: 3,445
  • Joined: 28-November 09

Re: Difference between PHP and HTML and creating a website

Posted 08 October 2010 - 09:04 AM

Look into XAMPP, it automatically installs PHP, FTP, Apache, and SQL as well as a few other goodies.

This post has been edited by Lemur: 08 October 2010 - 05:50 PM

Was This Post Helpful? 0
  • +
  • -

#6 nooblet  Icon User is offline

  • D.I.C Addict

Reputation: 120
  • View blog
  • Posts: 541
  • Joined: 12-March 10

Re: Difference between PHP and HTML and creating a website

Posted 08 October 2010 - 05:33 PM

View PostLemur, on 08 October 2010 - 08:04 AM, said:

XAMPP


Fixed... You want XAMPP or MAMPP if you're on Mac.
Was This Post Helpful? 0
  • +
  • -

#7 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1368
  • View blog
  • Posts: 3,445
  • Joined: 28-November 09

Re: Difference between PHP and HTML and creating a website

Posted 08 October 2010 - 05:50 PM

View Postnooblet, on 08 October 2010 - 05:33 PM, said:

View PostLemur, on 08 October 2010 - 08:04 AM, said:

XAMPP


Fixed... You want XAMPP or MAMPP if you're on Mac.


My bad mate.
Was This Post Helpful? 0
  • +
  • -

#8 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,232
  • Joined: 08-June 10

Re: Difference between PHP and HTML and creating a website

Posted 09 October 2010 - 12:10 AM

View Postnooblet, on 09 October 2010 - 12:33 AM, said:

or MAMPP if you're on Mac.

Mac comes with Apache and PHP by default, all you need is a MySQL/PostgreSQL database at most (or youre using SQLite)
Was This Post Helpful? 0
  • +
  • -

#9 nooblet  Icon User is offline

  • D.I.C Addict

Reputation: 120
  • View blog
  • Posts: 541
  • Joined: 12-March 10

Re: Difference between PHP and HTML and creating a website

Posted 09 October 2010 - 11:53 AM

View PostDormilich, on 08 October 2010 - 11:10 PM, said:

View Postnooblet, on 09 October 2010 - 12:33 AM, said:

… or MAMPP if you're on Mac.

Mac comes with Apache and PHP by default, all you need is a MySQL/PostgreSQL database at most (or you’re using SQLite)


Right, but I still prefer MAMPP. There are a few advantages I prefer in having MAMPP vs the built in.

This post has been edited by nooblet: 09 October 2010 - 11:53 AM

Was This Post Helpful? 0
  • +
  • -

#10 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,232
  • Joined: 08-June 10

Re: Difference between PHP and HTML and creating a website

Posted 10 October 2010 - 02:10 AM

View Postnooblet, on 09 October 2010 - 06:53 PM, said:

Right, but I still prefer MAMPP. There are a few advantages I prefer in having MAMPP vs the built in.

out of personal interest, what would those be? (Im running my development environment via MacPorts)
Was This Post Helpful? 0
  • +
  • -

#11 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5310
  • View blog
  • Posts: 27,210
  • Joined: 10-May 07

Re: Difference between PHP and HTML and creating a website

Posted 10 October 2010 - 02:17 AM

View Postjin0616, on 07 October 2010 - 04:55 AM, said:

I am trying to practice creating a website offline.

The one thing no one has touched on here, that could (& most likely will) throw you off is the order in processing.

You have Apache, this is software that runs on a webserver. It listens to requests made on port 80 (by default). This can take place on an internal (non-routable) network, or an external (routable) ip address.

So your web server receives a request. It now processes any PHP code, if you have it in your code. The web server now takes the output from the PHP processor & sends the HTML to the viewers web browser. At this point the html headers are created, all variables have been output as text, & there is no longer any PHP code, the web site is now viewable.

The viewer receives the HTML output from the webserver, & it is loaded into their browser. Their browser loads the HTML code & executes any css & Javascript at this time, displaying the website on the browser.

The reason why this is important is because you need to know what code has access to what code. Javascript & PHP can not & do not directly function together. PHP is a server side language & the browser can not function with it. In the same aspect, Javascript is executed by the browser, & can not function with the server or server side languages.

Hopefully this saves you from a few pit-falls.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1