I am using a product called CodeCharge Studio with RBase. I know nothing about php coding, but CCS does most of the coding.
I have created a convention registration form based on a single data table. The primary key is web_transid. After the data is submitted (this works okay) the user is referred to a new page to confirm the items.
In order for this to work correctly, it needs to retrieve the data associated with the web_transid field.
At present, it simply picks up the first record in the table.
CCS has “Events” associated with pages and/or forms; you can Add Actions or Add Code (custom). One of the Events is “After Insert” which is supposed to capture and advance the data to the referrenced page.
Here is the CCS explanation of the After Insert function:
“The record form’s After Insert event is used to retrieve the last inserted key (order_id) after the order record is created. The retrieved value is then sent over the URL by appending it to the ‘redirect’ variable as a URL parameter.”
Here is the code I wrote, following an example:
//web_ac_prereg_AfterInsert @4-37EEC5D8
function web_ac_prereg_AfterInsert()
{
$web_ac_prereg_AfterInsert = true;
//End web_ac_prereg_AfterInsert
//Custom Code @91-91E09946
// ————————-
global $web_ac_prereg;
global $DBweb_chea;
global $Redirect;
if(!CCGetFromGet(“web_transid”, 0)) {
$LastID = $web_ac_prereg->web_transid->GetValue();
if (strpos($Redirect,”?”) == false ) {
$Redirect = $Redirect.”?NewTrans=Yes&web_transid=”.$LastID;
} else if (substr($Redirect,-1) == “?” ) {
$Redirect = $Redirect.”NewTrans=Yes&web_transid=”.$LastID;
} else {
$Redirect = $Redirect.”&NewTrans=Yes&web_transid=”.$LastID;
}
}
// ————————-
//End Custom Code
The database name is “web_chea”
The table is “web_ac_prereg”
The PK is “web_transid”
I have assigned no variables
This does not work and I am stuck.