Hi Guys, Can any one help me. After inserting a value form a textbox to mysql db. the value remains (not sure how) but when I refresh the page (with the text box being empty now) it keeps entering the value provided at the start.
Could be a cache thing with the browser or a setting ... You could write a small Javascript reset function to clear the front end or as 77726812Lancevjm said you could do conditional logic if you are echoing out the values into the fields ... Are you outputting to the fields? If not then its most likely a browser setting ... What browser are you using? PHP by nature runs in the background and runs from top to bottom once as the page loads, so usually cahce-ing isn't too much of an issue with PHP ... Let's see your code?
Side note for those who use chrome a lot as a dev environment, the auto-fill feature can help you breeze though forms, can even save different auto-fill profiles / values ... A good browser, firefox is also up there but sadly no auto-fill feature built into it ...
<html><title>Manage Courses</title><head></head><?phpinclude';config.php';;$course=" ";if(isset($_POST[';submit';])){$course=$_POST[';course';];$course=htmlspecialchars($course);$SQL=mysql_query("INSERT INTO course(cname) VALUES(';$course';)");echo"course ".$course." added succesfully";}else{echo"enter new course";}?><body><FORM NAME ="form1" METHOD ="POST" ACTION ="course_man.php">
Course Name:<INPUT TYPE =';TEXT'; Name =';course'; value =" " size =';25';><P><INPUT TYPE ="Submit" Name ="submit" VALUE ="Save"></P></FORM></body></html>
Hi Guys, Thanks for your efforts I've managed to find solution to this issue. The problem was that the cache memory wasn't cleared after the "submit" button.
So now I am refreshing the page after every "submit" event with the simple