...

View Full Version : PHP Error



SC Source
12-23-2003, 06:06 AM
Ok, I got a problem. I no absolutely nothing about php scripting. I am installing a wishlist on my web site. And am getting errors.

Check it out: www.splintercellsource.com/index.php?page=wishlist/gbook

Try and post a wish. You will get an error. I have no idea what that means. I will give you the file contents:

<?php
$space = "<br>";
$space2 = "\n";
$filename = 'guests.dat';
$date = date("F j, Y, g:i a");
$name = $_POST["name"];
$email = $_POST["email"];
$comments = $_POST["comments"];
$file = file_get_contents($filename);
$fp = fopen($filename, "w");
fwrite($fp, "<b>Date:</b>");
fwrite($fp, $date);
fwrite($fp, $space);
fwrite($fp, "<b>Name:</b>");
fwrite($fp, $name);
fwrite($fp, $space);
fwrite($fp, "<b>Email:</b>");
fwrite($fp, "<a href=mailto:$email>$email</a>");
fwrite($fp, $space);
fwrite($fp, "<b>Comments:</b><Br>");
fwrite($fp, $comments);
fwrite($fp, $space);
fwrite($fp, $space);
fwrite($fp, $file);

fclose($fp);

include ("header.php");
echo "<a href=vbook.php>View the guestbook</a>";

include ("footer.php");
?>

Thats what it says. If someone could please IM me with some help, that would be great.

My screen name for AIM is devsterdude.

Any help or suggestions will be grateful.

Thanx

SC Source
12-23-2003, 06:11 AM
Very sorry to have posted this, I just figured out what was wrong. Please delete when anyone has a chance.

Celtboy
12-23-2003, 06:22 AM
before we do, i was wondering...where did you get the wishlist script from?

SC Source
12-23-2003, 07:06 AM
Damn, I gotta another problem. I will answer your quesiton first. I downloaded a guestbook off of HotScripts and changed the layout and junk around to make it a wishlist. Pretty easy. Sucks because no one ever made a wishlist script.

Well, if you go to http://splintercellsource.com/index.php?page=wishlist/vbook you will see that the text has stretched, not good. And I can't define a friggin width for some reason. Can someone help me. I tried everything. My aim is above. I will give FTP access to check it out.

Thanx!

me'
12-23-2003, 10:24 AM
Eurgh, tabular layout. Anyway, I think I drilled down through your huge amounts of unneccessary code, and:

Each wish is:
<b>Name:</b>[name]<br><b>Wish:</b>[wish]<br>
--------------------------Instead I'd suggest:
<p><h5>Name:</h5>[name]<br />
(we can argue over the semantics of that but I think it will do here)
<h5>Wish:</h5>[wish]</p><hr />Which is better, semantically richer code, and if you want you can specify a width on the <p> element.

Celtboy
12-23-2003, 02:22 PM
(the reason I asked, is that I've almost completed a Wishlist script.....built specifically for stuff like Christmas & Birthday).

SC Source
12-24-2003, 04:57 AM
Thanx alot gentlemen, Your help was excellent and very usful. It works great now and thanx for the nice comments. If anyone in this forum needs someone to tell someone else about your work, I am your man. Webmaster@splintercellsource.com

Thanx again.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum