Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

php variable in a third party button

General discussions related to php

Moderators: macek, egami, gesf

php variable in a third party button

Postby markosjal » Mon Dec 17, 2012 8:51 pm

I have a third party button that looks like this with my custom image
Code: Select all
<style>
a.zingaya_button {
display: block;
width: 182px;
height: 56px;
background: url(http://mydomain/images/customimage.png) no-repeat;
}
a.zingaya_button:hover {
background-position: 0 -56px;
}
a.zingaya_button:active {
background-position: 0 -112px;
}
</style>
<a href="http://zingaya.com/widget/nyuserid" onclick="window.open(this.href+'?referrer='+escape(window.location.href), '_blank', 'width=236,height=220,resizable=no,toolbar=no,menubar=no,location=no,status=no'); return false" class="zingaya_button">



Now the problem I have with this is my sit is dual language. I have 2 domains one for english and one for spanish. Normally I can create a separate page for each like the page may be called as test.php however test.php is just a wrapper that calls to test.en.php or test.es.php based on a $lang variable. IN this case since it is just a button I need to change in the section
Code: Select all
background: url(http://mydomain/images/customimage.png) no-repeat;


I would like to be able to call this image as
Code: Select all
background: url(http://mydomain/images/customimage.<?php .$lang.?>.png) no-repeat;


Thus the resulting file on a spanish page would be would be
Code: Select all
background: url(http://mydomain/images/customimage.es.png) no-repeat;


I have found some si,milar examples but none were siilar enough that I could make them work. I am certain there must be a way to do this easily

I have also tried to take the whole button script and use an " if, else ", however I can not seem to get the quotes and bracketing to all be happy . Its the quotes , parenthesis and curly brackets that kkill me every time

Anyone have suggestions? THanks in advance
markosjal
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Dec 17, 2012 8:34 pm

Re: php variable in a third party button

Postby markosjal » Mon Dec 17, 2012 9:07 pm

Funny how minutes after asking for help my brain finds a new approach that works . I made two buttons and called them as
Code: Select all
<?php include 'zingaya.'.$lang.'.php' ; ?>


Same effect different approach but wouyld sure like to know how to use a php variable in that button!
markosjal
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Dec 17, 2012 8:34 pm


Return to PHP General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron