sesc
08-30-2007, 04:25 PM
I have three pages.
one.php
<form action="second.php" method="post">
<input type="text" name="txt">
<input type="submit" value="submit">
</form>
second.php
<?php
$err = $_Post['txt']; // from one.php
if($err == 1)
{
$errVal = 1; ?>
<script>
location.href = "third.php"
</script>
<?php }
else
{
echo $errVal;
}
?>
third.php
<?php
echo $errVal; // from second.php
?>
if the text value from one.php is 1, then automatically that should be redirected to third.php and should carry the variable ($errVal) value to third.php from second.php. How can I achieve this. I am new to this php!. Thanks in advance.
one.php
<form action="second.php" method="post">
<input type="text" name="txt">
<input type="submit" value="submit">
</form>
second.php
<?php
$err = $_Post['txt']; // from one.php
if($err == 1)
{
$errVal = 1; ?>
<script>
location.href = "third.php"
</script>
<?php }
else
{
echo $errVal;
}
?>
third.php
<?php
echo $errVal; // from second.php
?>
if the text value from one.php is 1, then automatically that should be redirected to third.php and should carry the variable ($errVal) value to third.php from second.php. How can I achieve this. I am new to this php!. Thanks in advance.