Hi guys i have this page and it brings over lots of varibles and also
an image is being uploaded into a folder on the server here.
problems is i get an error on to of the varibles and the image is not
showing BUT as soon as i refresh the varibles are showing and so is
the image i cant figure out why i would appreciate any help please
<?php
session_start() ;
$_SESSION['price'];
$_SESSION['filename']=$HTTP_POST_FIL ES['upfile']['name'];
$test = $HTTP_POST_FILE S['upfile']['name'];
$test2 = $_SESSION['log'];
$test3= ($test2 .= $test);
$_SESSION['reg'];
$_SESSION['mileage'];
$_SESSION['colour'];
$_SESSION['email'];
$_SESSION['pcode'];
$_SESSION['adtelno'];
$_SESSION['adtelno2'];
$_SESSION['adcost']=$_POST['adcost'];
$_SESSION['make']=$_POST['myselect_1'];
$_SESSION['model']=$_POST['myselect_2'];
$_SESSION['photodesc']=$_POST['photodesc'];
$_SESSION['week']=$_POST['week'];
// This presumes 'config.php' is in the same directory
// as the page you are protecting - modify the path if your config.php
file is
// in a different location:
include_once("c onfig.php");
// Check user logged in already:
checkLoggedIn(" yes");
?>
<html>
<head>
<title>Carpound .Co.Uk</title>
<link href="index.css " rel="stylesheet " type="text/css">
</head>
<body bgcolor="ffffff " marginheight="0 " topmargin="0" marginwidth="0"
leftmargin="0">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td> </td>
<td width="750">
<!************* *************** ******* centers table below
*************** *************** ******>
<table border="0" cellspacing="0" cellpadding="0" width="750">
<tr>
<td><?php include "header.php " ?></td>
</tr>
<tr>
<td width="750" valign="top" bgcolor="EDEDED ">
<table border="0" cellspacing="0" cellpadding="0" width="750">
<tr>
<td> </td>
<td class="blackb"> Sell Your Car</td>
</tr>
<tr><td>  ;</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="center">
<table border="0" cellspacing="0" cellpadding="0"
width="550">
<tr>
<td class="bb">Plac e an advert:</td>
</tr>
<tr>
<td class="black">
Below is an example of how your advert will appear on here.
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
<td><img src="images/trans.gif" alt="" width="1" height="15"
border="0"></td></tr>
<tr><td>  ;</td>
<td align="center">
<table border="0" class="this3" cellspacing="0"
cellpadding="0" width="550">
<form name="myform" enctype="multip art/form-data"
action="sell4.p hp" method="POST">
<Tr>
<td width="200" class="this4" align="center"
valign="middle" >
<?php
if( !is_dir($store_ dir) )
{
echo("Specified directory is not valid... Exiting");
@unlink($HTTP_P OST_FILES['upfile']['tmp_name']);
exit();
}
if( copy($HTTP_POST _FILES['upfile']['tmp_name'],$store_dir.$te st3) )
{
echo("");
}
else
{
echo("Upload of ".$HTTP_POST_FI LES['upfile']['name']." to
".$store_di r." failed!!!!<BR>" );
}
@unlink($HTTP_P OST_FILES['upfile']['tmp_name']);
?><img src="uploads/<?php echo $filename; ?>" width="180"
height="150">
<input type="hidden" name="imageinpu t" value="<?php
echo($_SESSION["login"]); echo $filename; ?>">
</td>
<td>
<table border="0" cellspacing="0" cellpadding="0"
width="350">
<tr>
<td width="10">&nbs p;</td>
<td class="bullet" colspan="2"></td>
<td> </td>
</tr>
<tr>
<td width="10">&nbs p;</td>
<td class="bullet" bgcolor="E7E7E7 " width="340"
height="100" colspan="2"><?p hp echo $photodesc; ?></td>
<td> </td>
</tr>
<tr>
<td width="10">&nbs p;</td>
<td class="bullet"> </td>
<td> </td>
</tr>
<tr>
<td width="10">&nbs p;</td>
<td width="70" class="bullet"> Tel.</td>
<td class="black" width="270"><?p hp echo $adtelno;
?></td>
</tr>
<tr>
<td width="10">&nbs p;</td>
<td width="70" class="bullet"> Email.</td>
<td class="black" width="270"><?p hp echo $email; ?></td>
</tr>
<tr>
<td width="10">&nbs p;</td>
<td width="70" class="bullet"> Price.</td>
<td class="black" width="270"><?p hp echo $price; ?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
<td><img src="images/trans.gif" alt="" width="1" height="50"
border="0"></td></tr>
<tr><td>  ;</td>
<td>
</td></tr>
<tr>
<td bgcolor="99CC00 " height="40">&nb sp;</td>
<td bgcolor="99CC00 " height="40" align="center">
<INPUT TYPE="image" src="images/next2.gif" name="submit">
</td></tr>
</form>
</table>
</td>
</tr>
</table>
</td>
<td> </td>
</tr>
</table>
</body>
</html>
an image is being uploaded into a folder on the server here.
problems is i get an error on to of the varibles and the image is not
showing BUT as soon as i refresh the varibles are showing and so is
the image i cant figure out why i would appreciate any help please
<?php
session_start() ;
$_SESSION['price'];
$_SESSION['filename']=$HTTP_POST_FIL ES['upfile']['name'];
$test = $HTTP_POST_FILE S['upfile']['name'];
$test2 = $_SESSION['log'];
$test3= ($test2 .= $test);
$_SESSION['reg'];
$_SESSION['mileage'];
$_SESSION['colour'];
$_SESSION['email'];
$_SESSION['pcode'];
$_SESSION['adtelno'];
$_SESSION['adtelno2'];
$_SESSION['adcost']=$_POST['adcost'];
$_SESSION['make']=$_POST['myselect_1'];
$_SESSION['model']=$_POST['myselect_2'];
$_SESSION['photodesc']=$_POST['photodesc'];
$_SESSION['week']=$_POST['week'];
// This presumes 'config.php' is in the same directory
// as the page you are protecting - modify the path if your config.php
file is
// in a different location:
include_once("c onfig.php");
// Check user logged in already:
checkLoggedIn(" yes");
?>
<html>
<head>
<title>Carpound .Co.Uk</title>
<link href="index.css " rel="stylesheet " type="text/css">
</head>
<body bgcolor="ffffff " marginheight="0 " topmargin="0" marginwidth="0"
leftmargin="0">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td> </td>
<td width="750">
<!************* *************** ******* centers table below
*************** *************** ******>
<table border="0" cellspacing="0" cellpadding="0" width="750">
<tr>
<td><?php include "header.php " ?></td>
</tr>
<tr>
<td width="750" valign="top" bgcolor="EDEDED ">
<table border="0" cellspacing="0" cellpadding="0" width="750">
<tr>
<td> </td>
<td class="blackb"> Sell Your Car</td>
</tr>
<tr><td>  ;</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="center">
<table border="0" cellspacing="0" cellpadding="0"
width="550">
<tr>
<td class="bb">Plac e an advert:</td>
</tr>
<tr>
<td class="black">
Below is an example of how your advert will appear on here.
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
<td><img src="images/trans.gif" alt="" width="1" height="15"
border="0"></td></tr>
<tr><td>  ;</td>
<td align="center">
<table border="0" class="this3" cellspacing="0"
cellpadding="0" width="550">
<form name="myform" enctype="multip art/form-data"
action="sell4.p hp" method="POST">
<Tr>
<td width="200" class="this4" align="center"
valign="middle" >
<?php
if( !is_dir($store_ dir) )
{
echo("Specified directory is not valid... Exiting");
@unlink($HTTP_P OST_FILES['upfile']['tmp_name']);
exit();
}
if( copy($HTTP_POST _FILES['upfile']['tmp_name'],$store_dir.$te st3) )
{
echo("");
}
else
{
echo("Upload of ".$HTTP_POST_FI LES['upfile']['name']." to
".$store_di r." failed!!!!<BR>" );
}
@unlink($HTTP_P OST_FILES['upfile']['tmp_name']);
?><img src="uploads/<?php echo $filename; ?>" width="180"
height="150">
<input type="hidden" name="imageinpu t" value="<?php
echo($_SESSION["login"]); echo $filename; ?>">
</td>
<td>
<table border="0" cellspacing="0" cellpadding="0"
width="350">
<tr>
<td width="10">&nbs p;</td>
<td class="bullet" colspan="2"></td>
<td> </td>
</tr>
<tr>
<td width="10">&nbs p;</td>
<td class="bullet" bgcolor="E7E7E7 " width="340"
height="100" colspan="2"><?p hp echo $photodesc; ?></td>
<td> </td>
</tr>
<tr>
<td width="10">&nbs p;</td>
<td class="bullet"> </td>
<td> </td>
</tr>
<tr>
<td width="10">&nbs p;</td>
<td width="70" class="bullet"> Tel.</td>
<td class="black" width="270"><?p hp echo $adtelno;
?></td>
</tr>
<tr>
<td width="10">&nbs p;</td>
<td width="70" class="bullet"> Email.</td>
<td class="black" width="270"><?p hp echo $email; ?></td>
</tr>
<tr>
<td width="10">&nbs p;</td>
<td width="70" class="bullet"> Price.</td>
<td class="black" width="270"><?p hp echo $price; ?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
<td><img src="images/trans.gif" alt="" width="1" height="50"
border="0"></td></tr>
<tr><td>  ;</td>
<td>
</td></tr>
<tr>
<td bgcolor="99CC00 " height="40">&nb sp;</td>
<td bgcolor="99CC00 " height="40" align="center">
<INPUT TYPE="image" src="images/next2.gif" name="submit">
</td></tr>
</form>
</table>
</td>
</tr>
</table>
</td>
<td> </td>
</tr>
</table>
</body>
</html>
Comment