Jump to content

Search the Community

Showing results for tags 'database record'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hello guys. I have a problem with signup form record in database. My code works good but only firstname input doesnt send it to database. Other all information shown up in database. Do you have any idea why it is not working? <?php // index.php session_start(); require_once 'functions.php'; $userfirstname = $lastname = $email = $remember = $error = $username = $pass = $password1 = $password2 = $user = $birthday = $bdd = $bdm = $bdy = ""; $imgavatar = 'img/default_user_avatar.png'; $userstr = '(Guest)'; if (isset($_SESSION['user'])) { $user = $_SESSION['user']; $loggedin = TRUE; $userstr = " ($user)"; } else $loggedin = FALSE; if ($loggedin){ //redirect for profile page } if(isset($_POST['username'])&&($_POST['first']) && ($_POST['lastname']) && ($_POST['email'])){ $username = sanitizeString($_POST['username']); $password1 = sanitizeString($_POST['p']); $password2 = sanitizeString($_POST['p2']); $email = sanitizeString($_POST['email']); $userfirstname = sanitizeString($_POST['first']); $lastname = sanitizeString($_POST['lastname']); $bdd = sanitizeString($_POST['day']); $bdm = sanitizeString($_POST['month']); $bdy = sanitizeString($_POST['year']); $birthday = $bdd." / ".$bdm." / ".$bdy; if ( ($username == "") || ($email =="") || ($password1 =="") || ($password2 =="") || ($userfirstname = "") || ($lastname == "")) { $error = "You didn't give us enough information for Signup"; } else { $result = queryMySQL("SELECT * FROM Members WHERE username='$username'"); if($result->num_rows) { $error ="This Username is already exists"; } else { queryMysql("INSERT INTO Members VALUES( '$userfirstname','$lastname','$email','$username','$password1','$birthday')"); die("<h4>Account created</h4>Please Log in. Your first name is $userfirstname<br><br>"); } } } echo <<<_END <DOCTYPE html> <html> <head> <title>World. Your New World</title> <link rel='stylesheet' href='styles.css' type='text/css'> <script type="text/javascript" src="javascript/javascript.js"></script> </head> <body class='home'> <div class='loginform'> <img id='imgavatar' src='$imgavatar'> <form method='post' action='index.php'> <input class = 'loginput' type='text' maxlength='16' name='user' value='$user' placeholder='Username'> <input class = 'loginput' type='password' maxlength='16' name='pass' value='$pass' placeholder='Password'> <h6 id='rememberme'><input type="checkbox" value="None" name="check" checked='checked' />Remember Me</h6> <span>$error<br></span> <input type='submit' value='Login'> </form> </div> <div class='signupform'> <h1 id='signhead'>Join Us!</h1> <p id='signhead'>It will be free and it will always be free!<br> Creat your own personal tree</p><br><br><br> <form method='POST' action='index.php'> <input class= 'loginput' type='text' maxlength='16' name='first' value='$userfirstname' placeholder='Name'> <input class= 'loginput' type='text' maxlength='16' name='lastname' value='$lastname' placeholder='Last Name'><br> <input class= 'loginput' type='email' maxlength='32'name='email' value='$email' placeholder='E-mail'> <input class= 'loginput' type='text' maxlength='16' name='username' value='$username' placeholder='Username' onBlur='checkUser(this)'><br> <input class= 'loginput' type='Password' maxlength='16' name='p' value='$password1' placeholder='Password'> <input class= 'loginput' type='Password' maxlength='16' name='p2' value='$password2' placeholder='Repeat Password'><br> <select name="month" onchange="call()" value='$bdm'> <option value="0">-Month-</option> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option> <option value="5">May</option> <option value="6">Jun</option> <option value="7">July</option> <option value="8">August</option> <option value="9">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> <select name="day" value='$bdd'> <option value="">-Day-</option> </select> <select name="year" onchange="call()" value='$bdy'> <option value="">-Year-</option> </select> $userfirstname $lastname <input type='submit' value='Sign Up'> </form> </div> </body> </html> _END; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.