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? Link to comment https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/ 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. Link to comment https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/#findComment-204770 Share on other sites More sharing options...
tauchai83 Posted March 11, 2007 Share Posted March 11, 2007 you can use meta refresh as well. Link to comment https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/#findComment-204771 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. Link to comment https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/#findComment-204772 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 Link to comment https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/#findComment-204774 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>"; ?> Link to comment https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/#findComment-204778 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 } Link to comment https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/#findComment-204780 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 Link to comment https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/#findComment-204790 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 Link to comment https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/#findComment-204794 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 Link to comment https://forums.phpfreaks.com/topic/42217-solved-access-granted-redirect-help/#findComment-204895 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.