Markx Posted February 8, 2009 Share Posted February 8, 2009 Hi All I'm sure this is a very basic question, but I'm clueless on these things. I have a form that is generated from Google Checkout. The bit I'm struggling with is: <input name="item_description_1" type="hidden" value""/> In the value field I need to return text and a string. I've tried this: <input name="item_description_1" type="hidden" value="Payment for within the $loc area."/> ...but it just comes back as text. Any help would be much appreciated. Mark Quote Link to comment https://forums.phpfreaks.com/topic/144325-solved-form-value-string/ Share on other sites More sharing options...
Daniel0 Posted February 8, 2009 Share Posted February 8, 2009 How exactly doesn't that work? You might want to do <?php echo $loc ?> instead of just $loc. Quote Link to comment https://forums.phpfreaks.com/topic/144325-solved-form-value-string/#findComment-757329 Share on other sites More sharing options...
Markx Posted February 8, 2009 Author Share Posted February 8, 2009 Hi Daniel Unfortuantely that's not got it either. If you have a look at http://www.ignitiondrivingschool.com/onlinepayment2/warwick and click the first google checkout item, under the Item section, it should read Hourly lessons taken with Ignition Driving School within Warwick the area. ...where warwick is generated from the $loc. Thanks Mark Quote Link to comment https://forums.phpfreaks.com/topic/144325-solved-form-value-string/#findComment-757333 Share on other sites More sharing options...
Markx Posted February 8, 2009 Author Share Posted February 8, 2009 ...sorry forgot to mention I'm using including it in a .tpl file. Not sure if that matters Mark Quote Link to comment https://forums.phpfreaks.com/topic/144325-solved-form-value-string/#findComment-757434 Share on other sites More sharing options...
gevans Posted February 8, 2009 Share Posted February 8, 2009 It's not parsing as php. Change your extension from .tpl to .tpl.php and include that Quote Link to comment https://forums.phpfreaks.com/topic/144325-solved-form-value-string/#findComment-757438 Share on other sites More sharing options...
Markx Posted February 8, 2009 Author Share Posted February 8, 2009 Hi Gevans Thank you for the reply, but the same thing keeps happening Mark Quote Link to comment https://forums.phpfreaks.com/topic/144325-solved-form-value-string/#findComment-757520 Share on other sites More sharing options...
premiso Posted February 8, 2009 Share Posted February 8, 2009 Post more code. There are a few different reasons this can be happening. And without the code you get guessed answers. Quote Link to comment https://forums.phpfreaks.com/topic/144325-solved-form-value-string/#findComment-757524 Share on other sites More sharing options...
Markx Posted February 8, 2009 Author Share Posted February 8, 2009 Hi Premiso Here's the full code in the template. <table width="744" border="4" cellspacing="0" cellpadding="0" bordercolor="#7cbf00"> <tr bordercolor="#7CBF00" bgcolor="#7CBF00"> <td height="53"> </td> <td> </td> <td align="center" class="style15 style24 style31 style34">Price <br /> </td> <td align="center" class="style15 style24 style31 style34">Booking fee </td> <td width="13%" class="style15 style24"><div align="center" class="style33"> Qty</div></td> <td width="31%"> </td> </tr> <tr valign="top" bordercolor="#84CA00" style="padding-top:2px; padding-bottom:-10px"> <td width="1%" height="38"> </td> <td width="27%" valign="top"><span class="style22"><font color="#FFFFFF" face="Tahoma">Hourly lessons </font></span></td> <td width="11%" align="center" valign="top"><span class="style24 style31">£{PRICE}</span></td> <td width="17%" align="center" valign="top"><span class="style30 style31">£{BOOKINGFEE}</span></td> <td colspan="2"> <form action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/157371735812724" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm"> <table width="273" height="46" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="37"><input name="item_name_1" type="hidden" value="{UCFAREA} - Hourly Lessons"/></td> <td width="35" valign="top"><input name="item_quantity_1" value="1" size="3" maxlength="3"/></td> <td width="55"><input name="item_description_1" type="hidden" value="Hourly lessons taken with Ignition Driving School within the <?php echo '$loc'; ?> area."/> <input name="item_price_1" type="hidden" value="23.50"/> </td> <td width="71"><input name="image" type="image" src="http://www.ignitiondrivingschool.com/onlinepayment/buy.gif" alt=""/></td> <td width="54"><input name="item_currency_1" type="hidden" value="GBP"/> <input name="_charset_" type="hidden" value="utf-8"/></td> <td width="21"> </td> </tr> </table> </form> Thanks Mark Quote Link to comment https://forums.phpfreaks.com/topic/144325-solved-form-value-string/#findComment-757527 Share on other sites More sharing options...
premiso Posted February 8, 2009 Share Posted February 8, 2009 One single quotes interpret the $ literally, so it is print "$loc", you want to use double quotes. If this is a template, it seems like you need to make $loc into a template variable and call it with {loc}. Quote Link to comment https://forums.phpfreaks.com/topic/144325-solved-form-value-string/#findComment-757529 Share on other sites More sharing options...
Markx Posted February 8, 2009 Author Share Posted February 8, 2009 Perfect!! Thank you Mark Quote Link to comment https://forums.phpfreaks.com/topic/144325-solved-form-value-string/#findComment-757545 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.