Archive

Archive for October, 2008

jquery Dreamwaver Api

October 31st, 2008 karlosp No comments
Categories: Malo mešano Tags:

PHP date compare

October 26th, 2008 karlosp No comments
PHP:
  1. $exp_date = "2006-01-16";
  2. $todays_date = date("Y-m-d");
  3. $today = strtotime($todays_date);
  4. $expiration_date = strtotime($exp_date);
  5. if ($expiration_date> $today)
  6. { $valid = "yes";
  7. }
  8. else { $valid = "no"; }

Categories: php_mysql Tags:

php curl 2 & http build query

October 24th, 2008 karlosp No comments

http_build_query

PHP:
  1. //extract data from the post
  2. extract($_POST);
  3.  
  4. //set POST variables
  5. $url = 'http://domain.com/get-post.php';
  6. $fields = array(
  7.                         'lname'=>urlencode($last_name),
  8.                         'fname'=>urlencode($first_name),
  9.                         'title'=>urlencode($title),
  10.                         'company'=>urlencode($institution),
  11.                         'age'=>urlencode($age),
  12.                         'email'=>urlencode($email),
  13.                         'phone'=>urlencode($phone)
  14.                 );
  15.  
  16. //url-ify the data for the POST
  17. foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
  18. rtrim($fields_string,'&');
  19.  
  20. //open connection
  21. $ch = curl_init();
  22.  
  23. //set the url, number of POST vars, POST data
  24. curl_setopt($ch,CURLOPT_URL,$url);
  25. curl_setopt($ch,CURLOPT_POST,count($fields));
  26. curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
  27.  
  28. //execute post
  29. $result = curl_exec($ch);
  30.  
  31. //close connection
  32. curl_close($ch);

Categories: php_mysql Tags:

useful jquery utilities

October 20th, 2008 karlosp No comments

http://devkick.com/blog/useful-jquery-a-compilation-of-jquery-utilities/

Categories: Malo mešano Tags:

Convert MySQL date to UNIX timestamp

October 20th, 2008 karlosp No comments
PHP:
  1. <?php
  2. // from MySQL to UNIX timestamp
  3. function convert_datetime($str)
  4. {
  5.  
  6. list($date, $time) = explode(' ', $str);
  7. list($year, $month, $day) = explode('-', $date);
  8. list($hour, $minute, $second) = explode(':', $time);
  9.  
  10. $timestamp = mktime($hour, $minute, $second, $month, $day, $year);
  11.  
  12. return $timestamp;
  13. }
  14. ?>

Categories: php_mysql Tags:

“Free” Programing Books

October 7th, 2008 karlosp No comments

http://www.ebooksboard.com

Categories: Malo mešano Tags:

Protected: MS Office 2007 Enterprise

October 4th, 2008 karlosp Enter your password to view comments.

This post is password protected. To view it please enter your password below:


Categories: Pesmica Tags:
101910 pages viewed, 156 today
53342 visits, 92 today
FireStats icon Powered by FireStats