|
-
May 2nd, 2013, 11:05 AM
#2
Re: JPG that gets live data from a Webpage
Just use the a PHP page as the source for the image tag. And then in that PHP page, write the code to pick the random image or whatever image you want to and out it.
Eg:
Code:
<img src="http://www.yoursite.com/somedirectory/generate.php" />
In generate.php file, you would write something like this:
PHP Code:
<?php
$picture = 'mypath/to/image/location/my_image.jpg'; // you can pick an image randomly if needed
$type = 'image/jpeg'; // This is the content type we are going to use. ie, we would be going to tell the browser that that content outputted is of type JPG image, by using the header() function below
header('Content-Type:'.$type); //send the headers to the browser
readfile($picture); // read the file contents and write to the output buffer.
?>
That would be enough.
Last edited by akhileshbc; May 2nd, 2013 at 11:16 AM.
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|