Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to go to another page.php with condition
I create the user and password for condition a page but I don't know how to link this page to my download.php for download a attach file that condition fron user and password is true for it
Posted

The logics of this sample will guide you to solve your problem. Linking to your download page will involve the same programming logics as this sample. You may try something like:

PHP
<?php
if(isset($_REQUEST['sign'])){
   if($_REQUEST['sign'] == 'signup'){
//This redirects the user to the Signup page
      header("Location: /page0.php");
//When the user is redirected to this page you present to them a login form. Upon login you verify and validate their information, and when satisfactory, you use the header function to redirect them to your download page. The same logic will be applied in the signup form.
   }
   elseif($_REQUEST['sign'] == 'signin'){
//This redirects the user to the Login/Sign in page
      header("Location: /page1.php");
   }
}
?>;


Hope this works for you, and helps you solve your problem.
For more information visit PHP Home, and check the PHP Manual
 
Share this answer
 
v2
It should be a submit form. They based on submitted values you an redirect.

PHP
<?php
    // If the condition pass
    echo "<script language=\"javascript\" type=\"text/javascript\">document.location.replace('download.php');</script>"; 
?>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900