PHP Feezing with a function

Reply

Join Date: Mar 2004
Posts: 94
Reputation: Ragnarok is an unknown quantity at this point 
Solved Threads: 0
Ragnarok Ragnarok is offline Offline
Junior Poster in Training

PHP Feezing with a function

 
0
  #1
Jun 24th, 2004
I have created a function for a script I am doing for my website to help with manage navigation but something inside the function is causing the PHP Engine to stop running the script. I'm not to good with match expresions so I have a feeling it will have something to do with them.

[php]function navigation($navigation) {
if($navigation) {
preg_match("#\[coverage\](.*?)\[/coverage\]#is", $navigation, $navCov);
preg_match("#\[media\](.*?)\[/media]#is", $navigation, $navMedia);
}
if($navCov[0]) {
$coverage = explode("\n",$navCov[0]);
foreach($coverage as $link) $nav .= "&nbsp;&nbsp;<img src=\"images/arrow.gif\" alt=\"\" /> $link\n";
$return = <<<HTML
<table width="149" border="0" cellpadding="0" cellspacing="0" style="padding-top:5px;" align="center">
<tr>
<td><img height="22" width="149" src="images/coverage.jpg" alt="Coverage" /></td>
</tr>
<tr>
<td valign="top" style="background-image:url(images/table-bg.jpg);">
<table width="149" border="0" cellpadding="1" cellspacing="1">
<tr>
<td>$nav</td>
</tr>
</table></td>
</tr>
<tr>
<td style="padding-top:0px;"><img height="20" width="149" src="images/table-bottom.jpg" alt="" /></td>
</tr>
</table>
html;
}
unset($nav);
if($navMedia[0]) {
$media = explode("\n",$navMedia[0]);
foreach($coverage as $link) $nav .= "&nbsp;&nbsp;<img src=\"images/arrow.gif\" alt=\"\" /> $link\n";
$return .= <<<HTML
<table width="149" border="0" cellpadding="0" cellspacing="0" style="padding-top:5px;" align="center">
<tr>
<td><img height="22" width="149" src="images/media.jpg" alt="Media" /></td>
</tr>
<tr>
<td valign="top" style="background-image:url(images/table-bg.jpg);">
<table width="149" border="0" cellpadding="1" cellspacing="1">
<tr>
<td>$nav</td>
</tr>
</table></td>
</tr>
<tr>
<td style="padding-top:0px;"><img height="20" width="149" src="images/table-bottom.jpg" alt="" /></td>
</tr>
</table>
html;
}
return $return;
}[/php]

Thanx, Ragnarok
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 94
Reputation: Ragnarok is an unknown quantity at this point 
Solved Threads: 0
Ragnarok Ragnarok is offline Offline
Junior Poster in Training

Re: PHP Feezing with a function

 
0
  #2
Jul 1st, 2004
I have fixed the problem now, my host really screwed up when installing the stuff on the server, he had turned off half the error reporting and my error was one that had been disabled
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC