0

I have home page and a seperate file display_functions.php from where I am calling function file home.php

file display_functions.php 
html_header($title)
{
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xHTML1/DTD/xHTML1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="https://www.facebook.com/2008/fbml">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 

<title><?php echo $title;?></title>
<link href="home_style.css" rel="stylesheet" type="text/css" />
</head>;
}


html_footer()
{

}

getting error: html_header($title) { ; } html_footer() { } ( ! ) SCREAM: Error suppression ignored for ( ! ) Fatal error: Call to undefined function html_header() need help

2
  • are you including the file that contains the definition for html_header in the current execution space. Commented Jul 17, 2013 at 2:26
  • Show your actual code. We are not declaring function like function_name($variable){}. The right syntax is function function_name($variable) {} Commented Jul 17, 2013 at 2:27

2 Answers 2

1

your code is error.. You should wrapped the code which inside the html_header function whith echo, and html_header() is a function, so you need add a function keyword before it.

Sign up to request clarification or add additional context in comments.

Comments

0

That error happens because you put HTML tags directly in your PHP source (it's a syntax error). I guess you meant using echo on them?

And, in general, saving yourself from boilerplate code in this manner isn't a good idea. Better create templates or use an MVC framework.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.