Search the Community
Showing results for tags 'copy'.
-
I am unsuccessfully able to do the following: User creates an account After login, checks server if user has their own folder created If doesn't exist, create it Copy files from source_code to this new folder My code does create a folder, but no files appear inside it. Been trying to find an example with google search for the past 3 days with no luck. I am running LAMP on Linux Mint OS to run my PHP webpages. Can anyone tell me if issues with this section of coding? <?php function wait_time($seconds) { $seconds = abs($seconds); if ($seconds < 1): usleep($seconds*1000000); else: sleep($seconds); endif; } $file1 = "blank.html"; $file2 = "channel_video.php"; $file3 = "clear_playlist.php"; $file4 = "confirm.html"; $file5 = "index.html"; set_time_limit(0); //prevent script from timing out $account = $_POST["account_name"]; $src = "source_code/"; $dst = $account."/"; echo 'Setting up your account page ->.'; mkdir($account, 0777, true); echo '.'; //create folder with full write permissions wait_time(2000); //wait 2 seconds before copying files over copy($src.$file1, $dst.$file1); echo '.'; wait_time(2000); //wait 2 seconds before copying files over copy($src.$file2, $dst.$file2); echo '.'; wait_time(2000); //wait 2 seconds before copying files over copy($src.$file3, $dst.$file3); echo '.'; wait_time(2000); //wait 2 seconds before copying files over copy($src.$file4, $dst.$file4); echo '.'; wait_time(2000); //wait 2 seconds before copying files over copy($src.$file5, $dst.$file5); echo '.<- setup finished<br>'; ?> Thanks for any input you can provide.
-
Hello. When I copy tables to TinyMCE editor, the numbers in "numeric" columns disappear. The "normal" text is copied normally, but with numbers it happens what you see in attached pictures. Why? Who can help me?
-
Howdy folks, I am trying to get sessions to cooperate, but am at a loss. I am trying to copy the variable of userlevel in a session. The array displays correctly on pointerface.php. For some reason, the session doesn't seem to carry over to other pages, and the session ID's are different. I'd appreciate some input as to where I may be going wrong. pointerface.php: session_start(); { include('../htconfig/dbConfig.php'); mysql_connect("$hostname","$username","$password"); mysql_select_db("$database")or die("cannot select DB"); $tbl_name="members"; $sql2="SELECT * FROM members WHERE username='$myusername' and password='$mypassword'"; $result2=mysql_query($sql2); $userlevel=mysql_result($result2,$i,"userlevel"); $_SESSION["userlevel"] = "$userlevel" ; echo session_id(); echo "<br>"; Print_r ($_SESSION); adminnotes.php: session_start(); print_r ($_SESSION); echo session_id(); if($_SESSION['userlevel']=='Admin'){
-
I need to modify the script to additionally do the following: Once the image is on the server, I want it to duplicate itself, then, rename the new duplicated file to a variable name. (Let's say $TEST . '.jpg' where $TEST = TESTING for this example) My current piece of code: This following piece of code might assist you: PS: I am quite new to PHP. (Introduced to it only about 3 days ago)
-
I've got a dev server which, for reasons I won't go into, needs to have different .htaccess files for each site (and subfolders within them) within it. But not always. What I need to do is: - For the folder I put the PHP script in, and every folder under it (the whole tree under it): - If there's a .htaccess file an no .htaccess.dev file, copy .htaccess and name the copy .htaccess.dev (and look in subfolders) If there's a .htaccess file and also a .htaccess.dev file, do nothing (but keep looking for subfolders) If there's neither a .htaccess or .htaccess.dev file, do nothing (but keep looking for subfolders) I'd try to come up with something myself, but getting it wrong will be fairly catastrophic! I'm sure the conditional copy / rename bit is relatively straightforward, but it's the recursive searching of the whole file-system under the script's location that I'm not sure about... Any help greatly appreciated, as always! I have SSH access, if it's easier done that way maybe I'm approaching it wrong?