SitePoint Sponsor

User Tag List

Page 3 of 3 FirstFirst 123
Results 51 to 56 of 56

Thread: Script problems

  1. #51
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    im pretty sure it has to do with the mysql query

    cuz i dont think it likes this part of it :

    $query = "INSERT INTO list SET first ='$first', last='$last', email='$email'";

  2. #52
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    could you paste the WHOLE page code html and php. And yes line 14 means html and php i.e. 14th line from the top of the page.

    If you are using 2.2 thats pretty old I think we are on 4.2.2 now? Is that what you meant?

    Sarah
    Regular user

  3. #53
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah i meant 4.2.2 sorry..

    the whole script :

    <html>
    <head>
    <style type="text/css">
    <!--
    a{text-decoration:none; color:#6A1818}
    a:hover{text-decoration:none; color:darkred}
    //-->
    </style>
    </head>


    <?
    $username="username;
    $password="password;
    $database="database";

    $first = $_POST['first'];
    $last = $_POST['last'];
    $email = $_POST['email'];

    mysql_connect(localhost,$username,$password);
    mysql_select_db($database) or die( "Unable to select database");

    $query = "INSERT INTO list SET first ='$first', last='$last', email='$email'";
    mysql_query($query);

    mysql_close();
    ?>

  4. #54
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok i see now i didnt have passwords as strings, that was dumb

  5. #55
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    right okay your form is held on another page - seperate? so instead of using _POST use _GET

    (_POST is when getting details from form using php ON SAME PAGE and _GET is for when you are sending the details to another page)

    try that

    Sarah
    Regular user

  6. #56
    SitePoint Zealot
    Join Date
    May 2002
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey! it works

    i love you all



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
  •