Sorry - because I've used index.php as the file names with the folders showing in the URL, the page I attached is itinerary_add_images/index.php, which redirects to itinerary_added/index.php.
Basically what I would like to happen on the page I attached is for the code:
<?php
/********************
*
*insert Lodge Activities into the LodgeActivities table
*
********************/
//sql insert string
$sql = "INSERT INTO ItineraryActivities (ItineraryID, ActivityID) VALUES ";
$ck = $_GET['ckbox'];
//loops though the profiles adding the insert string each profile row
foreach ($ck As $GetIndex => $GetValue){
if ($GetValue=='on'){
$sql .= "('{$_GET['ItineraryID']}', '$GetIndex'), ";
}
}
//trims the end ,
$sql = rtrim($sql," ,") ;
//inserts data
mysql_select_db($database_connSafari, $connSafari); mysql_query($sql); echo mysql_error();
?>
To only execute when it is first loaded, and not execute a second time when the form is submitted. If that can be achieved using an IF statement that would be great, although I'll need a hand with the syntax for that.