Jump to content

Help with login code


rv20

Recommended Posts

I am looking at this code,

 

http://www.rbredlau.com/tutorials/process_forms_like_a_champ/part_ii/hello_form_better_errors.php?source

 

Now if everything is ok the page is processed,

 

   if( isset($_SESSION['post']) ){
      $post = unserialize($_SESSION['post']);
     $form = 'Hello, ' . $post['name'] . '!';
      unset($_SESSION['post']);

 

 

Say i have 5 people that have signed up and they enter their login details and they have they own page on my server that was created when they signed up, like their username.html or some number combination or whatever, can just include their file like,

 

   if( isset($_SESSION['post']) ){
      $post = unserialize($_SESSION['post']);
    include $post['name'] . ".html";
      unset($_SESSION['post']);

 

 

 

But how would i include their page and remove all the current html on the page also what would stop people directly navigating to their own page ex,

 

http://domain.com/username.html

 

another way of doing it would be something like,

 

   if( isset($_SESSION['post']) ){
      $post = unserialize($_SESSION['post']);
     Location ($post['name'] . ".html");
      unset($_SESSION['post']);

 

So basically i am trying to work out how best to get the users pageup but keeping urls as short as possible...

 

Ideally the url wouldn't change form the default webite url.

Link to comment
https://forums.phpfreaks.com/topic/159193-help-with-login-code/
Share on other sites

I don't know why you're trying to do that, doesn't really make sense.

 

anyway...

change this...

function ProcessForm(){
    $_SESSION['post'] = serialize($_POST);
    header('Location: ' . $post['name'] . ".html"');
    exit();
  }

to this...

function ProcessForm(){
    $_SESSION['post'] = serialize($_POST);
    header('Location: ' . $post['name'] . ' .html');
    exit();
  }

Link to comment
https://forums.phpfreaks.com/topic/159193-help-with-login-code/#findComment-839554
Share on other sites

I don't know why you're trying to do that, doesn't really make sense.

 

anyway...

change this...

function ProcessForm(){
    $_SESSION['post'] = serialize($_POST);
    header('Location: ' . $post['name'] . ".html"');
    exit();
  }

to this...

function ProcessForm(){
    $_SESSION['post'] = serialize($_POST);
    header('Location: ' . $post['name'] . ' .html');
    exit();
  }

 

 

 

yeah i just noticed my mistake where the script actually completes.

 

Why i am trying to do it is to prevent have a big messy url like,

 

http:/domain.com/sub/user=090923

 

i just want to keep the http:/domain.com displayed after the user logs in but still naviagte (or include) or get to their page..have the user in their own admin panel.

Link to comment
https://forums.phpfreaks.com/topic/159193-help-with-login-code/#findComment-839555
Share on other sites

why wouldn't you want to use mod_rewrite?  You can create code to redirect, but the best method is mod_rewrite

 

I want to know how it is done, there is a site i use for example where you sign up etc.. now when you login you can see from using www.iewatch.com that the GET and POST http headers  show this kind of thing, so you enter your login detils and cick login then ie watch shows,

 

POST  http://www.domain.com/login

GET    http://www.domain.com

GET    http://www.domain.com/cpanel

......

 

then it "GETS" all the sytlesheets, js and images.

 

So it doen't say for exmaple,

 

POST  http://www.domain.com/login

GET    http://www.domain.com/userif=93432

 

 

So i want to know what happens behind the scences after a user logins in how is their config infomation and the admin page shown.

 

My arguement here is that IE Watch WILL show what mod_rewrite is trying to hide, maybe it doesn't i haven't tried it.

Link to comment
https://forums.phpfreaks.com/topic/159193-help-with-login-code/#findComment-839813
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.