Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    When I run the script I get blocks

    When I try to run my PHP registration script I get a bunch of blocks and o's can some one help! Take a look
    Http://www.redwarning.net/reg.php If you need the script I can e-mail it to you. If you can help please e-mail me. Jusitn@redwarning.net Thanks!
    Last edited by greek_hyperion; 10-13-2003 at 02:22 AM.

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    You don't have php set up on the server.

    Notice the title <?php echo $page_title; ?>

  • #3
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No

    No php is there. The origional script is nothing but php and it runs. I think the title did that because I didn't setup a macro to handle .inc file types. I called that html from an include. Have any more ideas??

  • #4
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Well, beyond that, you'll have to post the code for more help.

    Also, take a look at the forum guidelines. Subject could be better worded.

  • #5
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code

    <?php #script 1.0 - php reg

    $page_title='register';
    include ('incs/header.inc');

    if(isset($_POST['submit'])) {

    $message = NULL;

    if (empty($_POST['f_name'])) {
    $fn = FALSE;
    $message .= '<p>You forgot to enter a first name!</p>';
    } else {
    $fn = $_POST['f_name'];
    }


    if (empty($_POST['l_name'])) {
    $ln = FALSE;
    $message .= '<p>You forgot to enter a last name!</p>';
    } else {
    $ln = $_POST['l_name'];
    }


    if (empty($_POST['email'])) {
    $e = FALSE;
    $message .= '<p>You forgot to enter an e-mail address!</p>';
    } else {
    $e = $_POST['email'];
    }


    if (empty($_POST['username'])) {
    $u = FALSE;
    $message .= '<p>You forgot to enter a username!</p>';
    } else {
    $u = $_POST['f_name'];
    }


    if (empty($_POST['pass1'])) {
    $p = FALSE;
    $message .= '<p>You forgot to enter a password!</p>';
    } else {
    if ($_POST['pass1'] == $_POST['pass2']) {
    $p = FLASE;
    $message .= '<p>Your password did not match the confimed password</p>';
    }
    }

    if ($fn && $ln && $e && $u && $p) {
    require_once ('incs/connect.php');


    $query = "INSERT INTO users (username, f_name, l_name, email, password, reg_date) VALUES ('$u', '$fn' '$ln', '$e', PASSWORD('$p'), NOW() )";
    $result = @mysql_query ($query);
    if ($result) {

    echo '<p><b> You have been registered!</b></p>';
    include ('incs/footer.inc');
    exit();
    } else {
    $message .= '<P>.mysql_error().</p>';
    }

    msql_close();

    }else{
    $message .= '<p>Please try again</p>';
    }

    }
    if (isset($message)) {
    echo '<font color="red">', $message, '</font>';

    }
    ?>



    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    <fieldset><legend>Enter info below</legend>

    <p>First Name: <input type="text" name="f_name" size="15" maxlength="15" value="<?php if (isset($_POST['f_name'])) echo $_POST['f_name']; ?>" /></p>
    <BR>
    <p>Last Name: <input type="text" name="l_name" size="20" maxlength="20" value="<?php if (isset($_POST['l_name'])) echo $_POST['l_name']; ?>" /></p>
    <BR>
    <p>E-mail: <input type="text" name="email" size="20" maxlength="20" value="<?php if (isset($_POST['email'])) echo $_POST['email']; ?>" /></p>
    <BR>
    <p>Username: <input type="text" name="username" size="15" maxlength="15" value="<?php if (isset($_POST['username'])) echo $_POST['username']; ?>" /></p>
    <BR>
    <p>Password: <input type="password" name="pass1" size="8" maxlength="8"/></p>
    <BR>
    <p>Confirm Password: <input type="password" name="pass2" size="8" maxlength="8"/></p>
    <center> <input type="submit" name="submit" value="Register"/> </center> </fieldset> </form>
    <?php
    inculde ('incs/footer.inc');
    ?>

  • #6
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    those blocks and junk could be a result of not <hmtl> tag's or no declaration of DTD
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #7
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    PHP Code:
    <?php #script 1.0 - php reg

    $page_title='register';
    include (
    'incs/header.inc');

    if(isset(
    $_POST['submit'])) {

    $message NULL;

    if (empty(
    $_POST['f_name'])) {
    $fn FALSE;
    $message .= '<p>You forgot to enter a first name!</p>';
    } else {
    $fn $_POST['f_name'];
    }


    if (empty(
    $_POST['l_name'])) {
    $ln FALSE;
    $message .= '<p>You forgot to enter a last name!</p>';
    } else {
    $ln $_POST['l_name'];
    }


    if (empty(
    $_POST['email'])) {
    $e FALSE;
    $message .= '<p>You forgot to enter an e-mail address!</p>';
    } else {
    $e $_POST['email'];
    }


    if (empty(
    $_POST['username'])) {
    $u FALSE;
    $message .= '<p>You forgot to enter a username!</p>';
    } else {
    $u $_POST['f_name'];
    }


    if (empty(
    $_POST['pass1'])) {
    $p FALSE;
    $message .= '<p>You forgot to enter a password!</p>';
    } else {
    if (
    $_POST['pass1'] == $_POST['pass2']) {
    $p FLASE;
    $message .= '<p>Your password did not match the confimed password</p>';
    }
    }

    if (
    $fn && $ln && $e && $u && $p) {
    require_once (
    'incs/connect.php');


    $query "INSERT INTO users (username, f_name, l_name, email, password, reg_date) VALUES ('$u', '$fn' '$ln', '$e', PASSWORD('$p'), NOW() )";
    $result = @mysql_query ($query);
    if (
    $result) {

    echo 
    '<p><b> You have been registered!</b></p>';
    include (
    'incs/footer.inc');
    exit();
    } else {
    $message .= '<P>.mysql_error().</p>';
    }

    msql_close();

    }else{
    $message .= '<p>Please try again</p>';
    }

    }
    if (isset(
    $message)) {
    echo 
    '<font color="red">'$message'</font>';

    }
    ?>



    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    <fieldset><legend>Enter info below</legend>

    <p>First Name: <input type="text" name="f_name" size="15" maxlength="15" value="<?php if (isset($_POST['f_name'])) echo $_POST['f_name']; ?>" /></p>
    <BR>
    <p>Last Name: <input type="text" name="l_name" size="20" maxlength="20" value="<?php if (isset($_POST['l_name'])) echo $_POST['l_name']; ?>" /></p>
    <BR>
    <p>E-mail: <input type="text" name="email" size="20" maxlength="20" value="<?php if (isset($_POST['email'])) echo $_POST['email']; ?>" /></p>
    <BR>
    <p>Username: <input type="text" name="username" size="15" maxlength="15" value="<?php if (isset($_POST['username'])) echo $_POST['username']; ?>" /></p>
    <BR>
    <p>Password: <input type="password" name="pass1" size="8" maxlength="8"/></p>
    <BR>
    <p>Confirm Password: <input type="password" name="pass2" size="8" maxlength="8"/></p>
    <center> <input type="submit" name="submit" value="Register"/> </center> </fieldset> </form>
    <?php
    inculde 
    ('incs/footer.inc');
    ?>


  •  

    Posting Permissions

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