I have potentially sensitive information that I would just like to email but not store on the site. Anyway to set this up? Clearing each form manually isn't really an option.

Comments

quicksketch’s picture

Hmm, you could do this with a small snippet of PHP in the confirmation page text area (make sure you use the PHP input format).

db_query('DELETE FROM {webform_submissions} WHERE sid = %d AND nid = %d', $_GET['sid'], arg(1));
db_query('DELETE FROM {webform_submitted_data} WHERE sid = %d AND nid = %d', $_GET['sid'], arg(1));

You won't be able to use this in the validation or additional processing code because the result hasn't yet been saved. Note that this lets users pretty much delete any submission they want by changing the sid in the URL, but if you're not storing any results for that webform it won't be a problem.

turbogeek’s picture

Status: Active » Closed (fixed)

thanks :)

brakzilla’s picture

Did this work for you? My submissions are not being deleted with the use of this code snippet, even if I post logged in or anonymous.

woc_art’s picture

Hi there,

I can confirm that this works for me. I'm using this version of webforms: 5.x-1.10

Are you using another?

brakzilla’s picture

Ok.. I am using 5.x-1.10 as well.

I removed the and nid='%d' part of this code and it worked fine. It finds the record by simply pulling the sid and poof its gone. Why is that? What is the significance of using nid as well in the string? Am I missing something here?

xcorex’s picture

How about 6.x version?