Skip to main content

Posts

Search Records into XML Using PHP

There is an example for search items or block into xml using php with simplexml_load_string method or function, this will return you record block for particular query. query = us CODE: 1 :   <?php 2 :        # parm query=delhi , us 3 :        $xmlStr = '<?xml version="1.0" encoding="utf-8"?> 4 :                            <temprature> 5 :                            <item> 6 :                                 <city>Bareilly</city> 7 :                                 <state>Uttar Pradesh</state> 8 :                                 <country>India</country> 9 :                                 <lat>32.4567</lat> 10 :                                 <lon>34.4567</lon> 11 :                                 <temp>43.0</temp> 12 :                            </item> 13 :                            <item> 14 :                                 <city>Haldwani</city&

Center Alignment of popup window Javascript

How to centralized popup window using Javascript. see the below code. CODE: 1 :   var OpenWindows = new Object(); 2 :   function OpenWin(sPath, w, h) 3 :   { 4 :        l = (screen.width - w)/2-5; 5 :        t = (screen.height - h)/2-20; 6 :        if (l<1) l=0; 7 :        if (t<1) t=0; 8 :        sWindowName = "mainwin_" + w + "_" + h; 9 :        if(OpenWindows[sWindowName]) { 10 :             if(!OpenWindows[sWindowName].closed) OpenWindows[sWindowName].close(); 11 :        } 12 :        OpenWindows[sWindowName] = window.open(sPath, sWindowName, "left=" + l + ",top=" + t + ",width=" + w + ",height=" + h + ",scrollbars=no,menubar=no,toolbars=no,status=no"); 13 :        return OpenWindows[sWindowName]; 14 :   }

How To Change Form Action at Runtime

How to change Form action at runtime using javascript. This the example which will change html form action at runtime. CODE: 1 :   <html> 2 :   <head> 3 :   <Script Language="javascript"> 4 :   function change_action(){ 5 :   var frm_obj=document.getElementById("frm"); 6 :   frm_obj.action="http://www.google.com"; 7 :   } 8 :   </Script> 9 :   </head> 10 :   <body> 11 :   <form id="frm" action="abc.php" method="post" onsubmit="return change_action()"> 12 :   UID &nbsp;&nbsp;<input type="text"><br> 13 :   PWD <input type="Password"><br><br> 14 :   <input type="submit" value="submit"> 15 :   </form> 16 :   </body> 17 :   </html>

Change Div Position Randomly on Home Page

Change Div position randomly on home page.here is simple example which display a div randomly on homepage within available width and hight. CODE: 1 :   <Script Langauge="javscript"> 2 :   var load=true; 3 :   var div_width=300; 4 :   var div_height=200; 5 :   var top=Math.floor(Math.random()*screen.availHeight - div_height) 6 :   var left=Math.floor(Math.random()*screen.availWidth - div_width) 7 :   document.write("<div id='pic_div' style='border:1px solid black;position:absolute;width:"+div_width+";height:"+div_height+"; 8 :   text-align:center;left:0px;top:0px'>a</div>"); 9 :   var d_obj=document.getElementById("pic_div"); 10 :   d_obj.style.top=top; 11 :   d_obj.style.left=left; 12 :   </script>

Free Online Meta Tag Creator

Meta Tags are HTML header part tags, which describe about the website . These meta tags provide information to the search engines such as Google, Yahoo, MSN Search, AOL Search, AltaVista ,HotBot, Lycos, Excite and other search engines . It is very important to the search engine point of view meta tags must be well formed and meaningful . HTML Meta tags help to increase your website rank. The common questions arise for meta tags are as follows? What Are META Tags? META Tags are HTML header part tags of HTML Document that provide internal & external information about the content of a web page or website while you are browsing that page you are not able to see that Meta tags on your browser output. How META Tags Work for Search Engine? Meta tag tell to search about the page such as keywords, Description, Content Language etc, which parameter you put in contents attribute of the meta tags that's is read by search engine to index your page with accuracy, which is totally depend to

Use FilterFunction in Flex ArrayCollection

Here is the simple Flex ArrayCollection FilterFunction example to ignore blank records (name) form arrayCollection. var ac=new ArrayCollection(); ac.addItem({name:'abc'}); ac.addItem({name:'xyz'}); ac.addItem({name:''}); ac.addItem({name:'dac'}); // use of fillter function ac.filterFunction = function(item:*):Boolean{ return (StringUtill.trim(item.name)!=""); // } ac.refresh(); Now filtered ArrayCollection object use further code.

Set Script Timeout In PHP

In PHP.ini define a script timeout (max_execution_time) if it's exceed , the script returns a fatal error. The default limit is 30 seconds. to set script max execution time we can use below function. set_time_limit(1000) //1000 seconds OR ini_set("max_execution_time","1000"); //1000 seconds