What I’m seeing is:
When I attempt the login button (the script doesn’t work correctly yet, basically just a redirect and some echo’s) I get a 404. However when my partner does it, it loads sometimes. It depends on what he puts in the login box.
I’m using this software:
Everything is from scratch code. New files created and coded.
Additional information:
2 images in 1 (new users can only add 1 image) Top is login.html form showing the action and bottom is the subdirectory.
This sounds like it’s an issue caused by the coding. After all, a PHP script is either present on the URL, or isn’t. It should not appear and disappear based on form input.
Does the PHP script redirect people back on valid or invalid output? And are you sure people are redirected correctly in both cases?
I’m not being redirected correctly at all. the first line of code on the page is echo “here”; to verify correct redirection. I’m getting sent to a 404 page with a bunch of ads on it. I’m really confused by this, because I feel like the php code shouldn’t have anything to do with the html page redirecting. I feel like it has to have something to do with the hierarchy, maybe login.html doesn’t like to be redirected to login.php or something to that effect? I included everything except the meta data.
It’s also worth noting that this all worked exactly as is on another hosting site, but we just moved here. Our registration page correctly redirects to our registration form, but for some reason login.html won’t redirect to login.php. Again, the entire form is posted above along with the subdirectory to show how it’s set up and coded.
**
Also forgot to mention that I have used the same input he used and was not correctly redirected. He was able to use username s and password s and get redirected. A very similar form:
has been used to redirect and works 100% of the time for both of us. The only effective difference from what I can tell is the name of the file. the form code is very similar IMO.
Could you please take a screenshot of that page and share it here (preferably with the URL of the 404 page)? The description of the page doesn’t ring a bell to me, but maybe I can recognize the page and figure out what could be causing it.
That’s not how forms are supposed to work. When you submit a form, the data is posted to the URL that’s configured in the action attribute.
That said, I see you use a relative URL login.php in the action field. Note that specifying a URL like that means the file name is relative to the current directory. So if you show this form on http://example.com/login.html, the generated URL will be http://example.com/login.php. But if you show this form on http://example.com/admin/login/index.html, your browser will send the data to http://example.com/admin/login/login.php.
Here is a StackOverflow answer which describes relative URLs in more detail:
We literally copied the code from login.html and pasted it into a new file called entrance.html and it works. It seems to be something with trying to redirect from login.html to login.php.
In the first post you can see the directory. It’s at the bottom of the image, since I can’t post 2 separate images.
We ended up switching to entrance. For some reason login.html wouldn’t redirect me to login.php and only did for my partner on occasion. I don’t understand why, I’m writing it off as a glitch / trying to use the same name. It works perfectly with entrance (which was copy pasted from login.html).