Jump to content

Recommended Posts

Posted

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4loose.dtd">

 

<html>

<head>

 

<meta http-equiv="Content-Type" Content="text/html; charset=iso-8859-1">

 

<title></Title>

 

 

 

<?php

 

 

 

 

 

 

 

function footer($email, $arg = "Jimmy!") {

 

echo "$email<br><br>";

 

 

if($arg == "Jimmy!") {

 

return "hey, I know " .$arg;

 

} else {

 

return "Do I Know You" .$arg ."?";

 

 

 

}

 

?>

 

 

</head>

 

<body>

 

 

<?php

 

 

 

echo footer("er" );

 

 

 

?>

 

 

 

 

</body>

</html>

 

 

 

2mims 15 secs

 

 

 

on following this lesson

 

 

i get the following when trying to view in browser

 

 

have gone through the code and can not see any errors

 

 

browser error

 

 

Parse error: syntax error, unexpected $end in C:\wamp\www\functions_custom_three.php on line 56

 

 

advise please

Posted

You're missing a closing "}" on your footer() function:

 

function footer($email, $arg = "Jimmy!") 
{
 echo "$email<br><br>";

 if($arg == "Jimmy!") 
 {
   return "hey, I know " .$arg; 
 } else {
   return "Do I Know You" .$arg ."?";
 }
} // <-- add here
?>

Posted

as i'm still very new to php, I only started learning yesterday, feel free to ignore anything i say.

 

but as i have a little bit of knowledge with coding, it would appear that you never closed your first function.

I didn't look very closely or very long but i would try that first.

  • Upvote 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...