Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Building a PHP website


  • Please log in to reply

#1
mayacrunk

mayacrunk

    Member

  • Member
  • PipPip
  • 31 posts
Hi guyz.

Can anyone here teach me how to build a PHP website? I've been to several PHP tutorial websites but I find it very difficult to follow what the tutorial is actually teaching me. I still fumble at the basic things such as Apache, pHp server and mySQL.

So can anyone out there give me no step by step instructions on how to build a pHp website? I have basic knowledge on building a website and on HTML codes.

Your willingness is very much appreciated.
Thanx.
  • 0

Advertisements


#2
Neil Jones

Neil Jones

    Member 5k

  • Member
  • PipPipPipPipPipPipPipPip
  • 8,476 posts
You could always do what's known as "content wrapping".

Uses technology called PHP. At a very simple level, all you do is make one file for the top half of each page (for example, the headers and site links) and one for the bottom of each page (copyright and contact details for example).

Then you just make separate pages for the bits in between and have a little script that sticks them all together and puts them on the screen for the visitors.

Benefits of all this is, saves time in the long run as once you've converted the pages once, no need to do it again as if or when you decide to change the layout/colours/design, just alter the wrappers and everything else will take care of itself.

Something like this:

Open a new file in Notepad, save it as index.php and put this in it:

<?php
include("header.inc");
?>
<h3>This is the main content of your page</h3>
<p>If you right click me and choose View Source, you'll see that I've stuck three bits of HTML together to make a web page!</p>

<?php
include("footer.inc");
?>


Now make another file called header.inc and put this in it:

<html>
<head>
<title>Test Page Type Thing</title>
</head>
<body>

Finally, make another file called footer.inc and put this in it:

</body>
</html>

Upload all three files to a folder on the server, ensure that they're all in the same folder together and then go to that page on the server.

That's all there is to it. Can be made as simple or as complicated as you like. This is very simple PHP page, but it can get a lot more complicated.
  • 0

#3
mayacrunk

mayacrunk

    Member

  • Topic Starter
  • Member
  • PipPip
  • 31 posts
But the problem now is that I do not have any server. No Apache, my SQL, whatsoever. I've downloaded some files/applications from apache.org and php.net but I dunno how to use it. I've deleted each and everyone of them. So now I'm back to square one.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP