Skip to content

Instantly share code, notes, and snippets.

@stanigator
Created May 5, 2012 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stanigator/aa70d1d4fee856ac3e86 to your computer and use it in GitHub Desktop.
Save stanigator/aa70d1d4fee856ac3e86 to your computer and use it in GitHub Desktop.
What's wrong with reading the type?
<html>
<head>
<title>FORM</title>
</head>
<body>
<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 />
<p>
<center><h3><?php include("links.php"); ?></h3></center>
</form>
</body>
</html>
<?php
// 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