Jump to content

me102

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by me102

  1. Ch0cu3r your the freaking best thanks so much... :happy-04: :happy-04:
  2. I think you may have miss understood me because of my poor english sorry. I am trying to use the script to replace define('script_path', 'files'); to define('script_path', 'NEWPATH');
  3. Hello I have the following code from php websites $myfile = fopen("/config.php", "a+") or die("Unable to open file!"); while(!feof($myfile)) { echo fgets($myfile) . "<br>"; $txt = "Mickey Mouse\n"; fwrite($myfile, $txt); } inside config.php is <?php define('script_path', 'files'); ?> How can I replace files with another value? any help would be great thanks.
  4. me102

    Better method

    thank you juddster just what I needed.
  5. me102

    Better method

    Hello I have a rating script what I need is a faster and better way of getting the title from the first query so i dont have to run 2 queries. $q1 = "select ItemID, sum(Rating) as mr from dd_rating group by ItemID order by mr desc limit 0,4"; $r1 = mysql_query($q1) or die(mysql_error()); while($a1 = mysql_fetch_array($r1)) { $q2 = "select ItemTitle from dd_items where ItemID = '$a1[0]' "; $r2 = mysql_query($q2) or die(mysql_error()); while($a2 = mysql_fetch_array($r2)){
  6. me102

    PHP FTP

    Hello I am having a little bit of a problem when I try to upload a directory and its subdirectorys i keep getting errors because the done exist but how would I go about making them, This is what I have, <?php //Source Files, Where to put them $src_dir = "/source_codes/"; $dst_dir = "/haha/"; // Start the ftp connection $conn_id = ftp_connect($ftp_server) or die("<span style='color:#FF0000'><h2>Couldn't connect to $ftp_server</h2></span>"); $login_result = ftp_login($conn_id, $user, $passwd); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; die; } else { echo "<br>Connected to $ftp_server, for user $user<br>"; } function ftp_copy($src_dir, $dst_dir) { global $conn_id; $d = dir($src_dir); while($file = $d->read()) { if ($file != "." && $file != "..") { if (is_dir($src_dir."/".$file)) { if (!@ftp_chdir($conn_id, $dst_dir."/".$file)) { ftp_mkdir($conn_id, $dst_dir."/".$file); } ftp_copy($src_dir."/".$file, $dst_dir."/".$file); }else { $upload = ftp_put($conn_id, $dst_dir."/".$file, $src_dir."/".$file, FTP_BINARY); // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } } } } $d->close(); } ftp_copy($src_dir, $dst_dir); // close the FTP stream ftp_close($conn_id); ?>
×
×
  • 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.