Forums
This topic is locked
insert record problem
Posted 17 Dec 2007 22:04:21
1
has voted
17 Dec 2007 22:04:21 Roger Angus posted:
Right now I have a results page using <?php echo $row_rsDownload['MP3_ZIP']; ?> to display a link to a file for download. The file location is in a mysql table called FILE_LOCATIONS. This works fine.What I need to do is to be able to track who is downloading which files. To do this I've created a form with an insert record behavior which also works fine. I'm using DW CS3.
The problem I'm having is getting the 'after inserting, go to' to point to the file for download. I'm using the insert record dialog, clicking on 'after inserting, go to' browse button, then selecting 'data sources' and the recordset entry ... the same one I've been using to display the link at the top of this post: <?php echo $row_rsDownload['MP3_ZIP']; ?>
This doesn't work. This is the code DW generated:
$insertGoTo = "" . $row_rsDownload['MP3_ZIP'] . "";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
Any help is appreciated, I'm completely stumped!