cwp
Posts: 7
|
Posted: 12/08/2011, 6:52 PM |
|
I tried to do some php coding to retrieve contents from a mail server. subsequently, i set values into a form (Record Builder). I would like to auto submit that form.
after I have setValues ($FORM_NAME->TEXTFIELD->SetValue($content);) I would like to trigger the submit button. Could someone tell me how do i trigger the submit button using php?
thank you!
|
|
|
ckroon
Posts: 869
|
Posted: 12/08/2011, 10:02 PM |
|
Are the fields on the record page that a user will be filling in prior to the form being submitted?
_________________
Walter Kempees...you are dearly missed. |
|
|
cwp
Posts: 7
|
Posted: 12/08/2011, 10:08 PM |
|
yes. they are populated with values. But i do not want to click on the "submit" button manually.
I tried to do the following, but it does not seem to trigger the submission of form. How does codecharge submits the form?
$post_data['CLOB_COL'] = "abc";
$post_data['ID'] = 101;
$post_data['PROCESSED'] = 0;
$post_data['Button_Insert'] = "Add";
$post_data['ccsForm'] = "MAIL_STAGING";
//traverse array and prepare data for posting (key1=value1)
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);
//we also need to add a question mark at the beginning of the string
$post_string = '?' . $post_string;
//we are going to need the length of the data string
$data_length = strlen($post_string);
//let's open the connection
$connection = fsockopen('www.mydomain.com', 80);
//sending the data
fputs($connection, "POST /page_two.php?ccsForm=MAIL_STAGING HTTP/1.1\r\n");
fputs($connection, "Host: www.mydomain.com\r\n");
fputs($connection, "Content-Type: application/x-www-form-urlencoded\r\n");
fputs($connection, "Content-Length: $data_length\r\n");
fputs($connection, "Connection: close\r\n\r\n");
fputs($connection, $post_string);
//closing the connection
fclose($connection);
|
|
|
|