如何在重定向页面上分配post globals?

I have a login form which sends 3 post values from username, password and submit button. But my form processor has 3 pages one is validation.php which validates the field second is read.php which checks the posted values against db and third is login.php which is a result of login success. All redirect to each other respectively on success. Problem here is that when I try to access the user posted values from form in read.php (redirected page) not validate.php (action page) I get an error of undefined index.

I really don't see why you are doing all those redirects, but if you want to make the data more persistent you could use a session variable, because the $_POST superglobal is only set for the current request.

firstfile.php

<?php
session_start();

$_SESSION['posted_data'] = $_POST;

other file

<?php
session_start();
var_dump($_SESSION['posted_data']);

However as already stated you may really want to reconsider doing all the requests.

UPDATE

Besides the fact that you will loose your data you are also doing multiple (unneeded) requests to simply sumbit the form. The only redirect that should happen is to the successpage when you have done all you work. See this for more information: http://en.wikipedia.org/wiki/Post/Redirect/Get

If you are look to keep you code clean you could always just include the other files or go for an OOP approach.

You should do one page only that will do all the work. That doesn't seem too complicated of a script, so I would advise putting everthing together on one page. You did not provide any code so I'll show you a general example. I just typed it without rereading so it's not pure PHP syntax, just the spirit:

<?php
$login=$_POST['login'];
$pwd=$_POST['pwd'];

$dbcheck = mysql_fetch_array(mysql_query("SELECT COUNT(1) FROM table WHERE user =$login and pwd = $pwd"))
if($dbcheck[0] > 0) {
  //Login success
  //Setup your session variables, cookies, etc
  //Then you can do your redirect here
} else {
  //Page for wrong login
}