Jump to content

jskywalker

Members
  • Posts

    292
  • Joined

  • Last visited

    Never

Everything posted by jskywalker

  1. php -r '$tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); echo $tomorrow; ' above is tested on Linux, for some reason, if you are on Windows you should do: php -r "$tomorrow = mktime(0, 0, 0, date('m') , date('d')+1, date('Y')); echo $tomorrow; "
  2. If you save this code in a file named 'check.php' this works: <?php print_r($_POST); ?> <HR> <FORM METHOD="POST" ACTION="check.php"> <input type="submit" value="submit"> <label>PDF Article</label><input name="article_type" value="pdf" type="radio" /> <label>Video Webcast</label><input name="article_type" value="webcast" type="radio" /> <label>Podcast</label><input name="article_type" value="podcast" type="radio" /> </form> which part am i missing ?
  3. and you should NOT do $money = $_GET['money']; just before your query....... @PFMaBiSmAd: you are right about the multiple query's...
  4. this is a SQL question......... (so wrong place of forum?) SELECT * from blog_addresses WHERE link like '%.blogspot.com%';
  5. try changing default charset, in stead of default collation.
  6. no, because if someone posts something like: $money="'; delete form countries" than it would delete the contents from your countries table.......
  7. $file = file_get_contents('http://www.facebook.com/favicon.ico'); file_put_contents('some_local_filename.ico', $file);
  8. an unchecked checkbox is not checked, so there's no need to send it? for this checkbox you can do this: $var1 = (isset($_POST['var1']) ? true : false);
  9. possible, because in the SQL-statement is: 'post_date' which should read: `post_date` The first one (between '') is a string, the second one (with the back-quotes), is a reference to the field named post_date.... and 'post_date' is always > '2010-10-02.....'..
  10. sorry it look this crappy..... But most it is simple SQL, beside some date-formatting in PHP Aboud those data-formats, you can check http://www.php.net/date and everything about MySQL is here: http://dev.mysql.com/doc/refman/5.1/en/index.html So, which part was not clear to you ? :'( ;)
  11. for post this year you have: <?php echo $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND 'post_date' > '" . date("Y") . "-01-01-01 00:00:00'"); if (0 < $numposts) $numposts = number_format($numposts); ?> for posts this month you could do: <?php echo $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND 'post_date' > '" . date("Y") . "-01-01-01 00:00:00' AND `post_date`>'2010-'.date("m").'-01-01 00:00:00'"); if (0 < $numposts) $numposts = number_format($numposts); ?>
  12. oeps, i did mean a 'LEFT JOIN'...... because you want all records from 'locations'
  13. it always send ALL data that you defined in the form, but NEVE the disabled elements... if (isset($_POST['var1])) { $var1 = $_POST['var']; This
  14. change the 'INNER JOIN' to a 'RIGHT JOIN' see: http://dev.mysql.com/doc/refman/5.1/en/left-join-optimization.html
  15. jskywalker

    procmail

    i'm trying to filter some messages using procmail when a message contains: 'Out: 401', i want to move it to a folder named 401 when a message contains: 'Out: 403', i want to move it to a folder named 403 etc.. Now i can make lines for every code possible (401, 403, ....., 450, 454) But instead i'd like to maken 1 rule for 4xx and have the foldername based on the found code... To achieve this, i tried to define a variable which should get the found errorcode VAR=`formail -I "" | expand | sed -e 's/.*\(Out: \)\(4..\).*/\2/' -e '/^4/!d' | head -1` :0 B * ^Subject:.*errors .folderwitherrors.${VAR}/ My question is, can above be done in a simpler way ? (and, if YES, how to do it.....)
  16. if your system is able to send emails, than you could edit your crontabfile ('crontab -e') and put 'MAILTO=youremailadres@example.com' before the line that tries to do the backup All output of that command will be mailed to the specified address (if mail is setup correctly) This way you can see error message's like 'wrong password', etc....
  17. use urldecode: http://nl2.php.net/manual/en/function.urldecode.php
  18. go to : http://localhost/test.php?c=Ba%20%26%20t and read about urlencode: http://nl2.php.net/manual/en/function.urlencode.php
  19. changing you password should not give this result: Rows Matched: 1 Changed: 0 Warnings: 0 But is should give this result: Rows Matched: 1 Changed: 1 Warnings: 0 There seems to be no user 'root' in your mysql.user table......
  20. SET `Address_visits` = '++1' change to: SET `Address_visits` = `Address_visits` + 1
  21. i found: http://www.prototypejs.org/ a good way to use/implement AJAX and an example is also given at: http://www.prototypejs.org/learn/introduction-to-ajax
  22. timer issue is simple: http://nl3.php.net/manual/en/function.sleep.php for the validation issue: i'm not playing Wow, because EVE-Online is much cooler......
  23. This will be hard to find out what happened... If you give the code that you tried + the error it gave..... Someone here could give a clue on what went wrong, or give tips on how to make it quicker....
×
×
  • 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.