Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28
  1. #11
    Join Date
    Jul 2004
    Location
    N29° 22.725' X W95° 6.452'
    Posts
    343
    its all good, a second opinion never hurts...

  2. #12
    Join Date
    Jul 2004
    Location
    N29° 22.725' X W95° 6.452'
    Posts
    343
    Quote Originally Posted by Tmacha

    $name = $_POST["txt_name"];

    remove quotes...

  3. #13
    Join Date
    Aug 2003
    Location
    Madrid - Spain
    Posts
    1,153
    Quote Originally Posted by mcarman
    remove quotes...
    What?
    n4x0 -- C++ Programmer
    Tank Game - Progress: 11%

  4. #14
    Join Date
    May 2006
    Posts
    50

    ok did that

    now I am getting this

    Notice: Use of undefined constant txt_name - assumed 'txt_name' in C:\Program Files\Apache Group\Apache2\htdocs\guestbook.php on line 7

    Notice: Undefined index: txt_name in C:\Program Files\Apache Group\Apache2\htdocs\guestbook.php on line 7

  5. #15
    Join Date
    Aug 2003
    Location
    Madrid - Spain
    Posts
    1,153
    Try this... I'm not sure $name = $_POST['txt_name'];

    PS: mcarman I won't forgive you
    n4x0 -- C++ Programmer
    Tank Game - Progress: 11%

  6. #16
    Join Date
    May 2006
    Posts
    50

    ok alittle better

    but I am back to this

    Notice: Undefined index: txt_name in C:\Program Files\Apache Group\Apache2\htdocs\guestbook.php on line 7

  7. #17
    Join Date
    Jul 2004
    Location
    N29° 22.725' X W95° 6.452'
    Posts
    343
    quotes are not needed on post/get/session type variables but i dont think thats the problem. can you repost what you have now?

  8. #18
    Join Date
    Aug 2003
    Location
    Madrid - Spain
    Posts
    1,153
    Quote Originally Posted by Tmacha
    but I am back to this

    Notice: Undefined index: txt_name in C:\Program Files\Apache Group\Apache2\htdocs\guestbook.php on line 7
    Nevermind
    Last edited by n4x0; 05-22-2006 at 04:11 PM. Reason: I was wrong
    n4x0 -- C++ Programmer
    Tank Game - Progress: 11%

  9. #19
    Join Date
    May 2006
    Posts
    50

    here is what I have now

    <?php
    require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");
    $link = mysql_connect($db_host, $db_user, $db_password)
    or die('Could not connect: ' . mysql_error());
    mysql_select_db($db_name, $link);

    $name = $_POST['txt_name'];
    $len = strlen($name);
    //Only write to database if there's a name
    if ($len > 0)
    {
    $email = $_POST["txt_email"];
    $comment = $_POST["txt_comment"];
    $date = time();

    $query = "INSERT INTO guestbook (autoID, name, email, comment, date_auto) VALUES (NULL, '$name', '$email', '$comment', '$date')";
    mysql_query($query, $link) or die(mysql_error());
    }
    ?>
    <html>
    <head>
    <title>Guestbook</title>
    </head>
    <body>
    <center>
    <form action="<?php echo $_SERVER[PHP_SELF]; ?>" method="POST">
    <font face="arial" size="1">
    Name: <input type="text" name="txt_name">&nbsp;
    Email: <input type="text" name="txt_email"><br><br>
    Comment:<br>
    <textarea style="width: 75%" rows="10" name="txt_comment"></textarea>
    <center><input type="submit" value="Submit"></center>
    </font>
    </form>

    </center>
    </body>
    </html>

  10. #20
    Join Date
    Jul 2004
    Location
    N29° 22.725' X W95° 6.452'
    Posts
    343
    can you run phpinfo() and tell me what the settings are for register_globals and safe_mode?

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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