Jump to content

Search the Community

Showing results for tags 'server'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. I want to backup mp3 files from a server folder to a local folder can this be done in php which is server side. I tried many scripts claiming to do this but all result in 'failed to open stream: No such file or directory' because the code is looking for the destination on the server, not the local directory. Here is an example that says it can be done. ini_set('display_errors',1); error_reporting(E_ALL); $source = "https://domain.com/2024-2021/path_to_file/test.mp3"; echo "src is ", $source; $destination = "C:/backup/2024-2021/Cpath_to_file/"; file_put_contents($destination, file_get_contents($source)); echo "OK"; This one also claims to 'force' the download $file = '/path/to/files/photo.jpg'; if (is_file($file)) { sendHeaders($file, 'image/jpeg', 'My picture.jpg'); $chunkSize = 1024 * 1024; $handle = fopen($file, 'rb'); while (!feof($handle)) { $buffer = fread($handle, $chunkSize); echo $buffer; ob_flush(); flush(); } fclose($handle); exit; } But has the same problem, in that it fails when opening the local folder to write the file, is there a way to do this?
  2. I have this php : <?php $email = 'yourpaypalemail'; $url = 'locationofdatabase'; $user = 'username'; $password = 'password'; $database = 'DatabaseName'; $sandbox = 'false'; $packages = array( "package1" => "ExamplePackage", "package2" => "Yourpackagetwo", "package3" => "Yourpackagethree" ); function anti_injection($sql) { foreach ($sql as &$value) { if (!is_array($value)) { $value = mysql_real_escape_string(stripslashes(trim($value))); } } unset($value); return $sql; } $link = mysql_connect($url, $user, $password); if (!$link) { die('Not connected : ' . mysql_error()); } $db_selected = mysql_select_db($database, $link); if (!$db_selected) { die ('Can\'t use database : ' . mysql_error()); } $req = 'cmd=' . urlencode('_notify-validate'); foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } if($sandbox == 'true'){ $url = '[url="https://www.sandbox.paypal.com/cgi-bin/webscr%27;"]https://www.sandbox....in/webscr';[/url] } else { $url = '[url="https://www.paypal.com/cgi-bin/webscr%27;"]https://www.paypal.c...in/webscr';[/url] } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded", "Content-Length: " . strlen($req))); curl_setopt($ch, CURLOPT_HEADER , 0); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_TIMEOUT, 30); $curl_result = @curl_exec($ch); $curl_err = curl_error($ch); curl_close($ch); $_POST = anti_injection($_POST); $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $player = mysql_real_escape_string(stripslashes(trim($_POST['custom']))); $settle = $_POST['settle_amount']; $package=false; foreach($packages as $pack){ if($pack == $item_name){ $package=true; } } //if($settle!=''){ //$amount = $settle; //} if (strpos($curl_result, "VERIFIED")==0) { if ($payment_status == 'Completed' && $receiver_email == $email){ $query = "INSERT INTO toothtransaction (player, amount, used, ipn) VALUES ('{$player}', {$amount}, 0, '{$txn_id}')"; mysql_query($query); if($package==true){ $query = "INSERT INTO toothpackages (player, cost, status, package) VALUES ('{$player}', {$amount}, 0, '{$item_name}')"; mysql_query($query); } mysql_close(); } } ?> And I need help cutting it down becasue evertime someone connect to the remote database on my minecraft server it lags alot. Im stuck and need help. I need to find out what part is causing the lag and I am debating between a remote database vs a local database.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.