Hi frnds...
here i am phasing a small problem...after successful completion of all my queries ,it is not redirecting to back page..plz check this one....
Need Logic
At the bottom of this code i execute 9 sql queries..all are in same manner..If there is any logic in this plz tell me....
<?php
ob_start();
session_start();
include_once("../../includes/dbconnect.php");
$title=$_POST['title'];
foreach ($_FILES["attachments4"]["tmp_name"] as $key => $error)
{
if ($error == UPLOAD_ERR_OK)
{
@$tmp_name0 = $_FILES["attachments4"]["tmp_name"][0];
@$name0 = $_FILES["attachments4"]["name"][0];
@$tmp_name1 = $_FILES["attachments4"]["tmp_name"][1];
@$name1 = $_FILES["attachments4"]["name"][1];
@$tmp_name2 = $_FILES["attachments4"]["tmp_name"][2];
@$name2 = $_FILES["attachments4"]["name"][2];
@$tmp_name3 = $_FILES["attachments4"]["tmp_name"][3];
@$name3 = $_FILES["attachments4"]["name"][3];
@$tmp_name4 = $_FILES["attachments4"]["tmp_name"][4];
@$name4 = $_FILES["attachments4"]["name"][4];
@$tmp_name5 = $_FILES["attachments4"]["tmp_name"][5];
@$name5 = $_FILES["attachments4"]["name"][5];
@$tmp_name6 = $_FILES["attachments4"]["tmp_name"][6];
@$name6 = $_FILES["attachments4"]["name"][6];
@$tmp_name7 = $_FILES["attachments4"]["tmp_name"][7];
@$name7 = $_FILES["attachments4"]["name"][7];
@$tmp_name8 = $_FILES["attachments4"]["tmp_name"][8];
@$name8 = $_FILES["attachments4"]["name"][8];
@$tmp_name9 = $_FILES["attachments4"]["tmp_name"][9];
@$name9 = $_FILES["attachments4"]["name"][9];
@move_uploaded_file($tmp_name0, "$title"."/"."$name0");
@move_uploaded_file($tmp_name1, "$title"."/"."$name1");
@move_uploaded_file($tmp_name2, "$title"."/"."$name2");
@move_uploaded_file($tmp_name3, "$title"."/"."$name3");
@move_uploaded_file($tmp_name4, "$title"."/"."$name4");
@move_uploaded_file($tmp_name5, "$title"."/"."$name5");
@move_uploaded_file($tmp_name6, "$title"."/"."$name6");
@move_uploaded_file($tmp_name7, "$title"."/"."$name7");
@move_uploaded_file($tmp_name8, "$title"."/"."$name8");
@move_uploaded_file($tmp_name9, "$title"."/"."$name9");
}
}
if($name0!='')
{
$path="$title"."/"."$name0";
$sql="insert into eventgallery values('','$title','$path')";
mysql_query($sql)or die(mysql_error());
}
if($name1!='')
{
$path="$title"."/"."$name1";
$sql="insert into eventgallery values('','$title','$path')";
mysql_query($sql)or die(mysql_error());
}
if($name2!='')
{
$path="$title"."/"."$name2";
$sql="insert into eventgallery values('','$title','$path')";
mysql_query($sql)or die(mysql_error());
}
if($name3!='')
{
$path="$title"."/"."$name3";
$sql="insert into eventgallery values('','$title','$path')";
mysql_query($sql)or die(mysql_error());
}
if($name4!='')
{
$path="$title"."/"."$name4";
$sql="insert into eventgallery values('','$title','$path')";
mysql_query($sql)or die(mysql_error());
}
if($name5!='')
{
$path="$title"."/"."$name5";
$sql="insert into eventgallery values('','$title','$path')";
mysql_query($sql)or die(mysql_error());
}
if($name6!='')
{
$path="$title"."/"."$name6";
$sql="insert into eventgallery values('','$title','$path')";
mysql_query($sql)or die(mysql_error());
}
if($name7!='')
{
$path="$title"."/"."$name7";
$sql="insert into eventgallery values('','$title','$path')";
mysql_query($sql)or die(mysql_error());
}
if($name8!='')
{
$path="$title"."/"."$name8";
$sql="insert into eventgallery values('','$title','$path')";
mysql_query($sql)or die(mysql_error());
}
if($name9!='')
{
$path="$title"."/"."$name9";
$sql="insert into eventgallery values('','$title','$path')";
mysql_query($sql)or die(mysql_error());
}
header("Location : uploadimages.php" );
?>
Thanks in advance..