I have a page function.php and call this function in another page view.php but function not call properly Here is the function.php code
<?php
function head1()
{
global $title;
<html xmlns="http://www.w3.org/1999/xhtml">
<header>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>WhiteFlower| florida web design</title>
</header>
}
head1();
?>
Second php file
<?php
include "function.php";
head1();
?>
This is code of another file view.php I am new in php so I cannot understand how it works properly
This page is showing error because you are have error in your function you should echo your html or return them you are writing like html in php block
your code
<?php
function head1()
{
global $title;
<html xmlns="http://www.w3.org/1999/xhtml">
<header>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>WhiteFlower| florida web design</title>
</header>
}
?>
Replace with this
<?php
function head1()
{
global $title;
echo '<html xmlns="http://www.w3.org/1999/xhtml">
<header>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>WhiteFlower| florida web design</title>
</header>';
}
?>
please let me know if your error is resolved or not and also attach a snapshot of error we will figure it out