Jump to content

[SOLVED] Access granted - redirect help


Guest aceooo2

Recommended Posts

Guest aceooo2

Hi, I have this code inside a username and password bit:-

 

           function accessGranted($name)
           {

             print("<title>Thank You</title></head>
             <body style = \"font-family: arial;
             font-size: 1em; color: blue\">
             <strong>Permission has been
             granted, $name. <br />
            </strong> <br> You can now go to the main Website ");
           }

 

Now I want to add a link or a redirect to another page - How would I do this

 

I tried sticking>>>    <A HREF=".\index2.html">Click here to go to te main web site</A>

or similar bit, in the code but it did not work.

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/
Share on other sites

Guest aceooo2

Thanks :)

 

Sorry to sound dumb but where in my code would I add your code

 

Like?

 

           function accessGranted($name)
           {

             print("<title>Thank You</title></head>
             <body style = \"font-family: arial;
             font-size: 1em; color: blue\">
             <strong>Permission has been
             granted, $name. <br />
            </strong> <br> <a href="/index2.html">Homepage< /a> ");
           }

 

It did not work - some parse error : s

<?php

 

 

echo "<a href="/index2.html/">Homepage</a>";

 

?>

^^ Thats wrong:

Do this:

           function accessGranted($name)
           {?>

             <title>Thank You</title></head>
             <body style = "font-family: arial
             font-size: 1em; color: blue">
             <strong>Permission has been granted, <?php echo $name; ?><br />
            </strong> <br> <a href="index2.html">Homepage</a>

  <?php       }

<?php
function accessGranted($name)
           {

             echo "<title>Thank You</title></head><body style = \"font-family: arial;font-size: 1em; color: blue\">
             <strong>Permission has been
             granted,".$name." <br />
            </strong> <br> <a href=\"index2.html\">Homepage< /a> ";
           }
?>

 

try this

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.