Jump to content

Committing FORMS data to database problem.


n33dl3

Recommended Posts

Hi ,

I am having problems with a database connection and the commit statement.

I am using a XE Oracle database.

When somebody presses the “Save “ button in a application a pop-up window appears, all the settings have been send successfully to the pop-up window via “POST” and the variables have been successfully been assigned like “ $abc = $HTTP_POST_VARS[‘abc’];” and so on.

Then the Database is updated with the new information with the :

“$s =oci_parse($db,

"update AE_WORKFLOW ………………..);” statements

At the end I use the “oci_execute($s, OCI_DEFAULT);” statement.

I have not send the commit command yet.

 

This pop-up window asks the user if he wants to accept the data being saved or not

 

If the user presses the “CANCEL” button then the pop-up window is to be closed and if the user presses the O.K. button then a commit should be send to the php script.

I really have no clue how I can achieve this, every time when the pop-up window opens , the PHP script ends and the Database produces a roll-back.

If O.K. is pressed then the pop-up window is submitting to itself.

 

It would be the best to send less data around as possible. Maybe there is another way to achieve  this?

Maybe you can help me

Regards

 

use javascript to have an alert to come up when the user presses submit. If they press OK on the popup then it will just goe to the php page to process the form

 

put this in between the <head> tags

<script LANGUAGE="JavaScript">
<!--
function confirmSubmit()
{
var agree=confirm("Check your values, then hit OK. Or click cancel to change");
if (agree)
return true ;
else
return false ;
}
// -->
</script>

 

then put this in for the submit button

<input type="submit" onClick="return confirmSubmit()" name=submit value="Confirm"></td>

 

Ray

Thanks a lot for quick answer Ray,

 

But it could be that in future a O.K. and Cancel buttons are not enough, would it be possible to send the "commit" command to the Database as an "onclick" event?

 

In the past I have been experimenting around trying to put php code into a "onclick" event, was not that successful.

 

Regards

 

 

Sorry I am only your VERY basic javascript guy. :) I have written javascript with php to loop through data and set variables to create the javascript code, but never used it to pass on commands. I am afraid it is a little above me right now.

 

Ray

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.