...

View Full Version : dynamic



AnDy89
06-07-2005, 03:58 PM
im making my new site dymnamic, i made the content dymnaic but to make the title image diff. for each page im using some modded code:


<?php
if (! file_exists("images/v2/title_$page.jpg"))
{
include("<img width='548' height='50' src='images/v2/title_update.jpg'>");
}
else
{
include("<img width='548' height='50' src='images/v2/title_$page.jpg'>");
}
?>

but when i load the page i get:


Warning: main(SHOWS THE IMAGE): failed to open stream: No such file or directory in /home/andy89/public_html/test/v2/v2.php on line 54

Warning: main(SHOWS THE IMAGE): failed to open stream: No such file or directory in /home/andy89/public_html/test/v2/v2.php on line 54

Warning: main(): Failed opening '<img width='548' height='50' src='images/v2/title_update.jpg'>' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/andy89/public_html/test/v2/v2.php on line 54

any help will be good, thanks

edit: site is http://www.andy89.com/test/v2/v2.php? for the default and http://www.andy89.com/test/v2/v2.php?page=news for the news page

Kid Charming
06-07-2005, 04:14 PM
Instead of using include(), which is meant for files, you should use echo. That'll send your tags directly to the browser:



<?php
if (! file_exists("images/v2/title_$page.jpg"))
{
echo("<img width='548' height='50' src='images/v2/title_update.jpg'>");
}
else
{
echo("<img width='548' height='50' src='images/v2/title_$page.jpg'>");
}
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum