help please
-----------------------pagina1.php-------------------------
<?php
session_start();
if ($_POST['Accion'] == "Insert"){
echo "<script language=\"JavaScript\">";
echo "window.location = \"pagina2.php\";";
echo "</script>";
}
?>
<html>
<head>
</head>
<body>
<form name="form1" method="post" action="pagina1.php">
<input name="Accion" type="hidden" value="Insert">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
-----------------------pagina2.php-------------------------
<?php
session_start();
?>
<html>
<head>
</head>
<body>
<a href="javascript:window.history.go(-1)">forward</a>
</body>
</html>
ok, firt load pagina1.php and click in submit button, that load
Pagina2.php, now when I click in link forward the explorer
end me a error of page not found, whyyyy?????
I realy need you help, thank a lot.
session and history.go(-1) don't work
Moderator: General Moderators
Re: session and history.go(-1) don't work
No, your code doesn't.. it goes to pagina1.php:ranpaco wrote:ok, firt load pagina1.php and click in submit button, that load
Pagina2.php
Code: Select all
...
<form name="form1" method="post" action="pagina1.php">
...Check and make sure that pagina1.php (after submit) is actually entering that code block.ranpaco wrote:ok, see that:
if ($_POST['Accion'] == "Insert"){
echo "<script language="JavaScript">";
echo "window.location = "pagina2.php";";
echo "</script>";
}
this lines redirect to pagina2.php
I know that this no have sense, but the original page has a lot more code that this.
I'm really sure that pagina1.php after submit is entering to that code, because pagina2.php is load , the real problem is in pagina2.php when a try to return to pagina1.php doing a forward, when click in back page button on explorer or when call a javascript function window.history.go(-1).
thk a lot really
thk a lot really
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
without the use of javascript...
Code: Select all
<?php
$url = "http://";
$url .= $_SERVER['HTTP_HOST'];
$url .= $_SERVER['REQUEST_URI'];
?>ok, problem solve
change the javascript for that:
thank for real help.
change the javascript for that:
Code: Select all
$url = "e;http://"e;;
$url .= $_SERVERї'HTTP_HOST'];
$url .= "e;/"e;.$_POSTї'Accion'];
header('Location: '.$url);