+ Reply to Thread
Results 1 to 9 of 9

Thread: unexpected error

  1. #1
    swirly's Avatar
    swirly is offline x10 Elder swirly is an unknown quantity at this point
    Join Date
    Jul 2005
    Location
    NC
    Posts
    965

    unexpected error

    ok for my site im trying to make a script for people to register and then they can therefore log into my site... but im getting theis error...could you guys take a look at it? or maybe teel me somewhere i can get a script for this kinda stuff cause im new at php and i need to make something for someone to registerand then it lets them login..

    its: www.zerog.x10hosting.com/add_record.php
    Don't go to bed angry, stay awake and plot revenge.

  2. #2
    Torch's Avatar
    Torch is offline x10 Lieutenant Torch is an unknown quantity at this point
    Join Date
    Apr 2006
    Location
    Belgrade, Serbia
    Posts
    317

    Re: unexpected error

    The best solution would be to get a CMS (content management system), since they already have all the functions you likely wanted to make. You have a selection of qite a few of them (ready to install) when you go to Fantastico at your cPanel. I would recommend Drupal, which is very light CMS and the most easly chagable one (you can quite easy make changes to it's coding and add new stuff yourself with a little knowledge). The next good one is Joomla, but for my taste it's too robust.

  3. #3
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: unexpected error

    Can you show some of the script? (Lines 20 - 30 would be nice. )

  4. #4
    swirly's Avatar
    swirly is offline x10 Elder swirly is an unknown quantity at this point
    Join Date
    Jul 2005
    Location
    NC
    Posts
    965

    Re: unexpected error

    Code:
    <A href="mailto:$conn=@masql_connect("localhost">$conn=@masql_connect("localhost", "swirly", "friends")
                                                                              or die("Err:conn");
          #select the specified database
          $rs = @mysql_select_db("swirlys_user", $conn)
                                                                 or die("Err:db")
          #create the query
          $sql="insert into swirlys_info (name, pass, bday, rname, email)
                                  values ( $id, \"$pass\", \"$name\", \$email\", \$bday\" )";
                   #execute the query
    lines 20-30 thanks!
    Don't go to bed angry, stay awake and plot revenge.

  5. #5
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: unexpected error

    How are you outputting this? Is this in an echo, or.. What? It's weird.. Where are your PHP tags?

  6. #6
    swirly's Avatar
    swirly is offline x10 Elder swirly is an unknown quantity at this point
    Join Date
    Jul 2005
    Location
    NC
    Posts
    965

    Re: unexpected error

    yea umm i am using a php book i bought and sooo.....i used the wrong thing...so umm nvm guys sorry...and bryon, you only asked for lines 20-30 so thats what i gave you there is more before and after...
    Don't go to bed angry, stay awake and plot revenge.

  7. #7
    Chris S's Avatar
    Chris S is offline Retired Chris S is an unknown quantity at this point
    Join Date
    Mar 2005
    Posts
    1,036

    Re: unexpected error

    it appears your error is here

    PHP Code:
          $rs = @mysql_select_db("swirlys_user"$conn)
                                                                 or die(
    "Err:db"
    should be

    PHP Code:
          $rs = @mysql_select_db("swirlys_user"$conn)
                                                                 or die(
    "Err:db"); 
    Last edited by Chris S; 05-02-2006 at 08:20 PM.

    I would love to change the world, but they won't give me the source code

  8. #8
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: unexpected error

    Yea I know you only showed me those lines, but it's weird and doesn't make sense the way you have it. You can't just execute/have functions in an echo construct, and it doesn't look like your escaped the PHP tags..

  9. #9
    swirly's Avatar
    swirly is offline x10 Elder swirly is an unknown quantity at this point
    Join Date
    Jul 2005
    Location
    NC
    Posts
    965

    Re: unexpected error

    well that was the wrong code i figured out...but now i got the right one...but its not working....its for people to add names and passwords etc..but its not submitting, and i copied it straight out of the book. did i just spell something. heres the code...
    Code:
    <html>
    <head>
    <title>Add User</title></head>
    <?php
    if( (!$firstname) or (!$lastname)
                                   or (!$username) or (!$password) )
    {
    $form ="Please enter all new user details...";
    $form.="<for action=\"$PHP_SELF\"";
    $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_connect("localhost", "swirlys", "friends")
    or die("Could not connect to MYSQL");
    $db = @mysql_select_db("swirlys_user", $conn)
    or die("could not select database"); 
    $sql = "insert into users
    (first_name,last_name,user_name,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"); }
    }
    ?></body</html>
    Don't go to bed angry, stay awake and plot revenge.

+ Reply to Thread

Similar Threads

  1. Internal Server Error
    By repusmod in forum Free Hosting
    Replies: 16
    Last Post: 06-19-2006, 01:53 PM
  2. {req} Banners
    By SEŅOR in forum The Marketplace
    Replies: 23
    Last Post: 01-05-2006, 03:15 PM
  3. Fusion News error
    By kouhi in forum Free Hosting
    Replies: 5
    Last Post: 12-14-2005, 02:48 PM
  4. Internal Sever Error
    By Gun Mac in forum Free Hosting
    Replies: 0
    Last Post: 09-19-2005, 03:00 PM
  5. Error Type: 500 Internal Server Error
    By TranceOperator in forum Free Hosting
    Replies: 3
    Last Post: 03-12-2005, 08:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers