Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

what is the comand for loading images to a php file?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

what is the comand for loading images to a php file?

Postby juansoul » Thu Oct 24, 2002 1:04 pm

what is the comand for loading images to a php file?
and how do i do this ?
juansoul
New php-forum User
New php-forum User
 
Posts: 29
Joined: Tue Oct 08, 2002 6:33 pm

Postby DoppyNL » Fri Oct 25, 2002 2:19 am

Do you want to add an image to the page you're building?
use the html-tag img:
Code: Select all
<img src="linktoimage.jpg">


Or do you want to do something else? Then explain more clearly.

Greetz Daan
DoppyNL
 

Re: what is the comand for loading images to a php file?

Postby Icarus » Fri Oct 25, 2002 3:29 am

juansoul wrote:what is the comand for loading images to a php file?
and how do i do this ?


Have a look at the example at :
http://www.php.net/manual/en/ref.image.php
User avatar
Icarus
New php-forum User
New php-forum User
 
Posts: 7
Joined: Thu Oct 24, 2002 9:32 am
Location: Amsterdam, NL

Postby juansoul » Fri Oct 25, 2002 5:18 am

Ok ill explain a bit better, I want to be able to load an image as the value to variable for example a person clicks on a link now depending on what link he or she clicks on image will be loaded to the php flie as the result of cliccking on that link , in other words how do I display an image as the value of a variable
juansoul
New php-forum User
New php-forum User
 
Posts: 29
Joined: Tue Oct 08, 2002 6:33 pm

Postby Icarus » Fri Oct 25, 2002 6:07 am

Code: Select all
<?php
    header("Content-type: image/png");
    $string = $_GET['text'];
    $im     = imagecreatefrompng("images/button1.png");
    $orange = imagecolorallocate($im, 220, 210, 60);
    $px     = (imagesx($im) - 7.5 * strlen($string)) / 2;
    imagestring($im, 3, $px, 9, $string, $orange);
    imagepng($im);
    imagedestroy($im);
?>


$im is the variable that has the image loaded
User avatar
Icarus
New php-forum User
New php-forum User
 
Posts: 7
Joined: Thu Oct 24, 2002 9:32 am
Location: Amsterdam, NL


Return to PHP coding => General

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron