Jump to content

ill-fated24

Members
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

ill-fated24's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry for the double post. Im having trouble with my internet connection. I've also tried the below code for upload_process. Keeps throwing me this is not a csv file. if (($_FILES["file"]["type"] == "application/vnd.ms-excel")) { if ($_FILES["file"]["error"] > 0) { echo "error uploading the file"; } else { echo "hooray!"; } } else { echo "this is not a csv file"; } Man this one problem got me searching for answers for like a day already.
  2. It should be the file uploaded from the upload_page.
  3. Hi everyone, I got trouble uploading a csv file in php. Cant seem to figure out whats wrong, it always lead me to "nicetry" even though im sure im uploading a csv file. upload_page <?php echo "<form action='upload_process.php' id='upload_form' method='post' enctype='multipart/form-data'>"; echo "<table id='class1' align='center'>"; echo "<tr>"; echo "<th colspan=2>Upload</th>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=2><input type='file' name='file' id='file' size='50'/></td>"; echo "</tr>"; echo "<tr class='alt'>"; echo "<td colspan=2><input type='submit' name='upload' value='upload' /></td>"; echo "</tr>"; echo "</table>"; echo "</form>"; ?> upload_process $mimes = array('application/vnd.ms-excel','text/plain','text/csv','text/tsv'); if(in_array($_FILES['file']['type'],$mimes)){ echo "csv file!"; } else { echo "nicetry"; } any input would be very much appreciated. thanks!
  4. how about if i want to lets say explode the file/quotes with " * " instead of by line?
  5. thanks for the quick replies.. very much appreciated,,,
  6. new in php.. if you would not mind.. need some explanation here.. i manage to get and post random quotes from a textfile(quotes.txt).. .the codes are from the net..so i want to know how it works instead of wondering how,, <?php $quotes = "quotes.txt"; $quotes = file($quotes); srand((double)microtime() * 1000000); $ranNum = rand(0, count($quotes)-1); echo ($quotes[$ranNum]); ?> anyone can explain this line by line? i would be very thankful..thanks
×
×
  • 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.