Jump to content

Stefany93

Members
  • Posts

    261
  • Joined

  • Last visited

Everything posted by Stefany93

  1. Here is the file! 18974_.zip
  2. Sorry the server here doesn't allow .docx word documents to be uploaded. I will try to convert the file
  3. Sorry about that! Here is the code that I have written for uploading the file I am trying to basically download. <?php include 'core/init.php'; include 'includes/overall/overallheader.php'; ?> <form action="" method="post" enctype="multipart/form-data"> <h2>Upload a syllabus</h2> <hr></hr> <input type="file" name="syllabus"/> <input type="submit" value="upload" /> </form> <?php if(isset($_FILES['syllabus'])){ $allowed_exts = array('asd','cnv','doc','docm','docx','dot','dotm','dotx',' wbk','wll','svd'); $name = $_FILES['syllabus']['name']; @$ext = strtolower(end(explode('.',$_FILES['syllabus']['name']))); $size = $_FILES['syllabus']['size']; $tmp = $_FILES['syllabus']['tmp_name']; if(in_array($ext, $allowed_exts) === false){ $errors[] = 'Extension not allowed!'; } if($size > 10485760){ $errors[] = 'Uploaded files must <= 10mb'; } if(empty($errors)){ if(move_uploaded_file($tmp, 'uploaded_files/syllabuses/'.$name)){ echo 'Your file has been successfuly uploaded!'; } }else{ foreach($errors as $error){ echo 'Error: <strong>',$error,'<strong><br /> '; return false; } } } include 'includes/overall/overallfooter.php'; ?>
  4. ^^ Could you please tell me how to check that?
  5. Hey friends, I have this problem. I have written a script where users can upload MS Word files. So far so good but I also wanted to make them download MS Word files. So I wrote the PHP script that allows users to download files as well, here it is: header("Content-Type: application/vnd.ms-word"); //open/save dialog box header('Content-Disposition: attachment; filename="syllabus.docx"'); //read from server and write to buffer readfile('uploaded_files/syllabuses/syllabus.docx'); But when the user the redirected to that page to download the file, everything goes fine until he/she tries to open in the their MS Word program and this error appears: First error And when I click OK, the second error appears: Second error And when I click OK on the second errors, the word documents works just file and everything is OK. But these errors are really annoying and may cause trouble to other people downloading this file. Could you please tell me how to fix them? Thank you! Best Regards Stefany
  6. Thank you guys, the way I am doing is that when they vote on an article I first get the user's ip address and store it in a table inside a DB with the article's id. That way they couldn't not vote again on the same article, but they will still be able to vote on other articles. Actually this is what you guys told me to do, so I did it and it worked!
  7. I say we name the baby Smarty or Zend Congratulations!
  8. Well thank you for the help, everybody! I will see what I can do.
  9. Because with the front end I will have to create an admin panel and everything the admin panel does I can do it myself. I have heard that admin panels are made only for people do not know how to program. I mean, I can do everything just manually typing the blog post and title and stuff. And to answer the upper question, I am not using wordpress, I have made the blog myself.
  10. Because I want the system to automatically send an email to all the subsdcribers to the blog. Or am I doing everyrhinf wron? Sorry, sometimes I do everything so messed up :'(
  11. Hello friends, I want to check when a new row is inserted into the mysql DB, but the problem is that since I insert the rows manualy because they are blog posts, the mysql_insert_id doesn't work, and I would very much like to check that because I would like a mail to be send after that action. Please tell me how to check when a row is inserted. Thank you! Best Regards Stefany
  12. Awesome, I stored the IP in the DB using the post id and it worked! How terrific are you guys? Thank you so much!
  13. Thanks but aren't sessions destroyed once the user has closed their browser, so that makes sessions securing the double rating useless?
  14. Hello friends, I have recently written a rating system, howerver I want to restrict a user to rate a post multiple times. I tried storing the their IP in the DB but the problem arose when I found out that they could only vote on one post for the entire blog and that wasn't pretty. So could you please tell me a better way to create a state for the user to vote only one time per a post? Thank you very much! Best Regards Stefany
  15. Thank you so much I am going to install it straight away!
  16. Hello, Please help me! Today suddenly my internet stopped for no reason! When I open the device manager and click on other devices and click network my Ethernet controller has a little yellow (!)sign next to it and when I click properties it says no driver installed, please tell me what to do! I have drivers I guess, I just installed an Atheros driver there for the network but somehow it doesn't recognize it or I do not know what is the problem, please help, please! Thank you Best Regards Stefany
  17. I tried AUTO_INCREMENT in the phpmyadmin but an errors occures telling me that only the primary key can auto - increment... Please tell me what to do?
  18. Thank you, but is there any way I could increment this post_id automatically?
  19. Hello colleagues, Please help me! Here is the issue: I have two tables in the Mysql DB one called posts and its columns are id title contents category_id datetime And I have another table whose name is comments and its fields are: id name comment So far I managed to display the comments from the databse, but the problem is that I want to display comments only that correspond to a specific post from the DB. Please, please help me, I have been trying to figure it out for weeks and still can't find the answer! Thank you! Best Regards Stefany
  20. Yeah indeed it was in this format, it is just made a typo in the previous post. I already displayed the time and date using the while loop. Turned out I could this is all along. I felt to stupid But you helped me a lot guys, thank you so much!
  21. ^^ Thank you very much for the help. You are awesome!
  22. Thank you very much for the help, fellows! You helped me very much! One last question please. You said that it is wrong to use globals, could you tell me how to make the variables global without using the keyword, please? Thank you! P.S and yes, there was a typo while I was writing down the date. Indeed it is 0000-00-00 00:00:00. Sorry!
  23. Hello colleagues, I am trying to create blog and so far it has been going great, however I have came across a very annoying problem. The thing is that I want to extract the datetime from my blog and to be shown under each post. The title and the content has been displaying OK in the blog page, but the problem is that every time I loop the datetime that has been stored in the DB it is display four times, and I don't want this to happen, plus I seem can't set it each row of datetime to be displayed only on the post with the same ID in the DB. Please, please tell me what to do! This is how the data is aligned at the DB: id title content datetime The format I use to save the current date and time in DB is DATETIME with a default value of 00-00-0000 00:00:00 and then in the mysql query I use the NOW() function to update the values. Here is the code: $query = mysql_query("SELECT id, title,date_posted, contents FROM posts"); if(mysql_num_rows($query)){ while($result = mysql_fetch_assoc($query)){ $title[] = $result['title']; $content[] = $result['contents']; $time[] = $result['date_posted']; } } function post(){ global $title; global $content; global $time; foreach(array_combine($title,$content) as $zaglavie=>$statia){ echo '<h1>'.$zaglavie.'</h1><p>'.$statia.'</p>'; } } I am using the post() funtion inside the index page of the blog where the values from the DB are supposed to be displayed. Thank you very much!
  24. ^^ OMG I feel so childish now!!! Thank you for the funny tip
  25. ^^ @Adam, thank you so much for the detailed review it was incredibly helpful! I will surely do all the things you have suggested. About the blog page, I wanted to update it but I mixed up the code and now it is not working that is why I took it offline but you are right the sign 'offline' is just silly, I will try to upload it again one of these days! About the comic sans you mean I should remove the headers with the hand-written-like-typeface, right? Thank you very much, you are great!
×
×
  • 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.