Date: 05/29/01
- Next message: Fernando Nunes: "Re: [phplib] Bilder über Pfadangabe in DB Mysql??"
- Previous message: Gerald Howse: "Re: [phplib] [for Menu Bar] creation of GIF image buttons in PHP - won't accept more than one word"
- In reply to: Gerald Howse: "Re: [phplib] [for Menu Bar] creation of GIF image buttons in PHP - won't accept more than one word"
- Next in thread: Gerald Howse: "[phplib] Re: Creation of GIF image buttons in PHP - plus URLENCODE Links in array"
- Reply: Gerald Howse: "[phplib] Re: Creation of GIF image buttons in PHP - plus URLENCODE Links in array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Gerald,
Try changing:
> print("?ButtonLabel=$label[$index]");
to:
print("?ButtonLabel=" . urlencode($label[$index]));
-Steve
Gerald Howse wrote:
>
> Thanks for your reply Steve.
> can you point out to me where the code is in error in the creation
> of say three words in the label only coming out as ONE, that is my biggest
> problem.
>
> You don't perhaps know of where there is an example of this type of
> menu that I could view the code on?
>
> Thanks
> Gerald Howse
>
> *************
>
> On Tuesday 29 May 2001 07:52, Stephen Woodbridge wrote:
> > The label is getting passed to 17-1.php as an argument via the url. You
> > have to url encode the label because of the space and possible other
> > special characters.
> >
> > -Steve
> >
> > Gerald Howse wrote:
> > > creation of GIF image buttons in PHP - LABEL won't accept more than one
> > > word
> > >
> > > Leon Atkinson had some code in his PHP book that works but the book
> > > shows more than one word as a label on the button,
> > > I cannot get more than one word to show up .
> > >
> > > Has anyone tried to make a menubar using PHP to create GIF image buttons
> > > that run across the top of the page? That is what I am trying to do
> > >
> > > Thanks for any help
> > > Gerald Howse
> > > Edmonton, AB
> > > Canada
> > >
> > > ***
> > >
> > > here is what I have so far
> > >
> > > <? //start HTML page
> > > print("<HTML>\n");
> > > print("<HEAD>\n");
> > > print("<TITLE>Foo Group</TITLE>\n");
> > > print("</HEAD>\n");
> > > print("<BODY>\n");
> > > print("<BR>\n");
> > > print("<BR>\n");
> > > $label = array("ABOUT US",
> > > "OUR PRODUCTS",
> > > "CONTACT US",
> > > "WHAT\'S NEW",
> > > "Used Equipment",
> > > "CONTACT US");
> > > for($index = 0; $index < count($label); $index++) {
> > > print("<A HREF=\"http://westwindleisure.com/aboutus.html\">");
> > > print("<IMG SRC=\"17-1.php");
> > > print("?ButtonLabel=$label[$index]");
> > > print("&ButtonWidth=145");
> > > print("&ButtonHeight=25");
> > > print("\" BORDER=\"0\">");
> > > print("</A>\n");
> > > } //close page
> > > print("<BR>\n");
> > > print("<center><IMG
> > > SRC=\"http://foo.com/image250x374.gif\"></center>");
> > > print("</BODY>\n");
> > > print("</HTML>\n");
> > > ?>
> > >
> > > **************
> > > 17-1.php is this:
> > >
> > > <?
> > > /* ** GIF button
> > > ** Creates a graphical button based ** form variables. */
> > >
> > > //set parameters if not given if(!isset($ButtonWidth)) {
> > > $ButtonWidth = 200; } if(!isset($ButtonHeight)) {
> > > $ButtonHeight = 30; } if(!isset($ButtonLabel)) {
> > > $ButtonLabel = "CLICK"; } if(!isset($ButtonFont))
> > > { $ButtonFont = 5; } //create image and
> > > colors $image = imagecreate($ButtonWidth, $ButtonHeight);
> > > $colorBody = imagecolorallocate($image, 0x99, 0x99, 0x99);
> > > $colorShadow = imagecolorallocate($image, 0x33, 0x33, 0x33);
> > > $colorHighlight = imagecolorallocate($image, 0xCC, 0xCC, 0xCC);
> > > //create body of button imagefilledrectangle($image, 1, 1,
> > > $ButtonWidth-2, $ButtonHeight-2, $colorBody); //draw bottom shadow
> > > imageline($image, 0, $ButtonHeight-1,
> > > $ButtonWidth-1, $ButtonHeight-1, $colorShadow); //draw
> > > right shadow imageline($image, $ButtonWidth-1, 1,
> > > $ButtonWidth-1, $ButtonHeight-1, $colorShadow);
> > > //draw top highlight imageline($image, 0, 0,
> > > $ButtonWidth-1, 0, $colorHighlight); //draw left highlight
> > > imageline($image, 0, 0, 0, $ButtonHeight-2,
> > > $colorHighlight); //determine label size $ButtonLabelHeight =
> > > imagefontheight($ButtonFont); $ButtonLabelWidth =
> > > imagefontwidth($ButtonFont) * strlen($ButtonLabel);
> > > //determine label upper left corner $ButtonLabelX = ($ButtonWidth -
> > > $ButtonLabelWidth)/2; $ButtonLabelY = ($ButtonHeight -
> > > $ButtonLabelHeight)/2; //draw label shadow
> > > imagestring($image, $ButtonFont, $ButtonLabelX+1,
> > > $ButtonLabelY+1, $ButtonLabel, $colorShadow);
> > > //draw label imagestring($image, $ButtonFont,
> > > $ButtonLabelX, $ButtonLabelY, $ButtonLabel,
> > > $colorHighlight); //output image header("Content-type:
> > > image/gif"); imagegif($image); ?>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> > > For additional commands, e-mail: phplib-help <email protected>
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Fernando Nunes: "Re: [phplib] Bilder über Pfadangabe in DB Mysql??"
- Previous message: Gerald Howse: "Re: [phplib] [for Menu Bar] creation of GIF image buttons in PHP - won't accept more than one word"
- In reply to: Gerald Howse: "Re: [phplib] [for Menu Bar] creation of GIF image buttons in PHP - won't accept more than one word"
- Next in thread: Gerald Howse: "[phplib] Re: Creation of GIF image buttons in PHP - plus URLENCODE Links in array"
- Reply: Gerald Howse: "[phplib] Re: Creation of GIF image buttons in PHP - plus URLENCODE Links in array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

