Jump to content

Those bless-ed buttons


toothmkr57

Recommended Posts

I have been searching for, and I think I found a customizable php button script, but I can't make it work, darnit...  If someone would please help!

 

This one was in the body, which quite honestly I would like something tidier if I could and have this a seperate php file.

function button($text) {
   $enc_text = urlencode($text);
   echo ("<img src=\"button.php?$enc_text\" border=0 Alt=\"$text\">");
  }
?>
      <P>
    <? button("hello") ?> <? button("How is life ?") ?>

 

and this was the button.php file

<?
        Header("Content-type: image/png");
        $string=urldecode(implode($argv," "));
        $im = imagecreatefrompng("media/button.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);
?>

 

now I'll be honest I don't necessarily need this php script, but I do want something that would submit a url, that could be very neat and tidy in the html code, and could maybe switch a background image onclick that would make it look like something was active.  Oh and I currently have and will continue to want a mouseover javascript, but hey if I could write it in to the php, that would be great too.

Thanks for the help!

Paul

 

 

Link to comment
https://forums.phpfreaks.com/topic/131299-those-bless-ed-buttons/
Share on other sites

well that's kinda what I was getting at, which is why I posted the code I had. But mr. grumpypants just jumped my crap, which is the complete opposite experience that had  with my last problem.  But I guess that, unlike the last thread, I didn't particularly get into the fact that I am extrememly new at php and am wanting to learn, and just not have stuff handed to me. But all that being said, blade had a point, the way my post was written thats why I didn't make an issue of it.  Anyway help would be nice, but whatever, I can find other stuff to different things other places as well.  More than one way to skin a cat.

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.