I am trying to use UserSpice to make an address book with a upload part that will be used to upload a CV and stored under the profile that is being created.
I got the file to upload, but I cant get it to add the data to the users table but if I make a different table it works, can anybody help me solve this?
The Form
<form action="<?=$form_action;?>" method="<?=$form_method;?>" enctype="multipart/form-data">
<input type="file" name="file" />
<button type="submit" id="next_button" name="submit"><?=lang("SIGNUP_BUTTONTEXT","");?></button>
The post script
<?php
include_once 'dbconfig.php';
if(isset($_POST['submit']))
{
$file = rand(1000,100000)."-".$_FILES['file']['name'];
$file_loc = $_FILES['file']['tmp_name'];
$file_size = $_FILES['file']['size'];
$file_type = $_FILES['file']['type'];
$folder="cvs/";
$new_size = $file_size/1024;
$new_file_name = strtolower($file);
$final_file=str_replace(' ','-',$new_file_name);
if(move_uploaded_file($file_loc,$folder.$final_file))
{
$sql="INSERT INTO users(file,type,size) VALUES('$final_file','$file_type','$new_size')";
mysql_query($sql);
?>
Added to Users Table
`file` VARCHAR( 100 ) NOT NULL ,
`type` VARCHAR( 10 ) NOT NULL ,
`size` INT NOT NULL