nope been messing about with that all day and it doesnt work.
Right im trying something like below-
test.php
<?php
include ("function.inc");
?>
<html>
<head>
<title>Account details</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="333333" text="e5e5e5" link="e5e5e5" vlink="e5e5e5" alink="e5e5e5">
<?php
$theValue = 'abram';
if (@$POST['abram'] == $theValue) # 7
{
header("Location: test2.php");
}
$theValue = $POST['abram'];
// post $productID??
?>
<?php
include("donuts.inc");
$connection = mysql_connect($host,$user,$password)
or die ("couldn't connect to server");
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database");
$result = mysql_query("select * from Products where productType='Silly Shirts'");
while($r=mysql_fetch_array($result))
{
$productID=$r["productID"];
$productName=$r["productName"];
$productType=$r["productType"];
$description=$r["description"];
$productRRP=$r["productRRP"];
$price=$r["price"];
$extraInformation=$r["extraInformation"];
$officialDescription=$r["officialDescription"];
$image=$r["image"];
$f_price = number_format($row['price'],2);
$f_price = $price;
echo "<table cellspacing='0' border='0' cellpadding='0' width='95%' align='center'>";
echo "<tr>\n";
echo "<td width=\"80%\"><font face=\"Verdana\" color=\"#E5E5E5\" font
size=\"-1\">$productName - $description <b>£$f_price</b></font></td>\n";
echo "<td><a href='../store/listitem.php?id=$productID'
border='0'>
<img src='../store/images/$image' border='0'
width='100' height='80'></a></td>\n";
echo "</tr>\n";
addBasket();
echo "<tr>";
echo "<td colspan=\"2\" td background=\"../store/images/linebreak.gif\"> </td>\n";
echo "</tr>\n";
echo "</table>\n";
<form name='form1' method='post' action='test2.php'>
<a href='test2.php'><img src='images/abram1.jpg' width='102' height='102' border='0' name='abram' value='<?php echo $theValue; ?>'></a>
</form>
}
?>
test2.php-
<?php
if($POST['abram'] == $theValue)
{
echo 'Item has been added to wishlist.';
// go back (javascript).
}
$theValue = $POST['abram'];
// $wishlist = $_POST['wishlist'];
$theValue = $wishlistValue;
$wishlistValue = "yes";
include("donuts.inc");
$connection = mysql_connect($host, $user, $password)
or die ("Can't find database, grr");
$db = mysql_select_db($database, $connection)
or die ("Can't find database, grr");
$wishlistValue=trim($wishlistValue);
$wishlistValue=ucfirst(strtolower(strip_tags($wishlistValue)));
$wishlistValue = strip_tags(trim($wishlistValue));
$productID = mysql_insert_id();
$query = "INSERT INTO Wishlist (productID,wishlist)
VALUES ('$productID','$wishlistValue')";
$result = mysql_query($query)
or die ("Can't find database, hmpph");
// insert into wishlist db, get id first.
?>
so im trying to set the image as a variable and sending that to a new page, where it is put into a table in the database along with its productID, however its simply not working. any ideas?