$Username = $_COOKIE["Username"]; $target_path = '../project/' . $Username . '/'; // echo $target_path; // echo "<br>"; if (is_dir($target_path)) { $files1 = scandir($target_path); // print_r($files1); } for ($i = 0; $i < sizeof($files1); $i++) { if ($files1[$i] != '.' && $files1[$i] != '..') { // echo "<strong>Image".$i."</strong><br>"; // echo $files1[$i]; // echo "<br>"; $target_path_feed = $target_path . $files1[$i]; // echo "<br>"; replicateFile($target_path_feed, $Username); } } if ($flag == 1) { echo "Replication Success"; } else { echo "Replication Failure"; } // // replicate.php takes $path -> Complete path in the server after saving in server // // $team->username which would be the file to be copied function replicateFile($path, $team) { $target_url = 'http://christinajuliet.com/receiveFile.php'; $file_name_with_full_path = realpath($path); $post = array('teamname' => $team, 'file_contents' => '@' . $file_name_with_full_path); $ch = curl_init();
<?php //Team name to be replicated// $Username = $_COOKIE["Username"]; $result = replicateFile($Username); return $result; // echo $result; // // replicate.php takes $path -> Complete path in the server after saving in server // // $team->username which would be the file to be copied function replicateFile($team) { // $target_url = 'http://photo-drop.com/curlfile.php'; $target_url = 'http://photo-drop.com/curlfilecheck.php'; $file_name_with_full_path = realpath($path); $post = array('teamname' => $team); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $target_url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $resultalice = curl_exec($ch); curl_getinfo($ch); echo "<br>"; curl_errno($ch); echo curl_error($ch); curl_close($ch); // echo $result; // if($result) // { // echo "File sent"; // }
<?php //Team name to be replicated// $Username = $_COOKIE["Username"]; // $Username='******'; $target_path = './project/'; // echo $target_path; // echo "<br>"; $finalresult = replicateFile($target_path, $Username); return $finalresult; // // replicate.php takes $path -> Complete path in the server after saving in server // // $team->username which would be the file to be copied function replicateFile($path, $team) { // $target_url = 'http://photo-drop.com/curlfile.php'; $target_url = 'http://photo-drop.com/curlfilecheck.php'; $file_name_with_full_path = realpath($path); $post = array('teamname' => $team); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $target_url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); echo $result = curl_exec($ch); curl_getinfo($ch); echo "<br>"; curl_errno($ch); echo curl_error($ch); curl_close($ch); // echo $result; // if($result)
echo $files = $size['files']; ?> <?php $counter = (include 'filecount.php'); $mp4 = $counter['video']; $mp3 = $counter['songs']; $png = $counter['png']; $jpg = $counter['jpg']; ?> <br> <?php $flag1 = replicateFile($Username); function replicateFile($team) { // $target_url = 'http://photo-drop.com/curlfile.php'; $target_url = 'http://photo-drop.com/curlfilecheck.php'; $file_name_with_full_path = realpath($path); $post = array('teamname' => $team); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $target_url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $resultalice = curl_exec($ch); curl_getinfo($ch); echo "<br>"; curl_errno($ch);