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
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

Link to comment
Share on other sites

<?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       }

Link to comment
Share on other sites

<?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

Link to comment
Share on other sites

Guest aceooo2

Hi,

Sorry I had to go out just when you posted the last 2 posts.

 

Just wanted to say thanks to both of you as they both worked in the end.  ;D Problem solved :)

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.