| | |
PHP Feezing with a function
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2004
Posts: 94
Reputation:
Solved Threads: 0
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 .= " <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 .= " <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
[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 .= " <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 .= " <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
![]() |
Similar Threads
- MY PHP MySQL Function keeps returning error message: "Database Query Failed" (PHP)
- How to embed youtube player in php mail function (PHP)
- PHP Mail() Function (PHP)
- PHP mail function issue (PHP)
- Need urgent assistance with php date function and recoring it into MySQL (PHP)
- php date function (PHP)
- Sending HTML email via PHP mail function (PHP)
- my php session_destroy() function not working (PHP)
Other Threads in the PHP Forum
- Previous Thread: Code Problem
- Next Thread: search and results problem
| Thread Tools | Search this Thread |
301 access apache api array autocomplete beginner binary broken button cakephp checkbox class cms code compression cron curl data database date display dropdown dropdownlist duplicates dynamic echo email error execution file files folder form forms function functions google href htaccess html htmlspecialchars httppost image include insert integration ip javascript joomla jquery limit link links login mail md5 menu methods mlm multiple mysql oop paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote script search secure server session sessions sms source space sql subscription syntax system table tutorial update upload url validator variable video virus volume votedown web youtube





