How else are you using this page? In other words, when you access this page, you obviously want it to set a value in the database, so you have tried submitting a form. What behaviour do you require on this page? Would it ever be that when you access this page, you don't want to set that value?
Auto-submit hidden form
Collapse
X
-
The server behavior, would be to update the record in the database and I would like to update record everytime user accesses this page. Hope this was helpful...
Originally posted by acoderHow else are you using this page? In other words, when you access this page, you obviously want it to set a value in the database, so you have tried submitting a form. What behaviour do you require on this page? Would it ever be that when you access this page, you don't want to set that value?Comment
-
-
-
Acoder,
Thank you for your time and your help. This is the code that worked.
I was getting errors because I had not deleted the form. After I removed the form there were no errors but the value was not being inserted. I then realized that the <cfif> isdefined ....updateform. .. that is inserted when dreamweaver updaterecord server behavior is used had not been removed. I removed it and it worked great. I could not have done it without your help Thanks.Code:<cfquery name="Recordset1" datasource="website_users"> SELECT * FROM #ExpandPath ("/Mailbox\Database\website_users.mail")# WHERE UserID = #Session.MM_UserID# ORDER BY ID DESC </cfquery> <cfquery datasource="website_users"> UPDATE #ExpandPath ("/Mailbox\Database\website_users.mail")# SET Confirmed=1 WHERE ID=#Recordset1.ID# </cfquery>
Golddigger
Originally posted by acoderThe Recordset1 query should be before this update query.Last edited by acoder; Apr 2 '12, 01:03 PM.Comment
-
Here is a working auto-submit method: when page is loaded, it will the form will be immediately autosubmited (the values can be set with php variables).
for example, the $_POST['something1'] value is received from the previous real-user submited Form, and this form can add another input with ANOTHER_YOUR_VA LUE.Code:<form action="page.php" method="post"> <input type="text" name="example1" value="<?php echo $_POST['something1'];?>" /> <input type="text" name="example2" value="ANOTHER_YOUR_VALUE" /> <input type="submit" /> </form> <SCRIPT LANGUAGE="JavaScript">document.forms[0].submit();</SCRIPT>
_______________ ________Comment
Comment