898 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+4 more
Gareth_Gillman says





On the form page, please do
var_dump( $_GET );
and tell me the output.

I get the following:

 array(1) { ["package"]=> string(20) "Graduate bronze £65" } 
Can you please paste the output of this then:
var_dump( isset( $_GET['package'] ) );
var_dump( strtok( $_GET['package'], '£' ) );
var_dump( strtok( '£' ) );
 bool(true) string(16) "Graduate silver " string(2) "75" 

Ok, then this should work:

$price = isset( $_GET['package'] ) ? intval( strtok( $_GET['package'], '£' ) ) : 0;
$price = intval( strtok( '£' ) );

Bingo! That’s brilliant, thanks so much :)

1509 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE says

Np, good luck in work ;)

898 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+4 more
Gareth_Gillman says

The above code works great but found a slight glitch that hopefully is an easy fix, in Paypal I show the url as the item but it shows the following:

Graduate silver £75

Is there a way to change it to be £75?

1509 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE says

Hmm I’m not sure I understand the problem.

So the problem is that it adds  to the item name?

898 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+4 more
Gareth_Gillman says

No, basically the browser is turning the £ into the A, basically because the £ hasn’t been set in the HTML character sert (£).

Is there a way with Php to change the £ to £ so it won’t get converted!

1509 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE says

Well you could try something like this:

$product_name = $_GET['package']; // This is the package name, does not matter, you probably have this already

$product_name = str_replace( '£', '& #163;', $product_name ); // Replace pound sign with it's html number in product name variable

Ps in the above code remove space between “&” and ”#163”

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by