- Forums
- PHP
- How Does A PHP Script Look Like? Give Example Script With Code
this is a very simple description of how a PHP script file looks like, it shows examples of PHP code and how to use it with in your HTML code [1024], Last Updated: Sat May 18, 2024
webmaster
Mon May 07, 2007
3 Comments
1817 Visits
here is a simple PHP script that will display today's date on your browser
first step is to open your text editor. you can use notepad if you are using windows.
then copy and paste this code:
<!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>Displaying Today's Date</title>
</head>
<body>
<h3 align="center">Displaying Today's Date Script by Wallpaperama </h3>
<hr>
<p>Today's Date is : <?php print(date("1 f d, Y")); ?>
</p>
<p> </p>
<p align="center">PHP Web Hosting Provided by <a href="http://www.webune.com">Webune.com</a> </p>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.01 transitional//en"
" w3.org/tr/html4/loose.dtd">
<ht http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>upl php</title>
</head>
<body> = "uploads/";
$target_path = $target_path . basename( $_files['uploadedfile']['name']
$target_path = "uploads/";
$target_path = $target_path . basename( $_files['uploadedfile']['name']
if(move_uploaded_file($_files[ $target_path)) {
echo "the file ". basename( $_files['uploadedfile']['name']
" has been uploaded";
} else{
echo "there was an error uploading the file, please try again!";
}
</body>
</html