简体   繁体   中英

Object not found! The requested URL was not found on this server. PHP file not being accessed

I installed Xampp and running a local server in order to test my php code. So I made a simple form which has a submit button and has action = seenotes.php and onSubmit = seenotes.php

The problem is when I click submit i get the error: Object not found! The requested URL was not found on this server. Error 404.

and the URL looks like this: http://localhost/MagodaSystems/seenotes.html?note=as&submit=Enter

See the seenotes.html part in the url? That file doesn't exist and I want it to be directed to seenotes.php instead. When I manually change that part of the link to seenotes.php I get the required page. How do I fix this so it automatically redirects to the correct php page? All my files are in a folder in htdocs.

use the form in this manner:

<form method = "post" action = "seenotes.php" >

<!--you can also use method = "GET" as per your requirement.Sice you said all files are in same folder i gave action as the file name
all your input fields are here -->

<input type = "submit" />

</form>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM