Forum Moderators: coopster

Message Too Old, No Replies

ltrim or something else?

         

kat_rees

3:03 pm on Sep 6, 2007 (gmt 0)

10+ Year Member



Hi there,

I just joined today and am stuck on a problem.
I have some code:

<script language="javascript" type="text/javascript">
cc_ClientId = 549;
cc_Amount = <? echo $_GET["p"];?>;
ProcessPConversion();
</script>

I need to create a php function to trim the "p" parameter before it goes into that variable above, as the end value coming through with a %20 before the number.

Im not too hot on php so any help very gratefully received! :)

dreamcatcher

3:07 pm on Sep 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



kat_rees,

A warm welcome to WebmasterWorld. :)

Try this:
cc_Amount = <? echo trim [php.net]($_GET["p"]);?>;

dc

kat_rees

3:59 pm on Sep 6, 2007 (gmt 0)

10+ Year Member



thank you so much, it worked :)