Posted: Tue Jul 17, 2007 1:11 pm
Try this:
Code: Select all
<?php
/**
* EVERAH | I added this bit for error checking and repoting
*/
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
/**
* EVERAH | I added the following for debugging
*/
$debug = true; // set to false to turn off
include 'dbcon.php';
include 'func.php';
require_once 'auth.php';
require_once 'includes/defines.php';
if (!isLoggedIn()) {
Redirect('index.php');
}
if ($debug) {
echo '<p>Debug: SESSION sess_name is : ' . $_SESSION['sess_name'] . ' at ' . __LINE__ . '</p>';
}
$log = $_SESSION['sess_name'];
if ($debug) {
echo '<p>Debug: Variable $s is : ' . $s . ' at ' . __LINE__ . '</p>';
}
$res3 = mysql_query("Select id,echo_count FROM userdata WHERE id='$s'") or die( mysql_error() );
$sel = mysql_fetch_row($res3);
if ($debug) {
echo '<p>Debug: Variable $sel is : ' . $sel . ' at ' . __LINE__ . '</p>';
}
mysql_free_result($res3);
if ($debug) {
echo '<p>Debug: Variable $p is : ' . $p . '</p>';
echo '<p>Debug: SESSION echos is: ' . $_SESSION['echos'] . ' at ' . __LINE__ . '</p>';
}
if ($_SESSION['echos'] >= $p) {
$echos -= $p;
$_SESSION['echos'] = $echos;
if ($debug) {
echo '<p>Debug: Variable $log is : ' . $log . ' at ' . __LINE__ . '</p>';
}
mysql_query("UPDATE userdata SET echo_count = $echos WHERE login = '".$log."' ") or die(mysql_error());
$echosseller += $p;
$sel[1] = $echosseller;
if ($debug) {
echo '<p>Debug: Variable $s is : ' . $s . ' at ' . __LINE__ . '</p>';
}
mysql_query("UPDATE userdata SET echo_count = $echosseller WHERE id = '$s' ") or die(mysql_error());
if ($debug) {
echo '<p>Debug: Variable $log is : ' . $log . ' at ' . __LINE__ . '</p>';
echo '<p>Debug: Variable $it is : ' . $it . ' at ' . __LINE__ . '</p>';
echo '<p>Debug: Variable $pr is : ' . $pr . ' at ' . __LINE__ . '</p>';
}
mysql_query("INSERT INTO coll_inven (user,item,price) VALUES ( '$log', '$it', '$pr' )");
mysql_query("DELETE FROM coll_sell WHERE id=$id");
header('Location: vendor_grovepark.php');
exit;
} else {
header('Location: vendor_grovepark.php?alert=noechos');
exit;
}
?>