Search results

  1. M

    What the best place to read about php script security

    Check out the suggestions for the question "PHP tutorial that is security-, accuracy- and maintainability-conscious?" on StackOverflow. Though I haven't read it, "Essential PHP Security" comes recommended and is published by O'Reilly. Whatever you do, don't use W3Schools.
  2. M

    need help in c++

    @marshian: since this is homework, it's best not to rewrite the code for the OP. We don't want to be too helpful.
  3. M

    need help in c++

    @dhruv227: in particular, conio.h isn't standard. <iostream> is the right one to use, according to the standard. It was changed in the '90s. Read up on namespaces for more information. True in C, not C++. calc_info and invest_info are valid typenames. The problem is they're not declared...
  4. M

    PHP issues with IE (internet explorer)

    While you're at it, run your pages through W3C's HTML validator. You're pages have some other problems that need addressing.
  5. M

    PHP issues with IE (internet explorer)

    The page also doesn't show in Safari 4, which means it probably won't show in Chrome. The problem isn't the include statements but the fact that you're missing the <body>, </body> and </html> tags. Also, don't use short tags; enter PHP mode with "<?php", not "<?". Lastly, <style> elements can...
  6. M

    Getting progress of download java

    How big are the files you're downloading? 32 bits for a signed integer gets you up to 2 GiB. If size and current are overflowing, try changing them to longs. How are you setting size?
  7. M

    Remove duplicates

    Where did you place the statement? After the call to preg_match_all? The following works for me $loadfile = file_get_contents("codes.txt"); $expression = "#[A-Z0-9]{8}([-_][A-Z0-9]{8}){3}#"; preg_match_all($expression, $loadfile, $resultat, PREG_PATTERN_ORDER); $resultat =...
  8. M

    Remove duplicates

    The issue with your code is that $resultat is a multidimensional array with a single value. The array_unique is called on the wrong value; a $resultat = $resultat[0]; would fix this, but the performance can be improved by taking a different approach. PHP uses associative arrays. Store the lines...
  9. M

    Cron Jobs

    Start with the cron tutorial.
  10. M

    Getting progress of download java

    Change line 18 to: out.write(buffer, 0, bytesRead); I'm sure you'll realize why and smack yourself in the head.
  11. M

    Dynamic redirect

    It's always best to show your work. It helps us help you see what isn't working and gives us a better idea of exactly what you're trying to do. RewriteRule ^index.php newdirectory/index.php
  12. M

    .htaccess redirect

    RewriteRules don't match against the query string. You'll need to use a RewriteCond: RewriteCond %{QUERY_STRING} (^|&)Product_Code=([^&]*) RewriteRule ^/?Merchant2/merchant\.mvc /%1.html [R=301] Depending on how exactly the site is arranged, you might need to remove the leading slash from the...
  13. M

    Getting progress of download java

    What line is the exception being thrown on/what's the stack? Where is size set?
  14. M

    Audio Length

    PHP has no built-in support for handling MP3s, and X10 doesn't have installed any PHP extensions for MP3s. You could try installing getID3. Perl modules might be easier to install & get working.
  15. M

    MySQL troubles

    Here's a quick one (and probably Descalzo's first suggestion): on line 136, insert a test on the result of the query, and print the MySQL error message if $posts is false. if (False === $posts) { echo mysql_error(); } Once you've got the error message, comment out the new code and post...
  16. M

    Inserting chinese text into mysql

    trim works fine for me: $chapters = str_replace('課', '課 <br />', $chapters); $chaptersRefined = str_replace(array('課', '第'), '', $chapters); $chaptersArray = array_map('trim', explode('<br />', $chapters)); $chaptersRefinedArray = array_map('trim', explode('<br />', $chaptersRefined)); If you...
  17. M

    PHP interpreter

    Did you try the example? Because that's the correct one: "/usr/local/bin/php". There's also a PHP binary at "/usr/bin/php". If you're using a PHP script for a cron job, a forum search for "cron path" would have turned up the answer.
  18. M

    MySQL - comma delimited fields?

    The place to look for MySQL's string manipulation capabilities is the string functions manual page. However, SQL isn't intended for string manipulation, hence MySQL's poor capabilities. A better solution would be to write a program in another language to perform the actual processing, perhaps...
  19. M

    access denied

    How are you attempting this? Are you using phpMyAdmin's import feature? (See also the many threads on this topic.) It's rather hard to answer questions about code without seeing it. However, "þ" isn't used in any SQL keyword. Possibilities include: the text isn't an SQL query, there's an...
  20. M

    minor CSS adjustments...

    I've always liked "CSS Sprites: Image Slicing’s Kiss of Death" on A List Apart.
Top