943,731 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2808
  • PHP RSS
Jun 24th, 2004
0

PHP Feezing with a function

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Ragnarok is offline Offline
94 posts
since Mar 2004
Jul 1st, 2004
0

Re: PHP Feezing with a function

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
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Ragnarok is offline Offline
94 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Code Problem
Next Thread in PHP Forum Timeline: search and results problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC