Skip to main content

Posts

Showing posts from December, 2010

select option in dropbox through javascript

If you want to select an option in your Dropdown box as you select that option from a link. Here is solution...... I have used the code with onclick event you r free to use at any event. Put this into Head section: <script> function setdate(num) { //alert(num); document.f1.approxdate[num].selected=true; } </script> Put this into Body section: <form name="f1" id="f1" > <select name="selSS1" id="approxdate"> <option value="0">ha ha ha</option> <option value="1">hi hi hi</option> <option value="2">hu hu hu</option> <option value="3">he he he</option> <option value="4">ho ho ho</option> </select> <br /><br /> <a href="javascript:void(0);" onclick="javascript:setdate(0)">ha ha ha</a> <br /> <a href="javascript:vo...

"Remember Me" or "Keep Me login" like Facebook

You can make a Remember Me check box using simple cookie function. Create a Cookie to store your Username and Password, this can be done as below : Check the username & password and validate user if it is valid set a cookie for him and pass him inside site. $check = $_POST['setcookie']; // Checks if the remember me check box was ticked , if not checked variable is null.  if($check)    { // Check to see if the 'setcookie' box was ticked to remember the user setcookie("cookemail", $email, $time + 5000); // Sets the cookie username setcookie("cookpassword", $password, $time + 5000); // Sets the cookie password    }   Now let him go inside. Use below code on your page where your log in panel exist.: ***New Code for cookie*** if(isset($_COOKIE['cookemail'])) // If the cookie 'cook' is set, do the following; { $email = $_COOKIE['cookemail']; //echo "Email :".$email; // Select the...