[!--quoteo(post=360267:date=Mar 31 2006, 04:34 PM:name=elementz)--][div class=\'quotetop\']QUOTE(elementz @ Mar 31 2006, 04:34 PM) [snapback]360267[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code]<? //ob_start(); //the above line needs to be above ALL HTML and PHP (except for <?). //include("config.php"); //gets the config page, which connects to the database and gets the user's information //if ($logged[username]) //{ //checks to see if they are logged in switch($_GET[song]) { //this allows us to use one page for the entire thing default: break; case 'upload': echo ("<form action=\"song.php?song=add\" enctype=\"multipart/form-data\" method=\"post\"><br /> Select file <input name=\"ufile\" type=\"file\" size=\"50\"> <input type=\"submit\" name=\"Upload\" value=\"Upload\"> </form>"); break; case 'add': $valid = array (".mp3",".wma"); $type = strtolower(strstr($filename, '.')); if (!in_array($type, $valid)) { echo ("The submitted file was of invalid type.<br />"); } $file_name = $HTTP_POST_FILES['ufile']['name']; $random_digit=rand(00000000,99999999); $new_file_name=$file_name.$random_digit; //set where you want to store files //in this example we keep file in folder upload //$new_file_name = new upload file name //for example upload file name cartoon.gif . $path will be upload/cartoon.gif $path= "songs/".$new_file_name; if($ufile !=none) { if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path)) { echo ("Successful<BR />"); //$new_file_name = new file name //$HTTP_POST_FILES['ufile']['size'] = file size //$HTTP_POST_FILES['ufile']['type'] = type of file echo ("File Name :".$new_file_name."<BR />0"); echo ("File Size :".$HTTP_POST_FILES['ufile']['size']."<BR />"); echo ("File Type :".$HTTP_POST_FILES['ufile']['type']."<BR />"); } else { echo ("Error"); } } break; } echo("<br /><br /><a href=\"song.php?song=upload\">Add</a></b>"); ?>[/code] This is my code, but when I go to upload a song on it, it takes a while as if it is uploading it but then it comes up with the page "Cannot Connect To Server". Thankyou, Luke [/quote] bump