PHP script embedded in js function running when not called

LOL, no one told you to do anything. The suggestion was based on what the posted code was trying to do, use onclick to call a javascript function that you expected to perform an operation on the server, and was given as a “perhaps” choice, i.e. used to express uncertainty or possibility.

When you were doing research on what AJAX was, what did you learn that caused you to choose to use it?

If you want to just use html, you need a post method form that submits to the same page all this code is on and when submitted causes the DELETE form processing code to be executed. The form processing code must detect that a post method request was made, detect what operation to perform (use a hidden field in the form, named action for example, with the value ‘delete’), enforce user permissions to insure that the current visitor is authorized to perform a DELETE operation, then execute the code/query(ies) needed to accomplish the operation. When the form processing code has successfully completed, you should do a header() redirect to the exact same URL of the page to cause a get request for that page - Post Redirect Get (PRG.). This will cause the process to start anew.

the directory in which this report is at is protected by a godaddy directory level permissions setting. so that’s how I took care of that issue. I’ll try what you’ve mentioned and post back here when I’ve tried it. it might be a little while. thank you very much you guys. I learned quite a bit from what you’ve said.

Sponsor our Newsletter | Privacy Policy | Terms of Service