Jump to content

[SOLVED] Looking for Some Clarification Regarding My Php Files


Modernvox

Recommended Posts

What' s up guys!

First off a special thanks to thorpe and Gayner for there help last night.

 

I am looking for some clarification before I delete and re-upload my site to localdump.

 

I am re-uploading because after doing so last night I'm getting errors coming from every direction so instead of trying to wrap my head around it all it's wiser to get it right.

 

I am using xammp for my localdump, ftp etc... So my path is C:\xampp\htdocs

 

My question is...How do I set up all my files and folders to work properly as they did on my previous remote host?

 

Do I put the public_html folder directly into the htdocs folder or the xammp folder or what :wtf:

 

 

 

 

Link to comment
Share on other sites

Just upload the contents of your previous root directory into your new root directory. In your specific case public_html was your previous root, and C:\xampp\htdocs is the root dir for xampp.

 

Guess I am doing it wrong then because that's what I did and every page gives errors like undefined functions and

Fatal error: Call to undefined function MySQLError() in C:\xampp\htdocs\index.php on line 42

Link to comment
Share on other sites

The undefined functions could be the result of a lot of things, like forgetting to include files. As for the other undefined function, unless that's a custom function there is no built in function called MySQLError(), it's mysql_error().

 

Welp, This was a fully functioning auction site very similar to eBay. Since I uploaded to local nothing works.

I put everything into htdocs. So I have a bunch of folders like public_html, themes, etc..

Does public_html need to be files within htdocs or are all the files in a folder within htdocs ok?

Link to comment
Share on other sites

Fatal error: Call to undefined function MySQLError() in C:\xampp\htdocs\public_html\public_html\index.php on line 42

 

I managed to upload the files correctly, but I keep getting this one error- PLEASE HELP!!

Getting ready to smash another laptop >:(

 

<?
#//v.3.2.1
#///////////////////////////////////////////////////////
#//  COPYRIGHT 2004 Phpauction.org ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

require('./includes/config.inc.php');

#// Run cron according to SETTINGS
if($SETTINGS['cron'] == 2) {
include_once "cron.php";
}

require("./header.php");

$TIME = mktime(date("H")+$SETTINGS['timecorrection'],date("i"),date("s"),date("m"), date("d"),date("Y"));
$NOW = date("YmdHis",$TIME);

/*
prepare data for templates/template
*/
//echo ($_SESSION['PHPAUCTION_LOGGED_IN']);
/* prepare categories list for templates/template */
# Prepare categories sorting
if($SETTINGS['catsorting'] == 'alpha') {
$catsorting = " ORDER BY t.cat_name ASC";
} else {
$catsorting = " ORDER BY sub_counter DESC";
}
$sql_m  = " AND `motors`='0'";
if($_REQUEST['c'] =='m')
$sql_m  = " AND `motors`='1'";

$TPL_categories_value = "";
$query = "select distinct * from PHPAUCTIONXL_categories c, PHPAUCTIONXL_cats_translated t 
          WHERE c.parent_id=0
          AND t.cat_id=c.cat_id
          AND t.lang='".$language."' $sql_m  
          $catsorting";
$result = mysql_query($query);                              //Here my problem lies
if(!$result) {
MySQLError($query);
exit; ***********************************************************
} else {
$num_cat = mysql_num_rows($result);
$i = 0;
$TPL_categories_value = "<ul>\n";
while($i < $num_cat && $i < $SETTINGS['catstoshow']) {
	$catlink="";
	$cat_id = mysql_result($result,$i,"cat_id");
	$cat_name = mysql_result($result,$i,"cat_name");
	$sub_count = intval(mysql_result($result, $i, "sub_counter"));
	$cat_colour = mysql_result($result, $i, "cat_colour");
	$cat_image = mysql_result($result, $i, "cat_image");
	$cat_counter = (int)mysql_result($result, $i, "counter" );
	if ($sub_count!=0)
		$cat_counter = "(".$sub_count.")";
	else {
		$cat_counter = "";
	}
	$cat_counter = "";
	$cat_url = "./browse.php?id=$cat_id";
	if ( $cat_image != "") {
		$catlink = "<A HREF=\"$cat_url\"><IMG SRC=\"$cat_image\" BORDER=0></a>";
	}
	#//  Select the translated category name
	$cat_name = ucwords(@mysql_result(mysql_query("SELECT cat_name FROM PHPAUCTIONXL_cats_translated WHERE cat_id=$cat_id AND lang='".$language."'"),0,"cat_name"));
	$catlink .= "<A HREF=\"$cat_url\">$cat_name</A>"." $cat_counter";
	if ( $cat_colour != "") {
		$catlink = setsspan($catlink,"background-color:$cat_colour");
	}
	$TPL_categories_value .= "<li>".$catlink."</li>\n";
	$i++;
}
$TPL_categories_value .= "</ul>\n";

}


/* get last created auctions */
        $query = "SELECT id,title,starts, pict_url,photo_uploaded,minimum_bid from PHPAUCTIONXL_auctions
         WHERE
         closed='0' AND
         suspended=0 AND ";
	 if($SETTINGS['adultonly']=='y' && !isset($_SESSION["PHPAUCTION_LOGGED_IN"])){
		 $query .= "adultonly='n' AND ";
	 }
         $query .= "starts<=".$NOW."
         ORDER BY starts DESC
         LIMIT 12";
$result = mysql_query($query);
if ( $result )
$num_auction = mysql_num_rows($result);
else
$num_auction = 0;

$i = 0;
$bgcolor = "#FFFFFF";

$TPL_last_auctions_value = "";
$TPL_last_auctions_value .= "<table border=0 cellpadding='2' cellspacing='2' width='90%' align='center'><tr>";
while($i < $num_auction) {
if($bgcolor == "#FFFFFF") {
	$bgcolor = $FONTCOLOR[$SETTINGS['headercolor']];
} else {
	$bgcolor = "#FFFFFF";
}
$title = mysql_result($result,$i,"title");
$id 	 = mysql_result($result,$i,"id");
$date	 = mysql_result($result,$i,"starts");
$min_bid	 = mysql_result($result,$i,"minimum_bid");
    $pict_url   = mysql_result ( $result, $i, "pict_url" );
    $phu        = intval(mysql_result( $result,$i,"photo_uploaded") &&($pict_url!=''));
    if ( $phu ) {
        $pict_url = $uploaded_path.$pict_url;
        $img=@getimagesize($pict_url);
        $sizedata=$img[3];
        //$TPL_pict_url = "<div style=\"style='width:97px; height:74px; overflow:hidden\"><A HREF=\"./item.php?id=$id\"><img border=1 src='".$SETTINGS['siteurl']."$pict_url' $sizedata  alt=\"\" style='width:97px; height:74px; border:1px solid #eeeeee;' /></A></div>"; 
			//updated by pinoidev to fix thumbnail size
        $TPL_pict_url = "<div style=\"style='width:97px; height:74px; overflow:hidden\"><A HREF=\"./item.php?id=$id\"><img border=1 src='".$SETTINGS['siteurl']."getthumb.php?w=".$SETTINGS['thumb_show']."&fromfile=$pict_url'  alt=\"\" style='width:50px; height:50px; border:1px solid #cccccc;' /></A></div>";
    } elseif ($pict_url!='') {
        $TPL_pict_url = "<div style=\"style='width:97px; height:74px; overflow:hidden\"><A HREF=\"./item.php?id=$id\"><img src='$pict_url' border=1  alt=\"\"  style='width:50px; height:50px; border:1px solid #eeeeee;'   /></A></div>";
    } else {
        $TPL_pict_url = "<A HREF=\"./item.php?id=$id\"><b>$MSG_114</b></A>";
    }

$year = substr($date,0,4);
$month = substr($date,4,2);
$day = substr($date,6,2);
$hours = substr($date,8,2);
$minutes = substr($date,10,2);
$seconds = substr($date,12,2);

#// Check bold and highlighted options

$ISBOLD = FALSE;
$ISHIGHLIGHTED = FALSE;

    if($i % 5 == 0){
        $TPL_last_auctions_value .= "</tr><tr>";
    }
    $TPL_last_auctions_value .= "<td align='center'>";
    
$TPL_last_auctions_value .= $TPL_pict_url;
    //$TPL_last_auctions_value .="<p style=\"background-color:$bgcolor;display:block\"><font size=1>".date( 'm/d/Y H:m:s', strtotime($date) )." </font><A HREF=\"./item.php?id=$id\">";
$TPL_last_auctions_value .="<p style=\"background-color:$bgcolor;display:block\"><font size=2>$".number_format($min_bid,0)." </font><A HREF=\"./item.php?id=$id\">";
if($ISHIGHLIGHTED) {
	$TPL_last_auctions_value .= "<SPAN CLASS=hg>";
}
if($ISBOLD) {
	$TPL_last_auctions_value .= "";
}
//$TPL_last_auctions_value .= substr( stripslashes($title), 0, 5 );

if($ISBOLD) {
	$TPL_last_auctions_value .= "";
}
if($ISHIGHLIGHTED) {
	$TPL_last_auctions_value .= "</SPAN>";
}
$TPL_last_auctions_value .= "</A></p>";
$i++;
    $TPL_last_auctions_value .= "</td>";
}
$TPL_last_auctions_value .= "</tr></table>";


// =============================================================================
/* get hot auctions */
$query = "SELECT
            id,title,starts, pict_url,photo_uploaded,
            (SELECT COUNT(*) FROM PHPAUCTIONXL_bids WHERE auction = PHPAUCTIONXL_auctions.id) as cnt
         from PHPAUCTIONXL_auctions         
         WHERE
         closed='0' AND
         suspended=0 AND ";
	 if($SETTINGS['adultonly']=='y' && !isset($_SESSION["PHPAUCTION_LOGGED_IN"])){
		 $query .= "adultonly='n' AND ";
	 }
         $query .= "starts<=".$NOW."
         ORDER BY cnt DESC
         LIMIT ".$SETTINGS['lastitemsnumber'];
$result = mysql_query($query);
if ( $result )
$num_auction = mysql_num_rows($result);
else
$num_auction = 0;

$i = 0;
$bgcolor = "#FFFFFF";

$TPL_hot_auctions_value = "";
$TPL_hot_auctions_value .= "<table border=0 cellpadding='2' cellspacing='2' width='90%' align='center'><tr>";
while($i < $num_auction) {
if($bgcolor == "#FFFFFF") {
	$bgcolor = $FONTCOLOR[$SETTINGS['headercolor']];
} else {
	$bgcolor = "#FFFFFF";
}
$cnt = mysql_result($result,$i,"cnt");
    if(intval($cnt) <= 0) { $i++; continue; };
$title = mysql_result($result,$i,"title");
$id 	 = mysql_result($result,$i,"id");
$date	 = mysql_result($result,$i,"starts");
    $pict_url   = mysql_result ( $result, $i, "pict_url" );
    $phu        = intval(mysql_result( $result,$i,"photo_uploaded") &&($pict_url!=''));
    if ( $phu ) {
        $pict_url = $uploaded_path.$pict_url;
        $img=@getimagesize($pict_url);
        $sizedata=$img[3];
        $TPL_pict_url = "<img src='".$SETTINGS['siteurl']."$pict_url' $sizedata border=0 alt=\"\" style='width:144px; height:112px; border:1px solid #eeeeee;' />";
    } elseif ($pict_url!='') {
        $TPL_pict_url = "<img src='$pict_url' border=0  alt=\"\"  style='width:144px; height:112px; border:1px solid #eeeeee;'   />";
    } else {
        $TPL_pict_url = "<b>$MSG_114</b>";
    }

$year = substr($date,0,4);
$month = substr($date,4,2);
$day = substr($date,6,2);
$hours = substr($date,8,2);
$minutes = substr($date,10,2);
$seconds = substr($date,12,2);

#// Check bold and highlighted options

$ISBOLD = FALSE;
$ISHIGHLIGHTED = FALSE;

    if($i % 3== 0){
        $TPL_hot_auctions_value .= "</tr><tr>";
    }
    $TPL_hot_auctions_value .= "<td align='center'>";
    
$TPL_hot_auctions_value .= $TPL_pict_url;
    $TPL_hot_auctions_value .="<p style=\"background-color:$bgcolor;display:block\">".ArrangeDateNoCorrection($day,$month,$year,$hours,$minutes)." <A HREF=\"./item.php?id=$id\">";
if($ISHIGHLIGHTED) {
	$TPL_hot_auctions_value .= "<SPAN CLASS=hg>";
}
if($ISBOLD) {
	$TPL_hot_auctions_value .= "<B>";
}
$TPL_hot_auctions_value .= stripslashes($title);
if($ISBOLD) {
	$TPL_hot_auctions_value .= "</B>";
}
if($ISHIGHLIGHTED) {
	$TPL_hot_auctions_value .= "</SPAN>";
}
$TPL_hot_auctions_value .= "</A></p>";
$i++;
    $TPL_hot_auctions_value .= "</td>";
}
$TPL_hot_auctions_value .= "</tr></table>";


/* get ending soon auctions */
$TPL_ending_soon_value = "";
$query = "select ends,id,title from PHPAUCTIONXL_auctions
         WHERE closed='0' AND
         suspended='0' AND ";
         $query .= "starts<=".$NOW."
         ORDER BY RAND() LIMIT ".$SETTINGS['endingsoonnumber'];
         //order by ends
$result = mysql_query($query);
$num_auction = mysql_num_rows($result);

$i = 0;
$bgcolor = "#FFFFFF";
while($i < $num_auction) {
if($bgcolor == "#FFFFFF") {
	$bgcolor = $FONTCOLOR[$SETTINGS['headercolor']];
} else {
	$bgcolor = "#FFFFFF";
}
$title 	= mysql_result($result,$i,"title");
$id 	= mysql_result($result,$i,"id");
$ends 	= mysql_result($result,$i,"ends");
$nowt	= $TIME;
$difference = mktime(	substr ($ends, 8, 2),
                      substr ($ends, 10, 2),
                      substr ($ends, 12, 2),
                      substr ($ends, 4, 2),
                      substr ($ends, 6, 2),
                      substr ($ends, 0, 4))-$nowt;
if ($difference > 0) {
	$days_difference = floor($difference / 86400);
	$difference = $difference % 86400;
	$hours_difference = floor($difference / 3600);
	$difference = $difference % 3600;
	$minutes_difference = floor($difference / 60);
	$seconds_difference = $difference % 60;
	$ends_string = sprintf("%d%s %02dh:%02dm:%02ds",$days_difference,$MSG_126, $hours_difference,$minutes_difference,$seconds_difference);
} else {
	$ends_string = $MSG_911;
}

#// Check bold and highlighted options
$ISBOLD = FALSE;
$ISHIGHLIGHTED = FALSE;

$TPL_ending_soon_value .= "
                          <p style=\"background-color:$bgcolor;display:block\">".$ends_string." <A HREF=\"./item.php?id=$id\">";
if($ISHIGHLIGHTED) {
	$TPL_ending_soon_value .= "<SPAN CLASS=hg>";
}
if($ISBOLD) {
	$TPL_ending_soon_value .= "<B>";
}

$TPL_ending_soon_value .= stripslashes($title);
if($ISBOLD) {
	$TPL_ending_soon_value .= "</B>";
}
if($ISHIGHLIGHTED) {
	$TPL_ending_soon_value .= "</SPAN>";
}

$TPL_ending_soon_value .= "</A></p>";
$i++;
}

/**
* NOTE: get higher bids
*/
$TPL_maximum_bids = "";
$query = "select auction,max(bid) AS max_bid
         FROM PHPAUCTIONXL_bids b, PHPAUCTIONXL_auctions a WHERE a.suspended=0 AND a.closed=0 AND a.id=b.auction GROUP BY b.bid,b.auction ORDER BY max_bid desc";
$result = mysql_query($query);

if ($result)
$num_auction = mysql_num_rows($result);
else
$num_auction = 0;

$i = 0;
$j = 0;
$bgcolor = "#FFFFFF";
$AU = array();

while($i < $num_auction && $j < $SETTINGS['higherbidsnumber']) {
$max_bid  = mysql_result($result,$i,"max_bid");
$auction  = mysql_result($result,$i,"auction");

//-- Get auction data

$query = "SELECT title,closed,id from PHPAUCTIONXL_auctions
         WHERE id=\"$auction\" AND";
		 $query .= "'".$NOW."'>=starts";
//print $query;
$result_bid = mysql_query($query);
if(mysql_num_rows($result_bid) > 0) {
	$title = mysql_result($result_bid,0,"title");
	$closed = mysql_result($result_bid,0,"closed");
	$auc_id = mysql_result($result_bid,0,"id");
}

if($closed == "0" && !in_array($auction,$AU)) {
	#// Check bold and highlighted options
	$ISBOLD = FALSE;
	$ISHIGHLIGHTED = FALSE;

	$TPL_maximum_bids .="
	                    <p style=\"background-color:$bgcolor;display:block\"><A HREF=javascript:window_open('converter.php?AMOUNT=$max_bid','incre',650,200,30,30)>"
	                    .print_money ($max_bid)." <A HREF=\"./item.php?id=$auc_id\">";
	if($ISHIGHLIGHTED) {
		$TPL_maximum_bids .= "<SPAN CLASS=hg>";
	}
	if($ISBOLD) {
		$TPL_maximum_bids .= "<B>";
	}
	$TPL_maximum_bids .= stripslashes($title);
	if($ISBOLD) {
		$TPL_maximum_bids .= "</B>";
	}
	if($ISHIGHLIGHTED) {
		$TPL_maximum_bids .= "</SPAN>";
	}
	$TPL_maximum_bids .= "</A></p>";
	if($bgcolor == "#FFFFFF") {
		$bgcolor = $FONTCOLOR[$SETTINGS['headercolor']];
	} else {
		$bgcolor = "#FFFFFF";
	}
	$AU[] = $auction;
	$j++;
}
$i++;
}
// Build list of help topics
$query = "SELECT * FROM PHPAUCTIONXL_faqscategories";
$r_h = @mysql_query($query);
if(!$r_h) {
MySQLError($query);
exit;
}
if(mysql_num_rows($r_h) > 0) {
$TPL_helptopics = "<ul>";
while($faqscat = mysql_fetch_array($r_h)) {
	$faqscat['category'] = stripslashes(@mysql_result(mysql_query("SELECT category FROM PHPAUCTIONXL_faqscat_translated WHERE id=".$faqscat['id']." AND lang='".$language."'"),0,"category"));
	//$faqscat['category']=stripslashes($faqscat['category']);
	$TPL_helptopics .= "<li><a href=\"javascript: window_open('viewfaqs.php?cat=".$faqscat['id']."','faqs',500,400,20,20)\">".$faqscat['category']."</a></li>";
}
$TPL_helptopics .= "</ul>";
} else {
$TPL_helptopics = "";
}

//-- Build news list
if($SETTINGS['newsbox'] == 1) {
$query = "SELECT title,id,new_date from PHPAUCTIONXL_news where suspended=0 order by new_date DESC limit ".$SETTINGS['newstoshow'];
$res = mysql_query($query);
if(!$res) {
	MySQLError($query);
	exit;
}
$TPL_news_list = "<ul>";
while($new = mysql_fetch_array($res)) {
	$new['title'] = @mysql_result(@mysql_query("SELECT title FROM PHPAUCTIONXL_news_translated WHERE id=".$new['id']." AND lang='".$language."'"),0,"title");
	$new_date= $new['new_date'];
	$F_date = FormatDate($new_date);
	$TPL_news_list .= "<li>$F_date - <a href=\"viewnew.php?id=".$new['id']."\">".$new['title']."</a></li>";
}
$TPL_news_list .= "</ul>";
} else {
$TPL_news_list = " ";
}

require(phpa_include("template_index_php.html"));
require('./footer.php');
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.