![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 8,234
|
PHP Question.. clearing variables...
say for example you're submitting a form to the page it is on (php_self).. and say you hit the refresh button after submitting that form... all those variables are re-submitted which causes for duplication... how do you avoid that so that you can clear those variables out?
i thought unset($variable) would work, but it doesn't. the code looks like: if (isset($comment)) { $date = time(); $sqlquery6 = "INSERT INTO bgcomments VALUES ('id','$_SESSION[username]','$uid','$comment','$date')"; $resultse = mysql_query($sqlquery6); unset($comment); } |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
if (isset($_POST['comment']))
{ $date = time(); $r = mysql_query("INSERT INTO bgcomments VALUES ('id','$_SESSION[username]','$uid','$comment','$date')"); unset($comment); }
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
I don't quite understand what you're doing. What I would do, however, is work on the syntax a bit more.
maybe even add if($_SERVER['REQUEST_METHOD'] hahahaha post) { // code inside } that tells the script to only parse if the type is POST, meaning from a form of some sort ![]() CHEERS
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
![]() |
![]() ![]() ![]() ![]() ![]() |