Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.