Zeroshade Posted December 6, 2006 Share Posted December 6, 2006 I'm very new to php. I would like to use it to store a picture something.jpg into a variable and call that variable to display the picture. Can I do this? Link to comment https://forums.phpfreaks.com/topic/29610-getting-a-picture/ Share on other sites More sharing options...
willfitch Posted December 6, 2006 Share Posted December 6, 2006 Yes. The following example assumes you just want to simply display the image.[code=php:0]<?php$img = 'example.jpg';echo '<img src="/image/location/'.$img.'" />';?>[/code]Is this what you're talking about? Link to comment https://forums.phpfreaks.com/topic/29610-getting-a-picture/#findComment-135874 Share on other sites More sharing options...
redarrow Posted December 6, 2006 Share Posted December 6, 2006 [code]<?php$num='10';$pic='mypic.jpg';if($num==10){echo " <img src='$pic'></img>";}else{echo "sorry no pic";}?>[/code] Link to comment https://forums.phpfreaks.com/topic/29610-getting-a-picture/#findComment-135875 Share on other sites More sharing options...
Zeroshade Posted December 6, 2006 Author Share Posted December 6, 2006 that helps a lot.. thank you. Link to comment https://forums.phpfreaks.com/topic/29610-getting-a-picture/#findComment-135878 Share on other sites More sharing options...
Zeroshade Posted December 6, 2006 Author Share Posted December 6, 2006 I have put two images into an array like so[code]<?php $picture[] = 'images\blue-carry.jpg'; $picture[] = 'images\blue-ebook.jpg'; echo '<img src="'.$picture[0].'" />'; ?>[/code]How can I set a timer up so that the one picture will fade and then reappear in say 5 seconds into the upcoming picture in the array? Link to comment https://forums.phpfreaks.com/topic/29610-getting-a-picture/#findComment-135901 Share on other sites More sharing options...
Zeroshade Posted December 6, 2006 Author Share Posted December 6, 2006 Here an updated piece of code. [code]<?php $increment; $picture[] = 'images\blue-carry.jpg'; $picture[] = 'images\blue-ebook.jpg'; for ($increment = 0; $increment < 3; $increment++) echo '<img src="'.$picture[$increment].'" />'; ?>[/code]But this places the image below the last one. How can i set a timer so that it replaces the old one in 5 seconds? Link to comment https://forums.phpfreaks.com/topic/29610-getting-a-picture/#findComment-135910 Share on other sites More sharing options...
Zeroshade Posted December 6, 2006 Author Share Posted December 6, 2006 Does anybody know? Link to comment https://forums.phpfreaks.com/topic/29610-getting-a-picture/#findComment-136136 Share on other sites More sharing options...
trq Posted December 6, 2006 Share Posted December 6, 2006 [quote]Does anybody know?[/quote]You need to use Javascript not PHP. Link to comment https://forums.phpfreaks.com/topic/29610-getting-a-picture/#findComment-136142 Share on other sites More sharing options...
Zeroshade Posted December 6, 2006 Author Share Posted December 6, 2006 Is it possible to do this in php? The reason is, the last time I used javascript in my xhtml, i had marks taken off because javascript slows the page down. So, php counters that because the page won't be slowed down because of it. Therefore, I'm learning php very quickly, and I thought I read something up on Timer.php? Am I wrong in assuming there is a way to do this in php? Link to comment https://forums.phpfreaks.com/topic/29610-getting-a-picture/#findComment-136173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.