Hi Guys,
I am still getting this error, this is a nightmare, I will show you all the code:
<?php
// headers change between logged in and not logged in
session_start();
$header = '';
$Added_Swaps_list = "";
$tableFirstpart = "";
$tableSecondpart = "";
$ConfirmDelete = "";
if (!isset($_SESSION["manager"])) {
$header ='../includes/header.php';
$Added_Swaps_list = "You need to be logged in to be able to view your profile";
}
else
{
// Be sure to check that this manager SESSION value is in fact in the database
$managerID = $_SESSION["id"];
$LEmail = $_SESSION["manager"];
$pass = $_SESSION["password"];
include '../includes/connect_users.php';
$sql = mysql_query("SELECT * FROM members WHERE id ='$managerID' AND Email ='$LEmail' AND Password='$pass' LIMIT 1");
$existCount = mysql_num_rows($sql); // count the row nums
if ($existCount == 0)
{
$header ='../includes/header.php';
$Added_Swaps_list = "Please Log in in order to be able to track your added swaps";
}
else
{
while($row = mysql_fetch_array($sql))
{
// Info from the users table
$User_name = $row["User_name"];
$Email = $row["Email"];
$header = '../includes/header_Secure.php';
//Output this user added swaps
include '../includes/ALL.php';
// select all the tables
$sql_added_Swaps = mysql_query( "SELECT *
FROM antiques
WHERE antiques.email = '$Email'
UNION ALL
SELECT *
FROM art
WHERE art.email = '$Email'
UNION ALL
SELECT *
FROM automotive
WHERE automotive.email = '$Email'
UNION ALL
SELECT *
FROM bookscomicsmagazines
WHERE bookscomicsmagazines.email = '$Email'
UNION ALL
SELECT *
FROM businessofficeindustrial
WHERE businessofficeindustrial.email = '$Email'
UNION ALL
SELECT *
FROM clothingaccessories
WHERE clothingaccessories.email = '$Email'
UNION ALL
SELECT *
FROM collectibles
WHERE collectibles.email = '$Email'
UNION ALL
SELECT *
FROM computing
WHERE computing.email = '$Email'
UNION ALL
SELECT *
FROM consumerelectronics
WHERE consumerelectronics.email = '$Email'
UNION ALL
SELECT *
FROM dollsplush
WHERE dollsplush.email = '$Email'
UNION ALL
SELECT *
FROM dvdfilmtv
WHERE dvdfilmtv.email = '$Email'
UNION ALL
SELECT *
FROM hobbiespastimes
WHERE hobbiespastimes.email = '$Email'
UNION ALL
SELECT *
FROM homegardenfamily
WHERE homegardenfamily.email = '$Email'
UNION ALL
SELECT *
FROM jewellerywatches
WHERE jewellerywatches.email = '$Email'
UNION ALL
SELECT *
FROM mobilehomephones
WHERE mobilehomephones.email = '$Email'
UNION ALL
SELECT *
FROM music
WHERE music.email = '$Email'
UNION ALL
SELECT *
FROM musicalinstruments
WHERE musicalinstruments.email = '$Email'
UNION ALL
SELECT *
FROM pcvideogaming
WHERE pcvideogaming.email = '$Email'
UNION ALL
SELECT *
FROM photographyoptical
WHERE photographyoptical.email = '$Email'
UNION ALL
SELECT *
FROM potteryporcelainglass
WHERE potteryporcelainglass.email = '$Email'
UNION ALL
SELECT *
FROM properties
WHERE properties.email = '$Email'
UNION ALL
SELECT *
FROM skillswaps
WHERE skillswaps.email = '$Email'
UNION ALL
SELECT *
FROM sports
WHERE sports.email = '$Email'
UNION ALL
SELECT *
FROM stamps
WHERE stamps.email = '$Email'
UNION ALL
SELECT *
FROM testlistings
WHERE testlistings.email = '$Email'
UNION ALL
SELECT *
FROM ticketstravel
WHERE ticketstravel.email = '$Email'
UNION ALL
SELECT *
FROM toysgames
WHERE toysgames.email = '$Email'
UNION ALL
SELECT *
FROM wholesalejoblots
WHERE wholesalejoblots.email = '$Email'
");
$productCount = mysql_num_rows($sql_added_Swaps);
if ($productCount > 0)
{
$count = 1;
while($row = mysql_fetch_array($sql_added_Swaps))
{
$id = $row["id"];
$track_ID = $row["track_ID"];
$producttittle = $row["producttittle"];
$productdescription = $row["productdescription"];
//what is he expecting in return
$ExchangeWithTittle = $row["ExchangeWithTittle"];
$ExchangeWithDescription = $row["ExchangeWithDescription"];
//Info about the owner of the already added product
$firstname = $row["firstname"];
$city = $row["city"];
$country = $row["country"];
$postalcode = $row["postalcode"];
$email = $row["email"];
$Category = $row["Category"];// what table is it in
$swaptakeplace = $row["swaptakeplace"];
$dateadded = $row["dateadded"];
$rowclass = (is_int($count / 2)) ? ' even' : ' odd';
$check_pic = "../ALL/$Category/$track_ID.jpeg";/////////////////////////////////////////////////////////////////
if (file_exists($check_pic))
{
$user_pic = "../ALL/$Category/$track_ID.jpeg"; ///////////////////////////////////////
}
else
{
$user_pic = "../ALL/$Category/fake.jpeg";//////////////////////////////////////////////////////////////
}
//First part of the table output
$tableFirstpart = '
<div id="addexchanges_Show_Out">
<div id="common_Div_Outside">
<div style="overflow:hidden; padding: 5px 0; margin-bottom: 5px;">
<a href="UserProfiles.php" style="color:white" class="common_Link_Sub">MY PROFILE</a>
<a href="userSwaps.php" style="color:white" class="common_Link_Sub">MY SWAPS</a>
<a href="user_swaphistory.php" style="color:white" class="common_Link_Sub">SWAPS HISTORY</a>
<a href="#" style="color:white" class="common_Link_Sub">FORUMS</a>
</div>
<div class="common_Div_Bg_Rounded">
<table width="100%" id="userprofile_AddedSwaps_Table">
<tr>
<th style="width:10%">Swap Image</th>
<th style="width:20%">Swap Title</th>
<th style="width:20%">Swap with Title</th>
<th style="width:20%">Swap Take place</th>
<th style="width:20%">Date Added</th>
<th style="width:10% ">Edit</th>
</tr>';
$Added_Swaps_list .='
<tr class="' . $rowclass . '">
<td><img style="height:72px; width:60px;" src="' . $user_pic . '"/></td>
<td class="limit">' . $producttittle . '</td>
<td class="limit">' . $ExchangeWithTittle . '</td>
<td class="limit">' . $swaptakeplace . '</td>
<td class="limit">' . $dateadded . '</td>
<td>
<a href="userSwaps.php?deleteThis=' . $track_ID . '">DELETE</a>
<form action="edit.php" method="post">
<input type="hidden" name="country" value="' . $swaptakeplace . '"/>
<input type="hidden" name="table" value="' . $Category . '"/>
<input type="hidden" name="trackID" value="' . $track_ID . '"/>
<input type="submit" name="edit" value="EDIT" id="button_Common_NoStyle"/>
</form><br/>
</td>
</tr>
';
$count++;
$tableSecondpart = '</table></div></div></div>';
//ask them if they are sure that they want to delete this swap
if (isset($_GET['deleteThis']))
{
$ConfirmDelete =
'
<div id="userSwaps_popUp_Delete_FullBg"></div>
<div id="userSwaps_popUp_Delete">
<strong>Are you sure that you want to delete this swap</strong><br/><br/><br/>
<div style="text-align:center">
<a href="userSwaps.php?deleteid=' . $track_ID . '" style="color:red; display:inline-block; margin-right:20px; font-weight: bold;">YES</a>
<a href="userSwaps.php" style="color:green; font-weight: bold;">NO</a>
</div>
</div>
';
}
// If the user clicked the delete Button this code will activate
if (isset($_GET['deleteid']))
{
$deleteID = $_GET['deleteid'];
include '../includes/ALL.php';
mysql_query("DELETE FROM $Category WHERE track_ID='$deleteID'");
//Delete the image from the All folder.
$exchanges_image = 'ALL/' . $Category . '/' . $deleteID . '.jpeg';
if (file_exists($exchanges_image))
{
unlink($exchanges_image);
}
include '../includes/' . $swaptakeplace . '.php';
mysql_query("DELETE FROM $Category WHERE track_ID='$deleteID'") or die("Some thing went wrong");;
//Delete the image from that country category folder.
$country_image = $swaptakeplace. '/paidImages/' . $Category . '/' . $deleteID . '.jpeg';
if (file_exists($country_image))
{
unlink($country_image);
}
header('Location: userSwaps.php');
}
}
}
else
{
$Added_Swaps_list ='<h3>You have no added swaps in the moment why not add some!!!</h3>';
}
}
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Description" content="swaps, la swap, car swaps, swap site, home swap, house swap, swap shop, swapping site, swap stuff online, exchange"/>
<meta name="Keywords" content="swaps, la swap, car swaps, swap site, home swap, house swap, swap shop, swapping site, swap stuff online, exchange"/>
<title>areeban.com swaps, la swap, car swaps, swap site, home swap, house swap, swap shop, swapping site, swap stuff online, exchange</title>
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="../css/style_IE.css" />
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
function limit(max) {
return function (_, elt) {
elt = $(elt);
if (elt.html().length > max) {
elt.html(elt.html().slice(0, max) + "…");
}
};
}
$('.limit').each(limit(120));
});
</script>
</head>
<body>
<?php echo $ConfirmDelete ?>
<!--header begin -->
<?php include_once "$header" ?>
<!--header end -->
<!--main begin -->
<div id="main">
<!--content begin -->
<div id="content">
<?php echo $tableFirstpart ?>
<?php echo $Added_Swaps_list ?>
<?php echo $tableSecondpart ?>
</div>
<!--content end -->
</div>
<!--main end -->
<!--Footer begin -->
<?php include_once "../includes/footer.php";?>
<!--Footer end -->
</body>
</html>
Many thanks,
Youssef