Guest aceooo2 Posted March 11, 2007 Share Posted March 11, 2007 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? Quote Link to comment Share on other sites More sharing options...
papaface Posted March 11, 2007 Share Posted March 11, 2007 <a href="pageyouwant.html">Homepage</a> That WILL work. Quote Link to comment Share on other sites More sharing options...
tauchai83 Posted March 11, 2007 Share Posted March 11, 2007 you can use meta refresh as well. Quote Link to comment Share on other sites More sharing options...
papaface Posted March 11, 2007 Share Posted March 11, 2007 You could use a lot of things, even javascript. But the OP wants a link. Quote Link to comment Share on other sites More sharing options...
Guest aceooo2 Posted March 11, 2007 Share Posted March 11, 2007 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 Quote Link to comment Share on other sites More sharing options...
tauchai83 Posted March 11, 2007 Share Posted March 11, 2007 <?php echo "<a href="/index2.html/">Homepage</a>"; ?> Quote Link to comment Share on other sites More sharing options...
papaface Posted March 11, 2007 Share Posted March 11, 2007 <?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 } Quote Link to comment Share on other sites More sharing options...
tauchai83 Posted March 11, 2007 Share Posted March 11, 2007 <?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 Quote Link to comment Share on other sites More sharing options...
papaface Posted March 11, 2007 Share Posted March 11, 2007 If you dont want to worry about escaping all the " 's use mine, otherwise you can use tauchai83's Quote Link to comment Share on other sites More sharing options...
Guest aceooo2 Posted March 11, 2007 Share Posted March 11, 2007 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. Problem solved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.