Jump to content

zohab

Members
  • Posts

    223
  • Joined

  • Last visited

Everything posted by zohab

  1. Hi, I heard that when we use truncate command to delete records from table then we can recover deleted data. AND When we delete data using delete command deleted records can not be recovered. How can we recover truncated data? my details mysql 5.0 php 5.2 xampp server windows xp
  2. Hi, In my project user has facility to upload images. There is no validation or condition on image size. i need script to resize user image to most suitable size automatically.
  3. Hi, Option B is correct. [email protected] =>valid [email protected] =>invalid I do not want to send email to user and tell them click on link to verify email. My script will verify email exists or not. if exists then send email else drop sending email. This is for marketing campaign purpose
  4. Hi, I have list of 6000 emails. Many of these emails are invalid (emails does not exists) Anyone has script to remove these invalid emails from list.
  5. Hi, When user visit my site index page i want to detect and store country name into my database. example user1 type http://www.example.com in Denmark then insert into tablename (id,countryname) values('id','countryname') insert into tablename (id,countryname) values('1','Denmark ') user2 type http://www.example.com in USA then insert into tablename (id,countryname) values('2','USA ') user3 type http://www.example.com in India then insert into tablename (id,countryname) values('3','India ') any idea?
  6. Hi, I have developed a plain php website and it is running good. My one joomla site was hacked and i am afraid of my plain php site. I would like to know what security mechanism should i implement to prevent site from hackers.
  7. Great work thanks
  8. Hi, Following not working echo standard_date('24.08.2009', 'd.m.y'); echo standard_date('24/08/2009', 'd/m/y'); i am getting Fatal error: Wrong date format supplied to standard_date()
  9. Hi, The people who develop php framework take care of security so we don't have to spend more time implementing security it is build in.
  10. OKay I got the format from user examples input=>m-d-Y input=>08-24-2009 required output=>2009-08-24 input=>Y/m/d input=>2009/08/24 required output=>2009-08-24 input=>d.m.Y input=>24-08-2009 required output=>2009-08-24 any solution
  11. Hi OKay First I will check wheather we can get user entered date format and then convert date to required format
  12. Hi User do not specify format we have to detect format and then convert
  13. HI guys echo ConvertDate('12/23/2006'); =>2006-12-/2 echo ConvertDate('2009/08/24'); =>8/24-20-09 not getting required result
  14. Hi, In my project user enter date in following format and i want to convert it into yyyy-mm-dd format '[b]Y-m-d' => '2006-12-23',[/b] 'm-d-Y' => '12-23-2006', 'd-m-Y' => '23-12-2006', 'Y/m/d' => '2006/12/23', 'm/d/Y' => '12/23/2006', 'd/m/Y' => '23/12/2006', 'Y.m.d' => '2006.12.23', 'd.m.Y' => '23.12.2006', 'm.d.Y' => '12.23.2006', examples input=>24/08/2009 output=>2009-08-24 input=>08.24.2009 output=>2009-08-24 input=>24-08-2009 output=>2009-08-24 any function to perform above task
  15. Framework provide more security than plane php code
  16. hi I have seen in many sites for example (image/icon)http://www.google.com (image/icon)http://www.phpfreaks.com/forums How to get this on mysite What changes i need to do?
  17. hi I am getting following error when i execute trigger ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) any idea? thanks in advance.
  18. hi How to check mysql table column has unique or primary key index or not? (in php)
  19. hi, I want to write content to word document. How to do it? thanks in advance.
  20. thanks Problem is solved
  21. hi I need regular expression for other array keys than yyyy-mm-dd function is_date($date,$format) { $date_formats=array ( 'yyyy-mm-dd' => '/[0-9]{4}-[0-9]{2}-[0-9]{2}/', 'mm-dd-yyyy' => '?', 'dd-mm-yyyy' => '?', 'yyyy/mm/dd' => '?', 'mm/dd/yyyy' => '?', 'dd/mm/yyyy' => '?', 'yyyy.mm.dd' => '?', 'dd.mm.yyyy' => '?', 'mm.dd.yyyy' => '?', ); if (!array_key_exists($format, $date_formats)) return false; // not a valid format return preg_match($date_formats[$format], $date); } aby idea?
  22. Hi , I have following dates and date format. 'Y-m-d' => '2009-07-16', 'm-d-Y' => '07-16-2009', 'd-m-Y' => '16-07-2009', 'Y/m/d' => '2009/07/16', 'm/d/Y' => '07/16/2009', 'd/m/Y' => '16/07/2009', 'Y.m.d' => '2009.07.16', 'd.m.Y' => '16.07.2009', 'm.d.Y' => '07.16.2009', I have following function which checks date against date format. function is_date($value, $format){ if(strlen($value) == 10 && strlen($format) == 10){ // find separator. Remove all other characters from $format $separator_only = str_replace(array('m','d','y'),'', $format); $separator = $separator_only[0]; // separator is first character if($separator && strlen($separator_only) == 2){ // make regex $regexp = str_replace('mm', '[0-1][0-9]', $value); $regexp = str_replace('dd', '[0-3][0-9]', $value); $regexp = str_replace('yyyy', '[0-9]{4}', $value); $regexp = str_replace($separator, "\\" . $separator, $value); if($regexp != $value && preg_match('/'.$regexp.'/', $value)){ // check date $day = substr($value,strpos($format, 'd'),2); $month = substr($value,strpos($format, 'm'),2); $year = substr($value,strpos($format, 'y'),4); if(@checkdate($month, $day, $year)) return true; } } } return false; } When i am using it as follow ,it is not giving result. if(!is_date("dd/mm/yy","2009-07-16"){ echo"errorxyz"; } if(!is_date("dd/mm/yy","07-16-2009"){ echo"errorxyz"; } if(!is_date("dd/mm/yy","2009.07.16"){ echo"errorxyz"; } if(!is_date("dd/mm/yy","16/07/2009"){ echo"errorxyz"; } any idea? PHP:5.2.6 MYSQL:5.0.51b
  23. Hi, I want to implement spell check implementation in text area. How can i do it? any idea? I have "Comments" textarea on my site. When user enter comments and he/she do the spelling mistake then spelling mistake should be check.
  24. hi , I have string as name1,value1,name2,value2,name3,value3,name4,value4. I wrote following code but does not produce required result. $array=array(); $string="name1,value1,name2,value2,name3,value3,name4,value4"; $explode=explode(",",$string); for($i=0;$i<count($explode);$i++) { $array[$string[$i]]=$array[$string[$i+1]]; } echo"<pre>"; print_r($array); echo "<pre>"; I need following required result. Array ( [name1] => value1 [name2] => value2 [name3] => value3 [name4] => value4 )
  25. I have array name "firstquarter" , i want to push key=>value(3=>'March') in an array. How can i implement it. Any idea? <?php $firstquarter = array(1 => 'January', 2=>'February',4=>'April');//3=>'March' print_r($firstquarter); ?> Array ( [1] => January [2] => February [4] => April ) I want array like Array ( [1] => January [2] => February [3] => March [4] => April ) array_push function will push value in an array not key.
×
×
  • 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.