Ok, here's the problem I've been having. Based on the customers in the table a list is made so that radio buttons are set out for each customer. I did this using the following php:
Code: Select all
<?php
$connection = mysql_connect("server","user","pass");
$db=mysql_select_db("db", $connection);
$cust = "SELECT customer FROM list";
$sql = mysql_query($cust) or die(mysql_error());
while ($row = mysql_fetch_array($sql))
{
echo "<input type=\"radio\" name=\"customer\" value='".$row['cust']"'>".$row['cust']."</input>";
}
?>
Code: Select all
<?php
$connection = mysql_connect("localhost","root","Mineallmine");
$db=mysql_select_db("test", $connection);
if(isset($_POST['customer'])
{
//What goes here?
}
if(!file_exists("upload"))
{
mkdir("/upload", 0777);
}
if($_FILES["file"]["error"] > 0)
{
echo $_FILES["file"]["error"];
}
else
{
echo "Uploaded File: ".$_FILES["file"]["name"]."<br />";
echo "Size of File: ".($_FILES["file"]["size"] / 1024)."Kb<br />";
if(file_exists("upload/".$_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"]." all ready exists in the upload directory";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"], $customer."/upload/".$_FILES["file"]["name"]);
echo "File has been stored successfully";
}
}
?>
Thanks
Stow