TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-26-2008, 01:51 PM   #1 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Bug İmage Create with multi lines ?

PHP Code:
<?php
header
("Content-type: image/png");
$yaziyaz "Alexa: 3,493,231";
$yaziyaz1 "Pagerank: 3";
$string $yaziyaz;
$string1 $yaziyaz1;
$im imagecreatefrompng("resim.png");
$orange imagecolorallocate($im949494);
$px = (imagesx($im) - 7.5 strlen($string)) / 2;
$px1 = (imagesx($im) - 11 strlen($string1)) / 2;
imagestring($im2$px2$string$orange);
imagestring($im2$px113$string1$orange);
imagepng($im);
imagedestroy($im);
?>
But if the $yaziyaz is short, it seems bad. The script is here
http://www.forumistan.net/7tepe/resim.php

How can I fix the problem ?

Last edited by CΛSTΞX : 03-26-2008 at 02:50 PM.
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 03-26-2008, 07:09 PM   #2 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

But if the $yaziyaz is short
What do you mean by this?
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 03-26-2008, 07:19 PM   #3 (permalink)
The Acquainted
 
freenity's Avatar
 
Join Date: Feb 2008
Posts: 119
Thanks: 17
freenity is on a distinguished road
Default

what is the problem with this? Looks fine for me.
__________________
http://feudal-times.net - My PBB Game
http://gwphp.feudal-times.net - My Blog "Gaming With PHP"
freenity is offline  
Reply With Quote
Old 03-26-2008, 09:34 PM   #4 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Default

I mean, I want to make it like this:

Alexa: 3,493
Pagerank: 3


But it seems like:

---- Alexa: 3,493
Pagerank: 3
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 03-26-2008, 10:59 PM   #5 (permalink)
The Addict
Upcoming Programmer Top Contributor 
 
Rendair's Avatar
 
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
Rendair is on a distinguished road
Default

Cant you just have

PHP Code:
imagestring($im2102$string$orange); 
imagestring($im21013$string1$orange); 
Because the X cords are different because of the length of the string and how you have worked them out. Would be easier to put a number?
__________________
www.jooney.co.uk - the online portfolio
Send a message via MSN to Rendair
Rendair is offline  
Reply With Quote
Old 03-27-2008, 01:18 AM   #6 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Default

Thanks a lot Rendair...
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 03-27-2008, 11:41 AM   #7 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Default

Yes, now it seems nice = http://www.forumistan.net/7tepe/olus...bodrumlife.com

I want to make a link of it in the php file, but I can`t...`(<a href='http://www.forumistan.net'>The image</a>)

Can someone please help me ??

Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 03-27-2008, 01:34 PM   #8 (permalink)
The Addict
Upcoming Programmer Top Contributor 
 
Rendair's Avatar
 
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
Rendair is on a distinguished road
Default

Yes it is very easy to do this.

PHP Code:
<a href="http://www.forumistan.net/"><img src="http://www.forumistan.net/7tepe/olus.php?site=www.bodrumlife.com"></a
All you need to do to show GD images is link to the actual PHP file and it will work
__________________
www.jooney.co.uk - the online portfolio
Send a message via MSN to Rendair
Rendair is offline  
Reply With Quote
Old 03-27-2008, 08:58 PM   #9 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Default

Yes I can do it. But I want to hyperlink it in the php file.
I mean, if you open http://www.forumistan.net/7tepe/olus...bodrumlife.com , the image which shown in the page should be also hyperlinked. So when you use
<img src="http://www.forumistan.net/7tepe/olus.php?site=www.bodrumlife" \> it is also hyperlinked...

It is like this (try to hover it, it is hyperlinked)

Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Old 03-27-2008, 09:48 PM   #10 (permalink)
The Acquainted
 
freenity's Avatar
 
Join Date: Feb 2008
Posts: 119
Thanks: 17
freenity is on a distinguished road
Default

it is impossible to hiperlink it in the php file....
You can only make it using html, or javascript.
What you really get from that php file is an image, and an image can't be a link by itself.
__________________
http://feudal-times.net - My PBB Game
http://gwphp.feudal-times.net - My Blog "Gaming With PHP"
freenity is offline  
Reply With Quote
Old 03-27-2008, 10:34 PM   #11 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Default

Well, I dont think that it is impossible.

I tried

<?php
echo "<a href=http://www.forumistan.net>";
header("Content-type: image/png");
$yaziyaz = "Alexa: 3,493,231";
$yaziyaz1 = "Pagerank: 3";
$string = $yaziyaz;
$string1 = $yaziyaz1;
$im = imagecreatefrompng("resim.png");
$orange = imagecolorallocate($im, 94, 94, 94);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
$px1 = (imagesx($im) - 11 * strlen($string1)) / 2;
imagestring($im, 2, $px, 2, $string, $orange);
imagestring($im, 2, $px1, 13, $string1, $orange);
imagepng($im);
imagedestroy($im);
echo "</a>";
?>

But when I do it, it gives some 'headers already sent
problems. Is there someone who know how to do it successfully ?
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:43 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design