Jump to content

Search the Community

Showing results for tags 'help with form'.

  • 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. form not posting to database instead its redirecting me to another page with heading "object not found!" <?php $connect= mysql_connect("localhost", "username", "password"); if (!$connect) { die("could'nt connect to db:".mysql_error()); } mysql_select_db("myapp", $connect); $sql="INSERT INTO form(fname,lname,email,password,telephone,sex,dob) VALUES ('','$_POST[fname]', '$_POST[lname]', '$_POST[email]' '$_POST[password]', '$_POST[telephone]', '$_POST[sex]', '$_POST[dob]')"; if (!mysql_query($sql, $connect)) { die("Error:" .mysql_error()); } mysql_close($connect); function spamcheck($field) { $field = filter_var($field, FILTER_SANITIZE_EMAIL); if(filter_var ($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } if (isset($_POST['email'])) { $mailcheck = spamcheck($_POST['email']); } if($mailcheck == FALSE) { //echo "invalid input"; } else { $email=$_POST['email']; $fname=$_POST['fname']; $lname=$_POST['lname']; $password=$_POST['password']; $retype_password=$password; $telephone=$_POST['telephone']; $sex=$_POST['sex']; $DOB=$_POST['dob']; } function yearOptions() { for ($i = 1910; $i <= date('Y'); $i++) { $s = date('Y') == $i ? ' selected="selected"' : ''; echo '<option '.$s.' value="'.$i.'">'.$i.'</option>'."\n"; } } function monthOptions() { $months = array( 1 => "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ); foreach ( $months as $monthNo => $month ) { ( $monthNo == date('n') ) ? $selected = ' selected="selected"' : $selected = ''; echo '<option value="'.$monthNo.'"'.$selected.'>'.$month.'</option>'."\n"; } } function dayOptions() { for ( $i = 1; $i <= 31; $i++ ) { ( $i == date('j') ) ? $selected = ' selected="selected"' : $selected = ''; echo '<option value="'.$i.'"'.$selected.'>'.$i.'</option>'."\n"; } } $password=$_POST["password"]; $salt=rand(100000,999999); $encrypted= (MD5(MD5($salt.$password))); if($retype_password!=$password) { echo "password mismatch"; } ?> <form action = "register.php" method=post> <fieldset> Firstname: <input type="text" size=30 name="fname"><br> Lastname: <input type="text" size=30 name="lname"><br> Email address: <input type=text size=30 name="email"><br> Password: <input type=password size=30 name="password"><br> Retype Password: <input type=password size=30 name="retype_password"><br> Telephone: <input type=tel size=30 name="telephone"><br> sex: <input type="radio" name="sex" value="male" checked="checked">Male<br/><input type="radio" name="sex" value="female">Female<br> Date of birth: <select name="dob"> <?php dayOptions();?> </select> <select name="dob"> <?php monthOptions();?> </select> <select name="dob"> <?php yearOptions();?> </select><br> <INPUT TYPE=SUBMIT VALUE="Register"> </fieldset> </form>
×
×
  • 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.