Topic: "php help..." (page 1 of 1)

1
Author Post
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
ok, this is what i have, it works with pages but it doesn't work with pics any hints on how to get it to work...

<?php if ($pic) { include("$pic"); } else { include("pic1.jpg"); } ?>

:-?
private message Website
diskis
groupmaster
um, don't include try to run the file?
how about <?php if ($pic) { echo("<img src=$pic>"); } else { echo("<img src=pic1.jpg>"); } ?>
just ripped that out of my ass, as i don't know what you want to be done...

--Diskis

private message EMail Website
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
well what i have is links at the bottom like ?pic=pic2.jpg and then when its clicked the picture changes.
Thanks btw :-)
private message Website
DeathSpawn
groupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Not sure if you can include a non.php file. Never tried it, but doesn't seem like it would work.

Why not just JavaScript it in to change on the mouse click? Might be easier. Just my 2¢

DS
private message
TheHiveMind
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Of course you can include (or require) a non-php file... it will just be interpreted as a standard html page.
(Which is not entirely correct, what happens is that the php interpretation pauses and the included file is parsed... should this file be / contain a script the server is configured to treat differently (php or whatnot), that will be done). So if you try including some binary file, most likely its content will simply be displayed on the page.
private message

Topic: "php help..." (page 1 of 1)

1