Jump to content

Forward to another page


PHPLRNR

Recommended Posts

<script type="text/javascript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>

 

and

 

<body onload="MM_goToURL('parent','view.php');return document.MM_returnValue">

 

just change view.php to whatever you want

Link to comment
Share on other sites

Create a file called .htaccess (just .htaccess, no filename) and put the following code in it. Then upload it to the directory you need it to be in. Obviously you'll have to change the oldpage.htm and newpage.htm to your requirements.

 

Redirect oldpage.htm newpage.htm

 

If this isn't what you want, you'll have to use JavaScript or meta tags. Or LemonInflux's method which to be honest is probably the best one so far.

Link to comment
Share on other sites

I want to forward from one page to another page in a conditon like below

 

<?php

$chk = $_POST["jschk"];

if ($chk != '1')

{

   header( 'Location: http://www.mysite.net/mypage.php' ) ;

}

?>

but whatever the value of chk, page forward to mypage.php.

How I will forward to this page in specific condition.

 

You've just answered your own question...

 

echo "<a href="link">link</a>";

:P

 

you haven't escaped the double quotes:

echo "<a href=\"link\">link</a>";

Link to comment
Share on other sites

Could you not just add an else clause to your if statement?

 

<?php
$chk = $_POST["jschk"];
if ($chk != '1')
{
   // If the condition is satisfied, the page is redirected and NOT displayed
   header( 'Location: http://www.mysite.net/mypage.php' ) ;
}
else
{
   // If the condition is not satisfied, the page is displayed
   // here.
}
?>

Link to comment
Share on other sites

To MFHJoe in this case the else is not necessary.

Right. I didn't really think about that before I posted it... Anyway, I think I've found the actual problem now. Checkboxes are not set if they are not checked, and when they are checked they return the value 'on' instead of 1. So this will be why the if statement isnt going through. Use:

 

if (isset($_POST["jschk"])

 

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.