Re: Double entry into MySQL..

From: Date: Wed, 08 Jan 2003 04:07:04 +0000
Subject: Re: Double entry into MySQL..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-130692@lists.php.net to get a copy of this message
Another strange behaviour... When I send the name of the file to be downloaded to this script, it works (still makes a double entry into MySQL though) with GET method but it doesn't work if the file's name is sent with the POST method. Why? I am pulling my hair out here!!! Please help... Thanks again "Altug Sahin" <altug@bonsai-apart.com> wrote in message news:20030107000217.7493.qmail@pb1.pair.com... > Hi here, > > I am sending a file to user's browser and logging the downloaded file into > MySQL but everytime this script works, I see double entry in the MySQL > table... Why is this happening? > > Any ideas? > > Thanks > > <? > $today = date("Y-m-d"); > > $conn = db_connect(); > > if(!$conn) > echo "Can't connect to database..."; > > $query = "INSERT INTO track_dl (dldate, email, file) > VALUES ('$today', 'user@email.com', 'file.ext')"; > > $result = mysql_query($query); > > if(!$result) > echo "Can't execute query: " . mysql_error(); > > header("Content-type: application/pdf"); > readfile("file.pdf"); > exit(); > ?> > >

« previous php.general (#130692) next »