putting my guestbook in a styled box

hi guys i just wondered if you could help me im new to php and i just want to put this code into the products box i have defined at the bottom i really dont get how to stryle php to look like html pleae can you help

thank you

Sign Discussion Board

<img src=“guestbook.png” align=“middle” alt=“advert”" width=“200” height=“50”/>

<?php $self = $_SERVER['PHP_SELF']; $name = $_POST['name']; $email = $_POST['email']; $comments = $_POST['comments']; $submit = $_POST['submit']; #the html form $form = ""; $form.= "Name:
"; $form.= "Email:
"; $form.= "Comments:
"; $form.= "$comments
"; $form.= " "; #on first opening display the form if( !$submit) { $msg = $form; } else #redisplay a message and the form if incomplete if( !$name or !$email or !$comments) { $msg = "Please complete all fields

"; $msg.= $form; } else #add the form data to the guestbook database table { #connect to MySQL $conn = mysql_connect("localhost", "****","******") or die("Count not connect to database"); #select the database $rs = mysql_select_db("ewood",$conn) or die ("Could not select database"); #create the SQL query if($name and $comments) { $sql = "insert into guestbook (name,email, comments) values ("$name","$email","$comments")"; $rs = mysql_query($sql,$conn) or die ("Could not execute SQL query"); } #confirm the entry and display a link to view guestbook if($rs) { $msg = "

Thank you - your entry has been saved.

"; $msg.= "

"; $msg.= "View My Guestbook

"; } } echo($msg); ?>

Hello,
Either I’m confused or you’re confused :). You don’t ‘style’ a page with php. All the normal HTML style rules apply. You just need to either update your .css file and include the class statements with HTML tags (

for example) or just with the style attribute directly.

cheers mate makes more senses but im still stuck on how to actually do that lol

I suggest reading through this web page:
http://www.w3.org/TR/html401/present/styles.html
It’s provides the basics for setting up a css stylesheet and tying it into your webpage.

On a side note you might also go and install the firefox add on firebug. It is a tool for debugging web pages. You can use the inspect function to select a particular page element and it will display the style elements associated with it. very very handy.
Best of luck

Sponsor our Newsletter | Privacy Policy | Terms of Service