jskywalker
Members-
Posts
292 -
Joined
-
Last visited
Never
Everything posted by jskywalker
-
Online Tool to See what PHP outputs server side?
jskywalker replied to Novice@PHP's topic in PHP Coding Help
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; " -
question mysql security.... is this function practical, safe enough?
jskywalker replied to mac007's topic in PHP Coding Help
damn, i need coffee, thats for sure..... -
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 ?
-
question mysql security.... is this function practical, safe enough?
jskywalker replied to mac007's topic in PHP Coding Help
and you should NOT do $money = $_GET['money']; just before your query....... @PFMaBiSmAd: you are right about the multiple query's... -
this is a SQL question......... (so wrong place of forum?) SELECT * from blog_addresses WHERE link like '%.blogspot.com%';
-
UTF-8 charset is replacing special chars with boxes?? Please help!
jskywalker replied to alamb's topic in PHP Coding Help
try changing default charset, in stead of default collation. -
question mysql security.... is this function practical, safe enough?
jskywalker replied to mac007's topic in PHP Coding Help
no, because if someone posts something like: $money="'; delete form countries" than it would delete the contents from your countries table....... -
$file = file_get_contents('http://www.facebook.com/favicon.ico'); file_put_contents('some_local_filename.ico', $file);
-
retrieve data from form with some disabled elements
jskywalker replied to RLJ's topic in PHP Coding Help
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); -
I don't understand how this code works - Advice?
jskywalker replied to Novice@PHP's topic in PHP Coding Help
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.....'.. -
I don't understand how this code works - Advice?
jskywalker replied to Novice@PHP's topic in PHP Coding Help
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 ? :'( ;) -
I don't understand how this code works - Advice?
jskywalker replied to Novice@PHP's topic in PHP Coding Help
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); ?> -
oeps, i did mean a 'LEFT JOIN'...... because you want all records from 'locations'
-
retrieve data from form with some disabled elements
jskywalker replied to RLJ's topic in PHP Coding Help
it always send ALL data that you defined in the form, but NEVE the disabled elements... if (isset($_POST['var1])) { $var1 = $_POST['var']; This -
change the 'INNER JOIN' to a 'RIGHT JOIN' see: http://dev.mysql.com/doc/refman/5.1/en/left-join-optimization.html
-
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.....)
-
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....
-
use urldecode: http://nl2.php.net/manual/en/function.urldecode.php
-
go to : http://localhost/test.php?c=Ba%20%26%20t and read about urlencode: http://nl2.php.net/manual/en/function.urlencode.php
-
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......
-
PRIMERY KEY change to: PRIMARY KEY
-
SET `Address_visits` = '++1' change to: SET `Address_visits` = `Address_visits` + 1
-
ajax "add as friend" button. How would i go about this?
jskywalker replied to shortysbest's topic in Javascript Help
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 -
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....