Reputation: 95
So I have this index.php page:
<?php
include main.php;
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css" />
<title>MySite</title>
</head>
<body>
<a id = "submit" href="submit.php">Submit</a>
<br />
<br />
<br />
<br />
<br />
<p id = "playing">Message</p>
<?php
getMessage();
?>
</body>
</html>
The include file main.php looks like this:
<?php
function getMessage()
{
echo "Test";
}
?>
But it is not echoing. Why?
Upvotes: 3
Views: 414
Reputation:
The include function has to be called like this: include('main.php');
Upvotes: 6