/    Sign up×
Community /Pin to ProfileBookmark

Capturing a field value

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.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@dptrouttauthorMar 31.2005 — When I run the page in a browser, I get this error message upon submission.

"Fatal error: Call to a member function GetValue() on a non-object in C:Program FilesApache GroupApache2htdocsACPreg_events.php on line 22"
Copy linkTweet thisAlerts:
@ShrineDesignsMar 31.2005 — the function GetValue() doesn't exist within the class
Copy linkTweet thisAlerts:
@dptrouttauthorApr 01.2005 — the function GetValue() doesn't exist within the class[/QUOTE]
Thank you for your response.

However, as I am essentially php illiterate, can you explain? What "class."

Also, do you see anything that looks amiss in the After Insert code that I included in my OP?

Thanks.
Copy linkTweet thisAlerts:
@ShrineDesignsApr 01.2005 — a class is an object, an object is a class

http://www.php.net/manual/en/
×

Success!

Help @dptroutt spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...