Jump to content

divinedesigns1

Recommended Posts

hey, im wondering how you would do a auto redirect, where when someone try to get into the back end something by typing in the page in the url, it gives them an error then redirect them to the main page i was searching and was only getting the header(); function which isnt what im trying to use

Link to comment
Share on other sites

header("Refresh:5;url=http://google.com");it will redirect after 5 seconds to google. remember that its is like meta redirect so if user has disabled redirection in their browser it wont redirect them.

Link to comment
Share on other sites

header("Refresh:5;url=http://google.com");it will redirect after 5 seconds to google. remember that its is like meta redirect so if user has disabled redirection in their browser it wont redirect them.
so there isnt a way of going around that so you redirect them to the main page even if the disable redirection on their browsers?
Link to comment
Share on other sites

There is no way to go around it if the user chooses to disable redirection. Most systems have a "Click here if you have not been redirected in 5 seconds" button to get around that. Be sure to print that after sending the header.

Link to comment
Share on other sites

The location header is the most common way to redirect someone with PHP. If that method isn't what you're "trying to use" then explain why that doesn't work for you and what exactly you want to happen.

Link to comment
Share on other sites

Guest So Called

If you are running Apache you can do it reliably and effectively using .htaccess directives, which will work irrespective if the visitor has JS enabled or not.

Link to comment
Share on other sites

I believe that would also require HTTP authentication, I don't think there's a way that you can use a .htaccess file to figure out if the user is authenticated for the page they're requesting via PHP authentication.

Link to comment
Share on other sites

Guest So Called

It is not clear to me that any of the OP's posts indicate that any kind of authentication is involved. In fact it's not even clear what sort of pages are desired to be redirected. At least not clear to me. AFAIK you can read and write cookies via .htaccess. You can also get into HTTP_REFERER. What exactly do you mean by HTTP authentication?

Link to comment
Share on other sites

This sounds like authentication or authorization to me:

where when someone try to get into the back end something by typing in the page in the url
HTTP authentication is a scheme where the web server itself prompts for a username and password, I believe those are stored in .htpasswd. The browser will pop up a box asking for the information, if you don't log in correctly the server responds with a 403. It's not used very often any more, in favor of more user-friendly approaches. I have set it up myself though in certain circumstances to provide 2-level authentication for something like a shopping cart control panel.
  • Like 1
Link to comment
Share on other sites

Guest So Called

I think "back end" is too general to draw any conclusions sufficient to write code to. Perhaps the OP can explain what exactly he means. The back end of my setup is a MySQL server.

Link to comment
Share on other sites

Guest So Called

If the OP's problem hasn't been solved yet I'll be happy to take another look at the problem if he will provide additional information defining what he means by "back end." As it stands now "back end" and nothing else is not sufficient for me to offer any more suggestions. In any case my own "back end" pages (using your definition, admin pages) will die() in the first few lines if unauthenticated access is attempted. They die with a redirect header if the site visitor is able to use that, or otherwise they just die with an error message.

Edited by So Called
Link to comment
Share on other sites

i just added 2 buttons and call it a day, thanks for the replied tho

Link to comment
Share on other sites

Guest So Called
i just added 2 buttons and call it a day, thanks for the replied tho
sounds like a pretty simple fix for a back end problem
Link to comment
Share on other sites

sounds like a pretty simple fix for a back end problem
yeah, it was. but i wouldnt suggest that they link on the second link tho lol :rofl:
Link to comment
Share on other sites

Guest So Called

Well it sounded like some serious security problem, and you solved it by adding two buttons? I never heard of a security fix like that. Maybe everybody in the topic has a different definition of "back end."

Link to comment
Share on other sites

Well it sounded like some serious security problem, and you solved it by adding two buttons? I never heard of a security fix like that. Maybe everybody in the topic has a different definition of "back end."
theres no security problem involue here at all, the security dont have anything to do with the buttons, the buttons is just to redirect them back to the main page the security disable them from entering the back end, the buttons allow them to return to the main page, therefore the button and the security have nothing in common. but i guess its true everyone have a different definition of "back end"
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...