Preview Dynamic Image Button
Posted: Mon Apr 17, 2006 11:55 am
Jcart | Please use
On this page, there is a form which posts information to a table in my database (this table is used to save settings to create a dynamic image, when it is called from another page).
Fields on this form are: Text Color, Background Color.
Next to the submit button, I want to create a preview button, so the user can see a preview of their dynamic image; prior to submitting it. The code below, is found on the page that dynamically creates the image.
$bg = Background Color
$fg = Foreground Color
I know the code above is called at the sever level and javascript runs at the user level. Is there any way I can have the preview button run the code above and display the image? I know that the page would have to be called again, since the image is created server side.
Thanks again!
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Please move this topic if I am in the wrong thread. Thought this would be the best place for this post.
To make this easier to understand, I am shorting everything I want to accomplish.
I currently have a php page which I intergrated to work with joomla by adding:Code: Select all
define( '_VALID_MOS', 1 );
include_once( 'globals.php' );
require_once( 'configuration.php' );
require_once( 'includes/joomla.php' );Fields on this form are: Text Color, Background Color.
Next to the submit button, I want to create a preview button, so the user can see a preview of their dynamic image; prior to submitting it. The code below, is found on the page that dynamically creates the image.
Code: Select all
header("Content-type: image/jpeg");
$im = imagecreate(460,90);
$bg = imagecolorallocate($im,255,255,255);
$fg = imagecolorallocate($im,100,120,130);
$borc = imagecolorallocate($im,0,0,0);
imagefill($im,0,0,$bg);
imagerectangle($im,0,5,459,89,$borc);
imagestring($im,3,6,7,"Banner Message Here",$fg);
imagejpeg($im);
imagedestroy($im);$fg = Foreground Color
I know the code above is called at the sever level and javascript runs at the user level. Is there any way I can have the preview button run the code above and display the image? I know that the page would have to be called again, since the image is created server side.
Thanks again!
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]