Jump to content

Jaswinder

Members
  • Posts

    124
  • Joined

  • Last visited

Everything posted by Jaswinder

  1. k.. syntax problem solved. i run the code... but a blank page is comings after processing... and no email in my mailbox
  2. your code is giving syntax-error on line 15.. correct it so i can test it
  3. @jazzman1 sorry but not getting it.. can u give me the proper code.. using my example
  4. so the code is correct........ may i try this code on another hosting??
  5. It should be as my other php websites are running on it.... Its Hostmonster.com
  6. the code is giving proper result on localhost..but i know to get mail i have to upload it on server ??? this problem is coming when i uploaded my script on hosting.... so how to install php there..
  7. feed.php <form action="feed1.php" method="post"> Name - <input type="text" name="name" /><br /><br /> Email - <input type="text" name="email" /><br /><br /> Subject - <input type="text" name="subject"/><br /><br /> message - <textarea rows="5" cols="10" name="message"></textarea><br /><br /> <input type="submit" value="Send mail" name="sub" /> </form> feed1.php <?php extract($_POST); $to="[email protected]"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers.="From:$name<$email>"; mail($to,$subject,$msg,$headers); echo "Message sent successfully"; ?> error "; mail($to,$subject,$msg,$headers); echo "Message sent successfully"; ?> how to solve it??
  8. i think 1st option is better.. so how to create custom php.ini file Is i have to copy my local php.in and where to paste it... and how it will override the main php.ini
  9. thank you again .... problem solved .. i more question.. how this problem will be solved if same problem arises after uploading my website on hosting
  10. my php.ini shows this ;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. ; http://php.net/file-uploads file_uploads=On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ; http://php.net/upload-tmp-dir upload_tmp_dir="C:\xampp1\tmp" ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize=2M ; Maximum number of files that can be uploaded via a single request max_file_uploads=20 i changed upload_max_filesize=2048M but still same error
  11. how u came to know its a maxsize problem not of type or tmp_name as they are also coming blank ?? and also in php.in i changed max_upload_size still getting same error.... any other changes needed??
  12. yes @ mac_gyver i tried your code ... it is working fine for all files except for any songs and videos.. following error is coming Upload failed. Array( [up] => Array ( [name] => filename.mp3 [type] => [tmp_name] => [error] => 1 [size] => 0 ))6511567 is there any other method for mp3 or mp4 files ??
  13. thanks for your answers..... i came to know my tmp_name is coming empty..but dont know why... any solutions?? how to fix this??
  14. hi.. the code i am using for uploading is working fine few days back.. now giving some errors.. please solve it <form action="up1.php" method="post" enctype="multipart/form-data"> <input type="file" name="up" /> <input type="submit" value="submit"/> </form> php <?php $up=$_FILES['up']['name']; copy($_FILES['up']['tmp_name'],"upload"."/".$up) ?> where upload is a folder in which all the uploaded files are stored Error - - Warning: copy(): Filename cannot be empty in C:\xampp\htdocs\copy\up1.php on line 3 where is the mess ???
  15. Finally its over.. here's the code <?php $download=$_GET['sno']; $cn=mysql_connect("localhost","root",""); $db=mysql_select_db("music",$cn); $a="select songs from mp3 where sno='$download'"; $sql=mysql_query($a) or die(mysql_error); $n=mysql_num_rows($sql); if($n>0) { $s=mysql_fetch_assoc($sql); $file ='songs'.'/'.$s['songs']; header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // required for certain browsers header("Content-Type: audio/mpeg"); header("Content-Disposition: attachment; filename=\"".basename($file)."\";" ); header("Content-Transfer-Encoding: binary"); header('Content-Length: ' . filesize($file)); ob_clean(); flush(); readfile( $file ); } ?> its working like charm Thanx jazzman1.. thanx alot .. i am not able to get this without your help...
  16. can you explain me what each header statement do which you suggested ... it help me in better understanding and help me in fixing this issue....
  17. yes i read that link... I try to reorder the header position, but not getting any result... and i dont understand the Output buffering... O man... you are right... i just deleted files from /songs there yesterday. Now i uploaded again now the output is Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\upload\download.php:1) in C:\xampp\htdocs\upload\download.php on line 18,19,20,21,22,23,24 and this ID3vTALBwww.primemusic.ruCOMMengwww.primemusic.ruTYER2011TCONPrime MusicTENCwww.primemusic.ruTCOP*Òîëüêî äëÿ îçíàêîìèòåëüíîãî ïðîñëóøèâàíèÿTRCK1TIT2E - Midnight CallerTCOMTPE1'Chase & Status feat. Clare MaguireÿûdXing!«HŒº "$'),/1468;>@CFHJLOPSVX[^`cegjmpsvy|ƒ…ˆ‹'"–˜šž¡£¥¨ª¬¯±³µ¸»¼¿ÃÅÈËÎÑÔ×ÚÞáãçêìïóõøûüþÿMLAME3.97 º.S4 $MàHŒºâÏÖ1ÿûdði ¤ 4€ "ÃAh´z+Ã@1?wóÜ€"es>J1î]ÁéçÐy`UÉ1ÛòèOÞ@á$?c»ñ0j.—É"ÿûd"ði ¤ 4€³éQ3úD€ä(—Ó'Ëé—?ä¡¥7—tÝ™HÛÿ›¡A¦ÆLÍ™$d´V‡ÿ÷AÿdÓtgwA¶ÿÿÿúÿûdDði ¤ 4€–ûAËÅÓÿÿ÷B'n]crñÕ@A,›{þ­"'ì]ÜΉüãV"nì>(>*Š'h¨r**!i'œ="{'‡Î>]Å9NÍ—<3E2öÐœ—g²ç•ú®tE_ÿÿÿÿÿý›®©/ôµPÚ‡W2!. ÿÿû`d7ãgxIé&ú@ p¥#-¦$Ù \%"ÿÿÿÿÿÿÿÿÿÿÿÿ_ôkAµK÷×ï¥×[JYÑ3‡A¨ëk¿'6Ôp,uùò{úx•ÁçzÇ…zµæmQö£8"6ÒŠ˜Å3)]Œl€œ«Û £]¢Kþ l-ô£ºy"Òú7È Ne×Y2iË&†["N`"†@ÎBB}/‡¼1œ$úUA‹T¸Öpä%éHŇƒÿÿÿÿÿÿÿÿÿÿÿÿ÷¬ÃêÔî'òD&UbWt×I,­ DË¥"å¬2¥Ò¥–áéÀUêe…Qä¨VCPŠ¯8ÿû€d€õ'UJéà`€Pñ+£$Á`T€e@±VBùeÓœ2-»"÷OgÚH.^rVKÅd¤ÕJžuîdôœñ&"rÁ(~+ÂòåÈfKÄVäëN!-.e§Ÿqˈ±ôª6rš? ‹2cHJMjÇ™š¦.3zQåÝ\´NÇ?®Af"ŽsëÙ Ý·"×!-úäÒÓ舛ÿÿÿÿÿÿÿÿÿÿÿÿmB­eú}M†ØEÂ.'vÚûe'"J;‰dÎLia™Á‰QÖ ÛK8™¤HÉáLRZê#¤¨'n_'©Î9Â0•à; »_ÇbI}J˘:ÒõÂ}Ê^6¦Ñ'†CÈb‹—$æ1‡JdÔy$·dòÕI4&4D° …‚ŠH"*‹UèG÷GöÞa#ÖÇÿÿÿÿÿÿÿÿÿÿÿÿÿÑ·mcbTš5FT†Vkl•´AŸümŒu×ÝGeËjtëÈMÿû€dôlOËy‰xÀ `éÙ+¦$WèN€e@!XÊ%OŒ¡ƒâÄùÆÈ ä$'z"ŒÝ&OÎ-9(¢t‰§ Ù$GFÓŒ Å º'30Šõ¡ƒ1…Âpü`cAXa DXŒ€­'x:‡WéœD ·@A ìoÈyó4ˆµLo>ÿÿÿÿÿÿÿÿÿÿÿÿÿÿõ¾õ$cdã'Im¸ÛHƒ'Œ·X§Á{½ Û?y·×ÂÖA|Ú§}ˆ&f>œiD ¤ÔgÊæ"eA¶#¬¹ìrCÏÄ*0<" bJHŸÅ(µ¯Ñ«NIt([˜ÇO$"Òåa‹Ovµg4ã)l›¹ùÓ:Ú©Óç–®·Qn¯¦"ç<"jç–b7+É­9ßÒ¦Õ¿Ûæ¡ùw «/ÿÿÿÿÿÿÿÿÿÿÿÿÿñè±7ª4ESXwYf•Ä"Æ ÷û³ÎŠZl*¹1S› mTK7¬«Ææÿû€dô,GËy(7` @¡)†3`g%ÓPa È'"Ÿ`–¶É½ @¹kªƒgŒ#E"xÐ h¾@....................................... i think its showing blob data
  18. filesize may be empty... because its just getting filename from database not file header problem... i cant change position of header statement and i changed the path.. still no result
  19. i want the images to change automatically in a div... i am not able to complete the code.. or dont know doing it correct or not i am using following script <script> var a=new array("1.jpg","2.jpg","3.jpg") var i=0 function show() { document.getElementById("snap").src=a i++; if(i>2) {i=0} } setInterval("show()",1000) </script> <body> <div style="height:500px; width:500px;" id="snap"> </div>
  20. jazzman1This is the result coming....Array( [songs] => Midnight Caller.mp3) and ..this is the name of my mp3 file its just taking the filename from database... because the acutal file is in songs folder in xampp
  21. gud try.... but following errors are coming Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\upload\download.php:1) in C:\xampp\htdocs\upload\download.php on line 15 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\upload\download.php:1) in C:\xampp\htdocs\upload\download.php on line 16 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\upload\download.php:1) in C:\xampp\htdocs\upload\download.php on line 17 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\upload\download.php:1) in C:\xampp\htdocs\upload\download.php on line 18 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\upload\download.php:1) in C:\xampp\htdocs\upload\download.php on line 19 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\upload\download.php:1) in C:\xampp\htdocs\upload\download.php on line 20 Warning: filesize() [function.filesize]: stat failed for songs/.mp3 in C:\xampp\htdocs\upload\download.php on line 21 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\upload\download.php:1) in C:\xampp\htdocs\upload\download.php on line 21 Warning: readfile(songs/.mp3) [function.readfile]: failed to open stream: No such file or directory in C:\xampp\htdocs\upload\download.php on line 22 i also tried putting concatenate after header like this header('Content-Description: File Transfer'); header.("Content-type: audio/mpeg"); header.('Content-Disposition: attachment; filename='. basename($file)); header.('Expires: 0'); header.('Cache-Control: must-revalidate'); header.('Pragma: public'); header.('Content-Length: ' . filesize($file)); readfile.($file); it reduces header loaction problem except once... Path - my mp3 files are in C:\xampp\htdocs\upload\songs\filename.mp3 and my php files are in Path - C:\xampp\htdocs\upload so i also tried the file path $file = 'upload'.'/'.'songs'.'/'.$s['songs'].'.mp3'; still no results... dont know giving correct path or not... Any clue?? i came across another link.. may be it will help .. take a look at this - http://www.finalwebsites.com/forums/topic/php-file-download
  22. I knew i am sending just filename into database not blob... and storing the original file into a folder named as Songs in my xampp folder.. the file is getting there properly.... while downloading i am not able to give path to that folder header("Content-Disposition: attachment; filename='<? echo $s[songs]; ?>'"); .. problem lies here... either i have to remove from here echo and use opendir & readdir commands ... or something better,, if u can suggest
  23. jazzman1 Thanx buddy.... now just 1 problem left... a download dialog box is coming.. but file size is showing just 0 KB .. but the song size is 4 MB ..... I am not able to give proper path,, i think
  24. Note - my uploaded file goes into a folder name- songs i used the following code to upload :- In player.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="i"/> <input type="submit" value="Upload" /> </form> </body> </html> In upload.php <? $i=$_FILES['i']['name']; copy($_FILES['i']['tmp_name'],"songs"."/".$i); $cn=mysql_connect("localhost","root",""); $db=mysql_select_db("music",$cn); $a="insert into mp3 values('','$i')"; $sql=mysql_query($a) or die(mysql_error); if($sql>=0) { echo "Successfully Entered";} else { echo "failed";} ?> <a href="show.php">show files</a> For downloading In show.php <? $cn=mysql_connect("localhost","root",""); $db=mysql_select_db("music",$cn); $a="select * from mp3"; $sql=mysql_query($a) or die(mysql_error); $n=mysql_num_rows($sql); if($n>0) { while($f=mysql_fetch_array($sql)) { ?> <table align="center" border="2" width="200" height="100"> <td><a href="download.php?sno=<? echo $f['sno'];?>">Download</a></td></tr> </table> <? } } else { echo 'No data'; } ?> In download.php <?php $download=$_GET['sno']; $cn=mysql_connect("localhost","root",""); $db=mysql_select_db("music",$cn); $a="select songs from mp3 where sno='$download'"; $sql=mysql_query($a) or die(mysql_error); $n=mysql_num_rows; if($n>0) { while($s=mysql_fetch_array($sql)) { header("Content-type:audio/mpeg"); header("Content-Disposition: attachment; filename='<? echo $s[songs]; ?>'"); } } ?> Note :- I think i am not able to give proper path of file to download... but the file is properly get uploaded into database and songs folder too. Database name - music table name - mp3 fields - sno and songs
×
×
  • 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.