Jump to content


Photo

Granted help.


  • Please log in to reply
2 replies to this topic

#1 HaZaRd420

HaZaRd420
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 03 April 2006 - 05:11 PM

I was wondering, when you are granted access. Is there any way to put a link in there so someone can click to continue? or if anyone can make it redirect to a different page when access granted. Thanks

Heres the code:
<?php
if($username == "name" && $password == "pass"){
echo "Access Granted";
}else{
echo "Access Denied";
}
?> 
</body>


#2 shortj75

shortj75
  • Members
  • PipPipPip
  • Advanced Member
  • 118 posts
  • LocationPort Huron,mi

Posted 03 April 2006 - 05:23 PM

yes it is very simple by adding a html link

<?php
if($username == "name" && $password == "pass"){
echo "Access Granted";
echo "<a href=nextpage.php>next page</a>
}else{
echo "Access Denied";
}
?> 
</body>

or you can automaticaly redirect them with the header function

<?php
if($username == "name" && $password == "pass"){
echo "Access Granted";
header("location: nextpage.php");
}else{
echo "Access Denied";
}
?> 
</body> 


or redirect with a meta tag

<?php
if($username == "name" && $password == "pass"){
echo "Access Granted";
echo "<META HTTP-EQUIV='refresh' content='2; url=nextpage.php'>";
}else{
echo "Access Denied";
}
?> 
</body>

thw meta tag will redirect the user in 2 seconds
The Short One

hopfully this helps if it doesn't sorry
i won't write the code for you!!! you don't learn that way

#3 HaZaRd420

HaZaRd420
  • Members
  • PipPipPip
  • Advanced Member
  • 37 posts

Posted 03 April 2006 - 05:24 PM

Thanks much man!!! Appreciate it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users