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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-23-2004, 12:46 AM   #1
galleryseek
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);
}
galleryseek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2004, 01:09 AM   #2
jwerd
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

Last edited by jwerd; 02-23-2004 at 01:12 AM..
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-23-2004, 01:12 AM   #3
jwerd
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 hope that helps

CHEERS
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com

Last edited by jwerd; 02-23-2004 at 01:15 AM..
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.