cancel
Showing results for 
Search instead for 
Did you mean: 

PHP function error

I'm creating a website and I'm getting PHP error.  I created it on my laptop using WAMP.  I copy mostof my files up and my index page loaded but when I added some PHP include file this errorpops up  It is a simple function hat it won't load.

 

<? php
	function load_category_page($category) {
	}
?>

 

PHP Parse error:  syntax error, unexpected 'function' (T_FUNCTION) in public_html/includes/header.php on line 39

2 REPLIES 2
Community Manager
Community Manager

Re: PHP function error

Hi @DavidFleming. Thanks for being part of GoDaddy Community! I'm not a PHP developer, but many times issues like this are related to the version of PHP for the hosting plan. You may want to try changing that to match up with what you have installed (if possible) on your WAMP machine. Hope that helps. If not, feel free to provide more information. Others in the community may be able to provide you with additional suggestions.

 

JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.
Highlighted
Helper I

Re: PHP function error

It looks to me like you're trying to load category as a variable where what your code wants to do is load a specific category.

function='load_category_page'(category='grocery'):