jordanking
Programmer
- Sep 8, 2005
- 351
Hello,
I have a form that accepts user info, evaluates it for errors, and if there are no errors inserts a record into a mysql databse. The page evaluates or targets itself. What I am wondering is... is it possible to pass the contents of the post array, unchanged, to another page after the record insert function based on the value of one of the form fields?
I managed to do it using the url string
i.e:
This code is immediatley after the insert record function.
but there are some values here I don't want the user to be able to see. Can I do something similar to pass the values again as post values, I realise I might be missing something obivous
any help is appreciated
JK
I have a form that accepts user info, evaluates it for errors, and if there are no errors inserts a record into a mysql databse. The page evaluates or targets itself. What I am wondering is... is it possible to pass the contents of the post array, unchanged, to another page after the record insert function based on the value of one of the form fields?
I managed to do it using the url string
i.e:
Code:
if ($_POST['listers'] == 1){
$insertGoTo = "comp_submissions.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
// if the record has been inserted, clear the POST array
$_POST = array();
} else {
$insertGoTo = "colisting.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
$insertGoTo .= "user_id=".$_POST['user_id'];
$insertGoTo .= "&dt_enter=".$_POST['dt_enter'];
$insertGoTo .= "&dt_service=".$_POST['dt_service'];
$insertGoTo .= "&service_id=".$_POST['service_id'];
$insertGoTo .= "&address=".$_POST['address'];
$insertGoTo .= "&quadrant=".$_POST['quadrant'];
$insertGoTo .= "&city=".$_POST['city'];
$insertGoTo .= "&vendor=".$_POST['vendor'];
$insertGoTo .= "&zone=".$_POST['zone'];
$insertGoTo .= "&listers=".$_POST['listers'];
$insertGoTo .= "&signs=".$_POST['signs'];
$insertGoTo .= "&co_listing=".$_POST['co_listing'];
$insertGoTo .= "&co_value=".$_POST['co_value'];
$insertGoTo .= "&status=".$_POST['status'];
$insertGoTo .= "&instructions=".$_POST['instructions'];
$insertGoTo .= "&hanger1=".'';
$insertGoTo .= "&hanger2=".'';
$insertGoTo .= "&hanger3=".'';
$insertGoTo .= "&topper=".'';
$insertGoTo .= "&amount=".$_POST['amount'];
$insertGoTo .= "&price=".$_POST['price'];
}
header(sprintf("Location: %s", $insertGoTo));
}
This code is immediatley after the insert record function.
but there are some values here I don't want the user to be able to see. Can I do something similar to pass the values again as post values, I realise I might be missing something obivous
any help is appreciated
JK