/    Sign up×
Community /Pin to ProfileBookmark

Passing variable containing ‘•’ via $_GET

I’m trying to pass a variable that contains a ‘bullet’ from one php file to another. It appears to work fine in Firefox and Explorer, but is not interpreted correctly by Chrome or Safari.

Here’s the code in the file defining the variable $title.

[CODE]<a href=”../product/product.php?title=Window Reflection &bull; 1985&dir-name=madrona&image=madrona1″ >Go To Store</a>[/CODE]

Here’s the code in the file “getting” the variable.

[CODE]<h2><?php echo $_GET[“title”] ?></h2>[/CODE]

I’ve messed around with htmlspecialchars() htmlentities(), but have not found a resolution that works in all browsers!?!

Any pointers are appreciated.

Thanks!!!

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@VBAssassinJun 02.2012 — The & means something in URL's... you need to use rawurlencode() eg:

dsadsdas.com?title=<?php print urlencode("Window Reflection &bull; 1985"); ?>&blabla=bladeda

Kind regards,

Scott
Copy linkTweet thisAlerts:
@crwaageauthorJun 02.2012 — Thank You!!!!

That solved my problem.
Copy linkTweet thisAlerts:
@crwaageauthorJun 02.2012 — Thanks!
×

Success!

Help @crwaage spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...