Search the Community
Showing results for tags 'refresh'.
-
Hi, I am building a website using PHP. By default the SESSION is kept active for 24(1440 seconds) minutes of inactivity. What i want is to refresh the SESSION as soon as the user interacts with the website (movement of the mouse, click on links inside the website, etc.) The way i am trying to refresh the session is by calling PHP script named refreshSession.php with AJAX as follow: $.ajax({ cache: false, type: "GET", url: "refreshSession.php" }); and the PHP script goes as follow: refreshSession.php <?php session_start(); echo 'test'; ?> But the session does not refresh. The only way to refresh the session is to reload the page. What am i doing wrong? Any suggestions? Regards, Christos
-
I have multiple divisions on my page.. what happens is by having next and previous buttons on my page i can browse thru the divisions... now i have save and delete on each page, i enter some values in the textboxes of the respective divs and they get saved or deleted.. i want to refresh those textboxes after saving or deleting, as the textboxes retrieve the values from database and show as their values.. now i don't want to refresh the page as i would have to start again from the first div even i was on lets say 55th div... is there a way that the textbox values can be refresh on lets say a refresh button or the whole division gets refreshed... all i want is the textboxes to be updated to the recent value without the whole page being refreshed... any help would be welcome..
- 1 reply
-
- div
- buttonclick
-
(and 3 more)
Tagged with:
-
Hello everybody, I'm working on a script which has 2 div tages controled by 2 radio buttons and using jquery to hide/show the div tags based on the users selection. Like to have.. if a user selects one of the radio button i like to maintain the selection radio button and the div tag if the page is refreshed. Problem: if the user selects the second div tag and if the page refreshes the radio button and the div tag returns to the initial setup which is going back to the first radio button and div tag. how do i maintain the selection, radio button and the div tage after a refresh? <script type='text/javascript'> $(document).ready(function() { $("#DivB").hide(); $('input[name="myproject"]').change(function() { if($(this).val() == "A") { $("#DivA").show(); $("#DivB").hide(); } else { $("#DivA").hide(); $("#DivB").show(); } }); }); </script> <div style ="border:1px solid black;"> <form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='POST'> <div id="div1"> <input type='radio' name='myproject' value='A' checked="checked" <?php echo (isset($_POST['myproject']) && $_POST['myproject'] == 'A') ? 'checked':''; ?> />Have projectID <input type='radio' name='myproject' value='B' <?php echo (isset($_POST['myproject']) && $_POST['myproject'] == 'B') ? 'checked':''; ?> />Lost projectID<br /> </div> <hr /> <div id='DivA'> projectID:<br /> <input type="text" name="proId"><br /> email: <br /> <input type="text" name="email"><br /><br /> <button name="btn_prj_info">View project status</button> <br /> </div> <div id='DivB'> Email: <br /> <input type="text" name="emailR"><br /><br /> <button name="btn_email">Email information</button> <br /> </div> </form> </div>
-
Hi, I'm trying to make it so when the whomever enters invalid information into the form, it'll return the error WHICH IT DOES but it also refreshes the page. Now this is a problem for me because the register form is slides down but only when the user presses the 'Register' button. Help will be much appreciated Problem: The pages refreshes when user submits the form and the form returns an error. How it should work: When an error occurs, the page doesn't refresh and should stay where it is and just return an error. The Register Script: <div id="register-container"> <div id="register-wrapper"> <form action="" method="post" name="register_form" id="register_form"> <table border="0" id="table-register"> <th colspan="2"> <h1 class="frm-header-style">Register</h1> <?php if( !(isset( $_POST['register'] ) ) ) { ?> <?php } else { $usr = new Users; $usr->storeFormValues( $_POST ); $errorMessage = ""; $error = false; $username = $_POST['username']; $email = $_POST['email']; $password = $_POST['password']; $cpassword = $_POST['cpassword']; if( strlen($username) < 6 ) { $errorMessage .= "<li class='error'>Username must be more than 6 characters long.</li>"; $error = true; } elseif( strlen($email) < 5 ) { $errorMessage .= "<li class='error'>Email is too short.</li>"; $error = true; } elseif( strlen($password) < 5 ) { $errorMessage .= "<li class='error'>Password must be more than 5 characters long.</li>"; $error = true; } elseif( $password != $cpassword ) { $errorMessage .= "<li class='error'>Password and Confirm password not match.</li>"; $error = true; } elseif(!preg_match('/^[a-zA-Z0-9]{5,}$/', $username)) { $errorMessage .= "<li class='error'>Username can only contain letters & numbers.</li>"; $error = true; } elseif(!preg_match('/^[_A-z0-9-]+((\.|\+)[_A-z0-9-]+)*@[A-z0-9-]+(\.[A-z0-9-]+)*(\.[A-z]{2,4})$/', $email)) { $errorMessage .= "<li class='error'>Email is invalid.</li>"; $error = true; } else { echo $usr->register( $_POST ); $error = false; } if($error) { echo($errorMessage); } } ?> </th> <tr> <td> <p class="frm-text-style">Username:</p> </td> <td> <input type="text" name="username" id="username" class="frm-style" required/> </td> </tr> <tr> <td> <p class="frm-text-style">Email:</p> </td> <td> <input type="text" name="email" id="email" class="frm-style" required/> </td> </tr> <tr> <td> <p class="frm-text-style">Password:</p> </td> <td> <input type="password" name="password" id="password" class="frm-style" required/> </td> </tr> <tr> <td> <p class="frm-text-style">Retype Password:</p> </td> <td> <input type="password" name="cpassword" id="cpassword" class="frm-style" required/> </td> </tr> <tr> <th colspan="2"> <input class="frm-submit-register" name="register" type="submit" value="Submit" /> <input class="frm-submit-close" name="close" id="close-register" type="button" value="Close" /> <th> </tr> </table> </form> </div> </div>
-
Hi guys and girls, I have a div on my page that I would like to refresh once every min. Is this possible with PHP, or should I use something like jquery? Any suggestions would be of much help. Thank you.
-
I have made a html form and use the post method to redirect in the same page. 1) Now the problem is every time someone adds something and press refresh the vales are inserted again. cna there be any method by which it is not inserted again the code <?php if(isset($_POST['add_skills'],$_POST['skills']) && !empty($_POST['add_skills'])) { $row=$_POST['add_skills']; $edit=mysql_query("some insert query") or die("unable to insert"); if($edit) { echo "OK"; unset($_POST['add_skills'],$_POST['skills']); } } ?> <body> <form name="form1" action="<?php $_SERVER['PHP_SELF']; ?>" method="post" > <div align="center"> <div align="left"> <div align="left"><p>Add Skill</p></div> <div><input type="text" id="add_skills" name="add_skills" placeholder="Add Skill" /></div> </div> <div align="left"> <div></div> <div><input type="submit" name="skills" name="skills" value="Add" /></div> </div> </div> </form>