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 8965771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:52:59+00:00 2026-06-15T16:52:59+00:00

Again, I’m very new to programming with PHP and JS. I pulled off a

  • 0

Again, I’m very new to programming with PHP and JS. I pulled off a piece of code that is a JS prompt function within PHP to confirm a modification to data. The $confirmdelete variable is indeed “YES” when I type that in the prompt… (I checked it with an echo), but it keeps producing the “MODIFICATION ABORTED” message no matter what (and of course not changing the data).

Is my IF statement bad? Hope it is just a newb typo… Is this even a good way to do this? Thanks for any help…

<?php
        //prompt function
        function prompt($prompt_msg){
                echo("<script type='text/javascript'> var answer = prompt('".$prompt_msg."'); </script>");
                $answer = "<script type='text/javascript'> document.write(answer); </script>";
                return($answer);
        }

        $prompt_msg = "Are you SURE you wish to make a modification? Type YES to confirm: ";
        $confirmdelete = prompt($prompt_msg);
        if ($confirmdelete != "YES") {
            echo "MODIFICATION ABORTED <br><br>
                <a href='index.php'>RETURN TO MAIN PAGE</a>";
            exit();
        }
?>
  • 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-15T16:53:00+00:00Added an answer on June 15, 2026 at 4:53 pm

    Ummmmm….

    You cannot do that.

    When the PHP code is outputted — it is done. There is no more talking back to the server unless you add some AJAX handlers.


    The only think your code outputs is this:

    <script type='text/javascript'> var answer = prompt('Are you SURE you wish to make a modification? Type YES to confirm: '); </script>MODIFICATION ABORTED <br><br>
                    <a href='index.php'>RETURN TO MAIN PAGE</a>
    

    Demo

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

Sidebar

Related Questions

Again, i'm quite new to Javascript and Extjs. code: var test = [ {
Again, I saw this sentence: A .classpath file snippet that can be included in
Again with the soap. I am trying to build a header using soap4r that
Again I'm moving from Xcode 3 to 4 and finding that some things are
Hello again codes masters, I'm stuck at this piece of codes for dropdown menu.
Again I m sry fr that non-sense way of asking the question what i
Again, apologies for the poor title - very hard to describe. I used the
Again i see that the @PostConstruct is firing every time even though no binding
Again a simple thing. I have a stylesheet that parses XML and XSL files.
Again pulling my hair out due to some Flex/AS3 weirdness. The following code does

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.