Copying Old Folders To A New Location
I'm trying to write a page that would make a copy of a set of folders to a new location for an intranet. There is lots in the page for debugging that would vanish once I get it to work. The problem I'm getting is I cannot get XCOPY to work. Other dos commands work fine. Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Copying Files
The situation is I have a template.php file, and I wan't my script to copy this file and give the new copy a new name. This is the code so far, but it doesn't copy... $temp = "template.php"; $file = $linktextdata . ".php"; if (!copy($temp, $file)) { echo "copy of $temp failed"; } I test echoed the variables, and they look ok.
Image Copying
I have this form tag to send an image to my message board: <input type=file name=picture> and the enctype="multipart/form-data" in in the form tag. I them use $picure_name to do two things. First, I alter the message the include the img tag using str_replace. That part works fine. I then try to copy the message to the images directory:exec("cp $picture /full/path/to/mbimages/$picture_name"); The image never gets there. I don't get any error messages, but the image never shows up in that directory.
Copying A Directory
I think i can use copy() to do this, but i just dk how :S. i can only get it to copy files. I need a script that can copy a folder, and all the files in that folder, and "paste" it in a new directory.
Copying Remote Files
How do i copy a picture or another file from a remote webpage, and put it into my webpage dir?
Copying From One Mysql Database To Another
Is it possible to open a connection to two separate mysql databases in order to copy the data from one table in the first database into a table in the second database? I'm assuming the answer is yes, but I'm confused as to the proper php syntax.
Files And Folder Copying
I am trying to write a function to copy an existing folder and folder structure but am already stuck. What I want to do is the following: Copy a default folder (default_folder) and all sub folders within it (down to a possible 4 levels) eg default folder ->subfolder1 ->subfolder2 ->sub subfolder1 ->sub sub folder 2 I have a form where the user can enter the name of the new folder and an option to confirm if they want to copy the files also located within the default folder. If the checkbox is not checked then copy just the folder structure only Can this be acheived in one function or will it be based on 2 where a set of empty folders are created and where the folders and files are copied over
Copying Entire Directories
I need to copy all of the files from one directory to another. This has to happen on the fly. The files that are being copied are actually templates for another site that will be created. I have seen the example on php.net under the fopen section but it doesnt work.
Copying Rows To Another Table
After I select a row whose ID is 10 or some other number, I need to copy the entire row into another table. Is there a way to copy rows between tables using PHP? Could someone please point me to an example..
Copying Files From One Server To Another
I am trying to set up a link excahnge program using php and I need to know how to copy a file from one server to another. See when people change the banner they have displayed they can enter the location of their banner, such as http://them.com/banner.gif and then i need to copy it over to my server and into there dir, such as www.me.com/them/banner.gif. Does anyone know how i can do this. I have tried many things but nothing has workd so far.
Copying A File From On Server
Let's say I have a file on my server at location: /public_html/Global/oilers.php ...and i want to copy this file and save it to another directory (using ftp commands): /public_html/hockey/Oilers/oilers.php How would I go about.... I gigured out how to login using ftp commands and explored the ftp command available.. (eg.put, get etc..) but I'm not sure which command to use.. can someone point me in the right direction?
Copying Files Using A Loop
I have a spreadsheed with names and image urls that I have converted to a tab delimited text file. Column one has the product name and column two has a url to an image on another site. I am trying to loop through the file and copy the image onto my computer, but it is giving me this error: "Warning: copy(http://ec1.images-amazon.com/images/I/41Oj92a63gL._AA280_.jpg ) [function.copy]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in C:Program Filesxampphtdocscopy.php on line 16" Code:
CopyDir (Copying One Directory To Another)
I was wondering if it was posible for someone to point me in the right direction. What i need to do it copy the contence of an entire directory to another designated destination, is this possible and if so could someone point me somewhere i where i can figure it out.
Copying A Multidimensional Array To $_SESSION
Specifically, is it possible to copy a multidimensional array into the $_SESSION array - ie a deep clone of all keys and data? I naively assumed that $_SESSION["myArray"'] = $myArray ; would work but it doesn't appear to work. Is there a single function or assignment I can use, or would I need to use a "foreach" at every level?
Error While Copying Files After Upload
I'm trying to allow users to upload to the server. The system seems to upload okay (at least it takes a while for the page to refresh after the submit button is pressed). When the submit button is pressed and the files are uploaded, it reloads the script (a $PHP_SELF in the form tag). What happens next is that it tries to copy the uploaded files (a maximum of 3 files can be uploaded) to a more permanent directory on the server. code:
Copying Variable Part Of A String
I have strings like these: $line = "Item <name> xxx stock, costs yyy and will sell for amount zzz"; Problem is <name> can consist of 1..n words. Most items are single words, but some are up to 8 in my example, and there are is no set maximum (well, max is 80 chars I believe, have to look in the stock db, not too relevant I think) I found this out the hard way. I thought I was clever (never do that again) by doing this: $words = explode (" ", $line); $itemname = $words [1]; This only works for single-word names. Now I want to create or use an existing function that simply copies everything between Item and the first numerical substr. The function then should look like: $itemname = GetSubStr ("Item" , <numerical> , $line); <numerical> should be a template of some sort I think.
Controlling The Copying Of Images From A Site
Is there a way to prevent users copying a full size image from a web page. Displaying the image with a smaller width and height only affects the image as viewed, the actual full size image file is still downloaded. I know I can get around it by having two versions of an image, the full size one and a smaller on for display purposes. but is there a way around having to have two images and use the full ssize one and stop it being copied or if copied will only be a thumbnail?
Copying File From Hosted Remote Sever To Local Machine
I am trying to use php to automate the copying of a file from my remotely hosted directory to my computer. I have put together the following but it will only do the copying from one directory to another on the remote server. Reading the postings on these functions they suggest that it can be done but it appears to be the case if your are hosting your site on the same machine you want to copy the files to. Does anyone know if there are functions in php to do the transfer from remote server to my machine or if the code below will acheive this with modification? <?php $ftp_server = "xxxxxxxx"; $ftp_user = "xxxxxxx"; $ftp_pass = "xxxxxx"; $local_file = 'myfile.txt' $server_file = 'myfile.txt' // set up a connection or die $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); $login_result = ftp_login($conn_id, $ftp_user, $ftp_pass); // check connection if ((!$conn_id) || (!$login_result)) { die("FTP connection has failed !"); } // try to change the directory to myfilesdirectory if (ftp_chdir($conn_id, "myfilesdirectory")) { echo "Current directory is now: " . ftp_pwd($conn_id) . ""; } else { echo "Couldn't change directory"; } if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) { echo "Successfully written to $local_file"; } else { echo "There was a problem"; } // close the connection ftp_close($conn_id);
Uploading Folders
Is it possible to upload entire directories from a form in such a way that a user can browse to the folder on their local machine and select it for uploading or synchronization? I am using php5.
Reading Folders
If I had several folders full of images, how can I get PHP to open the folder, read the image names and save the image names (inc extension) to a MySQL database? What I am trying to do is create an image gallery using PHP/MySQL, so that everytime i take a load of pics, all I would have to do is get PHP to read the contents of the folder and add the filenames to a MySQL database rather than having to manually input the names into the database
Gziping Folders
I'm using PHP and Gzip off the server to gzip up some files. If I select individual files, everything is fine, but I can't figure out the syntax to gzip a folder. $zipfile=shell_exec("gzip -9 test.html"); That's what I'm using for a file. But how do a zip a folder?
Protecting Folders
I have a data driven website. Part of the website is a downloads section - all the downloads are help in a folder called "downloads". When a general user (i.e. one that doesn't have a log in) uses the site and access the downloads page they are given a list of general downloads. When a member who has logged in uses the site, the same page presents the general downloads and the member only downloads. This all works fine. A slight hole in this security, however, is that the downloads folder is not protected. I have moved the member downloads into a subfolder within downloads. How can I protect this so that only people who are logged in can access it - so that general users cannot accidentally browse it or make a direct link to the documents within it?
Sorting Folders
I have a site with photo-albums on it. Each directory represents an album. What i want is on the "home page" of the site a feature which says "newest album: *******" So i have to search the album directory, and then sort them by date. And then it automatically has to grab the newest album. Maybe a slight problem is that the albums are divided over 4 subcategories. (Match, players etc.) Match: - Match 1 - Match 2 - Match 3 Players: - player 1 etc... Albums would be 'Match 1', 'Match 2', etc. hope ypu understand.
Files And Folders
I need to display images on the site. Every image is being stored in its own folder. Folders are updated daily. I need to display a list folders (like FTP), and when a user clicks on a folder name, it will show them other folders inside the parent folder, or if there are no more folders inside picture files will be opened. I know how to get a list of files and open them when I am in a current folder. PHP Code:
Images In Folders
I'm a newbie and I need a good starting off point. Basically is there a way in php where you can call up all images (jpgs and gifs) within a directory. Also is there a way to format the images to come up in rows. Hope this makes sense.
Creating Folders
I'm a web designer working with a company that needs a website similar to myspace. I'm pretty good with php, so recreating a bootleg version of myspace doesnt seem to hard. However The one element that I am not familiar with is creating folders with PHP. For example a user signs up, and they create a domain name "www.myspace.com/domain" well creating a separate database and all that is easy,but how to I create that folder and php files that need to go inside that folder to create there profile?
Find All Folders
I've been looking around and I can't seem to find a function that will allow me to open a folder and read all the folders inside it.
Creating Folders
im in member.php which is inside a folder called 'member' i have a folder called 'collection' which is outside this member directory. i want to create a folder inside the 'collection' folder based on the username, e.g, $_SESSION['Username'] . "_images"; so that will be like: john_images folder. i want to actually check if the folder 'john_images' doesn't already exist though. can soemone please show me how it can be done?
Displaying The Parent Folders Name
Say there is an url like this for example: www.mydomain.com/pics/b/basketball/index.php using php, is there a way to just display the word basketball in the index.php file? I would also need to display it in the title tags like this: <title>Basketball pics</title>
Protect File Folders
How do I protect file folders like "stylesheets" "php scripts" etc, from exposing their directories to the public? If a visitors would come upon these folders, they would be able to see the content of the folder, and view the documents.
Automattic Folders Question
Would it be possible to do the following? and if so , any body have any ideas where i should start. I want to allow users of a web site to create a page (index.php) inside of a folder that is the name of their company so : X Y Z Company would be: http://www.domain.com/X Y Z Company/ or should it be:? http://www.domain.com/X-Y-X-Company/ and i would want index.php to be inside of those directories so that a user could log in and change the information on index.php through a certain amount of form fields. The hardes part i think will be creating the directories on the fly if a user signs up for a site. the index.php page will be simple b/c it will just query the database and then pull the info from the URL.
PHP Access To .htaccess Folders
I've a folder which holds image (.gif/.jpg) files. the folder has been .htaccessed to prevent direct URL access. However, this also prevents my php codes to make calls to this folder. the following proposed solution does not work: 1. putting the image folder outside my root directory - i don't have access to the root directory 2. having <directory> codes </directory> in .htaccess does not work - it blocks everything.
Dealing With Folders/paths
When I develop a site I normally develop it within a directory from the domain name. Example if I was developing a site at http://www.dogs.com I usually would have my development work in a folder located at http://www.dogs.com/jeff/ When I code re-direction links for headers I then do this: Code: $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/enquiries.php"; But then when it comes to moving the site to the root of the domain, the re-direction link creats an extra slash(/) to the link being created because there is no sub folder. How do I tacke this situation automatically instead of manually changing all the link variables without removing the dirname($_SERVER['PHP_SELF']).
Copy Files And Folders
Assuming you had a template folder and files on the webspace and you wanted to make a exact copy/rename of it with a username and password being the one and only difference - how would one do it ? . (the difference being a password protected folder)
Uploading Images In Folders
Does Anybody know a good script to upload images to a directory with different folders inside.. I want users to be able to upload it to the folder that they choose or create a new folder within the dir IMAGES. The script can only accept JPG, JPEG and GIF extensions.
How To Turn All Your Pages Into Folders
I've seen websites that have each page as a folder e.g. 45xd remote control car will be at www.domain.com/45xd-remote-control-car/product.php how is that done automatically?
Using Files/folders To Create A DB
I'm always looking for ways to decrease the amount of time I spend adding records to my database. I was thinking about this today, and wondered if it was possible.... I want a PHP script to open a folder or folders, read the files, and make a record in the database for each file. For example: Folder 1 contains the files--4000out.jpg, 3000bcr.jpg, 4000btcf.jpg, etc... When excuted, the script would create (in this case) three records. I only want the script to do the base work, I will add what can't be done to the records later. Also, in the case with mp3's. I'd like the script (or a seperate one) to insert each record using the ID3v1 tag info. I'm familiar with open files and folders...but haven't come across any tutorials or scripts that do this. So...is this possible?
Securing Folders With Php Linux
I am creating a site in php on a dedicated linux redhat server. Users will sign up to the site and get the own url/folder www.mycompany.com/username They will be able to store files in their folder/url Can anyone give me any idea how to secure the folder so that only once logged in people can access the files in the folder. I want to stop anyone from being able to go to www.mycompany.com/username/file1.doc and being able to download it. I am using MYSQL 5 and PHP 5 and the latest version of Redhat Linux.
Cannot Delete Folders After Mkdir()
I am using php to make a directory (to store all of the users files for the site), and it works fine mkdir("/home/fullpathtomyserver/public_html/users/$users_id/", 0777); It makes the folder just perfect, BUT there is a flaw. The folders it creates are un-deletable. I can browse them, and even link to files within them, but I cannot delete them at all. I have tried deleting them through FTP and cPanel's File Manager,
Session Not Working In Folders
We just moved a script to a clients server. We developed in PHP 4 and everything worked fine. The clients server is PHP 5. Sessions work perfect when its in the main public_html directory. When a user goes to a folder ie oursite.com/folder/ the session is no longer there. Is there any changes in the versions that would cause a session to no longer be valid when you enter a folder?
Creating And Deleting Folders And Files
Hi to Everyone. After creating trought http a organize number of files and folders. I'm not able to delete them, not even trought an FTP Software like Cute FTP. It replies "Could not delete xxxxx.html".
Can Php Create New Folders On Webserver As Needed?
thread formally known as "can php create new folders on webserver as needed?" has changed... i know php can upload files, but can it create a new folder on the webserver? i am trying to create a "directory" with each person having his/her own folder for images. As a new person joins, i want a new folder that is named after him/her created for storage of his/her personal images. if php can, please let me know of scripts or functions that can be used to create new folders on a webserver...
Copy Files And Folders From One Directory Into Another
I have files in myurl.com/myfolder and I would like to copy all of them into myurl.com/newfolder I'd like to copy all of the subdirectories and files that are in /myfolder and I would like to be able to use a form of some sort to name the file I want to copy, and create the folder I'd like to copy it to, such as newfolder. How can I use a form to create a new folder on the server? How can I use a form to name the old folder I want to copy everything from, then create the name of the new folder I want to copy everything into, and then copy?
PHP File Management With User Folders.
I'm looking for a script / scripts that will allow me to control files that users can download. I would like to create 'General Folder' that any registered user can download from and private folders that only the specified registered user can download from. This needs to be simple to manage and simple to download from.
Include Path Problem, Sub Folders
I am new to PHP and facing problem in including header, footer, left navigation and right navigation files to the pages. I have a includes folder with all the including files in the root folder. <root folder>/includes/files.php These includes files are working fine in the root folder and there sub folder. That is <root folder>files.php <root folders>/sub folder/files.php But for the files of sub folder of sub folder it is not showing correct path. The images are link are not taking the correct path. That is the wrong files are <root folder>/sub folder/sub folder/files.php I went through many articles on the same subject and got to know that i should give path like '/includes/header.php'. I didn't know whether i got it correct or not. Please comment on this. But this is also not working. Error is like this: Warning: main(/includes/header.php) [function.main]: failed to open stream: No such file or directory in ....
Php To Search Folders Of Pdfs -where To Start? -
I am an scriptor looking into writing an application that would search pdfs within that are stored in MySQL. Not being too familar with php, I am wondering if it would be a good language to do this, as in are there already modules for this type of work, or should I be looking into a different set of programs to do this more easily? Basically I...
|