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:[email protected]/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) Link to comment https://forums.phpfreaks.com/topic/94937-newb-question-auto-login-script/ Share on other sites More sharing options...
ndondo Posted March 11, 2008 Author Share Posted March 11, 2008 anyone? Link to comment https://forums.phpfreaks.com/topic/94937-newb-question-auto-login-script/#findComment-489963 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. Link to comment https://forums.phpfreaks.com/topic/94937-newb-question-auto-login-script/#findComment-489970 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 Link to comment https://forums.phpfreaks.com/topic/94937-newb-question-auto-login-script/#findComment-492518 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(); } ?> Link to comment https://forums.phpfreaks.com/topic/94937-newb-question-auto-login-script/#findComment-492558 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.