PDA

View Full Version : undefined function issues


jeffyboy69101
March 18th, 2004, 02:55 PM
Hello,

I have installed squirrelcart, and the store.php is working. When I go to home.php, I get the following error:

Fatal error: Call to undefined function: show_best_sellers() in C:\someroot\somesite\home.php on line 7

What have I missed here? :confused: I searched the forums, yet can find no specific resolution to this specific problem.

Any help would be appreciated. Thanks in advance.

--JL

Jamie
March 18th, 2004, 04:57 PM
Hi JL,

It sounds like you are missing the "squirrelcart/functions/show_best_sellers.func" file. I would double check your other files as well. It sounds like maybe your FTP upload didn't complete.

Thanks,
Jamie

jeffyboy69101
March 24th, 2004, 08:03 PM
Hi again,

I also checked the files, and everyhting looks like it is where it should be, and the size it should be, etc. Another point that I forgot to mention is the store.php works fine.

Everything is under "squirrelcart", except for the home.php and store.php which live at the web site root level. So I guess it would look like this in relation to the website root:

./store.php
./home.php
./images/<all_the_images>
and ./squirrelcart/functions/<biglist_of_functions>

I inspected the home.php file, and I can't really see anything wrong there. I was thinking that maybe my config.php was screwy, so I have included it here (and changed some names to protect the innocent :p ):

<?
// --------------------------------------------------------------------------------------------
// Configuration Variables
//---------------------------------------------------------------------------------------------
// Installer of cart needs to change these variables to their appropriate values
// note: do not add trailing slashes
// site_www_root is the web address to the root of your site
$site_www_root = "http://www.somedomain.net";

// site_isp_root is the path to your root, from the server's directory structure
$site_isp_root = "C:/Inetpub/somedomain";

// site_secure_root is the path to your web root using HTTPS or (SSL). This is for secure transactions.
// if your server does not support SSL, then make this variable the same as site_www_root
$site_secure_root = "https://www.somedomain.net";

// cart page. this is the default path, from the root of your site that will be used to display your store
// it is usually set to "/index.php". when first installed, it defaults to the page for the demo store.
$cart_page = "/store.php";

// img_path is the path to the folder you keep your images in. this is the folder that you upload the products, categories, and other folders into
$img_path = "/images";

// sql_host is the name or IP address of the server that is running MySQL. localhost is the default
$sql_host = "localhost";

// sql_username is the name of the user you created and added to your squirrelcart database
$sql_username = "somekindaroot";
$sql_password = "somepass";

// db should be set to the name of the database squirrelcart is using
$db = "squirrelcart";
// ------------------------------ end of configuration section ----------------------------

// do not modify anything below this line!!!!!!!
include "$site_isp_root/squirrelcart/cart.php";
?>


I don't really know what's going on here. I have checked the permissions, and everything can see the directory and subdirectories. Like I mentioned, the store.php does work.

Any more help would be greatly appreciated. Thanks.

--JL

Rich
March 25th, 2004, 11:53 AM
By any chance, are you opening home.php directly in a browser? i.e. are you going to http://www.yoursite.com/home.php. If so, then the errors you are receiving are normal.

The home.php file is not meant to be called directly. When store.php is accessed, the contents of home.php are included (using the PHP "include" function). Opening home.php directly in a browser generates errors because there is no call to the config.php file, and the functions specified in home.php have not yet been defined.

jeffyboy69101
March 26th, 2004, 12:26 AM
That pretty much answered it for me yah. Thanks a bunch! :yahoo:

--JL

Rich
March 26th, 2004, 07:08 AM
No problem! Glad it wasn't something serious. :squirrel:

arvjgo
January 28th, 2005, 03:04 PM
I keep getting this error "Call to undefined function: get_crumb_nav() " when I click on the "Products" link from the store.php page.

Fatal error: Call to undefined function: get_crumb_nav() in /home/qsrawar/public_html/squirrelcart/crumb_navigation.php on line 9

What am I doing wrong?

Please help.