Questions tagged [pathinfo]
85 questions
1
vote
0 answers
pathinfo() safety: is it possible to fake the extension?
I currently get the extension of the files are uploaded by the admins using pathinfo($FILE["name"], PATHINFO_EXTENSION), validating them if they match with a specific list.
Today I was wondering:
is there any way to fake the exstension, giving the…

Brigo
- 1,086
- 1
- 12
- 36
1
vote
1 answer
Wildcard path mapping /A/* should return 404 when path info is absent like /A
I am new in Servlets. I am trying to map a URL using the wildcard (*), but it's not working the way i expected.
Here is my servlet class.
@WebServlet(urlPatterns = {"/A/*"})
public class TestServlet extends HttpServlet {
protected void…

theapache64
- 10,926
- 9
- 65
- 108
1
vote
3 answers
php remove filename from url if exists
hello I would like to remove all filenames from my url :
http://website.com/folder1/folder2/filename.php
here is what I have tried :
$file_info = pathinfo('http://website.com/folder1/folder2/filename.php');
echo $file_info['dirname'];
outputs…

I will be the best
- 59
- 1
- 9
1
vote
0 answers
There is a hard-to-resolve issue when using pathinfo in apache 2.4
I deployed httpd(2.4)+php5.6(FastCGI mode)+mysql playform in centos.
I installed thinkphp, but there were some mistakes of pathinfo.
My configurations are as follows:
1.The configuration in httpd.conf:
LoadModule rewrite_module…

qiandutianxia
- 88
- 8
1
vote
2 answers
Remove the extension from a file name and include all files in directory
I looked on the forums but did not find what I need.
I need help to delete the extension from the file name, and include all files for example (php files) from a directory, and show you examples.
This code work
$name = 'file.php';
$fileName=…

user2988099
- 1
- 1
- 7
1
vote
1 answer
ASP.NET MVC: PathInfo Limit?
One of the limitations of ASP.NET 2.0 was that PathInfo was limited to 255 characters. Is that limit a problem in ASP.NET MVC urls, or is there any sort of length limit with ASP.NET MVC routing urls?

claco
- 739
- 1
- 8
- 18
1
vote
2 answers
Finding path name to use as a slug for custom built cms with PHP
I'm building a website with a custom content management system, and I want to build a slug area like wordpress. I want to retrieve the path name from my front-end depending on the page they're on, and echo that out in my backend in the slug…

tickerll
- 43
- 1
- 3
- 10
1
vote
1 answer
.htaccess rewriting PATH_INFO vars to empty before passing to template; not removing index.php from url
Morning everyone, I'm hoping this will be an easy one! (I haven't even had coffee yet why am I up so early?!)
Anyway.. got a two-parter for you:
First (basic) issue that I'm trying to remove index.php from my links (which seems to be next to…

user2089001
- 23
- 1
- 6
1
vote
5 answers
PHP Finding a domain name and domain extension from an array
I have an array of data containing some domains with TLD extensions. I want to collect the domain name and TLD extension seperately.
E.g. From "hello.com" I want to collect "hello" as one variable, and then collect ".com" as another…

Ryan M
- 55
- 1
- 6
1
vote
4 answers
Image url can't get through if statement
I post an image url to a php script. In this php script I get the image url and check what the extension is and if this extension matches a couple of extensions or not:
$ext1 = pathinfo($_POST['form_pic'], PATHINFO_EXTENSION);
$ext =…

Stefan
- 155
- 7
- 18
1
vote
1 answer
How do I get apache on Rackspace Cloud Sites to serve scripts with extra path info?
I'm running a site on Rackspace Cloud Sites (I don't have access to the apache configuration, but I can potentially ask them to change something or enable me to make the changes).
I have a script called feeds.php and I want to put it in the document…

Kenny Wyland
- 20,844
- 26
- 117
- 229
1
vote
1 answer
RewriteRule to PHP PATH_INFO and hiding destination php script
I am trying to use Apache mod_rewrite to achieve the following:
In the document root, I have these files (for example):
.htaccess
index.php
dlscript.php
I want /downloads/this_is_path_info to be rewritten to /dlscript.php/this_is_path_info,…

Alvin Wong
- 12,210
- 5
- 51
- 77
0
votes
3 answers
Codeigniter uri_string not returning the full path
So being locate at this url (as an example) : http://localhost/codeigniter-app/en/results?search_query=data
uri_string doesn't return the needed path
["uri_string"]=>
string(10) "en/results"
and the expected:
["uri_string"]=>
string(10)…

Alex
- 7,538
- 23
- 84
- 152
0
votes
1 answer
Upload image script is not working
I have an image uploading script
In upload form page there is an input field as shown below:
Part of the php script handling image upload is:
$path_parts = pathinfo($_FILES['product_image']['name']);
$imgext = $path_parts['extension']…

user1010966
- 473
- 1
- 6
- 13
0
votes
2 answers
url/php path_info issue
I am having what I believe is a strange problem. I have several sites developed on the same hosting platform. All site seem to be fine except for one of them. The website is set up around 1 page (index.php) that retrieves the correct data to display…

kaliok
- 11
- 4