I'm trying to add an image to a database w/o using global registers. So far I have:
<?php
MYSQL_CONNECT("localhost","xxx","xxx");
mysql_select_db("SPA");
$name = $_FILES['form_data']['name'];
$size = $_FILES['form_data']['size'];
$type = $_FILES['form_data']['type'];
$data = addslashes(fread(fopen($_FILES['form_data'], "r"), filesize($_FILES['form_data'])));
$result=MYSQL_QUERY("INSERT INTO images (binary_junk,filename,filesize,filetype) VALUES ('$data','$name','$size','$type')");
MYSQL_CLOSE();
?>
Problem being that form_data is the name of the array and not the actual data itself, so I get an error. I looked up the $_FILES global register and it doesn't seem to have a statement for the actual data, like it does for name, size, and type. Any ideas?