Includes folder automatically being populated into the url

https://drjkpalli.lovestoblog.com/login

POST 302 found error:

Hello guys. I am trying to access the user email and password hash to check if they match with what the user posted in the login page while trying to login to the website. Even with the correct credentials, nothing happens when i click the login button, just an undefined error message appears on the webpage.

so, before i click on the login button, this is what my console looks like while i am in the login page:

after i press the login button (after entering the correct credentials), this is what the console looks like:

Now, if i use seperate files for my script and my html pages, everything works fine. but if i use my php script and the html code in the same file with the .php extension, the above problem begins. somehow mysteriously, the url contains an includes folder and a login.php file, none of which i have in my htdocs folder or the login folder. the login folder inside my htdocs folder has the index.php file which is the file that contains both my script and the html code.


here is a part of the index.php file:
at the top is my php script:

somewhere inside my html tag is my form:

Inside my .htaccess file, i had to add the first block of lines 1-10 because the index.php file inside my login folder wouldn’t display in firefox. without it, just a white screen appears in the browser window.

Here is my .htaccess file contents:

  1. why does this work when the script and the html are in two different files but doesn’t work when both of them are in a single file ??
  2. where is the includes folder coming from, where is the login.php file coming from ?

My website is live. please sign up with some test credentials and try to login after that to replicate the above problem.

here is the detailed 302 error:

No idea, but likely to be

image

Anyway SymLink and SSI most probably do not work on free hosting.
So check your code

is there a reason why it goes there ?? no where in my code do i mention this to happen do i ??

You can comment out to rule out that possibiility

image

I see you shared quite a lot of screenshots, which helps a lot! But the second screenshot shows that the login.php URL that returns the 302 response is initiated by jquery.min.js, which I assume means it’s triggered by AJAX.

Could you please share the Javascript/jQuery code that’s triggering the login request? I’d check it myself but I don’t see any custom Javascript code being loaded, and the form seems to be using basic HTML form actions now.

6 Likes

Thanks for the reply.
I am using the blocs app to design the website and assign actions. I recently change the code to include the same page in the action=“page url” and it works alright.

I have no idea where AJAX came into the picture as i didnt write that file.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.