setting variable to image file (gif) and using it in $out.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CdnRebel
Forum Newbie
Posts: 4
Joined: Wed Jan 03, 2007 9:35 am

setting variable to image file (gif) and using it in $out.

Post by CdnRebel »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] 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]


Hi,

They prefer to use variables and I am not sure how to code it.
I have the following:

Code: Select all

var $yearNavForw="bookingAgent/images/rightarrow.gif";

$out.="<img src =\"".$this->yearNavForw."\"width = \"11\" height \"10\"></a></td></tr></table></td></tr>\n";
This doesn't seem to be working. What am I doing wrong?

Thanks,
CdnRebel


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Can you post more of the code, or explain more?

Is $out in a method of whatever class $yearNavForw was set in?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Greetings, my rebelious neighbour.

Are you using some sort of class?
CdnRebel
Forum Newbie
Posts: 4
Joined: Wed Jan 03, 2007 9:35 am

setting variable to image file (gif) and using it in $out.

Post by CdnRebel »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] 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]


Hi Everyone,

Thanks, but the problem has been resolved.  See revised version of the code:

Code: Select all

<?php
   echo 	'	
var $yearNavForw="/bookingAgent/images/rightarrow.gif";

$out.="<img src =\"".$this->yearNavForw."\"width = \"11\" height= \"10\"></a></td></tr></table>\n";
'
?>
I hope the syntax is right for your purposes.

I was missing the first / from the link for the file and the '=' from the height and there was an extraneous </td></tr>

Regards,
CdnRebel


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] 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]
Post Reply