I want to create a folder navigation in PHP [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i want to create a data browser where i can navigate through data based on a apache and Mysql server. How can i list data form a selected folder? is this possible in PHP?
Thank you!

Listing folder contents can be done in numerous ways using PHP, from a very simple glob() cmd to a complicated(?) recursiveIterator.
Example of glob.
----------------
$dir=realpath( $_SERVER['DOCUMENT_ROOT'] . '/path/to/folder' );
$col=glob( $dir . '/*.*' );
print_r( $col );

Related

Creating file 'php' after getting data [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
. I wonder how can my project automatically create php file by itself , after getting some data like product description ?
Like you'd create any other file. From the manual. Just give it a .php extension.

Php: Iterate over dir path and create folder if not exist [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to make sure each folder in path exist.
$Path = "NamFdr1/NamFdr2/NamFdr3/NamImj.jpg"
E.g.:
First check that "NamFdr1" exists, if not create it;
Then check that "NamFdr2" exists, if not create; and so on.
How can I do this with built-in functions?
try this,
if (!file_exists('NamFdr1/NamFdr2/NamFdr3'))
{
mkdir('NamFdr1/NamFdr2/NamFdr3', 0777, true);
}
i hope it will be helpful

PHP - Find File in Directory By File Name [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a directory full of filenames that contain unix timestamps.
file_1434320602.data
file_1434320352.data
file_1434320112.data
file_1434320032.data
How would I get about loading them up in PHP so that I can select the one which I needed?
There are many ways you can do it. The simplest in this case is glob:
$files = glob('/path/to/file_*.data');
print_r($files);

BarsCode Int25 into image in php [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hello I have to create a function which generates a barCode INT25 in php. Any ideas how to do it. The function should generate the image and give back the url where to find it.
Thank you very much
There are many examples, and libraries/classes, that can assist in this. Most of these, when you create the image, you save it instead of discarding. Then you can also post the url, or save it in a database for later use. Some examples are as follows:
http://bmpradeep.wordpress.com/2013/01/29/generating-barcode-using-php/
http://www.barcodephp.com/en/manual/i25
http://barcode-coder.com/en/barcode-php-class-203.html
http://www.phpkode.com/source/s/barcode-generator/barcode-generator/class/i25.barcode.php
Save file using php
http://php.net/manual/en/function.imagepng.php
http://php.net/manual/en/function.imagejpeg.php
http://php.net/manual/en/function.imagegif.php

How can I create a new Directory on my website from the Clients computer so they can upload unique data to me? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Can somebody please give me the code to be able to create a new folder on my website from a Clients computer using a submit button? PHP, JAVA or HTML
You can create a directory on the server with
<?php
mkdir("/path/to/my/dir", 0700);
?>
Have a look here: http://php.net/manual/en/function.mkdir.php
You need to have the right permission on your path. Folder should be owend by webserver user.
For a full example have a look at this previous asked question or this blog post
Use php mkdir()
<?php
mkdir("/path/to/my/dir", 0700);
?>

Categories