/    Sign up×
Community /Pin to ProfileBookmark

Hi,

I’m trying to retrieve a reference to a file name that contains an ampersand. The problem is, using $_REQUEST ignores everything after the ampersand, and as a result I cannot achieve a reference to the file I am looking for,

For example, I’m trying to retrieve ‘Monday & Tuesday.xls’, but all I am getting is ‘Monday’.

This is the code I am using, this is always failing as the filename is just read as ‘Monday’. Does anyone know how to get around this?

Thanks

[code]
if ($_REQUEST[‘filename’] == “Monday & Tuesday.xls”)
{
echo (“File found!”);
}
[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@brunoaisJul 07.2009 — use the backslash () before &.

Maybe it'll work
Copy linkTweet thisAlerts:
@MindzaiJul 07.2009 — ^^^^

It won't :p

If you are using GET in your form, you should url_encode any data such as this. Otherwise just use POST.
×

Success!

Help @Hysteria86 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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