View Full Version : Gif creation w/ PHP3
I was messing with this when we first had PHP3 installed and never did get it to work... does anyone else have something like this working or possibly willing to help me figure out what I am missing...
http://www.php.net/manual/feature-images.php3
I keep ending up with a missing image graphic http://www.aota.net/ubb/frown.gif
Thanks ahead of time
Deb
(someone who isn't going to dare ask terra. I WANT to learn this w/o him (grin))
Justin
01-06-1999, 07:35 PM
I tried this as my first endeavor in php3, and it worked (if you meant the button script thing). I am trying ideas now. So far, seems like a neat thing.
Justin
------------------
Justin Nelson, SFE Inc.
http://www.vdj.net
Justin
01-06-1999, 07:42 PM
I should mention, the code on that page goes into a file, e.g., button.php3, then the image tag looks like:
button.php3?button text here
I just put Click Me. Also make sure in the button.php3 file the
$im = imagecreatefromgif("button1.gif");
refers to an image, like a blank button.
I just realized how old this message was, and I'm sure you've figured it out by now, but I am sort of excited that I got it to work on the first try :-)
Anyway, if not, make sure to change the images/button1.gif to an existing gif image. That's probably the problem.
I suppose they could explain it a little better on the site - he doesn't mention that, or the fact that the script needs to be in a .php3 file. I just wildly guessed, and it worked.
- Justin
------------------
Justin Nelson, SFE Inc.
http://www.vdj.net
hmmm from memory -- all of the above ideas were done correctly -- but it didn't work for me. The only diff I see is that I used an image that did have color on it, are you guys using totally transparent blank images?
I set it down after posting here... think I'll go back today and look at it again.
So for those wondering -- Nope I never did get it to work -- hmpf
Thanks all
Deb
Justin
01-07-1999, 05:23 PM
I used a color gif. I went into Paint Shop Pro and made a gif and buttonized it. Cheesy, but it gave the desired effect.
Personally, I'd rather make individual buttons anyway, because since each one becomes a separate gif, it takes just as long to load, plus you are stuck with their cheap font.
If you want to see it in action, I just posted it again. It's at http://www.vdj.net/phptest/
Justin
hhrrrmmmm
I'm missing something... ideas?
http://midnightmerchants.com/php/im/aimage.html
is where the flaw shows itself...
http://midnightmerchants.com/php/im/image.php is the php file
http://midnightmerchants.com/php/im/image.phps shows the source of the file
and the image itself is there at http://midnightmerchants.com/php/im/green.gif
I'm stumped http://www.aota.net/ubb/frown.gif
Can I blame the codeine?
Deb
The only difference I see is that Deb's is blah.php while Justin's is blah.php3. I'm not a php wizard by any stretch of the imagination, I've never even tried it in any depth yet. It also shouldn't make a difference whether the extension is php or php3, but you might wanna give it a shot since it's the only difference between the two test.
IMO http://www.aota.net/ubb/smile.gif
Oh yeah. Of course you can blame the codeine! Gotta have some fun with it *eg*
------------------
Del
www.downinit.com (http://www.downinit.com)
da da da
[This message has been edited by Del (edited 01-08-99).]
Try this too;
You've got
$string=implode($argv, "");
___________________^ space there
Justin has
$string=implode($argv,"");
__________________.^ no space
Just another maybe suggestion. If it doesn't work, please don't kill me http://www.aota.net/ubb/smile.gif
------------------
Del
www.downinit.com (http://www.downinit.com)
da da da
(tinkerin with the proper amount of _'s is a pain! Darn non-fixed-width fonts!)
[This message has been edited by Del (edited 01-08-99).]
[This message has been edited by Del (edited 01-08-99).]
Justin
01-08-1999, 02:32 PM
I am at a loss. I have tried everything, and I can't get mine NOT to work. Check out http://www.vdj.net/phptest/ again. Now I'm using green.gif!!! It works fine. I also have the colors figured out and everything. Notice, too, that I renamed to button.php, and it still works.
I even tried uploading it binary and ascii, still works. I tried changing some spacing, etc., in different parts of the code, nothing. Or I mean something. I can't break it.
I noticed that you copied my source exactly and it still doesn't work. And we're all on the same server. So there is no difference at all here, except one works, one doesn't.
I renamed the variable $orange to $color, because I used a color other than orange. But the variable name doesn't matter. It worked for me from stock, or as it was on their site. I am stumped that I've never even heard of php3, and yet I can't make it not work.
There's got to be something really simple wrong here. The simple problems are always the hardest to pinpoint.
I will play around with it some more later on today.
Justin
------------------
Justin Nelson, SFE Inc.
http://www.vdj.net
Justin
01-08-1999, 02:43 PM
Aha!!! You have a blank line at the beginning of your file (at least in the browser). When I view the source on mine, there's one gap at the start, and on yours there's two - signaling that there's a blank line in your file at the top.
Anyway, I tried it on mine and guess what? Three x's. No image.
Just remove the blank line on the image.php file and it will work.
I just knew I could break it! I can break anything. But in the process, I guess I fixed something, too. Darn.
- Justin
------------------
Justin Nelson, SFE Inc.
http://www.vdj.net
That was it!!
geeeeezzzzzzzzzz lol
Removing the extra line at the top was the fix of all things...
Thanks!
So ummm hmmm I guess that is something to 'look for' in future scripts or at least to be aware of ... PHP likes to start at the beginning http://www.aota.net/ubb/smile.gif
Deb
vBulletin® v3.6.8, Copyright ©2000-2013, Jelsoft Enterprises Ltd.