| 
	
 | 
 Posted by J.O. Aho on 04/07/07 23:27 
H@C0 wrote: 
> I tried menu.php but I get thefollowing warnings: 
>  
> Warning: Unexpected character in input: '\' (ASCII=92) state=1 in 
> E:\AppServ\www\test\menu-org.php on line 4 
>  
> Parse error: parse error, unexpected '"', expecting '}' in 
> E:\AppServ\www\test\menu-org.php on line 4 
 
you have a line break where there should be none 
 
>> --- menu.php --- 
1:>> <?PHP 
2:>> function typeLink($page,$img,$title="",$alt="link image") { 
3:>> if(basename ($_SERVER['PHP_SELF']) == $page) 
4:>> 	return "<div class=\"nolnk\"><img src=\"{$img}\" alt=\"{$alt\" 
>> title=\"{$title}\"></div>"; 
5:>> return "<div class=\"lnk\"><a href=\"{$page}\"><img src=\"{$text}\" 
>> alt=\"{$alt}\" title=\"{$title}\"></a>/div>"; 
6:>> } 
7:>> 
8:>> echo typeLink('page1.php','someimage1.png','Page 1'); 
9;>> echo typeLink('page2.php','someimage2.png','Page 2'); 
10:>> echo typeLink('page3.php','someimage3.png','Page 3'); 
11:>> ?> 
>> --- eof --- 
 
--  
 
  //Aho
 
  
Navigation:
[Reply to this message] 
 |