Home>

On the HTML page there is a button, when you click, the data should be sent to the PHP script, I implemented it using jQuery and Ajax, for simplicity I wrote PHP, which simply displays a message. The problem is that jQuery gives an error that the php file is not found. I put a site on a local host with the help of Open Server, I tried through a special extension in Google, but nothing helps. Error -Failed to Load Resource: The Server Respondd with A Status of 404 (Not Found). If you click on an error, displays-Entry not Found: /PHPSѓheckhitpoint.php

$ ("# Formsubmit_Check"). Click (Function (E) {
    var x= $ ('INPUT [NAME= "COORDINATEX"]: Checked'). Val ();
    var y= $ ("# coordinatey"). Val ();
    VAR Y= PARSEINT (Y);
    var r= $ ("# coordinate"). Val ();
    if (ISNAN (Y) || Y >
 3 || Y <
 -3 || Y== undefined || x== undefined) {
        if (ISNAN (Y) || Y >
 3 || Y <
 -3 || Y== undefined) {
            $ ('# Rezult'). Text ('Invalid Data');
        }
        if (x=== undefined) {
            $ ('# Rezultx'). Text ('Invalid Data');
            RETURN FALSE;
        }
        ELSE {
            $ ('# Rezultx'). Text ('');
        }
    }
    ELSE {
        $ ('# Rezult'). Text ('');
        $ ('# Rezultx'). Text ('');
        $.ajax ({
            URL: "PHP \ Checkhitpoint.php",
            Type: 'Get',
            Cache: False,
            Data: $ ('# CheckForm'). Serialize (),
            Datatype: 'HTML',
            BeforesenD: Function () {
                $ ("# Formsubmit_Check"). Prop ("Disabled", True);
            }
            SUCCESS: FUNCTION (DATA) {
                If (! Data) {
                    Alert ("There was a data acquisition error");
                }
                ELSE {
                    $ ("# CheckForm"). Trigger ("Resert");
                }
                $ ("# Formsubmit_Check"). Prop ("Disabled", False);
            }
        });
    }
}
);

php file itself

<
? php.
 Echo 'Hello';? >

It can be seen that there is some left symbol in the file name. Just erase and write anew.

Ипатьев2021-07-26 11:20:45

Instead of "php \ checkhitpoint.php" I would write "php /checkhitpoint.php" for a start. And the commentator is above -right.

Quazimorda2021-07-26 12:52:35