0

I used Forum and used this line:

<form method="post" action="adduser.php">
Picture:<input type="file" name="file" id="file" accept="image/gif, image/jpeg, image/png" /></br>

<input type="submit" name="submit">

Also in adduser.php

$image="pic/" .$_FILES["file"]["name"];

if(mysql_query("INSERT INTO users(userid,username,name,family,email,city,gender,password,img) values(' ','$_POST[username]','$_POST[name]','$_POST[family]','$_POST[email]','$_POST[city]','$_POST[gender]','$password','$image');",$cn))
echo "New user added";

What's wrong? in database table just i see in img : pic/

dertkw
  • 7,798
  • 5
  • 37
  • 45
moh3en
  • 42
  • 5

1 Answers1

0

use enctype attribute with form

<form method="post" action="adduser.php" enctype="multipart/form-data">
g-newa
  • 459
  • 3
  • 10