Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: PHP Error

  1. #1
    New Coder
    Join Date
    Jun 2003
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP Error

    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: http://www.splintercellsource.com/in...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
    Webmaster and Owner
    www.splintercellsource.com
    "I only play in the dark."

  • #2
    New Coder
    Join Date
    Jun 2003
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Very sorry to have posted this, I just figured out what was wrong. Please delete when anyone has a chance.
    -SC Source
    Webmaster and Owner
    www.splintercellsource.com
    "I only play in the dark."

  • #3
    Regular Coder
    Join Date
    May 2002
    Location
    Virginia, USA
    Posts
    621
    Thanks
    0
    Thanked 6 Times in 6 Posts
    before we do, i was wondering...where did you get the wishlist script from?

  • #4
    New Coder
    Join Date
    Jun 2003
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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....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!
    -SC Source
    Webmaster and Owner
    www.splintercellsource.com
    "I only play in the dark."

  • #5
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Eurgh, tabular layout. Anyway, I think I drilled down through your huge amounts of unneccessary code, and:

    Each wish is:
    Code:
    <b>Name:</b>[name]<br><b>Wish:</b>[wish]<br>
    --------------------------
    Instead I'd suggest:
    Code:
    <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.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #6
    Regular Coder
    Join Date
    May 2002
    Location
    Virginia, USA
    Posts
    621
    Thanks
    0
    Thanked 6 Times in 6 Posts
    (the reason I asked, is that I've almost completed a Wishlist script.....built specifically for stuff like Christmas & Birthday).

  • #7
    New Coder
    Join Date
    Jun 2003
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    -SC Source
    Webmaster and Owner
    www.splintercellsource.com
    "I only play in the dark."


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •