ndondo Posted March 7, 2008 Share Posted March 7, 2008 Is it possible to have a script something like this <this is a script> http://username:password@www.website.com/index.php <this is a script> save it somewhere, and when user run the script it will automatically show the content we want to display? let's say the index.php / main joomla page require visitor to login before they can view the site contet? ( I use joomla CMS) Quote Link to comment Share on other sites More sharing options...
ndondo Posted March 11, 2008 Author Share Posted March 11, 2008 anyone? Quote Link to comment Share on other sites More sharing options...
trq Posted March 11, 2008 Share Posted March 11, 2008 I'm not sure I understand the question. Quote Link to comment Share on other sites More sharing options...
ndondo Posted March 14, 2008 Author Share Posted March 14, 2008 for example I have a website www.accounting.com/index.php before anyone can see the content in accounting.com they have to enter username and password... I also have accounting.exe (Visual basic Program) and inside accounting.exe program, there is a support window, and What I would like to do is for user with accouting.exe program to be able to see the content of www.acconting.com/index.php, without user name and password so essentially what I am trying to do is maybe to have a function hidden in the program, that will call the script on the server..so that it will log in for me. so I need to know if it's possible to have a script that will silently pass the username and password .. the script can be on the server or on the client it doesn't really matter Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 14, 2008 Share Posted March 14, 2008 well with out using a sql database you can do this: login.php <?php session_start(); if(isset($_POST['submit'])){ if($_POST['username']=="USERNAME HERE" && $_POST[password]=="YOUR PASSWORD HERE" ){ session_register('login'); $_SESSION['login']="true"; header("location: index.php"); }else{ echo "invalid user or pass"; } } ?> <html> <form method='post'> <table> <TR> <TD>User Name:</TD> <TD><input type='text' name='username'></TD> </TR> <TR> <TD>Password:</TD> <TD><input type='text' name='password'></TD> </TR> <TR> <TD colspan='2'><input type='submit' value='Login' name='submit'></TD> </TR> </table> </form> </html> and on your index.php page include this at the top <?php session_start(); if($_SESSION['login']!="true"){ header("location: login.php"); exit(); } ?> 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.