Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8169253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:47:17+00:00 2026-06-06T20:47:17+00:00

I have an account database on my Mac that uses HTML, Javascript & PHP

  • 0

I have an account database on my Mac that uses HTML, Javascript & PHP to delete an account after I click the delete button. It works every time in FireFox and fails every time in Safari (fail meaning the delete request is completely ignored).

Essentially, this is what my code is doing…

  1. Button onclick inside a Form calls a js func verifyDelete() asking me to verify my choice to delete
  2. Next, the onsubmit from same form calls a js func delAccount()
  3. Finally, delAccount() uses XMLHttpRequest to call a php page to delete the
    account

I got the idea of using the XMLHttpRequest from looking at AJAX. I didn’t need all the ReadyState, Response, etc. that AJAX uses so I just used what I needed. Is it ‘legal’ to do what I did inside the delAccount() function? Maybe that’s why Safari is failing?

Any help is appreciated, here’s my code…

FILE – View.php

<?php
    // some code
?>
        <form method="get" onsubmit="return delAccount('<?php echo $acctNum; ?>')">
            <input type="hidden" name="acctName" value="Blah” />
            <button onclick="return verifyDelete()" >Delete</button>
        </form>
<?php
    // some code
?>

FILE – common.js

function verifyDelete() {
    var r=confirm("Are you sure you want to Delete this?\r\n\n" +
        "A)  'Cancel' delete request\r\n" +
        "B)  'OK', delete\r\n");
    if (r == false) {
        return false;
    }
    else {
        return true;
    }
}

function delAccount (acctNum) {
    if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
        var xmlDelete = new XMLHttpRequest();
    }
    xmlDelete.open("GET", "delAcct.php?q=" + acctNum, true);
    xmlDelete.send(null);
    return false;
}

FILE – delAcct.php

<?php
    // code to delete account
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:47:18+00:00Added an answer on June 6, 2026 at 8:47 pm

    I overlooked something. I just needed to swap true with false for the XMLHttpRequest…

    xmlDelete.open("GET", "delAcct.php?q=" + acctNum, false);
    

    I get that it makes the event synchronous, but i don’t really know why this work and the other didn’t.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user Sql Authentication account that has remote access to my database
I have a database where you can select articles etc, users have an account,
I have an Oracle account (schema) of a remote Oracle database. By using this
I have created login account on my localhost\sql2008 Server (Eg. User123) Mapped to Database
i have an account number that is stored in as a query string. How
Let's say that I have a file (file1.php) with a simple form with the
I have an account in oracle database. I can connect it via jdbc in
I am making a database for a client where I will have an Account
I have an Account model that has_one User model, and a User model that
I have a MySQL database in which each user has an account, and each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.