Create a gist now

Instantly share code, notes, and snippets.

@stanigator /form.php Secret
Created May 5, 2012

What would you like to do?
What's wrong with reading the type?
<h2>Registration Form</h2>
<form ENCTYPE="multipart/form-data" method="post" action="insert.php">
Name: <input type="text" name="name" maxlength="15" /><br />
Email: <input type="text" name="email" maxlength="30" /><br />
Password: <input type="password" name="password" maxlength="15" /><br />
Confirm Password: <input type="password" name="cpassword" maxlength="15" /><br />
<input type="hidden" name="MAX_FILE_SIZE" value="10000">
Choose your picture: <input type="file" name="upload"><p>
<input type="submit" name="submit" value="Register" /><br />
<center><h3><?php include("links.php"); ?></h3></center>
// relevant code snippets
$mypic = $_FILES['upload']['name'];
$temp = $_FILES['upload']['tmp_name'];
$type = $_FILES['upload']['type'];
$name = mysql_real_escape_string($_POST["name"]);
$email = mysql_real_escape_string($_POST["email"]);
$pw = mysql_real_escape_string($_POST["password"]);
$cpw = mysql_real_escape_string($_POST["cpassword"]);
echo $type."<br />";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment