Jump to content

Text to image - Add more


Twist3d

Recommended Posts

Hello guys.

Well I've ran into a sorta crossroad here with this script.

See I'm trying to create like a click to make point system on an image.

I have it all working except 1 problem..

 

At the moment the text to image script is only adding 1 bit of text onto the image, that is fine, that is because this is the only one in the php file:

 

Imagettftext($im, 12, 0, $X, $Y, $black, 'verdana.ttf', "$text");

 

But, what I am trying to do is to let the user create more points.

I thought I could achieve this by a database and just echoing out all of the rows from point txt which are like the above.

So it will be like

 

Imagettftext($im, 12, 0, 342, 455 $black, 'verdana.ttf', "$text");

Imagettftext($im, 12, 0, 443, 953, $black, 'verdana.ttf', "$text");

Imagettftext($im, 12, 0, 553, 445, $black, 'verdana.ttf', "$text");

 

And every time a user adds another point another one of the above is added to the database, it is then read by the TXT file, and displayed onto the image.

 

Although I only have this running at the moment:

 

<?php echo $row['pointtxt']; ?><br>

 

And for a test I just tried a simple echo command, and this is the only record or row in the database in the field pointtxt:

 

echo "hello";

 

As you can image, I don't think an echo can echo PHP commands, sorry this is really hard to explain, if anyone needs further explaining tho I will try.

 

Its basically I just want a user to add one of these into the database

 

Imagettftext($im, 12, 0, 553, 445, $black, 'verdana.ttf', "$text");

 

And on the image, it will grab all of those from the database, and run them so they all appear on the image.

Thanks for your help.

 

 

Link to comment
https://forums.phpfreaks.com/topic/218935-text-to-image-add-more/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.