mme Posted July 15, 2010 Share Posted July 15, 2010 I am trying to use functions to insert code into other pages I have a php file with multiple functions inside: function md_chef_record() { $md_chef_ip=$_SERVER['REMOTE_ADDR']; $md_chef_time=date("D M j G:i:s T Y"); } function md_chef_image() { $output .= "<img src='$siteurl/wp-content/uploads/wpsc/product_images/no-image-uploaded.gif' title='".$special['name']."' alt='".$special['name']."' /><br />"; } Then in multiple files I have this in the top of the php file if (file_exists('wp-content/plugins/md-chef/md-chef-f.php')) { require_once('wp-content/plugins/md-chef/md-chef-f.php');} else {echo("ERROR");} Then throughout the files different functions are placed to insert the pieces of code. However it doesn't seem to work any suggestions? Thanks MME Quote Link to comment https://forums.phpfreaks.com/topic/207796-functions-not-showing-up/ Share on other sites More sharing options...
trq Posted July 15, 2010 Share Posted July 15, 2010 Your functions don't return any data & md_chef_image() uses variables which aren't defined anywhere. You might need to look at http://php.net/functions to get an idea of the basics. Quote Link to comment https://forums.phpfreaks.com/topic/207796-functions-not-showing-up/#findComment-1086281 Share on other sites More sharing options...
PravinS Posted July 15, 2010 Share Posted July 15, 2010 You have not called any of the defined functions and your functions does not return any value. Quote Link to comment https://forums.phpfreaks.com/topic/207796-functions-not-showing-up/#findComment-1086286 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.