Multiple Selection List = where Filter
16 posts by 2 authors in: Forums > CMS Builder
Last Post: January 28, 2009 (RSS)
By s2smedia - January 27, 2009
the 3rd one keeps giving me this error:
Warning: strpos(): Empty delimiter in /home/highview/public_html/apexFinal/summerlocation_details.php on line 171
CODE:
<?php foreach ($newsRecords as $record): ?>
<?php if (strpos($summer_academy_locationsRecord['location'], $record['summer_location']) !== false) { continue; } ?>
<?php $bgColor = (@$bgColor == "") ? '#666666' : ''; ?>
<table width="100%" border="0" cellspacing="0" cellpadding="8" >
<tr>
<th align="left" valign="top" bgcolor="<?php echo $bgColor; ?>" scope="col"><span class="newsheadlines2"><?php echo $record['date'] ?></span><br />
<span class="newsheadlines4"><b><a href="<?php echo $record['_link'] ?>"><?php echo $record['headline'] ?></a></b></span><br />
<span class="newsheadlines2"><?php echo $record['article_snippet'] ?></span></th>
</tr>
</table>
<?php endforeach; ?>
<?php if (!$newsRecords): ?>
<span class="newsheadlines2">No records were found!</span><br/>
<?php endif ?>
By Dave - January 27, 2009
Try this:
<?php if (strpos("{$summer_academy_locationsRecord['location']}", "{$record['summer_location']"}) !== false) { continue; } ?>
Let me know if that works for you.
interactivetools.com
Re: [Dave] Multiple Selection List = where Filter
By s2smedia - January 27, 2009
how can i have it display the "end if php" code if there are no records?
The most recent code you replied with gave me this error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '}' in /home/highview/public_html/apexFinal/summerlocation_details.php on line 172
By Dave - January 27, 2009
<?php if (strpos("{$summer_academy_locationsRecord['location']}", "{$record['summer_location']}") !== false) { continue; } ?>
And you can display an error if there is no record loaded with some code like this at the top:
// error if page not found
if (!@$summer_academy_locationsRecord) {
header("HTTP/1.1 404 Not Found");
print "<h1>404 File Not Found!</h1>";
exit;
}
Hope that helps!
interactivetools.com
Re: [Dave] Multiple Selection List = where Filter
By s2smedia - January 27, 2009
I just realized the strpos code isnt working how i need it either...
I think the best thing would be for me to email you login to my cms so you can see how everything is functioning...
By Dave - January 28, 2009
interactivetools.com