SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help needed with "unexpected T_IF"

    Hi,

    I have the following error:

    Parse error: parse error, unexpected T_IF in d:\Program Files\Abyss Web Server\htdocs\html\guestbook.php on line 10

    I'm trying to execute the following: (password and username have been changed for security)

    <HTML>
    <HEAD><TITLE>SIMPSONVILLE.NET - GUESTBOOK</TITLE><HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <?php
    $username = "root";
    $password = "1234567";
    $host = "localhost";
    $database = "guestbook";
    $dbcnx = @mysql_connect($host, $username, $password)
    if (!$dbcnx) {
    echo( "<P>Unable to connect to the " .
    "database server at this time.</P>" );
    exit();
    }
    ?>

    What am I doing wrong?

    Thanks
    ToCool
    www.simpsonville.net

  2. #2
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Format your code properly.. and your missing a ;

    PHP Code:
    <HTML>
    <HEAD><TITLE>SIMPSONVILLE.NET - GUESTBOOK</TITLE><HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <?php
    $username 
    "root";
    $password "1234567";
    $host "localhost";
    $database "guestbook";
    $dbcnx = @mysql_connect($host$username$password); // missing ; right here <=
    if (!$dbcnx) {
    echo( 
    "<P>Unable to connect to the " .
    "database server at this time.</P>" );
    exit();
    }
    ?>
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  3. #3
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Moved to a more appropriate forum

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  4. #4
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!
    ToCool
    www.simpsonville.net


Bookmarks

Posting Permissions

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