Creating Dir, Copy Files And Pass Variables To 2 Files
I need to create a folder on the server weekly named by the user. To this folder copy the contents of an /Original folder. Inside the new folder edit one of the files to insert a data with a XML path generated in another application, copied (via memory) and pasted within the very first form and passed to the file in question.
<param name="FlashVars" value="xmlfile= $lanofile" />
the $lanofile is the value that I need to pass from the form to be read by this file.
I have created an form (n.php) that POST the name of the folder to a second file (creatdir.php) everything is cool until I have to edit the third file.
How can I pass the value of one of the formfileds to a second file and them read this value as a variable to be consumed as mentioned above? Or actually right whatever is on the third field to this position (not using variables).
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Copy Files To A Different Dir?
I have a file which is located in "/usr/home/coreyr/html_files" and I want to copy it to "/usr/home/public/html" I've tried the following and I receive errors. <?php copy('sf.html', '/usr/home/public/html'); ?> any ideas?
Copy Files From Remote URL
how can I copy a file from a url into the directory where my php file is located? On the server I use it is not possible to use the copy() function for this task.
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)
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?
Creating Files
I was wondering, if/how do you create a file with PHP, Im making a "network" for my site with PHP, and ran across this problem.
Creating Files
Is there a way to create files such as config.ini thoruhg a form. so they put in all the stuff they want and press submit and then the file is created with their settings in it.
Creating Files
I am rather new to PHP and a relative newbie to Linux too. I have a webserver at home (Apache 2.0.48 on SuSe 9.0, PHP4). I have some scripts, one of them needs to be able to create logfiles somewhere on my machine. It must also later be able to read from and write to these files again. Sofar I get a permission error. I tried chmodding 666 or 777 the directory in which the files could reside, to no avail. How do I set up the permissions so that my script can simply fopen a file for writing. Or if that's not the issue, what am I doing wrong or overlooking ? The errors: Warning: fopen(logfileslog1.txt): failed to open stream: Permission denied in script1.php on line 142 Warning: fwrite(): supplied argument is not a valid stream resource in script1.php on line 154 Warning: fclose(): supplied argument is not a valid stream resource in script1.php on line 161 It's the first I am puzzled about, the 2nd and 3rd are a logical consequence. By the way, reading from and writing to a file I have previously created myself with exactly the names I tried to get created by the script (echoed the name, ok) is no problem at all. So I don't think it has much to do with a safemode or open_basedir setting. I also tried creating the scripts in the same dir the script itself resides. Did not work either.
Creating Files
I am currently creating a file manager to add/edit/delete files and folders, etc but i was wondering if there is a function in PHP to create files such as a php file or txt file? All i want is a function that will allow you to create a file from the name you give! Is this possible? I have seen a script called Genesis but the problem is that it is Perl! and i dont have a clue about Perl!
Creating Exe From Php Files
I know for a fact that is possible but can not figure it out, how can I get my application to an exe stand alone file?
Creating And Saving Files With PHP
Hi, hope someone has some ideas !. Is there a way to use PHP and Mysql(if needed) in the following way: Lets say I used a script that when a person enters their birthday info, this script produces an onscreen report (like horoscope), how could this browser screen be saved as a file(html or other) so I could then include it into the body of an email or attach!.
Creating Csv Files From Scratch
I have a db containing customer information (ie. address, phone number, email). My client wants the ability to print mailers from the db. The idea is that the client will run searches on the db, and the search results will be dumped into a file which the client will download. The client will then give that file to their printer, to print the mailers. The printer wants the file in csv format but I'm having trouble finding good info on creating csv files from scratch. Obviously part of the script will output the fields separated by a semi-colon, or some other delimiter, but I'm confused about how to define those fields. Does this make sense?
PHP Scripts And Creating Files
I have a PHP script that attempts to create a temporary file to be used during processing. The script is owned by my username (bryanrme) on the server. When the script attempts to create the temporary file, I get a "failed to open stream: Permission denied" error. The permissions on my directory are set to 755. When I set the permissions to 757, the creation of the file is successful. In this case, I notice that the script spawns a temporary file owned by a user named "99". Is there any way to avoid this? I'd prefer not to leave my directory set at 757, but is there any workaround for this? I checked my server configuration and safe mode is not enabled. Any suggestions? I would prefer that the script handle the creation, usage, and disposable of the temporary file.
Creating Files Remotely
I'm trying to do here is write 2 files simultaneously to both the local server and a remote server on which I have write access. In the process, however, I was stuck at how to create the file initially on the remote server. I tried using touch() which works well locally to create a blank file, but I get an error: Warning: unable to create file http://198.78.114.67/news/tech/20010718-1820.dat because No such file or directory in /home/httpd/html/makepost.php well, I take it touch() only works locally, so, any idea guys?
Creating Text Files On The Fly
What I want to do is allow a logged in user to download a text file version of the list they are viewing on the screen. So if they are viewing the Paid list of users, there should be a button on that same page that says Download To Text File, and when clicked, the user is prompted to download a text file version of the list.
Creating .m3u Files Dynamically
Im looking at creating a playlist program for my server. i have alist of files within my database, and i wanted to be able to place these values into a playlist file. the problem is that i dont know how to get the database to create the playlist form its records. ie, if i uploaded a new file to my server and into the database, then i woudl want the script to automatically grab that file ( SQL i know), anbd the nplace it in the m3u file ( i dont know). Coudl someone recommend a simple method to complete this? or point me in teh righ t doirection for a tutorial?
Creating Text Files..
I want to set my access rules to 0777 so that I can delete the text file via script if I need to. I already set the folder to 0777 when I created it.. now I just need the text files. How would I set the access to 0777 when I create the file? This is what I have right now... $text= "this is text."; $fileName = "examplefolder1/example.txt; $handle = fopen($fileName, 'w'); fwrite($handle, $text); fclose($handle); Is there some way to do it in that statement?
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".
Strategy For Creating Files And Then Cleaning Up
I'm using PHP 4.3. There is a section of my application in which I'd like users to be able to download a custom file. The file would be different for each user, so I was planning on creating it on the fly when they click "Download". However, I would like to delete the file from the server a certain period of time after they've downloaded it. (It's a 3 or 4K file). How can I do this?
Creating Files Using Fopen That Are Unlocked!
i'm trying to setup my website to create new webpages dynamically using php but I am have a major problem in that whenever i create a file it is always created locked so that it can only be read even when i specify read and write access. Here is a basic example of the code I am using (I am using a Mac OSX 10.3.9): <?php $filename = '/Users/myusername/sites/mysitefolder/newfile.php' $mytext = 'my text' fopen($filename, 'w+'); fwrite($filename, $mytext); fclose($filename); ?> When i run this program all it does is create a blank file with read-only access. My question is what settings do I need to change that will enable me to create writable files using PHP?
Creating Download Manager For Multiple Files
Has anyone run across some sort of download manager to be able to download multiple files at a time via http with PHP? I run a mp3 site and I would like to be able to allow people to download whole folders at a time basically the same functionality as ftp but with http. It would be kind of like the smart download thing that netscape has but cross platform compatible. Any ideas?
Creating .xls And .doc Files With Page Breaks Using PHP / MySQL
Our company currently processes a few hundred form submissions through our site. Up till now, the contents of the form has been sent to our customer support staff in real-time. Each submission goes to a general e-mail box where it's printed through our mail client. A copy of the form is also stored in a MySQL db, although it's not used that often. I have been asked to figure out a way to stop delivering the form submissions in real-time and migrate to the following: Each morning, provide an Excel spreadsheet and word document (or PDF) with a certain number of form submissions to each customer support rep. For example, say 200 form submissions were processed the day before. This morning, I should split those 200 among the 5 support reps and provide each of them a certain amount (which can change daily). Assuming each person gets 40 form submissions, each person would need to be given an excel file and .doc document that contains their 40 form submissions. One of the most important things is that the .doc file needs to have each form submission separated by a page break, so that when they print the document each form submission is printed on a separate page. Finally, not all of the fields from the form submission should be given to the support rep. Maybe date and time is left off.
Variables And Php Files
I'm working on a web page and I got 2 files who share a same include file where's my function are created but I want to share variables between these 2 pages, hoping via the include file.
Txt Files And Variables
I'm making a script that will email my users upon registration. For the email body, I want to use file_get_contents to shorten the mail function line. If I use a txt file such as reg_email.txt, will variables such as $username still work? I'm developing this script on my computer and I don't believe the mail function works.
Same Variables Used In 2 Included Files
I have 2 seperete files I am including into a script. They uses the same verriables however I want one to execute and then the other. will this be a problem?
Passed Variables In Included Files
I'm looking for a guide on how variables are handled in included files. A pitfall I've run into is that if I define a variable, then include a file, the variable can be displayed on the included file. But if I try to call that same variables on the included page within a function, the variable is undefined. Example: PHP Code:
Reading Variables From Text Files
I am playing with several text files that have variables stored in two different ways. One text file stores the data like this: hair=brown eyes=green gender=male The other text file stores data like this: hair=brown&eyes=green&gender=male How can I read the variables from the text file and use them in my php program? I know how to write them to a text file, but have no clue as how to read them.
Sending Queries & Variables Across Included Files
I'm working on a template parsing engine of sorts. Basically the way it works is, depending on how a variable is set, a file is included. The file is an entire page containing HTML and PHP, starting at the <html> tag. What I had planned on doing was writing a query for that specific type page. For instance, on "index.php" I have my connection script, and on "include.php" I have the while($row = mysql_fetch_array($query)) loop to actually display what results the query got. Problem 1: Unless I write the query into a variable on include.php, I get an error. The error states that the query isn't a valid MySQL resource, but I know for certain it is, because if I write the exact same query on the included page with the exact same connection script, it works fine. Problem 2: For files that are included off of the included page (for example, I have an include on include.php that links "homeslice.php" to the page), I have to use the full path (http://mysite.com/ect/homeslice.php) rather than just the site path, (/ect/homeslice.php). My question: Is there a trick to getting these things to work the way I want them to, and if so, could someone please let me in on it?
Session Variables Do Not Persist Into Included Files
In my index.php file I set a session variable $_SESSION['product'] = "foo"; and then in my html part of index.php I include a file menu.php using require_once() which I use to build the menu tree. However, the session variable is not available to me inside that include file. It is available to me inside index.php because if I echo it I can see it. If I go to page2.php it is also there. Just not in the include file.
Including Files In Different Direcories That Include Files From Teirs
Okay, I made a simple AJAX shoutbox and I want to include it on all my pages. To insert the shoutbox I simply type <? include('/shoutbox/shoutbox.php');?> into my HTML page. The problem is, that in /shoutbox/shoutbox.php I also include settings.php, functions.php, and some other files, and when I include /shoutbox/shoutbox.php into my index page, /shoutbox/shoutbox.php tries to call settings.php from the same folder that my index file is in, since I just 'included' it in index's source. So my question is, is there any way, without using frames, to include a PHP file as it would be if you link directly to it in the address bar, but placed into another file in a different directory?
How Do I Hide Database Connection Files Using PHP Include Files?
I have the following at the beginning of the PHP page: <?php require_once('Connections/conn.php'); ?> I want to hide the connection file, "conn.php", so it's out of the web accessible file structure. I understand putting them in the php include directory shoudl do this. For example, let's say the directory I put them in is /www/phpIN/, and /www/ht/ is the root web directory. So I put "conn.php" in the inlcude directory (/www/phpIN/conn.php) and removed it form CONNECTIONS directory.
How Do I Hide Database Connection Files Using PHP Include Files?
I have the following at the beginning of the PHP page: <?php require_once('Connections/conn.php'); ?> I want to hide the connection file, "conn.php", so it's out of the web accessible file structure. I understand putting them in the php include directory shoudl do this. For example, let's say the directory I put them in is /www/phpIN/, and /www/ht/ is the root web directory. So I put "conn.php" in the inlcude directory (/www/phpIN/conn.php) and removed it form CONNECTIONS directory. Now it doesn't work. What do I need to change?
Selecting Files Extsions And Splitting Up File Variables
1. How would I go about selecting the files with sorten extensions i.e in one directory there might b filename.mes and filename.det, and I would like to select only the filename.mes. Once I have done that I would to count to see how many there is. 2. I am going to have in each of filename.mes multiple lines of data, in the following kind of format:- $membername|$title|$email|$html|$inpost|$previewfirst And I am wondering how about I would go about reading each of the variables from the file and putting them in to the variable names above?
Upload Audio Files Of Type .wav & Video Files Of Type .avi
I need to upload audio files of type .wav & video files of type .avi / .mov but my current file unloader is not helping me with that. My unloader works with application types, images, txt, pdf , mp3, mpg, mpeg but not with those .wav & .mov/.avi files........
Files Inside Files
im creating something new with alot of php files, and i remembered that alot of times on message boards and things like that you see like "misc.php?action=list" or something like that. i would really like to decrese the amount of files i have for this new thing im creating. can someone show me how to put multi files in one?
Variables Copy Accorss Pages
I have a variable $user in one page which I would like to be available in another page. I was reading that with the session manager this should work but when I check if the variables is there its not I dont want to post variables using forms constantly so how do i do it without switching on global variables? I know such a noob question but the PHP manual is a bit confusing and I cant find it anywhere. this is the code where my session starts and then refers to the other page which then goes to another page where I would like the $user to be available. PHP Code:
Methods To Pass Variables
I am trying to pass 8 variables from a search form to different pages and I am confuse whether to use: 1) session 2) cookie 3) passing variable through URL 4) Using hidden form field My page#1 is a search form and with 8 Select fields. After press Submit Button, page#2 shows all the search results. Some search would show up 100+ rows so I am using a script to break the result pages. Each display page would limit 20 records with links <<Previous 1 2 3.... Next>> at bottom. However only the first search result page would show up properly but rest of search result won't showup. I read a few threads on this forums and I wonder what is the best method to use in my case??? It seem passing variable through URL is inefficient in my case since there are 8 variables. With session or cookie, what happen if the user decide to do another search (page#1 search form) without closing browser will the session id renew itself. With hidden form field, since my Page#2 (result display page) is not using form, will it work.
Pass Get Variables Using PHP Header()
I got a form page with 'update' & 'cancel' buttons. When 'cancel' clicked, I want to be redirected to the index page on the right page number. URL of my edit page is like this: http://localhost/form.php?op=edit&id=1&cursor=2 In the form.php I got few lines of code to get that 'cursor' before doing redirection: $iCursor = $_GET["cursor"]; $url = 'index.php?cursor='.(int) $iCursor; if ($_POST["cancel"]) { header("Location: $url"); } The new URL is supposed to be: http://localhost/index.php?cursor=2 but it showed up like this: http://localhost/index.php?cursor=0 I've tried using sessions variables as well, but the value of the cursor's still 0. Do you guys know what happened?
How To Pass Variables To PHP Binary (CGI)?
My system use to run PHP as an Apache module. And I pass in variables like this: http://www.somesite.com/somefile.php?IDvar=1 Now my system runs PHP as a CGI. So I am running the same script like this: /usr/local/bin/php /somepath/somefile.php How do I pass in the variable IDvar and value 1?
Can't Pass Variables By URL On Localhost
I'm developping on localhost (127.0.0.1). When I try to pass parameters from one page to another using the standart way (URL), I just can't retrieve the values. In fact, the isset($varname) returns false. Code:
Pass Variables To Functions
In php i've found that I cant seem to access global variables from within a function. Is there a way to access variables in a function that are in the same scope that the function is??? Can you make a variable global or something? How does that all work in PHP, is there a doc somewhere to explain? Can I define a global within a function in php?
How Do I Pass Variables On A Location
i have a script which creates 2 variables which then does a redirect to a page which then uses a query using the two variables. But i was wondering how to get the code to pass across the page... Code:
Pass Variables Via Include Command?
I've been trying to put amend a variable to the end of an include statement, but each time I do this, the variable isn't passed. For example:
Pass The Variables In The Form Of Sessions
If I have something like this how can i pass the variables in the form of sessions to another page, where i Can calculate based on the products selected, very much like a shopping cart! PHP Code:
Pass Variables To Php Include File
I'm working on using an include file that is set up all good to go for an image gallery. The one thing I need to change though, is the path. My code is simple enough using the inculde PHP Code:
|