Jump to content

Stefany93

Members
  • Posts

    261
  • Joined

  • Last visited

Everything posted by Stefany93

  1. Welcome! Usually you will get a reply when a fair amount of time has elapsed because programmers are very rare and programmers that can actually help you are usually too busy to spend their free time in forums.
  2. Right, so for now it is better to make animations with JS than with CSS since most of the browsers won't support it while JS has been supported for years. I got it. Recently I read that you no longer need to enclose your JS code with HTML comments for browser comparability, every browser support JS now which is awesome.
  3. Awesome book indeed, I have been reading it for some time now seriously. What I mostly like about it is that they actually "talk" there, while in the other programming books, they only show you tons of code with very little explanation on what to do now or how to use the code they have shown.
  4. Notepad++. I get a little jealous when using IDEs because I want to write all the code by myself
  5. Haha me too. Thank you very much for the help, buddy.
  6. Just to be on the safe side, JQ means jQuery, right?
  7. That's exactly what I was going to suggest. A friend of mine who is a great programmer suggested I should start working on an open source project so I am building a forum now which I am going to put on Github and then put a link in my CV.
  8. Hi there, I was turning the pages of a JS book the other day and I stumbled upon JS animations. I am wondering, with the invention of CSS3, does it make using scripted animations deprecated since it is way faster to use CSS instead, or CSS still can't do what JS can? Thank you. Best Regards Stefany
  9. First of all if you have finished studying Computer science that means you should have a perfect knowledge of PHP at least, but of course, they teach people nothing in the universities so I guess it's no surprise. Second of all, if you want to call yourself a programmer, do not use frameworks, so forget Zend, Yii, mend - bend, and other nonsense. Hard studying at the books and writing code all the time will make you an awesome programmer and you will have no trouble finding a job. P.S. They fired you after 8 days?? Terrible employers!!
  10. ^^ Thank you again for the tips, guys. I am a future member of the penguin flock
  11. Thank you Christian for the help!
  12. I friend of mine who is a great programmer told me to omit the tag so that I could avoid header errors, also because some text editors have the nasty habit of adding a new line after the closing ?> tag thus screwing up your program.
  13. ^^ Here it is: Graphics Generic PnP Monitor (1366x768@60Hz) AMD Radeon HD 6310 Graphics (Acer Incorporated [ALI])
  14. Thank you very much for the help! I can't believe you don't need drivers on Ubuntu! I love it already! Here is my laptop's specifications: CPU AMD K14 Hard Drives 313GB Western Digital WDC WD3200BPVT-22JJ5T0 ATA Device (SATA) RAM 4,00 GB DDR3 @ 532MHz (7-7-7-20) Operating System MS Windows 7 Home Premium 64-bit SP1
  15. Hello fellas', I would like to dual boot Windows with Ubuntu, so I ran the live session off the LiveDVD and it worked fine, like, the sound, the internet, everything was working. Now my question is, do I need to install network or sound drivers once I install Ubuntu, and if I don't have to, then how one earth is everything working while on Windows you need to install drivers for sure? Thank you Best Regards Stefany
  16. You start off first by creating the font - end. You need upload and submit buttons in a form element where it will send the data with POST: Save this as upload_avatar.html <form action="upload_avatar_process.php" method="post" enctype="multipart/form-data"> <input type="file" name="avatar" id="avatar" /> <br /> <input type="submit" value="Upload your avatar" /> </form> Then you need to create a separate page, upload_avatar_process.php where you have to 1. Check whether the user has basically uploaded the file; 2. Disallow unwanted extensions; 3. Set a file size's limit; 4. Move the image from its temporary location to a directory of your choice Here is the code: if(isset($_FILES['avatar'])){ $allowed_extensions = array('jpeg','jpg','png','gif'); $file_name = htmlentities($_FILES['avatar']['name']); $file_extension = strtolower(end(explode('.',$_FILES['avatar']['name']))); $file_location = $_FILES['avatar']['tmp_name']; $file_size = $_FILES['avatar']['size']; if(!in_array($file_extension, $allowed_extensions)){ $errors[] = 'File has an invalid extention. Allowed extensions are jpg, jpeg, png and gif'; } if($file_size > 133120){ $errors[] = 'File is way too large. Max size is 130 KiB'; } if(!empty($errors)){ foreach($errors as $error){ echo $error.'<br />'; } }if(empty($errors)){ move_uploaded_file($file_location, 'avatars/'.$file_name); } } Note that the $_FILES array is multidimensional, that's why you need to refer to its values with double brackets like this: $_FILES['avatar']['name'];
  17. It's a shame* Sorry damn keyboard slip.
  18. Sorry for the late reply guys, thank you very much for the replies. It is a same that Hollywood don't make such movies about programmers tho
  19. Hello, I was wondering if there are any good movies about programmers? I have seen Hackers but it is basically not about programmers and the Social Network but it wasn't again strictly about programmers, can you recommend me some movies on that topic? Best Regards Stefany
  20. Create a new table named answers and create 4 different columns like answer1, answer, answer3, answer4, as much as you need. Then make your query like this: mysql_query("INSERT INTO table_name(answer1,answer2,answer3,answer4) VALUES('value1','value2','value3','value4')"); Only make new tables when there is no way around it, because MySQL queries tend to be a lot faster when they are inserting or fetching data only from a single table. Also make sure to escape your variables with mysql_real_escape_string function before sending them into the database.
  21. That's a better solution. Thank you Chris!
  22. ^^ Exactly like the colleague above suggested but I usually create a separate file for example protected.php and include it on the top of the page I want to protect basically. Inside the file I write this if(isset($_SESSION['user_id']) and !empry($_SESSION['user_id'])){ // do nothing return true; }else{ die('You be must be logged in to see this page'); return false; } You really do not need to write a return statement, I just did it to clarify stuff
  23. Dear friends, I am trying to build a PHP graph using the GD library on the students' grades. The grades files must be in a word format and in this case docx. And the docx files are archived in a zip archive basically. So what I am trying to do is to open this docx file in the zip archive, read its contents do the calculations and display the graph. The problem occurs when trying to read the docx file the result is just gibberish. Here is the code I have written to open the file. It is taken from W3schools. <?php $zip = zip_open("grade.zip"); if ($zip) { while ($zip_entry = zip_read($zip)) { echo "<p>"; echo "Name: " . zip_entry_name($zip_entry) . "<br />"; if (zip_entry_open($zip, $zip_entry)) { echo "File Contents:<br/>"; $contents = zip_entry_read($zip_entry); echo "$contents<br />"; //zip_entry_close($zip_entry); } echo "</p>"; } } ?> And here is the result: Name: Test assignment.docx File Contents: PK! $????[Content_Types].xml ?( ??MO?@??&??W?z0?? ??M???.C??~dg???JK???Z???2???3??J??<*kR?Oz,#m??,e?????E??Di ?l ?F???t?#?6??"w?9????:0t?[?E [??N?1~???piM?Pi???r1/C4^????C?,??_??R&?+??H??d?\??CB??w?P???V????????*?h"|x?0????gV?5???i??y?$4????V"e??9?B??A???)j???T(?y?>vw?????v?(?SL???qW??U?DX???Q??w??4S?^? ??0?F?"??\?gsld?Y?dL?uH????????c9>(hVD?5??{?????A???7?t? ??PK!???N_rels/.rels ?( Please tell me what I am doing wrong so that the contents of the file are displayed so nasty. Thank you! Best Regards Stefany
  24. It is not a good idea to send emails from localhost because by default your ISP will try to limit or not allow you at all to send emails since the ISPs do not want the people they give Internet to spam other people's mail boxes because that way it will be very easy. Write your code and then upload it to a server with PHP MAIL() function enabled and you will be fine. Yeah the testing will be a bit difficult, but it is worth it :-)
  25. Thank you very much for the help everyone but the same error appears once again but not every time thank you very much for the help, you are awesome! So I decided to make if anyone wants to upload a docx document to archive it in a zip format first. Now the errors are gone. Thank you!
×
×
  • 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.