Error message after moving a scrtipt to a new server
Posted: Mon Feb 04, 2008 2:58 pm
hello, i just moved to a new server and I dont know much about php but one of my scripts went totally berserks and I dont know what I could change.
below is the error and I'm attaching the perspective files as well....
Any help would be much appreciated!
Warning: include(/config.php) [function.include]: failed to open stream: No such file or directory in /home/europeb/public_html/site_functions.php on line 9
Warning: include() [function.include]: Failed opening '/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/europeb/public_html/site_functions.php on line 9
Fatal error: Call to undefined function create_session() in /home/europeb/public_html/site_functions.php on line 1298
<?
####################################
##declaring all the variables
####################################
##### Enter Database Server #####
define("DATABASE_SERVER","localhost");
##### Enter Database Name #####
define("DATABASE_NAME","europeb_auction");
##### Enter Database UserName #####
##define("DATABASE_USERNAME","atin");
define("DATABASE_USERNAME","europeb");
##### Enter Database password #####
##define("DATABASE_PASSWORD","kapoor");
define("DATABASE_PASSWORD","a123b123");
##### Enter You site URL uptill the folder in which you save these scripts #####
##define("YOURSITE_URL","http://localhost/auction/");
define("YOURSITE_URL","http://www.europe-buy.com/");
##### Enter You site URL uptill the folder in which you save these scripts #####
##define("PAYMENT_URL","http://localhost/auction/payment.php");
define("PAYMENT_URL","http://www.europe-buy.com/payment.php");
##### Enter The Site Name #####
define("SITE_NAME","europe-buy.com");
##### Enter sendmail path #####
define("SENDMAIL_PATH","/usr/lib/sendmail");
define("BANNER_IMAGE_DIR","banner_image/");
##### Enter PDF File Uploading Path #####
define("PDF_FILE_PATH","uploaded");
##### Enter the Max Product Display Value #####
define("PAGE_SIZE","3");
##### Enter Error Text #####
define("ERROR_TEXT","Error:You are not authorized to view this page");
######### Products Directory path ####################
##define("PRODUCT_IMAGE_DIR",$DOCUMENT_ROOT."\\auction\images\\products\\");
define("PRODUCT_IMAGE_DIR",$DOCUMENT_ROOT."/images/products/");
######### Listings per page ####################
define("RECORDS_PER_PAGE","50");
define("ANTI_SNIP","5");
define("ANTI_SNIP_INC","5");
function create_session($session_name) {
session_register($session_name);
}
?>
------------------------------------------------------------------------------------------------------------------------------------
<?php
######### Directory path ####################
##define("FULL_PATH",$DOCUMENT_ROOT."");
define("FULL_PATH",$DOCUMENT_ROOT."/");
$_config_file=FULL_PATH . "config.php";
include($_config_file);
function connection() {
$connection = mysql_connect(DATABASE_SERVER,DATABASE_USERNAME,DATABASE_PASSWORD) or die("cannot connect to the server");
$db = mysql_select_db(DATABASE_NAME,$connection) or die("cannot select the database");
return;
}//end of connection function
function checkSelect($check1, $check2) {
if($check1==$check2) {
return "SELECTED";
}
return "";
}
function checkRadio($check1, $check2) {
if($check1==$check2) {
return "CHECKED";
}
return "";
}
#################################################
#### query_execute function
#################################################
####inserts or updates or deletes or select data into mysql database
####Input parameter : 1) sql query
####
####Output parameter : 1) result
#################################################
function query_execute($query)
{
$result = mysql_query($query);
return $result;
}####end of query_execute function
#################################################
#### num_rows function
#################################################
####return the number of rows affected by the query
####Input parameter : 1) executed sql query
####
####Output parameter : 1) number of rows
#################################################
function num_rows($result)
{
$numrows = mysql_num_rows($result);
return $numrows;
}####end of num_rows function
///////////////////////////////////////////////////////////////
// get_result function
///////////////////////////////////////////////////////////////
//return the result or data of the executed query
//Input parameter : 1) executed sql query
//
//Output parameter : 1) result
///////////////////////////////////////////////////////////////
function get_result($result)
{
$row_count = 0;
$col_count = 0;
while($queryresult_arr = mysql_fetch_row($result))
{
for($col_count=0;$col_count<=count($queryresult_arr);$col_count++)
{
$result_array[$row_count][$col_count] = $queryresult_arr[$col_count];
}
$row_count++;
}
return $result_array;
}//end of get_result function
///////////////////////////////////////////////////////////////
// site_url function
///////////////////////////////////////////////////////////////
//provides the url of the site
///////////////////////////////////////////////////////////////
function site_url()
{
$site_url_path = YOURSITE_URL;
return $site_url_path;
}//end of site_url function
//===== if session expired ========
function sessionExpired() {
echo "<table border=0 cellpadding=5 cellspacing=5><tr><td class=font12>";
echo "Session Expired";
echo "<br><a href='index.php'>Back to login</a>";
echo "</td></tr></table>";
}//end of back_sub function
//===== admin name and email id ========
function admin_detail() {
$detail="Admin<admin@europe-buy.com>";
return $detail;
}
//===== admin name and email id ========
############# Memebership Level Name ###################
function level_name($id) {
$level="ERROR";
$sql="Select level_name from user_fee_structure where id='" . trim($id) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$level=$fees[0];
}
return $level;
}
######### User full name #############
function user_name($id) {
$str="ERROR";
$sql="Select first_name, last_name from user_detail where user_id='" . trim($id) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$str=$fees[0] . " " . $fees[1];
}
return $str;
}
######### User Login Name #############
function get_username($id) {
$str="ERROR";
$sql="Select user from user_login where user_id='" . trim($id) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$str=$fees[0];
}
return $str;
}
######### User Login Name #############
function get_user_regdate($id) {
$str="ERROR";
$sql="Select reg_time from user_login where user_id='" . trim($id) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$str=date("d M Y",$fees[0]);
}
return $str;
}
######### User Location #############
function get_user_location($id) {
global $country_array;
$str="ERROR";
$sql="Select city,country from user_detail where user_id='" . trim($id) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$str=$fees[0] . ", " . $country_array[$fees[1]];
}
return $str;
}
######### return fees for special listing #############
function extra_fees($level_id,$fee_for) {
$str="[ERROR. contact administrator]";
$sql="Select " . $fee_for . " from user_fee_structure where id='" . trim($level_id) . "'";
//echo"<br>sql :-----------------".$sql;
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$str=$fees[0];
}
return $str;
}
####################################
## Category related Functions
####################################
############# Get Category Name ###################
function cat_name($cid) {
$temp="ERROR";
$sql="Select CatName from categories where (CatActive='-1') and CatNum='" . trim($cid) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# Get Category Name ###################
function get_cat_name($cid) {
$temp="ERROR";
$sql="Select CatName from categories where CatNum='" . trim($cid) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
### DELETE ######
############# Get Category Parent ID ###################
function cat_parent_id($cid) {
$temp=-1;
$sql="Select CatParent from categories where (CatActive='-1') and CatNum='" . trim($cid) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# Get Category Parent ID ###################
function get_cat_path($cid) {
$temp=-1;
$sql="Select CatPath from categories where (CatActive='-1') and CatNum='" . trim($cid) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# Get Category Parent ID ###################
function count_prod_by_cat($cid) {
$temp=0;
$cat="|" . trim($cid) . "|";
$sql="Select count(prod_num) from products where (category like '%" . trim($cat) . "%')";
$sql.=" and (active='1') and (now()>=start_time and now()<=end_time)";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# Is cat contains subcat ###################
function is_cat_has_subcat($cid) {
$temp=0;
$sql="Select count(CatNum) from categories where CatActive='-1' and CatPath='" . trim($cid) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# SubCat list by Cat ID ###################
function subcat_list_by_cat($cid) {
$temp=0;
$sql="Select CatNum, CatName from categories where CatActive='-1' and CatPath='" . trim($cid) . "' order by CatName";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=get_result($result);
mysql_free_result($result);
return $fees;
}
else {
return 0;
}
}
############# SubCat list by Cat ID ###################
function get_cat_list() {
$temp=0;
$sql="Select CatNum, CatName, CatPath from categories where CatActive='-1' and CatPath='|1|' order by CatName";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=get_result($result);
mysql_free_result($result);
return $fees;
}
else {
return 0;
}
}
################################
#### cat_multisubcat_dropdown
################################
function get_cat_path_names($str) {
$temp="";
$data=explode("|",$str);
while(list($_id,$_val)=each($data)) {
if(trim($_val)!="" and trim($_val)!="1" ) {
if(trim($temp)!="") {
$temp .= " - ";
}
$temp .= get_cat_name($_val);
}
}
return $temp;
}
function get_cat_subcat_array() {
$sql="select CatName,CatNum,CatPath from categories where CatNum!='1'";
$result=mysql_query($sql);
$num=mysql_num_rows($result);
if($num>0) {
$cat_path_array=get_result($result);
mysql_free_result($result);
for($i=0;$i<$num;$i++) {
$cat_full_path=$cat_path_array[$i][2] . $cat_path_array[$i][1];
$cat_path_array[$i][0]=get_cat_path_names($cat_full_path);
}
sort($cat_path_array);
return $cat_path_array;
}
}
####################################
## Bidding related Functions
####################################
############# Get Current bid price ###################
function get_display_price($price,$price1,$list_type,$auction_type) {
$temp="$0.00";
if(trim($list_type)=="IB") {
$temp="$" . $price1;
}
else if(trim($list_type)=="SA") {
$temp="$" . $price;
}
else if(trim($list_type)=="CL") {
$temp="$" . $price;
}
else {
if(trim($auction_type)=="AB") {
$temp="$" . $price . "<br>" . "$" . $price1;
}
else if(trim($auction_type)=="IB") {
$temp="$" . $price1;
}
else {
$temp="$" . $price;
}
}## main else
return $temp;
}
############# Get Current bid price ###################
/*
function get_current_bid_price($pid,$auction_type,$list_type) {
$temp="$0.00";
if(trim($auction_type)=="AB") {
$sql="Select start_price, buy_price from products_auction where prod_num='" . trim($pid) . "'";
$result=mysql_query($sql);
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp="$" . $fees[0] . "<br>" . "$" . $fees[1];
}
} else {
if(trim($auction_type)=="IB") {
$sql="Select price from products_buy where prod_num='" . trim($pid) . "'";
}
else if(trim($auction_type)=="CL") {
$sql="Select price from products_classified where prod_num='" . trim($pid) . "'";
}
else {
$sql="Select start_price from products_auction where prod_num='" . trim($pid) . "'";
}
$result=mysql_query($sql);
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp="$" . $fees[0];
}
}
return $temp;
}
*/
############# Get Date in dd Month Time format ###################
function get_date_format($dt) {
$temp=$dt;
if(trim($temp)!="") {
$temp1=explode(" ",trim($temp));
$date1=explode("-",trim($temp1[0]));
$time1=explode(":",trim($temp1[1]));
$temp=date("d M H:i",mktime ($time1[0],$time1[1],$time1[2],$date1[1],$date1[2],$date1[0]));
}
return $temp;
}
############# Get Number of Bids ###################
function get_number_of_bids($pid,$auction_type,$list_type) {
$temp="";
if(trim($list_type)=="IB") {
$temp="Instant Buy";
}
else if(trim($list_type)=="SA") {
$temp="0";
}
else if(trim($list_type)=="CL") {
$temp="Classified";
}
else {
if(trim($auction_type)=="AB") {
$temp="0" . "<br>" . "Instant Buy";
}
else if(trim($auction_type)=="IB") {
$temp="Instant Buy";
}
else if(trim($auction_type)=="CL") {
$temp="Classified";
}
else {
$temp="0";
}
}## main else
return $temp;
}
####################################
## Other Functions
####################################
############# Censor Bad words ###################
function censor_bad_words($str) {
$temp=$str;
$sql="Select bad_word from censored_words";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=get_result($result);
mysql_free_result($result);
for($i=0;$i<$num;$i++) {
if(trim($fees[$i][0])!="") {
$search_str=$fees[$i][0];
$temp=preg_replace("|\\b$search_str\\b|i","",$temp);
}
}
}
return $temp;
}
############# Censor Bad words ###################
function get_location_name($lid) {
$temp="";
$sql="Select location from product_locations where id=" . trim($lid);
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# Re Listing ###################
function relist_product($prod_num) {
$query_select = "select * from products where prod_num = $prod_num";
$result_select = mysql_query($query_select);
$rows_select = mysql_num_rows($result_select);
if($rows_select > 0)
{
$query_result_select = get_result($result_select);
$product_id = $query_result_select[0][0];
$user_seller = $query_result_select[0][1];
$product_name = $query_result_select[0][2];
$new_title_description = $query_result_select[0][3];
$product_image = $query_result_select[0][4];
$cat = $query_result_select[0][5];
$start_on = $query_result_select[0][6];
$end_on = $query_result_select[0][7];
######### calculating start and end date ####
$start_on = explode(" ",$start_on);
$end_on = explode(" ",$end_on);
$start_on = explode("-",$start_on[0]);
$end_on = explode("-",$end_on[0]);
$start_mktime = mktime(0,0,0,$start_on[1],$start_on[2],$start_on[0]);
$end_mktime = mktime(0,0,0,$end_on[1],$end_on[2],$end_on[0]);
$list_days = ($end_mktime - $start_mktime) / 86400;
$start_on = date("Y-m-d H:i:s");
$end_on="DATE_ADD(\"" . $start_on . "\", INTERVAL " . $list_days . " DAY)";
######### End of .. calculating start and end date ####
$listing_type = $query_result_select[0][8];
$active = $query_result_select[0][9];
$boldtitle = $query_result_select[0][10];
$catfeatured = $query_result_select[0][11];
$homefeatured = $query_result_select[0][12];
$current_price = $query_result_select[0][13];
$buy_price1 = $query_result_select[0][14];
$location = $query_result_select[0][15];
$auto_relist = $query_result_select[0][16];
$sql="insert into products(prod_num,user_id, title, description,image,category, start_time, end_time, listing_type, active, bold_title, cat_featured, home_featured,current_price,buy_price1,location,auto_relist)" .
" values('','" . trim($user_seller) . "','" . trim($product_name) . "','" . trim($new_title_description) . "','$product_image','" . trim($cat) . "','" . trim($start_on) . "'," .
trim($end_on) . ",'$listing_type','$active','" . trim($boldtitle) . "','" . trim($catfeatured) . "','" . trim($homefeatured) . "','" . trim($current_price) . "','" . trim($buy_price1) . "','" . trim($location) . "','" . trim($auto_relist) . "')";
$result=mysql_query($sql) or die("ERROR:" . mysql_error());
$sql="select max(prod_num) from products";
$result=mysql_query($sql) or die("ERROR:" . mysql_error());
$num=mysql_num_rows($result);
if($num>0) {
$data=mysql_fetch_row($result);
mysql_free_result($result);
$temp_prod_num=$data[0];
} else {
$err_str="<br>Error while adding listing. Please contact administrator.";
}
if($listing_type == "CL")
{
$sql_classified = "select * from products_classified where prod_num = $prod_num";
$result_classified = mysql_query($sql_classified);
$num_classified = mysql_num_rows($result_classified);
if($num_classified >0)
{
$result_classified = get_result($result_classified);
$price = $result_classified[0][2];
$contact = $result_classified[0][3];
$sql="insert into products_classified( id, prod_num, price, contact)" .
" values('','" . trim($temp_prod_num) . "','" . trim($price) . "','" . trim($contact) . "')";
$result=mysql_query($sql) or die("ERROR:" . mysql_error());
}
}
else if($listing_type == "IB")
{
$sql_buy = "select * from products_buy where prod_num = $prod_num";
$result_buy = mysql_query($sql_buy);
$num_buy = mysql_num_rows($result_buy);
if($num_buy >0)
{
$result_buy = get_result($result_buy);
$condition = $result_buy[0][2];
$price = $result_buy[0][3];
$quantity = $result_buy[0][4];
$p_paypal = $result_buy[0][5];
$p_check = $result_buy[0][6];
$p_cod = $result_buy[0][7];
$s_local = $result_buy[0][8];
$local_charges = $result_buy[0][9];
$s_international = $result_buy[0][10];
$international_charges = $result_buy[0][11];
$instruction = $result_buy[0][12];
$warranty = $result_buy[0][13];
$sql="insert into products_buy( id, prod_num, condition, price, quantity, pay_paypal, pay_check, pay_cod, ship_local, ship_local_charges, ship_international, ship_international_charges, pay_ship_instructions, warranty)" .
" values('','" . trim($temp_prod_num) . "','" . trim($condition) . "','" . trim($price) . "','" . trim($quantity) . "','" . trim($p_paypal) . "','" . trim($p_check) . "','" .
trim($p_cod) . "','" .trim($s_local) . "','" . trim($local_charges) . "','" . trim($s_international) . "','" . trim($international_charges) . "','" .
trim($instruction) . "','" .trim($warranty) . "')";
$result=mysql_query($sql) or die("ERROR:" . mysql_error());
}
}
else if($listing_type == "SA")
{
$sql_auction = "select * from products_auction where prod_num = $prod_num";
$result_auction = mysql_query($sql_auction);
$num_auction = mysql_num_rows($result_auction);
if($num_auction > 0)
{
$result_auction = get_result($result_auction);
$condition = $result_auction[0][2];
$start_price = $result_auction[0][3];
$increment = $result_auction[0][4];
$reserve_price = $result_auction[0][5];
$buy_price = $result_auction[0][6];
$quantity = $result_auction[0][7];
$p_paypal = $result_auction[0][8];
$p_check = $result_auction[0][9];
$p_cod = $result_auction[0][10];
$s_local = $result_auction[0][11];
$local_charges = $result_auction[0][12];
$s_international = $result_auction[0][13];
$international_charges = $result_auction[0][14];
$instruction = $result_auction[0][15];
$warranty = $result_auction[0][16];
$sql="insert into products_auction( id, prod_num, condition, start_price, bid_increment, reserve_price, buy_price, quantity, pay_paypal, pay_check, pay_cod, ship_local, ship_local_charges, ship_international, ship_international_charges, pay_ship_instructions, warranty)" .
" values('','" . trim($temp_prod_num) . "','" . trim($condition) . "','" . trim($start_price) . "','" . trim($increment) . "','" .
trim($reserve_price) . "','" .trim($buy_price) . "','" . trim($quantity) . "','" . trim($p_paypal) . "','" . trim($p_check) . "','" .
trim($p_cod) . "','" .trim($s_local) . "','" . trim($local_charges) . "','" . trim($s_international) . "','" . trim($international_charges) . "','" .
trim($instruction) . "','" .trim($warranty) . "')";
$result=mysql_query($sql) or die("ERROR:" . mysql_error());
}
}
}
}
############# End of .. Re Listing ###################
//################ function to calculate number of auctions/ib/clasifed closing today ########################
function closing_today($list_type,$user_id)
{
$td_date = getdate();
if(strlen($td_date["mday"])==1)
$td_date["mday"] = "0".$td_date["mday"];
if(strlen($td_date["mon"])==1)
$td_date["mon"] = "0".$td_date["mon"];
$ini_date = $td_date["year"]."-".$td_date["mon"]."-".$td_date["mday"];
if($list_type=="SA")
{
$result = '';
$query_closing = "select end_time from products where listing_type = 'SA' and user_id = $user_id and end_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
elseif($list_type=="IB")
{
$result = '';
$query_closing = "select end_time from products where listing_type = 'IB' and user_id = $user_id and end_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
$result = '';
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
else
{
$result = '';
$query_closing = "select end_time from products where listing_type = 'CL' and user_id = $user_id and end_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
$result = '';
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
//echo"<br>result :----------------".$result;
if($result=='')
$result = 0;
return $result;
}
//############################################################################################################
//################ function to calculate number of auctions/ib/clasifed opening today ########################
function opening_today($list_type,$user_id)
{
$td_date = getdate();
if(strlen($td_date["mday"])==1)
$td_date["mday"] = "0".$td_date["mday"];
if(strlen($td_date["mon"])==1)
$td_date["mon"] = "0".$td_date["mon"];
$ini_date = $td_date["year"]."-".$td_date["mon"]."-".$td_date["mday"];
if($list_type=="SA")
{
$result = '';
$query_closing = "select start_time from products where listing_type = 'SA' and user_id = $user_id and start_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
elseif($list_type=="IB")
{
$result = '';
$query_closing = "select start_time from products where listing_type = 'IB' and user_id = $user_id and start_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
$result = '';
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
else
{
$result = '';
$query_closing = "select start_time from products where listing_type = 'CL' and user_id = $user_id and start_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
$result = '';
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
//echo"<br>result :----------------".$result;
if($result=='')
$result = 0;
return $result;
}
//############################################################################################################
//################# number of auctions/ib/classified/ loaded on the day ####################################
function loaded_today($list_type,$user_id)
{
if($list_type=="SA")
{
$query_closing1 = "select count(*) from products where listing_type = 'SA' and user_id = $user_id and (now()>=start_time and now()<=end_time) and active = 1";
$result_closing1 = query_execute($query_closing1);
$query_result_closing = get_result($result_closing1);
$result = $query_result_closing[0][0];
}
elseif($list_type=="IB")
{
$query_closing1 = "select count(*) from products where listing_type = 'IB' and user_id = $user_id and (now()>=start_time and now()<=end_time) and active = 1";
$result_closing1 = query_execute($query_closing1);
$query_result_closing = get_result($result_closing1);
$result = $query_result_closing[0][0]; }
else
{
$query_closing1 = "select count(*) from products where listing_type = 'CL' and user_id = $user_id and (now()>=start_time and now()<=end_time) and active = 1";
$result_closing1 = query_execute($query_closing1);
$query_result_closing = get_result($result_closing1);
$result = $query_result_closing[0][0]; }
if($result=='')
$result = 0;
return $result;
}
//########## geting the banner click details #####################################################################################
function banner_detail($user_id)
{
$query_banner_det = "select banner_id,banner_name from user_banner where user_id = $user_id and active=1";
$result_banner_det = query_execute($query_banner_det);
$rows_banner_det = num_rows($result_banner_det);
if($rows_banner_det > 0)
{
$query_result_banner_det = get_result($result_banner_det);
$result = "<tr><td> </td></tr>";
for($jk=0;$jk<$rows_banner_det;$jk++)
{
$banner_id = $query_result_banner_det[$jk][0];
$banner_name = $query_result_banner_det[$jk][1];
$query_count_banner_click = "select banner_number from banner_view where banner_id = $banner_id";
$result_count_banner_click = query_execute($query_count_banner_click);
$rows_count_banner_click = num_rows($result_count_banner_click);
if($rows_count_banner_click > 0)
{
$query_count_banner_click = get_result($result_count_banner_click);
$banner_click = $query_count_banner_click[0][0];
echo $result."<tr><td class='font121'> $banner_name : <b>$banner_click</b> Clicks</td></tr>";
}
else
{
echo $result ."<tr><td class='font121'> $banner_name : No Clicks</td></tr>";
}
}
}
else
{
echo $result. "<br><tr><td align='center' class='alert'>No banner uploaded</td></tr>";
}
return $result;
}
####################################
## Session related Functions
####################################
####################################
## Array Initialized
####################################
######### Auction Listing Type #######################
$auction_type_array = array (
"AB" => "Auction + Buy",
"IB" => "Instant Buy",
"CL" => "Classified",
"SA" => "Auction",
"DA" => "Dutch Auction"
);
########################## function for blocked user ###################################
function blocked_users($uid,$user_id)
{
$query_select_block = "select block_user from user_seller where user_id = $uid";
$result_select_block = query_execute($query_select_block);
$rows_select_block = num_rows($result_select_block);
if($rows_select_block > 0)
{
$query_result_select_block = get_result($result_select_block);
$block_user1 = $query_result_select_block[0][0];
if($block_user1 == '')
$block_val = 0;
else
{
$block_user = explode("|",$block_user1);
$num_block = count($block_user);
$test = 2;
for($k=0;$k<$num_block;$k++)
{
$block_id = $block_user[$k];
if($block_id == $user_id)
{
$block_val = 1;
$test = 2;
break;
}
else
$block_val = 0;
if($test !=2)
$block_val = 0;
}
}
}
return $block_val;
}
######### country array #######################
$country_array = array(
'AF' => 'Afghanistan',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarctica',
'AG' => 'Antigua and Barbuda',
'AR' => 'Argentina',
'AM' => 'Armenia',
'AW' => 'Aruba',
'AC' => 'Ascension Island',
'AU' => 'Australia',
'AT' => 'Austria',
'AZ' => 'Azerbaidjan',
'BS' => 'Bahamas',
'BH' => 'Bahrain',
'BD' => 'Banglades',
'BB' => 'Barbados',
'BY' => 'Belarus',
'BE' => 'Belgium',
'BZ' => 'Belize',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BO' => 'Bolivia',
'BA' => 'Bosnia-Herzegovina',
'BW' => 'Botswana',
'BR' => 'Brazil',
'BN' => 'Brunei Darussalam',
'BG' => 'Bulgaria',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'BT' => 'Buthan',
'KH' => 'Cambodia',
'CM' => 'Cameroon',
'CA' => 'Canada',
'CV' => 'Cape Verde',
'KY' => 'Cayman Islands',
'CF' => 'Central African Rep.',
'TD' => 'Chad',
'CL' => 'Chile',
'CN' => 'China',
'CX' => 'Christmas Island',
'CC' => 'Cocos (Keeling) Isl.',
'CO' => 'Colombia',
'KM' => 'Comoros',
'CG' => 'Congo',
'CK' => 'Cook Islands',
'CR' => 'Costa Rica',
'HR' => 'Croatia',
'CY' => 'Cyprus',
'CZ' => 'Czech Republic',
'CS' => 'Czechoslovakia',
'DK' => 'Denmark',
'DJ' => 'Djibouti',
'DM' => 'Dominica',
'DO' => 'Dominican Republic',
'EC' => 'Ecuador',
'EG' => 'Egypt',
'SV' => 'El Salvador',
'GQ' => 'Equatorial Guinea',
'EE' => 'Estonia',
'ET' => 'Ethiopia',
'FK' => 'Falkland Isl.(Malvinas)',
'FO' => 'Faroe Islands',
'FJ' => 'Fiji',
'FI' => 'Finland',
'FR' => 'France',
'GA' => 'Gabon',
'GM' => 'Gambia',
'GE' => 'Georgia',
'DE' => 'Germany',
'GH' => 'Ghana',
'GI' => 'Gibraltar',
'GR' => 'Greece',
'GL' => 'Greenland',
'GD' => 'Grenada',
'GP' => 'Guadeloupe (Fr.)',
'GU' => 'Guam (US)',
'GT' => 'Guatemala',
'GN' => 'Guinea',
'GY' => 'Guyana',
'HT' => 'Haiti',
'HN' => 'Honduras',
'HK' => 'Hong Kong',
'HU' => 'Hungary',
'IS' => 'Iceland',
'IN' => 'India',
'ID' => 'Indonesia',
'IQ' => 'Iraq',
'IE' => 'Ireland',
'IL' => 'Israel',
'IT' => 'Italy',
'CI' => 'Ivory Coast',
'JM' => 'Jamaica',
'JP' => 'Japan',
'JO' => 'Jordan',
'KZ' => 'Kazachstan',
'KE' => 'Kenya',
'KI' => 'Kiribati',
'KR' => 'Korea (South)',
'KW' => 'Kuwait',
'LA' => 'Laos',
'LV' => 'Latvia',
'LB' => 'Lebanon',
'LS' => 'Lesotho',
'LR' => 'Liberia',
'LY' => 'Libya',
'LI' => 'Liechtenstein',
'LT' => 'Lithuania',
'LU' => 'Luxembourg',
'MO' => 'Macau',
'MG' => 'Madagascar',
'MW' => 'Malawi',
'MY' => 'Malaysia',
'MV' => 'Maldives',
'ML' => 'Mali',
'MT' => 'Malta',
'MH' => 'Marshall Islands',
'MQ' => 'Martinique (Fr.)',
'MR' => 'Mauritania',
'MU' => 'Mauritius',
'MX' => 'Mexico',
'FM' => 'Micronesia',
'MD' => 'Moldavia',
'MC' => 'Monaco',
'MN' => 'Mongolia',
'MS' => 'Montserrat',
'MA' => 'Morocco',
'MZ' => 'Mozambique',
'MM' => 'Myanmar',
'NA' => 'Namibia',
'NR' => 'Nauru',
'NP' => 'Nepal',
'AN' => 'Netherland Antilles',
'NL' => 'Netherlands',
'NC' => 'New Caledonia (Fr.)',
'NZ' => 'New Zealand',
'NI' => 'Nicaragua',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'NF' => 'Norfolk Island',
'NO' => 'Norway',
'OM' => 'Oman',
'PK' => 'Pakistan',
'PW' => 'Palau',
'PA' => 'Panama',
'PG' => 'Papua New',
'PY' => 'Paraguay',
'PE' => 'Peru',
'PH' => 'Philippines',
'PL' => 'Poland',
'PT' => 'Portugal',
'PR' => 'Puerto Rico (US)',
'QA' => 'Qatar',
'RE' => 'Reunion (Fr.)',
'RO' => 'Romania',
'RU' => 'Russian Federation',
'RW' => 'Rwanda',
'LC' => 'Saint Lucia',
'SM' => 'San Marino',
'SA' => 'Saudi Arabia',
'SN' => 'Senegal',
'SC' => 'Seychelles',
'SL' => 'Sierra Leone',
'SG' => 'Singapore',
'SK' => 'Slovak Republic',
'SI' => 'Slovenia',
'SB' => 'Solomon Islands',
'SO' => 'Somalia',
'ZA' => 'South Africa',
'ES' => 'Spain',
'LK' => 'Sri Lanka',
'SH' => 'St. Helena',
'PM' => 'St. Pierre & Miquelon',
'KN' => 'St.Kitts Nevis Anguilla',
'VC' => 'St.Vincent & Grenadines',
'SD' => 'Sudan',
'SR' => 'Suriname',
'SZ' => 'Swaziland',
'SE' => 'Sweden',
'CH' => 'Switzerland',
'TJ' => 'Tadjikistan',
'TW' => 'Taiwan',
'TZ' => 'Tanzania',
'TH' => 'Thailand',
'TG' => 'Togo',
'TK' => 'Tokelau',
'TO' => 'Tonga',
'TT' => 'Trinidad & Tobago',
'TN' => 'Tunisia',
'TR' => 'Turkey',
'TM' => 'Turkmenistan',
'TC' => 'Turks & Caicos Islands',
'TV' => 'Tuvalu',
'UG' => 'Uganda',
'UA' => 'Ukraine',
'AE' => 'United Arab Emirates',
'UK' => 'United Kingdom',
'US' => 'United States',
'UY' => 'Uruguay',
'UZ' => 'Uzbekistan',
'VU' => 'Vanuatu',
'VA' => 'Vatican City State',
'VE' => 'Venezuela',
'VN' => 'Vietnam',
'VG' => 'Virgin Islands (British)',
'VI' => 'Virgin Islands (US)',
'WF' => 'Wallis & Futuna Islands',
'YE' => 'Yemen',
'YU' => 'Yugoslavia',
'ZR' => 'Zaire',
'ZM' => 'Zambia',
'ZW' => 'Zimbabwe',
);
##########################################
//===== assigning values to variables ========
reset($HTTP_POST_VARS);
while(list($iname,$ival) = each($HTTP_POST_VARS)) {
if($ival <> "") {
$$iname = $ival;
}
}
reset($HTTP_POST_VARS);
reset($HTTP_GET_VARS);
while(list($iname,$ival) = each($HTTP_GET_VARS)) {
if($ival <> "") {
$$iname = $ival;
}
}
reset($HTTP_GET_VARS);
//===== end of assigning values to variables ========
create_session("user_id");
connection();
?>
below is the error and I'm attaching the perspective files as well....
Any help would be much appreciated!
Warning: include(/config.php) [function.include]: failed to open stream: No such file or directory in /home/europeb/public_html/site_functions.php on line 9
Warning: include() [function.include]: Failed opening '/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/europeb/public_html/site_functions.php on line 9
Fatal error: Call to undefined function create_session() in /home/europeb/public_html/site_functions.php on line 1298
<?
####################################
##declaring all the variables
####################################
##### Enter Database Server #####
define("DATABASE_SERVER","localhost");
##### Enter Database Name #####
define("DATABASE_NAME","europeb_auction");
##### Enter Database UserName #####
##define("DATABASE_USERNAME","atin");
define("DATABASE_USERNAME","europeb");
##### Enter Database password #####
##define("DATABASE_PASSWORD","kapoor");
define("DATABASE_PASSWORD","a123b123");
##### Enter You site URL uptill the folder in which you save these scripts #####
##define("YOURSITE_URL","http://localhost/auction/");
define("YOURSITE_URL","http://www.europe-buy.com/");
##### Enter You site URL uptill the folder in which you save these scripts #####
##define("PAYMENT_URL","http://localhost/auction/payment.php");
define("PAYMENT_URL","http://www.europe-buy.com/payment.php");
##### Enter The Site Name #####
define("SITE_NAME","europe-buy.com");
##### Enter sendmail path #####
define("SENDMAIL_PATH","/usr/lib/sendmail");
define("BANNER_IMAGE_DIR","banner_image/");
##### Enter PDF File Uploading Path #####
define("PDF_FILE_PATH","uploaded");
##### Enter the Max Product Display Value #####
define("PAGE_SIZE","3");
##### Enter Error Text #####
define("ERROR_TEXT","Error:You are not authorized to view this page");
######### Products Directory path ####################
##define("PRODUCT_IMAGE_DIR",$DOCUMENT_ROOT."\\auction\images\\products\\");
define("PRODUCT_IMAGE_DIR",$DOCUMENT_ROOT."/images/products/");
######### Listings per page ####################
define("RECORDS_PER_PAGE","50");
define("ANTI_SNIP","5");
define("ANTI_SNIP_INC","5");
function create_session($session_name) {
session_register($session_name);
}
?>
------------------------------------------------------------------------------------------------------------------------------------
<?php
######### Directory path ####################
##define("FULL_PATH",$DOCUMENT_ROOT."");
define("FULL_PATH",$DOCUMENT_ROOT."/");
$_config_file=FULL_PATH . "config.php";
include($_config_file);
function connection() {
$connection = mysql_connect(DATABASE_SERVER,DATABASE_USERNAME,DATABASE_PASSWORD) or die("cannot connect to the server");
$db = mysql_select_db(DATABASE_NAME,$connection) or die("cannot select the database");
return;
}//end of connection function
function checkSelect($check1, $check2) {
if($check1==$check2) {
return "SELECTED";
}
return "";
}
function checkRadio($check1, $check2) {
if($check1==$check2) {
return "CHECKED";
}
return "";
}
#################################################
#### query_execute function
#################################################
####inserts or updates or deletes or select data into mysql database
####Input parameter : 1) sql query
####
####Output parameter : 1) result
#################################################
function query_execute($query)
{
$result = mysql_query($query);
return $result;
}####end of query_execute function
#################################################
#### num_rows function
#################################################
####return the number of rows affected by the query
####Input parameter : 1) executed sql query
####
####Output parameter : 1) number of rows
#################################################
function num_rows($result)
{
$numrows = mysql_num_rows($result);
return $numrows;
}####end of num_rows function
///////////////////////////////////////////////////////////////
// get_result function
///////////////////////////////////////////////////////////////
//return the result or data of the executed query
//Input parameter : 1) executed sql query
//
//Output parameter : 1) result
///////////////////////////////////////////////////////////////
function get_result($result)
{
$row_count = 0;
$col_count = 0;
while($queryresult_arr = mysql_fetch_row($result))
{
for($col_count=0;$col_count<=count($queryresult_arr);$col_count++)
{
$result_array[$row_count][$col_count] = $queryresult_arr[$col_count];
}
$row_count++;
}
return $result_array;
}//end of get_result function
///////////////////////////////////////////////////////////////
// site_url function
///////////////////////////////////////////////////////////////
//provides the url of the site
///////////////////////////////////////////////////////////////
function site_url()
{
$site_url_path = YOURSITE_URL;
return $site_url_path;
}//end of site_url function
//===== if session expired ========
function sessionExpired() {
echo "<table border=0 cellpadding=5 cellspacing=5><tr><td class=font12>";
echo "Session Expired";
echo "<br><a href='index.php'>Back to login</a>";
echo "</td></tr></table>";
}//end of back_sub function
//===== admin name and email id ========
function admin_detail() {
$detail="Admin<admin@europe-buy.com>";
return $detail;
}
//===== admin name and email id ========
############# Memebership Level Name ###################
function level_name($id) {
$level="ERROR";
$sql="Select level_name from user_fee_structure where id='" . trim($id) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$level=$fees[0];
}
return $level;
}
######### User full name #############
function user_name($id) {
$str="ERROR";
$sql="Select first_name, last_name from user_detail where user_id='" . trim($id) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$str=$fees[0] . " " . $fees[1];
}
return $str;
}
######### User Login Name #############
function get_username($id) {
$str="ERROR";
$sql="Select user from user_login where user_id='" . trim($id) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$str=$fees[0];
}
return $str;
}
######### User Login Name #############
function get_user_regdate($id) {
$str="ERROR";
$sql="Select reg_time from user_login where user_id='" . trim($id) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$str=date("d M Y",$fees[0]);
}
return $str;
}
######### User Location #############
function get_user_location($id) {
global $country_array;
$str="ERROR";
$sql="Select city,country from user_detail where user_id='" . trim($id) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$str=$fees[0] . ", " . $country_array[$fees[1]];
}
return $str;
}
######### return fees for special listing #############
function extra_fees($level_id,$fee_for) {
$str="[ERROR. contact administrator]";
$sql="Select " . $fee_for . " from user_fee_structure where id='" . trim($level_id) . "'";
//echo"<br>sql :-----------------".$sql;
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$str=$fees[0];
}
return $str;
}
####################################
## Category related Functions
####################################
############# Get Category Name ###################
function cat_name($cid) {
$temp="ERROR";
$sql="Select CatName from categories where (CatActive='-1') and CatNum='" . trim($cid) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# Get Category Name ###################
function get_cat_name($cid) {
$temp="ERROR";
$sql="Select CatName from categories where CatNum='" . trim($cid) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
### DELETE ######
############# Get Category Parent ID ###################
function cat_parent_id($cid) {
$temp=-1;
$sql="Select CatParent from categories where (CatActive='-1') and CatNum='" . trim($cid) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# Get Category Parent ID ###################
function get_cat_path($cid) {
$temp=-1;
$sql="Select CatPath from categories where (CatActive='-1') and CatNum='" . trim($cid) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# Get Category Parent ID ###################
function count_prod_by_cat($cid) {
$temp=0;
$cat="|" . trim($cid) . "|";
$sql="Select count(prod_num) from products where (category like '%" . trim($cat) . "%')";
$sql.=" and (active='1') and (now()>=start_time and now()<=end_time)";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# Is cat contains subcat ###################
function is_cat_has_subcat($cid) {
$temp=0;
$sql="Select count(CatNum) from categories where CatActive='-1' and CatPath='" . trim($cid) . "'";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# SubCat list by Cat ID ###################
function subcat_list_by_cat($cid) {
$temp=0;
$sql="Select CatNum, CatName from categories where CatActive='-1' and CatPath='" . trim($cid) . "' order by CatName";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=get_result($result);
mysql_free_result($result);
return $fees;
}
else {
return 0;
}
}
############# SubCat list by Cat ID ###################
function get_cat_list() {
$temp=0;
$sql="Select CatNum, CatName, CatPath from categories where CatActive='-1' and CatPath='|1|' order by CatName";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=get_result($result);
mysql_free_result($result);
return $fees;
}
else {
return 0;
}
}
################################
#### cat_multisubcat_dropdown
################################
function get_cat_path_names($str) {
$temp="";
$data=explode("|",$str);
while(list($_id,$_val)=each($data)) {
if(trim($_val)!="" and trim($_val)!="1" ) {
if(trim($temp)!="") {
$temp .= " - ";
}
$temp .= get_cat_name($_val);
}
}
return $temp;
}
function get_cat_subcat_array() {
$sql="select CatName,CatNum,CatPath from categories where CatNum!='1'";
$result=mysql_query($sql);
$num=mysql_num_rows($result);
if($num>0) {
$cat_path_array=get_result($result);
mysql_free_result($result);
for($i=0;$i<$num;$i++) {
$cat_full_path=$cat_path_array[$i][2] . $cat_path_array[$i][1];
$cat_path_array[$i][0]=get_cat_path_names($cat_full_path);
}
sort($cat_path_array);
return $cat_path_array;
}
}
####################################
## Bidding related Functions
####################################
############# Get Current bid price ###################
function get_display_price($price,$price1,$list_type,$auction_type) {
$temp="$0.00";
if(trim($list_type)=="IB") {
$temp="$" . $price1;
}
else if(trim($list_type)=="SA") {
$temp="$" . $price;
}
else if(trim($list_type)=="CL") {
$temp="$" . $price;
}
else {
if(trim($auction_type)=="AB") {
$temp="$" . $price . "<br>" . "$" . $price1;
}
else if(trim($auction_type)=="IB") {
$temp="$" . $price1;
}
else {
$temp="$" . $price;
}
}## main else
return $temp;
}
############# Get Current bid price ###################
/*
function get_current_bid_price($pid,$auction_type,$list_type) {
$temp="$0.00";
if(trim($auction_type)=="AB") {
$sql="Select start_price, buy_price from products_auction where prod_num='" . trim($pid) . "'";
$result=mysql_query($sql);
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp="$" . $fees[0] . "<br>" . "$" . $fees[1];
}
} else {
if(trim($auction_type)=="IB") {
$sql="Select price from products_buy where prod_num='" . trim($pid) . "'";
}
else if(trim($auction_type)=="CL") {
$sql="Select price from products_classified where prod_num='" . trim($pid) . "'";
}
else {
$sql="Select start_price from products_auction where prod_num='" . trim($pid) . "'";
}
$result=mysql_query($sql);
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp="$" . $fees[0];
}
}
return $temp;
}
*/
############# Get Date in dd Month Time format ###################
function get_date_format($dt) {
$temp=$dt;
if(trim($temp)!="") {
$temp1=explode(" ",trim($temp));
$date1=explode("-",trim($temp1[0]));
$time1=explode(":",trim($temp1[1]));
$temp=date("d M H:i",mktime ($time1[0],$time1[1],$time1[2],$date1[1],$date1[2],$date1[0]));
}
return $temp;
}
############# Get Number of Bids ###################
function get_number_of_bids($pid,$auction_type,$list_type) {
$temp="";
if(trim($list_type)=="IB") {
$temp="Instant Buy";
}
else if(trim($list_type)=="SA") {
$temp="0";
}
else if(trim($list_type)=="CL") {
$temp="Classified";
}
else {
if(trim($auction_type)=="AB") {
$temp="0" . "<br>" . "Instant Buy";
}
else if(trim($auction_type)=="IB") {
$temp="Instant Buy";
}
else if(trim($auction_type)=="CL") {
$temp="Classified";
}
else {
$temp="0";
}
}## main else
return $temp;
}
####################################
## Other Functions
####################################
############# Censor Bad words ###################
function censor_bad_words($str) {
$temp=$str;
$sql="Select bad_word from censored_words";
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=get_result($result);
mysql_free_result($result);
for($i=0;$i<$num;$i++) {
if(trim($fees[$i][0])!="") {
$search_str=$fees[$i][0];
$temp=preg_replace("|\\b$search_str\\b|i","",$temp);
}
}
}
return $temp;
}
############# Censor Bad words ###################
function get_location_name($lid) {
$temp="";
$sql="Select location from product_locations where id=" . trim($lid);
$result=mysql_query($sql) or die("Query failed");
$num=mysql_num_rows($result);
if($num>0) {
$fees=mysql_fetch_row($result);
mysql_free_result($result);
$temp=$fees[0];
}
return $temp;
}
############# Re Listing ###################
function relist_product($prod_num) {
$query_select = "select * from products where prod_num = $prod_num";
$result_select = mysql_query($query_select);
$rows_select = mysql_num_rows($result_select);
if($rows_select > 0)
{
$query_result_select = get_result($result_select);
$product_id = $query_result_select[0][0];
$user_seller = $query_result_select[0][1];
$product_name = $query_result_select[0][2];
$new_title_description = $query_result_select[0][3];
$product_image = $query_result_select[0][4];
$cat = $query_result_select[0][5];
$start_on = $query_result_select[0][6];
$end_on = $query_result_select[0][7];
######### calculating start and end date ####
$start_on = explode(" ",$start_on);
$end_on = explode(" ",$end_on);
$start_on = explode("-",$start_on[0]);
$end_on = explode("-",$end_on[0]);
$start_mktime = mktime(0,0,0,$start_on[1],$start_on[2],$start_on[0]);
$end_mktime = mktime(0,0,0,$end_on[1],$end_on[2],$end_on[0]);
$list_days = ($end_mktime - $start_mktime) / 86400;
$start_on = date("Y-m-d H:i:s");
$end_on="DATE_ADD(\"" . $start_on . "\", INTERVAL " . $list_days . " DAY)";
######### End of .. calculating start and end date ####
$listing_type = $query_result_select[0][8];
$active = $query_result_select[0][9];
$boldtitle = $query_result_select[0][10];
$catfeatured = $query_result_select[0][11];
$homefeatured = $query_result_select[0][12];
$current_price = $query_result_select[0][13];
$buy_price1 = $query_result_select[0][14];
$location = $query_result_select[0][15];
$auto_relist = $query_result_select[0][16];
$sql="insert into products(prod_num,user_id, title, description,image,category, start_time, end_time, listing_type, active, bold_title, cat_featured, home_featured,current_price,buy_price1,location,auto_relist)" .
" values('','" . trim($user_seller) . "','" . trim($product_name) . "','" . trim($new_title_description) . "','$product_image','" . trim($cat) . "','" . trim($start_on) . "'," .
trim($end_on) . ",'$listing_type','$active','" . trim($boldtitle) . "','" . trim($catfeatured) . "','" . trim($homefeatured) . "','" . trim($current_price) . "','" . trim($buy_price1) . "','" . trim($location) . "','" . trim($auto_relist) . "')";
$result=mysql_query($sql) or die("ERROR:" . mysql_error());
$sql="select max(prod_num) from products";
$result=mysql_query($sql) or die("ERROR:" . mysql_error());
$num=mysql_num_rows($result);
if($num>0) {
$data=mysql_fetch_row($result);
mysql_free_result($result);
$temp_prod_num=$data[0];
} else {
$err_str="<br>Error while adding listing. Please contact administrator.";
}
if($listing_type == "CL")
{
$sql_classified = "select * from products_classified where prod_num = $prod_num";
$result_classified = mysql_query($sql_classified);
$num_classified = mysql_num_rows($result_classified);
if($num_classified >0)
{
$result_classified = get_result($result_classified);
$price = $result_classified[0][2];
$contact = $result_classified[0][3];
$sql="insert into products_classified( id, prod_num, price, contact)" .
" values('','" . trim($temp_prod_num) . "','" . trim($price) . "','" . trim($contact) . "')";
$result=mysql_query($sql) or die("ERROR:" . mysql_error());
}
}
else if($listing_type == "IB")
{
$sql_buy = "select * from products_buy where prod_num = $prod_num";
$result_buy = mysql_query($sql_buy);
$num_buy = mysql_num_rows($result_buy);
if($num_buy >0)
{
$result_buy = get_result($result_buy);
$condition = $result_buy[0][2];
$price = $result_buy[0][3];
$quantity = $result_buy[0][4];
$p_paypal = $result_buy[0][5];
$p_check = $result_buy[0][6];
$p_cod = $result_buy[0][7];
$s_local = $result_buy[0][8];
$local_charges = $result_buy[0][9];
$s_international = $result_buy[0][10];
$international_charges = $result_buy[0][11];
$instruction = $result_buy[0][12];
$warranty = $result_buy[0][13];
$sql="insert into products_buy( id, prod_num, condition, price, quantity, pay_paypal, pay_check, pay_cod, ship_local, ship_local_charges, ship_international, ship_international_charges, pay_ship_instructions, warranty)" .
" values('','" . trim($temp_prod_num) . "','" . trim($condition) . "','" . trim($price) . "','" . trim($quantity) . "','" . trim($p_paypal) . "','" . trim($p_check) . "','" .
trim($p_cod) . "','" .trim($s_local) . "','" . trim($local_charges) . "','" . trim($s_international) . "','" . trim($international_charges) . "','" .
trim($instruction) . "','" .trim($warranty) . "')";
$result=mysql_query($sql) or die("ERROR:" . mysql_error());
}
}
else if($listing_type == "SA")
{
$sql_auction = "select * from products_auction where prod_num = $prod_num";
$result_auction = mysql_query($sql_auction);
$num_auction = mysql_num_rows($result_auction);
if($num_auction > 0)
{
$result_auction = get_result($result_auction);
$condition = $result_auction[0][2];
$start_price = $result_auction[0][3];
$increment = $result_auction[0][4];
$reserve_price = $result_auction[0][5];
$buy_price = $result_auction[0][6];
$quantity = $result_auction[0][7];
$p_paypal = $result_auction[0][8];
$p_check = $result_auction[0][9];
$p_cod = $result_auction[0][10];
$s_local = $result_auction[0][11];
$local_charges = $result_auction[0][12];
$s_international = $result_auction[0][13];
$international_charges = $result_auction[0][14];
$instruction = $result_auction[0][15];
$warranty = $result_auction[0][16];
$sql="insert into products_auction( id, prod_num, condition, start_price, bid_increment, reserve_price, buy_price, quantity, pay_paypal, pay_check, pay_cod, ship_local, ship_local_charges, ship_international, ship_international_charges, pay_ship_instructions, warranty)" .
" values('','" . trim($temp_prod_num) . "','" . trim($condition) . "','" . trim($start_price) . "','" . trim($increment) . "','" .
trim($reserve_price) . "','" .trim($buy_price) . "','" . trim($quantity) . "','" . trim($p_paypal) . "','" . trim($p_check) . "','" .
trim($p_cod) . "','" .trim($s_local) . "','" . trim($local_charges) . "','" . trim($s_international) . "','" . trim($international_charges) . "','" .
trim($instruction) . "','" .trim($warranty) . "')";
$result=mysql_query($sql) or die("ERROR:" . mysql_error());
}
}
}
}
############# End of .. Re Listing ###################
//################ function to calculate number of auctions/ib/clasifed closing today ########################
function closing_today($list_type,$user_id)
{
$td_date = getdate();
if(strlen($td_date["mday"])==1)
$td_date["mday"] = "0".$td_date["mday"];
if(strlen($td_date["mon"])==1)
$td_date["mon"] = "0".$td_date["mon"];
$ini_date = $td_date["year"]."-".$td_date["mon"]."-".$td_date["mday"];
if($list_type=="SA")
{
$result = '';
$query_closing = "select end_time from products where listing_type = 'SA' and user_id = $user_id and end_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
elseif($list_type=="IB")
{
$result = '';
$query_closing = "select end_time from products where listing_type = 'IB' and user_id = $user_id and end_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
$result = '';
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
else
{
$result = '';
$query_closing = "select end_time from products where listing_type = 'CL' and user_id = $user_id and end_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
$result = '';
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
//echo"<br>result :----------------".$result;
if($result=='')
$result = 0;
return $result;
}
//############################################################################################################
//################ function to calculate number of auctions/ib/clasifed opening today ########################
function opening_today($list_type,$user_id)
{
$td_date = getdate();
if(strlen($td_date["mday"])==1)
$td_date["mday"] = "0".$td_date["mday"];
if(strlen($td_date["mon"])==1)
$td_date["mon"] = "0".$td_date["mon"];
$ini_date = $td_date["year"]."-".$td_date["mon"]."-".$td_date["mday"];
if($list_type=="SA")
{
$result = '';
$query_closing = "select start_time from products where listing_type = 'SA' and user_id = $user_id and start_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
elseif($list_type=="IB")
{
$result = '';
$query_closing = "select start_time from products where listing_type = 'IB' and user_id = $user_id and start_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
$result = '';
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
else
{
$result = '';
$query_closing = "select start_time from products where listing_type = 'CL' and user_id = $user_id and start_time >= 'now()' and active = 1";
$result_closing = query_execute($query_closing);
$rows_closing = num_rows($result_closing);
if($rows_closing > 0)
{
$query_result_closing = get_result($result_closing);
$result = '';
for($k=0;$k<$rows_closing;$k++)
{
$end_time = $query_result_closing[$k][0];
$end_fin_time = explode(" ",$end_time);
$end_final_time = $end_fin_time[0];
if($end_final_time == $ini_date)
{
$result = $result + 1;
}
}
}
}
//echo"<br>result :----------------".$result;
if($result=='')
$result = 0;
return $result;
}
//############################################################################################################
//################# number of auctions/ib/classified/ loaded on the day ####################################
function loaded_today($list_type,$user_id)
{
if($list_type=="SA")
{
$query_closing1 = "select count(*) from products where listing_type = 'SA' and user_id = $user_id and (now()>=start_time and now()<=end_time) and active = 1";
$result_closing1 = query_execute($query_closing1);
$query_result_closing = get_result($result_closing1);
$result = $query_result_closing[0][0];
}
elseif($list_type=="IB")
{
$query_closing1 = "select count(*) from products where listing_type = 'IB' and user_id = $user_id and (now()>=start_time and now()<=end_time) and active = 1";
$result_closing1 = query_execute($query_closing1);
$query_result_closing = get_result($result_closing1);
$result = $query_result_closing[0][0]; }
else
{
$query_closing1 = "select count(*) from products where listing_type = 'CL' and user_id = $user_id and (now()>=start_time and now()<=end_time) and active = 1";
$result_closing1 = query_execute($query_closing1);
$query_result_closing = get_result($result_closing1);
$result = $query_result_closing[0][0]; }
if($result=='')
$result = 0;
return $result;
}
//########## geting the banner click details #####################################################################################
function banner_detail($user_id)
{
$query_banner_det = "select banner_id,banner_name from user_banner where user_id = $user_id and active=1";
$result_banner_det = query_execute($query_banner_det);
$rows_banner_det = num_rows($result_banner_det);
if($rows_banner_det > 0)
{
$query_result_banner_det = get_result($result_banner_det);
$result = "<tr><td> </td></tr>";
for($jk=0;$jk<$rows_banner_det;$jk++)
{
$banner_id = $query_result_banner_det[$jk][0];
$banner_name = $query_result_banner_det[$jk][1];
$query_count_banner_click = "select banner_number from banner_view where banner_id = $banner_id";
$result_count_banner_click = query_execute($query_count_banner_click);
$rows_count_banner_click = num_rows($result_count_banner_click);
if($rows_count_banner_click > 0)
{
$query_count_banner_click = get_result($result_count_banner_click);
$banner_click = $query_count_banner_click[0][0];
echo $result."<tr><td class='font121'> $banner_name : <b>$banner_click</b> Clicks</td></tr>";
}
else
{
echo $result ."<tr><td class='font121'> $banner_name : No Clicks</td></tr>";
}
}
}
else
{
echo $result. "<br><tr><td align='center' class='alert'>No banner uploaded</td></tr>";
}
return $result;
}
####################################
## Session related Functions
####################################
####################################
## Array Initialized
####################################
######### Auction Listing Type #######################
$auction_type_array = array (
"AB" => "Auction + Buy",
"IB" => "Instant Buy",
"CL" => "Classified",
"SA" => "Auction",
"DA" => "Dutch Auction"
);
########################## function for blocked user ###################################
function blocked_users($uid,$user_id)
{
$query_select_block = "select block_user from user_seller where user_id = $uid";
$result_select_block = query_execute($query_select_block);
$rows_select_block = num_rows($result_select_block);
if($rows_select_block > 0)
{
$query_result_select_block = get_result($result_select_block);
$block_user1 = $query_result_select_block[0][0];
if($block_user1 == '')
$block_val = 0;
else
{
$block_user = explode("|",$block_user1);
$num_block = count($block_user);
$test = 2;
for($k=0;$k<$num_block;$k++)
{
$block_id = $block_user[$k];
if($block_id == $user_id)
{
$block_val = 1;
$test = 2;
break;
}
else
$block_val = 0;
if($test !=2)
$block_val = 0;
}
}
}
return $block_val;
}
######### country array #######################
$country_array = array(
'AF' => 'Afghanistan',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarctica',
'AG' => 'Antigua and Barbuda',
'AR' => 'Argentina',
'AM' => 'Armenia',
'AW' => 'Aruba',
'AC' => 'Ascension Island',
'AU' => 'Australia',
'AT' => 'Austria',
'AZ' => 'Azerbaidjan',
'BS' => 'Bahamas',
'BH' => 'Bahrain',
'BD' => 'Banglades',
'BB' => 'Barbados',
'BY' => 'Belarus',
'BE' => 'Belgium',
'BZ' => 'Belize',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BO' => 'Bolivia',
'BA' => 'Bosnia-Herzegovina',
'BW' => 'Botswana',
'BR' => 'Brazil',
'BN' => 'Brunei Darussalam',
'BG' => 'Bulgaria',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'BT' => 'Buthan',
'KH' => 'Cambodia',
'CM' => 'Cameroon',
'CA' => 'Canada',
'CV' => 'Cape Verde',
'KY' => 'Cayman Islands',
'CF' => 'Central African Rep.',
'TD' => 'Chad',
'CL' => 'Chile',
'CN' => 'China',
'CX' => 'Christmas Island',
'CC' => 'Cocos (Keeling) Isl.',
'CO' => 'Colombia',
'KM' => 'Comoros',
'CG' => 'Congo',
'CK' => 'Cook Islands',
'CR' => 'Costa Rica',
'HR' => 'Croatia',
'CY' => 'Cyprus',
'CZ' => 'Czech Republic',
'CS' => 'Czechoslovakia',
'DK' => 'Denmark',
'DJ' => 'Djibouti',
'DM' => 'Dominica',
'DO' => 'Dominican Republic',
'EC' => 'Ecuador',
'EG' => 'Egypt',
'SV' => 'El Salvador',
'GQ' => 'Equatorial Guinea',
'EE' => 'Estonia',
'ET' => 'Ethiopia',
'FK' => 'Falkland Isl.(Malvinas)',
'FO' => 'Faroe Islands',
'FJ' => 'Fiji',
'FI' => 'Finland',
'FR' => 'France',
'GA' => 'Gabon',
'GM' => 'Gambia',
'GE' => 'Georgia',
'DE' => 'Germany',
'GH' => 'Ghana',
'GI' => 'Gibraltar',
'GR' => 'Greece',
'GL' => 'Greenland',
'GD' => 'Grenada',
'GP' => 'Guadeloupe (Fr.)',
'GU' => 'Guam (US)',
'GT' => 'Guatemala',
'GN' => 'Guinea',
'GY' => 'Guyana',
'HT' => 'Haiti',
'HN' => 'Honduras',
'HK' => 'Hong Kong',
'HU' => 'Hungary',
'IS' => 'Iceland',
'IN' => 'India',
'ID' => 'Indonesia',
'IQ' => 'Iraq',
'IE' => 'Ireland',
'IL' => 'Israel',
'IT' => 'Italy',
'CI' => 'Ivory Coast',
'JM' => 'Jamaica',
'JP' => 'Japan',
'JO' => 'Jordan',
'KZ' => 'Kazachstan',
'KE' => 'Kenya',
'KI' => 'Kiribati',
'KR' => 'Korea (South)',
'KW' => 'Kuwait',
'LA' => 'Laos',
'LV' => 'Latvia',
'LB' => 'Lebanon',
'LS' => 'Lesotho',
'LR' => 'Liberia',
'LY' => 'Libya',
'LI' => 'Liechtenstein',
'LT' => 'Lithuania',
'LU' => 'Luxembourg',
'MO' => 'Macau',
'MG' => 'Madagascar',
'MW' => 'Malawi',
'MY' => 'Malaysia',
'MV' => 'Maldives',
'ML' => 'Mali',
'MT' => 'Malta',
'MH' => 'Marshall Islands',
'MQ' => 'Martinique (Fr.)',
'MR' => 'Mauritania',
'MU' => 'Mauritius',
'MX' => 'Mexico',
'FM' => 'Micronesia',
'MD' => 'Moldavia',
'MC' => 'Monaco',
'MN' => 'Mongolia',
'MS' => 'Montserrat',
'MA' => 'Morocco',
'MZ' => 'Mozambique',
'MM' => 'Myanmar',
'NA' => 'Namibia',
'NR' => 'Nauru',
'NP' => 'Nepal',
'AN' => 'Netherland Antilles',
'NL' => 'Netherlands',
'NC' => 'New Caledonia (Fr.)',
'NZ' => 'New Zealand',
'NI' => 'Nicaragua',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'NF' => 'Norfolk Island',
'NO' => 'Norway',
'OM' => 'Oman',
'PK' => 'Pakistan',
'PW' => 'Palau',
'PA' => 'Panama',
'PG' => 'Papua New',
'PY' => 'Paraguay',
'PE' => 'Peru',
'PH' => 'Philippines',
'PL' => 'Poland',
'PT' => 'Portugal',
'PR' => 'Puerto Rico (US)',
'QA' => 'Qatar',
'RE' => 'Reunion (Fr.)',
'RO' => 'Romania',
'RU' => 'Russian Federation',
'RW' => 'Rwanda',
'LC' => 'Saint Lucia',
'SM' => 'San Marino',
'SA' => 'Saudi Arabia',
'SN' => 'Senegal',
'SC' => 'Seychelles',
'SL' => 'Sierra Leone',
'SG' => 'Singapore',
'SK' => 'Slovak Republic',
'SI' => 'Slovenia',
'SB' => 'Solomon Islands',
'SO' => 'Somalia',
'ZA' => 'South Africa',
'ES' => 'Spain',
'LK' => 'Sri Lanka',
'SH' => 'St. Helena',
'PM' => 'St. Pierre & Miquelon',
'KN' => 'St.Kitts Nevis Anguilla',
'VC' => 'St.Vincent & Grenadines',
'SD' => 'Sudan',
'SR' => 'Suriname',
'SZ' => 'Swaziland',
'SE' => 'Sweden',
'CH' => 'Switzerland',
'TJ' => 'Tadjikistan',
'TW' => 'Taiwan',
'TZ' => 'Tanzania',
'TH' => 'Thailand',
'TG' => 'Togo',
'TK' => 'Tokelau',
'TO' => 'Tonga',
'TT' => 'Trinidad & Tobago',
'TN' => 'Tunisia',
'TR' => 'Turkey',
'TM' => 'Turkmenistan',
'TC' => 'Turks & Caicos Islands',
'TV' => 'Tuvalu',
'UG' => 'Uganda',
'UA' => 'Ukraine',
'AE' => 'United Arab Emirates',
'UK' => 'United Kingdom',
'US' => 'United States',
'UY' => 'Uruguay',
'UZ' => 'Uzbekistan',
'VU' => 'Vanuatu',
'VA' => 'Vatican City State',
'VE' => 'Venezuela',
'VN' => 'Vietnam',
'VG' => 'Virgin Islands (British)',
'VI' => 'Virgin Islands (US)',
'WF' => 'Wallis & Futuna Islands',
'YE' => 'Yemen',
'YU' => 'Yugoslavia',
'ZR' => 'Zaire',
'ZM' => 'Zambia',
'ZW' => 'Zimbabwe',
);
##########################################
//===== assigning values to variables ========
reset($HTTP_POST_VARS);
while(list($iname,$ival) = each($HTTP_POST_VARS)) {
if($ival <> "") {
$$iname = $ival;
}
}
reset($HTTP_POST_VARS);
reset($HTTP_GET_VARS);
while(list($iname,$ival) = each($HTTP_GET_VARS)) {
if($ival <> "") {
$$iname = $ival;
}
}
reset($HTTP_GET_VARS);
//===== end of assigning values to variables ========
create_session("user_id");
connection();
?>