Jump to content

Headers


SirChick

Recommended Posts

I have a question about headers...

 

If i use headers to prevent people doing something they should not be on a site for simple example:

 

if user's level is below 10  header to "test.php"

 

 

Can that level 10 some how stop the header from occur using a program or just some other clever way ? Because I have been using headers to redirect users away from pages they should not be on... is this the best secure way?

Link to comment
Share on other sites

I have a question about headers...

 

If i use headers to prevent people doing something they should not be on a site for simple example:

 

if user's level is below 10  header to "test.php"

 

 

Can that level 10 some how stop the header from occur using a program or just some other clever way ? Because I have been using headers to redirect users away from pages they should not be on... is this the best secure way?

 

That, or just use a die() statement.

Link to comment
Share on other sites

well die would make the user go to a white screen.. which is slightly unprofessional.

 

But can hackers stop headers from happening on their browsers?

 

 

die(" ALL THE HTML, AND SEXY LAYOUT ERROR STUFF YOU WANT IN HERE TO SHOW THE MEMBER" );

 

 

to repeat the html over and over for each error would make my scripts over 1000 lines long on average given the amount of error checks it does... possibly not a logical method.

 

Revraz.... thanks for info, i hope your right hehe! :)

Link to comment
Share on other sites

well die would make the user go to a white screen.. which is slightly unprofessional.

 

But can hackers stop headers from happening on their browsers?

 

 

die(" ALL THE HTML, AND SEXY LAYOUT ERROR STUFF YOU WANT IN HERE TO SHOW THE MEMBER" );

 

 

to repeat the html over and over for each error would make my scripts over 1000 lines long on average given the amount of error checks it does... possibly not a logical method.

 

Revraz.... thanks for info, i hope your right hehe! :)

 

What?

 

<?php

if($level == 10){



die("Sorry, you cant access this page");


}


//// THE REST Of YOUR SITE
?>

 

 

It was 3 lines of code.

Link to comment
Share on other sites

phpSensei, allot of people would rather there site like more professional then a blank page with a single line message.

 

Yes but couldnt you just make a function with the nice professional layout

 

function show_error(){

 

$error = // html

 

echo $error;

 

}

 

and then do

 

 

die(show_error()); and still have a nice little message and still leaving you with your layout?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.