Posts

validate email with password in php -

i'm involved in product development, user register company. once becomes user of our product, need send announcements,newsletters etc. users on behalf company. for purpose company email , password, need validate email valid , he's given correct password email id or not. i'am thinking 2 methods validate email , password, send test mail smtp authetication try open inbox. i feel first 1 better later. because if user given wrong passwords, there chances considered attack. any 1 can tell me there better way validate given email password. answers appreciated, thanks! just connect imap_open() , test if connection successful. $resource = sprintf("{%s:%s/imap/ssl/novalidate-cert/notls/norsh}inbox","imap.host",993); $imap = imap_open($resource, "user", "password", op_readonly, 1); if($imap) echo "it works";

android - How to keep fragments in memory on orientation change -

i'm creating tablet optimised application using fragments. have thin navigation fragment down left hand side buttons controls fragments loaded 2 viewgroup containers take rest of screen. for example, if button in navigation fragment pressed, 1st container loaded item list fragment (eg settings, customers etc) , second container loaded fragment show item details. since want retain fragments in memory (so, when navigating settings customers , settings, previous settings fragments should there user doesn't lose to) - have created fragments instance variables activity settingslistfragment settingslistfragment; settingsdetailfragment settingsdetailfragment; customerlistfragment customerlistfragment; customerdetailfragment customerdetailfragment; i create these fragments when neccessary , replace containers fragments needed. eg. fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); if(settin...

javascript - Loading CSS and JS files from another domain and serving resources from consistent URL -

i have website grown large , built on super-restrictive platform (sbi). there have follow file structure , put in appropriate folder , upload each , every file through interface manually. have cool html5 template , javascript lot of little files , images way easier upload stuff other domain hosted hostgator using filezilla , refer css , js files sbi site location @ hostgator's domain. are there potential issues method? the reason asking because yesterday came across google's article on serving resourcing consistent url: https://developers.google.com/speed/docs/best-practices/payload#duplicate_resources however, might misunderstanding means. when put actual url test @ google's page speed insights here https://developers.google.com/speed/pagespeed/insights advises me serve resources consistent url, in details doesn't complain css , js files, complains facebook only, this: suggestions page: following resources have identical contents, served different urls. ser...

java - Methods using private members or public accessors -

i realize cannot answered , i'm looking whether there sort of guidance whether use private members directly or public accessors inside class methods. for example, consider following code (in java, similar in c++): public class matrix { // private members private int[][] e; private int numrows; private int numcols; // accessors public int rows(){ return this.numrows; } public int cols(){ return this.numcols; } // class methods // ... public void printdimensions() { // [a] using private members system.out.format("matrix[%d*%d]\n", this.numrows, this.numcols); // [b] using accessors system.out.format("matrix[%d*%d]\n", this.rows(), this.cols()); } the printdimensions() function illustrates 2 ways same information, [a] using private members ( this.numrows, this.numcols ) or [b] via accessors ( this.rows(), this.cols() ). on 1 hand, may prefer using accessors since there...

php - Does ORDER BY apply before or after DISTINCT? -

in mysql query, when using distinct option, order by apply after duplicates removed? if not, there way make so? think it's causing issues code. edit : here's more information what's causing problem. understand that, @ first glance, order not important, since dealing duplicate rows. however, not entirely case, since using inner join sort rows. say have table of forum threads, containing data: +----+--------+-------------+ | id | userid | title | +----+--------+-------------+ | 1 | 1 | information | | 2 | 1 | faq | | 3 | 2 | support | +----+--------+-------------+ i have set of posts in table this: +----+----------+--------+---------+ | id | threadid | userid | content | +----+----------+--------+---------+ | 1 | 1 | 1 | lorem | | 2 | 1 | 2 | ipsum | | 3 | 2 | 2 | test | | 4 | 3 | 1 | foo | | 5 | 2 | 3 | bar | | 6 | 3 | 5 | bob ...

php - Adding anchor tag to javascript URL -

i have php system , use popup lay processing, ie upload image. no problems here , on completing insert , upload go page call underlying page , refresh it: $callpage="jobsheet_build.php?id=".$_get['id']; echo("<script language=\"javascript\">"); echo("top.location.href = \" ").$callpage.("\";"); echo("</script>"); ok works fine, in ideal world put reference #images in $callpage end with $callpage="jobsheet_build.php?id=".$_get['id']."#images"; but javascript hangs no matter do. any ideas appreciated! @jim have tried set anchor tag echo("top.location.href = \" ").$callpage.("#images\";"); instead of set anchor tag inside variable ?

how to get number of commit each day from xml subversion log file with javascript, php, shell script? -

having xml subversion commits log: <?xml version="1.0"?> <log> <logentry revision="2"> <author>20070299</author> <date>2012-06-06t05:23:21.999470z</date> <msg>add part</msg> </logentry> <logentry revision="1"> <author>20070299</author> <date>2012-05-22t08:35:55.663875z</date> <msg></msg> </logentry> </log> and want result array grouped date , numbers of commit each day on site php-javascript. similar one: date[0]=2012-05-22 value[0]=1 date[1]=2012-05-23 value[1]=0 ... date[15]=2012-06-06 value[15]=1 is there solution it? i consulted link but don't work, non result non error log (apache, php), , don't know how send $number[] php code javascript code you can play xpath : $ xmllint --shell foo.xml / > cat //log/*[@revision]/@revision ------- revision="2" ------- revision="1" / ...