Pure PHP - JavaScript / Ajax https://www.pure-php.de/taxonomy/term/2/0 en PHP Style Cookie and Get Parameters in JavaScript https://www.pure-php.de/node/30 <p>For lazy phpers, with this function you can read cookies and get parameters in javascript in php style.<br /> (I use php tags to highlight the code)<br /> Example<br /> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000CC">&lt;?php<br />populateRequest</span><span style="color: #006600">();<br />if(&nbsp;</span><span style="color: #0000CC">$_COOKIE</span><span style="color: #006600">[</span><span style="color: #CC0000">'sid'</span><span style="color: #006600">]&nbsp;)&nbsp;{<br /></span><span style="color: #FF9900">//&nbsp;do&nbsp;something<br /></span><span style="color: #006600">}<br />if(&nbsp;</span><span style="color: #0000CC">$_GET</span><span style="color: #006600">[</span><span style="color: #CC0000">'cmd'</span><span style="color: #006600">]&nbsp;==&nbsp;</span><span style="color: #CC0000">'login'&nbsp;</span><span style="color: #006600">)&nbsp;{<br /></span><span style="color: #FF9900">//&nbsp;do&nbsp;something<br /></span><span style="color: #006600">}<br /></span><span style="color: #0000CC">?&gt;</span> </span> </code></div></p> <p><a href="https://www.pure-php.de/node/30">read more</a></p> https://www.pure-php.de/node/30#comment JavaScript / Ajax Thu, 23 Feb 2006 09:56:08 +0100 pure-php 30 at https://www.pure-php.de The easist way to avoid double clicks in submit buttons https://www.pure-php.de/node/27 <p>Most of the sites have this problem, for example, when user want to create an account. The fill in the registration from, and submit the form. If the site is too slow at that moment. they would click again, and you have double entries.</p> <p>With this JavaScript class, you deactivate this. Just put that and end of your site.<br /> <code><br /> function ClickObServer(){<br /> this.deactivateDoubleClicks = function() {<br /> this.checkClicks(document.getElementsByTagName("a"));<br /> this.checkClicks(document.getElementsByTagName("input"));<br /> }<br /> this.checkClicks = function ( el ){<br /> for (var i = 0; i &lt; el.length; i++) {</p> <p><a href="https://www.pure-php.de/node/27">read more</a></p> https://www.pure-php.de/node/27#comment JavaScript / Ajax Fri, 25 Nov 2005 21:30:00 +0100 pure-php 27 at https://www.pure-php.de
Datenschutz | Impressum