There is an issue with url sending from a url variable to php file. The first url showing 404 error while second one is working fine.
http://example.com/fix/ajax/linksave.php?li=http%3A%2F%2Fmail.google.com%2Fma&st=14&ty=3&tl=test&ip=117.219.231.12
http://example.com/fix/ajax/linksave.php?li=hy&st=14&ty=3&tl=test&ip=117.219.231.12
so when variable "li" want to send a url it always showing 404 error.
While sending url string use php's urlencode() . For more info refere http://php.net/manual/en/function.urlencode.php .
Related
A strange problem is happening on my site . I want to get JSON data from query string so I request a url something like this http://myurl.com/?get_json.php={"created":"now"} but this gives me a 404 error . But the other query string works just fine I mean when I add {" : "} this permeter the url does not work. I am pretty sure this a problem in my server side configuration beacause when I try the same url in other site from different hosting the url just works fine . How can I configure my site to get this work?
Not working https://altahleel.com/new.php?order=%7B%22created%22%3A%22-%22%7D but this is working https://dainikalorprotidin.com/t.php?ts=%7B%22created%22%3A%22-%22%7D
before redirect to url parse with url_encode($url)
This is my tiny url function
private function getTinyUrl($url) {
return file_get_contents("http://tinyurl.com/api-create.php?url=".$url);
}
the output is something like http://tinyurl.com/nj76pbs so thats good.
But when I use the url, it takes me to
tinyurl.com/mywebsite.com/code?=fqhfkqhiurhg98y
and i get a 404 not found. What to do?
I'm thinking it's because your $url doesn't contain "http://" or "https://". Because of this, when tinyURL attempts a redirect, it stays within the tinyurl domain. Does your $url variable have http or https? If it always wont, you can just add it to the file_get_contents call.
Also, file_get_contents won't work on all servers. Sometimes it's restricted. I'd recommend attempting to do this with CURL if you get the chance.
You're missing the http://, https:// in front of the URL. You can possible add a check in your function to auto prefix this if needed.
I build some Facebook-login for my website. I send this parameter to Facebook api as so
https://www.facebook.com/dialog/oauth?client_id=myclient_id&redirect_uri=http%3A%2F%2Fmysite.fr%2Fmydir%2Findex.php%253Fpage%253Dlogin&state=mystate&scope=email%2Cpublish_actions
Everything goes well until the redirection process :
http://mysite.fr/mydir/index.php%3Fpage%3Dlogin?code=somecopde
I get this error message
The requested URL /mydir/index.php?page=login was not found on this server.
But everything goes normal if I replace %3F by ? in redirect_uri to
redirect_uri=http%3A%2F%2Fmysite.fr%2Fmydir%2Findex.php?page%253Dlogin&state=mystate&scope=email%2Cpublish_actions
Why is it so, How can I adjust this ?
Looks like you double url encodes your get parameters
See:
myclient_id&redirect_uri=http%3A%2F%2Fmysite.fr%2Fmydir%2Findex.php%253Fpage%253Dlogin&state=mystate&scope=email%2Cpublish_actions
Lets try url decode you url:
http%3A%2F%2Fmysite.fr%2Fmydir%2Findex.php%253Fpage%253Dlogin&state=mystate&scope=email%2Cpublish_actions
First time:
http://mysite.fr/mydir/index.php%3Fpage%3Dlogin&state=mystate&scope=email,publish_actions
You can see that the ? is still encoded to %3F and your = is still encoded to %3D
to fix this you should not urlencode you url twice. I need to know more about your implementation if this information is not enough.
my domain is www.xyz.com in this i have a page like www.xyz.com/test.php when u
open this page it'll show u a link like click here , the address of link is like
www.abc.net/secret/vEX0szqBscdQx but when i click this click here it shows 404 error
page not found and there url look like this
http://www.xyz.com/"https://www.abc.net/secret/vEX0szqBscdQx/"
its not redirection the page please help me.
ok lets get real
this is my code
When you reference external URI you need to specify the full URI including the protocol, e.g. http, https etc:
Try:
click here
Or the shorthand to keep the same scheme/protocol(http/https):
click here
Http 404 error is a clear indication that your url is wrong or does not exist. Specify the full url in your code.
I am trying to pass a value with a url which goes to a login page. The login page has a https url and when I follow the link it removes the variable at the end. So for example the url starts off as
https://website.com/login?myvalue
The link works and the url still contains the value when I get to the page but by the time the page has finished loading the value is gone. The url becomes:
https://website.com/login
Is it not possible to pass a value with a https url or am I just doing it wrong?
All help appreciated. Thanks in advance.
Surely you should assign a value to the urlURL variable myvalue?
https://website.com/login?myvalue=yes
I haven't worked with HTTPS, only HTTP, but it should work the same unless they don't allow request variables.
Turned out to be a redirect over-writing the url. I had to use session variables in the end unfortunately