Você está na página 1de 14

Code for "style.

css"

body { background-color: plum;


font-family: Verdana;
font-size: 16px;
color:gold;
margin: 10px;
padding-bottom:20px;
}

#left { position:absolute;
top:20px;
left:0px;
width:130px;
background:gold;
color:purple;
border:2px solid purple;
}

#mainbody { margin-left:150px;
background:purple;
border:2px solid gold;
}

p,h1 { margin: 10px 10px 10px 10px}

Code for "left.html"

<p>
This left content could be general info that shows on all pages. Or perhaps a menu box - with
either buttons or text links. Use your imagination :) Example Link : <a
href="http://www.maketemplate.com/">
MakeTemplate</a>
</p>

Code for "mainbody.html"

<p align="center">
<img src=http://www.maketemplate.com/images/maketop.jpg>
</p>
<h1 align=center>
Test Heading</h1>
<p>
Just an example of using HTML tags in the input to insert an image. You can put links, images,
etc in this section <p>
<p>
blank space </p>
<p>
blank </p>

Code for "index.php"

<html>
<head>
<title>
Bookmark Title Here </title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="left">
<?php include ("left.html") ?>
</div>
<div id="mainbody">
<?php include ("mainbody.html") ?>
</div>
</body>
</html>

VIP: This last file (index.php) is the main body of the php template. Please note that it 'loads' all
the other 'pieces' into the web page.

By setting up all pages using the code in the index.php file, you control all pages by changing 2
files (left.html and mainbody.html). Then for a new / individual page you change the 'mainbody'
file to mainbody2 (or similar)

PHP Code From: IBDhost

Code for "style.css"

body { background-color: antiquewhite;


font-family: Verdana;
font-size: 12px;
color:brown;
margin:0px;
padding-bottom:20px;
scrollbar-face-color:antiquewhite;
scrollbar-highlight-color:red;
scrollbar-3dlight-color:orange;
scrollbar-darkshadow-color:brown;
scrollbar-shadow-color:pink;
scrollbar-arrow-color:red;
scrollbar-track-color:ivory;
}

.header { height:70px;
background:antiquewhite;
border:1px solid brown;
}

#mainbody { margin-left:120px;
padding-top:5px;
padding-right:20px;
padding-bottom:5px;
padding-left:20px;
background:antiquewhite;
border:0px solid brown;
}

#menu { position:absolute;
top:70px;
left:0px;
width:120px;
background:antiquewhite;
color:brown;
border:1px solid brown;
text-align: center;
}

.menuitem { width:100px;
background:ivory;
color:brown;
font-size:10px;
border:3px solid cornsilk ;
text-align: center;
}

.menuhead { left: 0px;


width:95px;
background:cornsilk ;
color:brown;
border:3px solid cornsilk ;
text-align: center;
font-weight:bold;
font-size:10px;
}

.footer { width:100%;
text-align:center;
margin-top:5px;
padding:1px;
background:ivory;
color:brown;
border:1px solid red;
}

a:hover { font-size:14px;
background-color:yellow;
color:brown}

h1 { font-size:30px}

h2 { font-size:24px}

h3 { font-size:20px}

p,h1,h2,h3 { margin: 10px 10px 10px 10px}

.heading { font-family:Lucida Calligraphy;


font-size:36px;
background-color:yellow;
color:brown;
font-weight:bold;
text-align: center}

Code for "header.html"

<p align="center">
<a href="/index.php">
<img src="http://www.maketemplate.com/images/banner.gif" border="0" alt="pic" />
</a>
</p>

Code for "menu.html"


<p>
&nbsp;</p>
<div class="menuitem">
<div class="menuhead">
Code Generator</div>
<a href="http://www.ibdjohn.com/csstemplate/">
CSS Template</a>
<span class="note">
<br/>
3 Column Layout Example</span>
</div>
<div class="menuitem">
<a href="http://www.ibdjohn.com/csstemplate/">
Example2</a>
<span class="note">
<br/>
blah blah blah blah blah</span>
</div>
<p>
&nbsp;</p>

Code for "homebody.html"

<!-- Note: Everything in this page can be replaced with the text that you want on the main page
i.e. this is the 'homebody.html' page that is included in the template - so this will be the main
page text for the right side -->
<h3 align="center">
Secret Hint:<br />
If PHP Includes Not Required<br />
Use the style sheet code <br />
Use view source (save as :) </h3>
<h2 align="center">
CSS Template<br/>
2 Column <br/>
With Header n Footer</h2>
template space holder to keep template layout to keep template layout more template layout
space blah more template layout space

Code for "footer.html"

<p>
<b>
Footer</b>
This is just a test using plain text in the footer. Of course, the same options - such as image
banner and/or CSS generated banner could have been used here - Same as in heading. Refer to
CSS style sheet to see how the header, footer, heading class are used to control these two files.
</p>

Code for "index.php"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>
Bookmark Title Here </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noarchive" />
<meta name="keywords" content=" Insert keywords - SOME search engines still use
keywords" />
<meta name="description" content=" Description is used by some search engines" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="header">
<?php include ("header.html") ?>
</div>
<div id="menu">
<?php include ("menu.html") ?>
</div>
<div id="mainbody">
<?php include ("homebody.html") ?>
</div>
<div class="footer">
<?php include ("footer.html") ?>
</div>
</body>
</html>

VIP: This last file (index.php) is the main body of the php template. Please note that it 'loads' all
the other 'pieces' into the web page i.e. the external style sheet and the php include files are the
'pieces'.

By setting up all pages using the code in the index.php file, you control all pages by changing 3
files (header, menu, footer). Then for individual pages you change the 'body' file (such as
homebody, secondpagebody, etc). You also control the look n feel on all pages just by changing
the external style sheet (style.css) file

P.S. Of course, you must have a host (such as IBDhost) that allows php to take advantage of the
'power' of the includes. However, if you just need the template code without using php / includes,
just use view source and copy all the code.

Code for "headstyle.css"

#header { width:100%;
background:blue;
margin:0px;
padding:0px;
}

#leftbar { float:left;
width:40%;
height:30px;
background:blue;
text-align:right;
}

#rightbar { float:left;
width:60%;
height:30px;
background:aqua;
text-align:center;
}

#bar { width:100%;
background:blue;
}

a { font-family:Arial;
font-size:16px;
background-color:aqua;
color:darkblue;
font-weight:bold;
vertical-align:text-bottom;
}

a:hover { font-family:Lucida Calligraphy;


font-size:ahoversize1;
background-color:yellow;
color:darkblue;
}
Code for "header.html"

<div id="header">
<div id="leftbar">
<img src="http://maketemplate.com/header/aquat.gif" border="0" width=55 height=30 />
</div>
<div id="rightbar">
<a href="">
Optional Link</a>
&nbsp; &nbsp; &nbsp; <a href="">
Optional Link</a>
</div>
</div>
<div id="bar">
<img src="logo.gif" width="100" height="50" border="0" align="left" />
<img src="eagle.gif" width="240" height="91" border="0" align="left" />
<img src="river.jpg" width="300" height="91" border="0" align="right" />
</div>
<div id="header">
<div id="leftbar">
<img src="aqua.gif" border="0" width=55 height=30 />
</div>
<div id="rightbar">
<a href="">
<img src="back.gif" border="0" width=128 height=23 />
</a>
&nbsp; &nbsp; <a href="">
<img src="back.gif" border="0" width=128 height=23 />
</a>
</div>
</div>

Code for "test.php"

<html>
<head>
<title>
Favorites Title Here </title>
<link rel="stylesheet" type="text/css" href="headstyle.css">
</head>
<body>
<?php include ("header.html") ?>
</body>
</html>

VIP: This last file (test.php) is a temporary php include setup which uses the css (headstyle.css)
file and the 'include' (header.html) file for the body. In 'real life' the include file (header.html)
would be a copy n paste operation - for the 'body' of your existing page. The external style sheet
(headstyle.css) would be added to the head section, with code like this:

<link rel="stylesheet" type="text/css" href="headstyle.css">

Of course, additional style elements would be recommended for a full external style sheet.
Examples of other style sheets are shown on this website and/or some of the 'more tutorial' sites
shown in the menu.

<style type="text/css">

<!--

body {

scrollbar-face-color:fuchsia;

scrollbar-highlight-color:yellow;

scrollbar-3dlight-color:orange;

scrollbar-darkshadow-color:darkblue;

scrollbar-shadow-color:gray;

scrollbar-arrow-color:yellow;

scrollbar-track-color:aqua;

-->

</style>
Feedback Form Code / Instructions

The source code for the two files (feedback.php and feedout.php) is shown below. Copy and
paste the feedback.php into your existing php page. Then copy and paste the output and Thank
You page into your existing Thank You page / template.
BTW: In the feedout.php file you must enter your 'from' and 'to' email address information.
VIP: The web host must have PHP safe mode OFF and the mail() function is required.
If not sure about Safe Mood, BE SURE to make and run a test.php (see notes)

feedback.php
<form action="feedout.php" method="post">
<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
<h2 align="center">Feedback Form</h2>
<p>
All input is blah blah ...... </p>
<p>Send Data to: <select name="attn" size="1">
<option value=" MT General Email ">General Email</option>
<option value=" MakeTemplate Owner ">Owner of MakeTemplate</option>
<option value=" Technical Support ">Technical Support</option>
<option value=" PHP Codemaster ">PHP Codemaster</option>
</select>
<br />
Name: <input type="text" name="nameis" size="20" /> Email:<input type="text" name="visitormail"
size="20" />

<br/> Overall Rating:<br/> [<input checked="checked" name="rating" type="radio" value="good" />


Good]   [<input name="rating" type="radio" value="bad" /> Bad]   [<input name="rating" type="radio"
value="ugly" /> Ugly]
</p>
<p> Request additional features for a feedback tutorial:<br />
<input type="checkbox" name="emailvalidation" value="y" /> Email 'format' Validation - check @<br />
<input type="checkbox" name="fieldvalidation" value="y" /> Required Form Field Validation.<br />
<input type="checkbox" name="htmlcontrol" value="y" /> More intergratd HTML (in form).<br />
<input type="checkbox" name="phpform" value="y" /> Improved PHP form script generator.<br />
<input type="checkbox" name="htmlform" value="y" /> A complete HTML form generator. <br />
</p>
<br />
<h3 align="center">General Comments</h3>
<p align="center">
<textarea name="feedback" rows="6" cols="30">Notes n comments here</textarea>
</p>
<hr />
<p align="center">
<input type="submit" value="Submit Feedback" />
</p>
<p>
<a href="http://www.maketemplate.com/feedback/"> Feedback Source Code </a>
</p>
</form>

feedout.php
<h3 align="center">Thanks for your Feedback </h3>
<!-- VIP: change YourEmail to your real email -->

<?php

$ip = $_POST['ip'];
$httpagent = $_POST['httpagent'];
$httpref = $_POST['$httpref'];
$nameis = $_POST['nameis'];
$visitormail = $_POST['visitormail'];
$feedback = $_POST['feedback'];
$rating = $_POST['rating'];
$emailvalidation = $_POST['emailvalidation'];
$fieldvalidation = $_POST['fieldvalidation'];
$htmlcontrol= $_POST['htmlcontrol'];
$phpform = $_POST['phpform'];
$htmlform = $_POST['htmlform'];
$attn = $_POST['attn'];

if (eregi('http:', $feedback)) { die ("Do NOT try that! ! "); }

if((!$visitormail == "") && (!strstr($visitormail,"@") || !strstr($visitormail,".")))


{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$tellem = "<h2>Feedback was NOT submitted</h2>\n";
}

if(empty($nameis) || empty($feedback) || empty($visitormail)) {


echo "<h2>Use Back - fill in all fields</h2>\n";
}

echo $tellem;

if ($emailvalidation == "y") {
$req1 = "Email format Validation \n" ;
}

if ($fieldvalidation == "y") {
$req2 = "Required Form Field Validation \n";
}
if ($htmlcontrol == "y") {
$req3 = "More intergratd HTML (in form) \n";
}
if ($phpform == "y") {
$req4 = "Improved PHP form script generator \n";
}
if ($htmlform == "y") {
$req5 = "A complete HTML form generator \n";
}
$req = $req1 . $req2 . $req3 . $req4 . $req5;

$todayis = date("l, F j, Y, g:i a") ;

$attn = $attn;
$subject = $attn;

$feedback = stripcslashes($feedback);

$message = " $todayis [EST] \n


Attention: $attn (Rating: $rating) \n
From: $nameis ($visitormail)\n
Requested:
$req \n
Feedback: $feedback \n
Additional Info : IP = $ip \n
Browser = $httpagent \n
Referral = $httpref
";

$from = "From: $visitormail\r\n";

mail("YourEmail", $subject, $message, $from);

$screenout = str_replace("\n", "<br/>", $message);


?>

<p align="center">

<?php echo $screenout ?>

</p>

Note: Some web host block the mail() function if the 'YourEmail' does not have your domain. In
other words: sometimes, the domain email address must be used - or the mail() function will not
work.

Check Safe Mode.


How to check that PHP is running and that Safe Mode is OFF !

Use notepad (or other text editor) create an ASCII text file with this line:

<?php phpinfo() ?>

Save that file as test.php


Must be a text file with .php extension - NOT test.php.txt

>Upload test.php (as ASCII file) - to the server

Run test.php from the browser


e.g. www.domain.com/test.php
This will display all the php settings. Use 'find' to check the 'safe' mode section to make sure it is
OFF. e.g. look under the Configuration PHP Core Table in the Directive column to see that safe
mode is off.

Sample code - converts form variables to Superglobals (for all forms):

<?php
$ip = $_POST['ip'];
$httpagent = $_POST['httpagent'];
$httpref = $_POST['$httpref'];
$nameis = $_POST['nameis'];
$visitormail = $_POST['visitormail'];
$feedback = $_POST['feedback'];
$rating = $_POST['rating'];
$emailvalidation = $_POST['emailvalidation'];
$fieldvalidation = $_POST['fieldvalidation'];
$htmlcontrol= $_POST['htmlcontrol'];
$phpform = $_POST['phpform'];
$htmlform = $_POST['htmlform'];
$attn = $_POST['attn'];
?>

<embed type="application/x-shockwave-flash" flashvars="audioUrl=MP3_FILE_URL"


src="http://www.google.com/reader/ui/3523697345-audio-player.swf" width="400" height="27"
quality="best"></embed>

Você também pode gostar