- Forums
- Interesting Topics
- PHP Learn How To Make Webpage Using Php Tutorial Guide For Beginers Show Me
This Page Contains information about PHP Learn How To Make Webpage Using Php Tutorial Guide For Beginers Show Me By edwino85 in category Interesting Topics with 0 Replies. [2128], Last Updated: Sat May 18, 2024
edwino85
Tue Feb 06, 2007
0 Comments
863 Visits
ok so you want to learn how to make web pages using php. well, i hope this small tutorial will help. every time you learn a new programming language you want to start with a hello world. so here is what you do.
below i have provided you with php code you can expirement with. usgin html, we will display a complete page using php.
the only thing you will need is to have php, if you have a website but don't have php, you can visit our friends at www.webune.com to signup for php web hosting. we recommend them to all our friends. did you know that wallpaperama is being hosted by webune? we are very please with their service and support.
so here we go. open you text editor, if you are using windows, you can open notepad. copy and paste the following code into notepad:
CODE:
<?php
# use the # to came comments
// or you can use // to make comments
/* you can also us this to make comments */
# Step 1. declare the $string variable. you can change Hello world to whatever you want and it will change the whole page in general
$string = "Hello World";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><? echo $string; ?> </title>
</head>
<body>
<p>Hi,</p>
<h1>This is a <? echo $string; ?> Page</h1><hr>
<p>the value of $string is Hello World so when i do the echo in PHP it tells php to display the value of the variable,</p>
<p>you can also display anyting with echo, like this: echo "Hello World"; (make sure to end the statement with a semilcolon, this is a semicolon ; </p>
<p> </p>
<p align="center"> PHP Sample Code Tutorial By <a href="http://www.wallpaperama.com">wallpaperama.com </a></p>
<p align="center">PHP hosting provide by <a href="http://www.webune.com">Webune.com</a> </p>
</body>
</html>
now that you have copy and pasted the code above save the file as hello-world.php. if you are using notepad, make sure you save it as "hello-world.php" (include the quotes)
now upload to your website with php and watch it in action. study the code and see how interacts with HTHL. It helps alot if you know HTML. if you don't know HTML, i recommend that you start learning HTML before you jump on PHP, otherwise, it will not make so much sense to learn PHP if you don't know HTML. you'll be just wasting your time. so make sure you are familiar with HTML, otherwise, the code i provided above, will not make much sense to you.
hope this helps, you can leave any comments or question.
webmaster