Jump to content

daxguy

Members
  • Posts

    62
  • Joined

  • Last visited

Everything posted by daxguy

  1. i have a script that uses simple file function to upload images.. is der a way i can sumhow select multiple files and use them to upload.. or is there a way i can resize or reduced the size of the image as its being uploaded.. if yes please guide me through! i use simple form to upload the file and use the following file to upload move_uploaded_file($_FILES['img']['tmp_name'], "images/albums/{$_FILES['img']['name']}");
  2. My question would be a little out of topic... what i am doing is trying to create a music album website for my customer.. nd have to create a form to upload the .mp3 files... the file my customer have are like complete albums.. each album named as track01.mp3 , track02.mp3.. i rename them as getting a value from the text box where the user enter the correct name and this track01 gets renamed.. by default the .mp3 files have the correct song name in its <title> tag.. like everysong have there properties.. and title is one them.. the title of the song is present in title tag of the song property.. is there a way i can get that title be assigned as the name of the song and finish of this manual way of entry of the name of the song by the user? i hope u understand what i am saying.. i want what ever is in the title track to automatically be assigned to the name of the song... please help me if this is possible?
  3. i cant cuz i need the files to be added in my DB as well as i upload them.. like my db gets updated with the latest file and the link to the file as well.. and it gets displayed in the index page.. linked to the file uploaded.. any better suggestion to sort the issue? or is there a way i can achieve the same thing using ftp nd db together?
  4. I have made a script to upload a few files from the pc to my server.. like i upload big files which are generally above 50mb of size.. but most of the times as there is some problem with the internet the hours of wait is just ruined.. is there a better way to upload files.. or anything that if the internet connection is interupted the downloading starts from wer it stopped cuz of the problem.. please help.. i use the normal function for uploading a file move_uploaded_file($_FILES['song1_upload']['tmp_name'] can anyone give a better idea than this?
  5. I have made a script to upload a few files from the pc to my server.. like i upload big files which are generally above 50mb of size.. but most of the times as there is some problem with the internet the hours of wait is just ruined.. is there a better way to upload files.. i use the normal function move_uploaded_file($_FILES['song1_upload']['tmp_name'] can anyone give a better idea than this?
  6. Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\wahab_gl\register.php on line 65 i am getting the above error on running the following code.. i am using the local host at the moment $password=md5($password); $repeatpassword=md5($repeatpassword); //generate random number for activation process $random = rand(23456789,98765432); $query = mysql_query(" INSERT INTO users VALUES ('','$fullname','$username','$password','$email','$date','$random','0') "); $to = $email; $subject = "Activate your account!"; $headers = "From: ayaz.haneef@gmail.com"; $server = "mailhost.sheffield.co.uk"; ini_set("SMTP",$server); $body = " Hello $fullname, \n\n You need to activate your account with the link below: http://localhost/register.php?id=$lastid&code=$random\n\n Thanks! "; $lastid = mysql_insert_id(); mail($to, $subject, $body, $headers); die("You have been registered! Check your email to activate your account!"); help please
  7. These are the errors Warning: touch() [function.touch]: Unable to create file C:/xampp/htdocs/gl/uploads/movies/2010/08/I-Hate-Luv-Storys-2010-Hindi-Movie-Watch/Dailymotions-Video-Link--Alternative-Link-/I-Hate-Luv-Storys-2010-Hindi-Movie-Watch-Part-1.php because No such file or directory in C:\xampp\htdocs\gl\movie_process.php on line 197 Warning: copy(C:/xampp/htdocs/gl/uploads/movies/2010/08/I-Hate-Luv-Storys-2010-Hindi-Movie-Watch/Dailymotions-Video-Link--Alternative-Link-/I-Hate-Luv-Storys-2010-Hindi-Movie-Watch-Part-1.php) [function.copy]: failed to open stream: No such file or directory in C:\xampp\htdocs\gl\movie_process.php on line 208 The complete code $part_href = "http://localhost/gl/uploads/movies/{$year}/{$month}/{$title}"; $base_folder = "{$base}uploads/movies/{$year}/{$month}/{$title}"; $base = $_SERVER['DOCUMENT_ROOT']."/gl/"; $path = "http://localhost/gl/albums"; $query1 = "select * from movies where title = '".$title."' ;"; $result1 = mysql_query($query1) or die('Could Not Execute The Query'); while ($row = mysql_fetch_assoc($result1) ) { $hosting = explode(',', $row['host']); $linking = explode(',', $row['links']); $parts = explode(',', $row['link_no']); $no_host = count($hosting); //miniusing the no of loops to make it accurate $count_host = count($hosting); $count_links = count($parts); $current_k = 0; $sum = 0; $parts_href = ''; $new = null; $updated_part = null; for($i=0; $i<($count_host-1); $i++ ) { $j = $i+1; $hos = str_replace(":","",$hosting[$i]); $path = "$base_folder/{$hos}"; echo "<br />{$hos}"; echo "<br />{$path}"; mkdir($path); for($k=$current_k; $k<($count_links); $k++) { for($f=0; $f<$parts[$current_k]; $f++ ) { $for_touch = "$base_folder/{$hos}/".$linking[$sum].".php"; $for_touch = str_replace(" ","-",$for_touch); touch("$for_touch"); $new_seo = "{$part_href}/{$hos}/".$linking[$sum].".php"; $new_seo = str_replace(" ","-",$new_seo); $new = "$new_seo"; $updated_part = $updated_part.$new; $updated_part = $updated_part.","; //copy function $old_file = "$for_touch"; $new_file = "{$part_page}/part".$sum.".php"; $new_file = str_replace(" ","-",$new_file); $new_file = "$new_file"; copy($new_file,$old_file); $sum++; } $query_href = 'update movies set href_parts = \''.$updated_part.'\''; mysql_query($query_href) or die('COULD NOT EXECUTE THE QUERY FOR PARTS HREF'); echo "<br />{$updated_part}"; $sum = $sum; $current_k = $current_k+1; break; } }
  8. i have a random no. of directories and files being created using the mkdir and touch functions and the newly created files are copying a pre-made template.. the links of the pages which were being created had %20 signs between the spaces.. i wanted to change them with "-" soo i used the following code.. but it gives errors.. as invalid arguments in mkdir and touch and as well as copy function can anyone help? here is the code while ($row = mysql_fetch_assoc($result1) ) { $hosting = explode(',', $row['host']); $linking = explode(',', $row['links']); $parts = explode(',', $row['link_no']); $no_host = count($hosting); //miniusing the no of loops to make it accurate $count_host = count($hosting); $count_links = count($parts); $current_k = 0; $sum = 0; $parts_href = ''; $new = null; $updated_part = null; for($i=0; $i<($count_host-1); $i++ ) { $j = $i+1; $hos = str_replace(":","",$hosting[$i]); $path = "$base_folder/{$hos}"; echo "<br />{$hos}"; echo "<br />{$path}"; mkdir($path); for($k=$current_k; $k<($count_links); $k++) { for($f=0; $f<$parts[$current_k]; $f++ ) { $for_touch = "$base_folder/{$hos}/".$linking[$sum].".php"; $for_touch = str_replace(" ","-",$for_touch); touch("$for_touch"); $new_seo = "{$part_href}/{$hos}/".$linking[$sum].".php"; $new_seo = str_replace(" ","-",$new_seo); $new = "$new_seo"; $updated_part = $updated_part.$new; $updated_part = $updated_part.","; //copy function $old_file = "$for_touch"; $new_file = "{$part_page}/part".$sum.".php"; $new_file = str_replace(" ","-",$new_file); $new_file = "$new_file"; copy($new_file,$old_file); $sum++; } $query_href = 'update movies set href_parts = \''.$updated_part.'\''; mysql_query($query_href) or die('COULD NOT EXECUTE THE QUERY FOR PARTS HREF'); echo "<br />{$updated_part}"; $sum = $sum; $current_k = $current_k+1; break; } } PLEASE HELP ME!
  9. $query1 = "select * from movies where title = '".$title."' ;"; $result1 = mysql_query($query1) or die('Could Not Execute The Query'); while ($row = mysql_fetch_assoc($result1) ) { for($f=0; $f<$parts[$current_k]; $f++ ) { touch("$base_folder/{$hos}/".$linking[$sum].".php"); $old_part_href = $row['href_parts']; $updated_part = $old_part_href.$new; $query_href = 'update movies set href_parts = \''.$updated_part.'\''; mysql_query($query_href) or die('COULD NOT EXECUTE THE QUERY FOR PARTS HREF'); $new = "{$base_folder}/{$hos}/".$linking[$sum].".php"; $sum++; } } what i am trying to do is take the value of href_parts and add the new href of the page to the existing value on the href_parts and update the href_parts field in my db.. but i am not getting the desired results.. all i am getting in the db is the last value that is passed in the loop in the db.. i want to save the values which are exisiting in the db and add the newly created values to itt.. can anyone help please..
  10. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '600' height='480' frameborder='0' src='http://embed.videoweed.com/embed.php?v=cw' at line 1 this the error am getting again on the following code foreach($_POST['embed'] as $embed_value) { $query4_1 = "Select * from movies where title = '".$_POST['title']."';"; $result2 = mysql_query($query4_1) or die(mysql_error()); while ($row2 = mysql_fetch_assoc($result2)) { $embed_update = $row2['embed']; $updated_embed = $embed_update.$embed_value; $update_embed = mysql_real_escape_string($update_embed); $query4 = 'UPDATE movies SET embed = \''.$updated_embed. ',\' where title =\''.$_POST['title'].'\' '; mysql_query($query4) or die(mysql_error()); } } i did this $update_embed = mysql_real_escape_string($update_embed); but its still interfearing with the code
  11. well yea u are right mysql_real_escape_string() is to be used with variables but is there a way i cud use it with $_post['embed'] where embed is an array??? or any oder solution for the problem i asked in my 1st post in this topic?
  12. $embed_text = mysql_real_escape_string($_POST['embed']); foreach($embed_text as $embed_value) { $query4_1 = "Select * from movies where title = '".$_POST['title']."';"; $result2 = mysql_query($query4_1) or die(mysql_error()); while ($row2 = mysql_fetch_assoc($result2)) { $embed_update = $row2['embed']; $updated_embed = $embed_update.$embed_value; $query4 = 'UPDATE movies SET embed = \''.$updated_embed. ',\' where title =\''.$_POST['title'].'\' '; mysql_query($query4) or die(mysql_error()); } } $_POST['embed'] is an array and $_POST['embed'] creates a random no of fields soo an array is used here.. in the above code i have tried to update the existing db entries with new ones added to them. but now am getting the error Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\xampp\htdocs\gl\movie_process.php on line 112 Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\gl\movie_process.php on line 114
  13. $embed_text = mysql_real_escape_string($_POST['embed']); but i am getting the following error.. mysql_real_escape_string() expects parameter 1 to be string, array given in C:\xampp\htdocs\gl\movie_process.php on line 109 i did wat u said and its not working
  14. $query4 = 'UPDATE movies SET embed = \''.$updated_embed. ',\' where title =\''.$_POST['title'].'\' '; i have written this query to update my movies table and as u see the query is written using ' ' quotes now wen i try inserting the values in the text box and if it encounters " quote it works fine but if it encounters ' quote anywer it causes error cuz it messes up with the query.. can anyone help??? sumhow i could igone ' quote in the sql query but want the complete text in the text box including ' quote to be inserted in the db.. if i use " quote with query then i have the same problem.. if i try adding a text and it encounter " then there is a problem with sql syntax and a problem is caused any one give a solution please.. i want these quotes used in the text box to be inserted in db.. dont want to remove them..
  15. thnx alot it worked awesome
  16. but the files are being created properly.. the error still resides
  17. Warning: touch() [function.touch]: Utime failed: No such file or directory in C:\xampp\htdocs\gl\movie_process.php on line 183 this is the error displaying.. but the result is all fine.. the files are created.. and everything works fine but y is this error displaying den?
  18. i am trying io copy my template to the newly created file using copy function but the copy function does not work on the server it worked fine in localhost.. i tried using fil_get_contents and file_put_function but that didnt work as well mayb cuz of the restrictions of the server.. and i do not have the permission to edit the php.ini file.. i am talking to talk with the hosting company.. but just wanted to knw is der any oder wat to copy my template to a new file that is created?
  19. $string = House Full 2010 Hindi Movie Watch Online : Dailymotions Video Link : Alternative Link : ; i want to take out ":" from the string.. can anyone tell me wat function should i use to get this following result House Full 2010 Hindi Movie Watch Online Dailymotions Video Link Alternative Link help please..
  20. I tried both the solutions.. even tried $base_folder = "{$base}uploads/movies/{$year}/{$month}/{$title}/" for$(i = 0; $i < 5; $i++) { if(is_dir($base_folder) { $path = "$base_folder/{$hosting[$i]}"; mkdir($path); } else { echo "{$base_folder} is not a directory"; } } its giving the same error.. dunno wats up with this!! please help
  21. I am trying to create random no. of directories but its always giving this error Warning: mkdir() [function.mkdir]: Invalid argument in C:\xampp\htdocs\gl\movie_process.php on line 173 the code is for(i=0; i<5; i++) { mkdir("".$base."uploads/movies/$year/$month/$title/".$hosting[$i].""); }
×
×
  • 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.