Forum Moderators: coopster
The Form
--------
function prntpgnm($details,$showbox,$id,$btg,$itu){
global$PHP_SELF;
echo"\n<form action=\"$PHP_SELF\" method=\"POST\" id=\"dispbox\" enctype=\"multipart/form-data\">\n<input type=\"submit\" value=\"Update\" name=\"update\" id=\"button4\"> <input type=\"submit\" value=\"Add New Item\" name=\"addnew\" id=\"button4\"><hr align=\"center\" noshade size=\"1\" color=\"#B78C8C\">\n";
$dbuser="****xx";
$dbpass="xxxxx";
$db="database";
$link=mysql_connect("localhost",$dbuser,$dbpass);
mysql_select_db($db,$link);
$dbresult=mysql_query("SELECT * FROM table");
while($field=mysql_fetch_array($dbresult)){
if($field[id]>="1"){echo"\n<hr align=\"center\" noshade size=\"1\" color=\"#B78C8C\">\n";}
echo"<b id=\"loginhead2\">Item ID:</b> $field[id]<br>\n";
echo"<b id=\"loginhead2\">Show:</b>";
echo"<input type=\"radio\" id=\"loginhead2\" value=\"1\" name=\"showbox$field[id]\"";
if(!$field[showbox]=="0"){echo" CHECKED";}echo">On";
echo"<input type=\"radio\" id=\"loginhead2\" value=\"0\" name=\"showbox$field[id]\"";
if(!$field[showbox]=="1"){echo" CHECKED";}echo">Off";
echo" ¦ Status:";
if(!$field[showbox]==0){echo"<b id=\"on\"> On</b> ¦ ";}else{echo"<b id=\"off\"> Off</b> ¦ ";}
echo"<input type=\"submit\" value=\"Remove\" name=\"remove\" id=\"button3\"><input type=\"radio\" value=\"$field[id]\" name=\"btg\"><br>";
echo"<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\"><tr><td valign=\"top\">";
echo"<textarea rows=\"15\" cols=\"45\" id=\"loginhead2\" name=\"details$field[id]\">$field[details]</textarea></td>";
echo"<td width=\"150\" align=\"center\"><div id=\"dispbox\"><a href=\"images/aucitems/$field[itempic]\" target=\"_blank\"><image src=\"images/aucitems/$field[itempic]\" border=\"0\" width=\"212\" height=\"212\"></a></div>";
echo"\n<input type=\"file\" name=\"itemimage$field[id]\"><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"102400\"><div align=\"left\"><input type=\"submit\" value=\"Add image\" name=\"userimage\" id=\"button3\"><input type=\"radio\" value=\"$field[id]\" name=\"itu\"></div>";
echo"</td></tr></table>";}
echo"<hr align=\"center\" noshade size=\"1\" color=\"#B78C8C\"><input type=\"hidden\" name=\"editaucitems\" value=\"result\"><input type=\"submit\" value=\"Update\" name=\"update\" id=\"button4\"> <input type=\"submit\" value=\"Add New Item\" name=\"addnew\" id=\"button4\"></form>";}
The Image Upload Function (This just outputs the vars for now):
function uploadimage($itu){
global$PHP_SELF;
$imagetoup="itemimage$itu";
echo"itu var: $itu<br>";
echo"imagetoup var: $imagetoup<br>";
echo"Image to up: $GLOBALS[$imagetoup]<br>";}
As i say it works for the first image var and outputs the temp dir, so im sure that if i applied the copy() function it would transfer the picture to the set dir, but it doesnt work for the rest, The submit to upload is individual to each image/box set (i.e. one at a time)
Any ideas, im a bit lost with it...
(Sorry about the mess)
GD and PHP may also require other libraries, depending on which image formats you want to work with. You may wish to enhance GD to handle more image formats (including jpeg/jpg).
Laters