Parse error

  • 18 years ago

    Hi, i'm writing an adding user script but get this error



    Parse error: parse error in /home/virtual/site106/fst/var/www/html/x/add_user.php on line 225


    this is the script


     <?php
     if( (!$firstname) or (!$lastname)
                 or (!$username) or (!$password) )
     
      {    $form ="Plese Enter All New User Details....";    
       $form.="<form action=\ "$PHPSELF\"";                    #THIS IS LINE 225
       $form.=" method=\ "post\">First Name: ";
       $form.="<input type=\"text\" name=\"firstname\"";
       $form.=" value=\"$firstname\"><br>Last Name: ";
       $form.="<input type=\"text\" name=\"lastname\"";
       $form.=" value=\"$lastname\"><br>User Name: ";
       $form.="<input type=\"text\" name=\"username\"";
       $form.=" value=\"$username\"><br>Password: ";
       $form.="<input type=\"text\" name=\"password\"";
       $form.=" value=\"$password\"><br>";
       $form.="<input type=\"submit\" value=\"Submit\">";
       $form.="</form>";
       echo($form);
       }
         else
      {
      $conn = @mysql("localhost","lucac","arsenal")
           or die("could not connect to MYSQL");
        $db = @mysql
    selectdb("LUCACCOM",$conn)
         or die("could not connect to database");
        $sql = "insert into users
           (first)name,lastname,username,password) values
           (\"$firstname\",\"$lastname\",\"$username\",
               password(\"$password\") )";
       $result = @mysql_query($sql,$conn)
        or die("could not execute query");
       if ($result) {echo("New User $username Added To X-Dimension.co.uk");
       }    


       ?>


    Thanks

  • 18 years ago

    try

    Code:
    $form.='<form action=\ "'.$PHP_SELF.'\"';


    (dunno y the other one shouldn't work... it may be a problem elsewhere that shows up there)


    [a tip.... on the line with the die statement and other lines that are outputting static text to the browser, try to use single quotes not double ones, then php wont bother looking for variables to replace and evaluate.... then your code will be much quicker ]

  • 18 years ago

    i think the most likely reason is the space between \ and " before $PHP_SELF.



    $form.="<form action=\"$PHP_SELF\"";

  • 18 years ago

    hehe i didnt notice that!


    (that'll teach me to try and offer advice whilst my mind's on A level french..... )

  • 18 years ago

    thanks guys i worked it out it was


    $form .= "<form action=$PHP_SELF";


    worked
    thanks alot for your time


    Bris


    I would love to chat to you guys in IRC or MSN sometime
    my MSN = Luca_cc@hotmail.com
    irc = quakenet #x-dimension


    Thanks Again

  • 18 years ago

    also who made this forum or where can i download a copy for my website. one of the best i've seen


    Bris

  • 18 years ago

    Bris; I wrote the forum, but its not currently available for download. On my next vacation from uni, i am planning to rewrite all the code behind developer fusion to make it more extensible so that the code can be sold on for anyone else who wants to use bits of it.

  • 18 years ago

    well good job, Would you install this forum on my site? or could i be  a beta tester for it?
    to tell the truth i think it's the best forum i have seen so fast and looks great


    Please contact


    Bris

  • 18 years ago

    sssccuuuhhh



    (how do you spell that noise you make when you mean that someone's sucking up??)

  • 18 years ago

    Sucking up lol, whats wrong you jellous? the thing is i Appreciate a good program when one is written.


    Bris

  • 18 years ago

    the word you're looking for is jealous




    hehehe only pulling ur leg no offence mate

  • 18 years ago

    hey paulfp nice site that help charity,


    just gotta click on the buttons and it clicks loads of banners on other sites have a look


    http://www.greedyfools.com/articles/9/2


    bris

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” - Tom Cargill