I recently started getting this error on my site :
The requested URL /ilanlar.php was not found on this server.
although the link is correct and I have set the path and everything correctly, the link I try to access is as follows :
http://domain.com/%EF%BB%BFilanlar.php?il=34&ilce=34.35&mah17050&path=2
here the surprising thing is, I have the link defined as:
<a href='http://domain.com/ilanlar.php?il=34&ilce=34.35&mah17050&path=2'>CLICKY</a>
but the %EF%BB%BF part is being added automatically on its own, what am I missing here?
Change the file encoding to UTF8, delete the link and type it again.
Don't copy/paste it. Type it.
Related
I'm using onlyoffice to convert a file from docx to pdf (Documentation here : https://api.onlyoffice.com/editors/conversionapi).
I use curl to execute the example, and it works. I get the file url back, but the only issue is that when I try using this url (in a browser or downloading with file_get_contents), I have a 403 error.
There is nothing in the documentation that speak about the next steps post conversion, so I was wondering if someone could give me a hint. Is there an api method undocumented or something like that ?
Thanks
I get the file url back, but the only issue is that when I try using
this url
Please make sure that you use the link with all parameters. secure_link should also be included into the download link. If that doesn't help send us the link that you get.
The url in the xml back is sent back with html characters in it.
htmlspecialchars_decode on the url resolved my issue.
this problem started happening when my server got upgraded to use PHP7, so I suspect it has something to do with that.
My website's URLs build the page content based on the query string. For example:
example.com/?prop=one
example.com/?prop=two
example.com/?prop=three
etc...
But for some reason, when I do the following:
$prop = $_REQUEST["prop"];
or:
$prop = $_GET["prop"];
It does not recognize the specified query string value.
On the other hand, using the following URL format works fine (note the addition of "index.php"):
example.com/index.php?prop=one
example.com/index.php?prop=two
example.com/index.php?prop=three
In other words, I'm able to grab the prop query string value without a problem with the presence of the "index.php" in the URL. I don't want to use index.php in the URL, I'd like the URLs to remain clean. This is basically a single page info-app that changes the content via that query string value, so there should be no need for index.php at the root of the domain.
Any thoughts as to how I would fix this? Does this have something to do with updating to PHP7 on the server?
Well, this is embarrassing.
Basically I realized that the problem was that I had an index.html file at the root, and the server was picking that up by default when the index file wasn't specified. So naturally there was no PHP present, so it gave the impression that the query string value wasn't being read correctly. After renaming the index.html file, everything works as expected.
I'm wondering if the settings on my previous server were set to pick up the index.php file by default instead of index.html.
I'd delete this entire post but I suppose someone else might have the same problem so I'll leave it.
I have an image that is supposed to redirect to another page when it's clicked. It also "sends" two variables to the page, s and n.
echo "<a href='../?change-preference&s=up&n=".$element."'>
<img src='..media/images/sort-up.png'>
</a>";
On the change-preference page I get the two variables like so:
$s=$_REQUEST['s'];
$n=$_REQUEST['n'];
My problem is that I get a "Page Not Found" error.
Also, if I try to directly access the page it works, but only if I type this:
www.example.com/preference/change-preference
and not if I try it with :
www.example.com/preference/change-preference&s=up&n=999
Any help would be appreciated!
You should use:
www.example.com/preference/change-preference?s=up&n=999
The ? is being used in the incorrect place when you are building your link.
You need to build your link as follows:
$element = 900;
echo "<a href='../change-preference?s=up&n=" . $element ."'><img src='..media/images/sort-up.png'></a>";
This will give you:
www.example.com/preference/change-preference?s=up&n=900
And in the following link from your question the ? is missing, which will not work:
www.example.com/preference/change-preference&s=up&n=999
First you are using ? in the incorrect place as Daniel_ZA pointed out or you have typed incorrectly on your question the url that actually works. For this answer I will assume that it is the first case.
Second, do you have a php file named "change-preferences" without the .php extension? It is being parsed via php. I think probably not. So you should have a folder named change-preferences then and a file named index.php inside it right?
Well, that's the reason change-preference?s=up&n=900 redirects to change-preference\?s=up&n=900. Because you are accessing the index file for that address and not directly a file. It should work fine however.
If it still return a 404 (Page not Found) error then it's probably something that you haven't include in your question that isn't well configured or is having a bad behavior. Please try a simpler setup (create a new folder with only the minimal necessary to execute the url) or provide more information on your question.
Well.. I didn't mention that I am working with Wordpress because I thought this was 100% PHP question. It appears that "s" is a reserved term in Wordpress causing a 404 error. Changing the "s" fixed the problem. I am living this answer here in case that some one else working on Wordpress finds him/her self in the same position. Al of the reserved terms.
I'm getting the following error when trying to add the facebook like box on my website:
Could not retrieve the specified page. Please verify correct href was passed in.
The like box appears to work fine in my DEV folder that's a subdirectory within the public_html directory. So DEV/index.php worksfine when I have the data-herf contains "/DEV/". However, when I change the data-href to anything other than /DEV/, it fails.
data-href should be a full non-private URL like http://www.stackoverflow.com.
Don't use relative paths like /foo/bar.php.
Hope it helps!
i have some problem i try to get the uri in php.
I'm using:
$_SERVER['REQUEST_URI']
It works just fine if i do it in the index.php, but, i NEED to get the url in a include file, but, when i do it, it takes the FILE adress, i mean, it shows something like this
adress bar: www.webpage.com/index.php
$_SERVER['REQUEST_URI'] output: webpage/includefile.php
I am explaining myself here? Thanks!
How are you including the file? If it's being included via an HTTP reference then it's actually being served as a page and the functionality you are seeing is correct. If the include path is a local file, you shouldn't be seeing this behaviour
Found this whilst trying to solve the same issue.
My solution that worked is to use $_SERVER['HTTP_REFERER']
This worked well in that it also included the parameters (e.g. ?this=that&foo=bar)
Maybe somewhere in your code (or in another include file) the value is overwritten.