/    Sign up×
Community /Pin to ProfileBookmark

Using public urls as a php get argument gives me error message

If i write the url of a file on a public domain, for instance
[url]http://dahwan.info/emailextractor/emailextractor.php?link=http://www.google.com/index.html[/url]

I get the error message

Forbidden

You don’t have permission to access /emailextractor/emailextractor.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Even though i dont even use the url in the php code.

Writing any other garbage in there, for isntance
[url]http://dahwan.info/emailextractor/emailextractor.php?link=qwleucfgoqwieufqwioufgn[/url]

Works fine! I need to be able to transmit the url

Help!

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiAug 20.2009 — For one thing you need to use urlencode() on that URL.
Copy linkTweet thisAlerts:
@DahwanauthorAug 20.2009 — No function in javascript is called urlencode()
Copy linkTweet thisAlerts:
@criterion9Aug 20.2009 — Then why did you post to a php forum if you are using javascript?
Copy linkTweet thisAlerts:
@DahwanauthorAug 20.2009 — I'm sending from javascript, through POST or GET with ajax, to PHP
Copy linkTweet thisAlerts:
@criterion9Aug 20.2009 — FYI: In Javascript escape() does the same as urlencode() in PHP

http://www.w3schools.com/jsref/jsref_escape.asp
Copy linkTweet thisAlerts:
@DahwanauthorAug 20.2009 — Well no, in fact, it does [i]almost[/i] the same as urlencode. I had to fashion my own function for it to finally work properly.

[code=php]function urlencode(str) {
return escape(str).replace(/+/g,'%2B').replace(/%20/g, '+').replace(/*/g, '%2A').replace(///g, '%2F').replace(/@/g, '%40');
}[/code]


Thanks for help though ?
×

Success!

Help @Dahwan 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.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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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