- This topic is empty.
-
AuthorPosts
-
September 11, 2009 at 8:13 pm #26073smilinmonki666Member
Hi,
I’m trying to build a client login page so they can login to their web site before publishing. I have followed the following guide:
http://www.phpeasystep.com/workshopview.php?id=6What I would like to do, is when the user logs in, I want them to be redirected to their site on our server!
Just getting to grips with MySQL with PHP. So any help with either will be much appreciated…
Many thanks
Smilinmonki666
September 11, 2009 at 11:20 pm #63888cybershotParticipantthe tutorial has a redirect in it. it’s this line
header("location:login_success.php");
you need to change it to header("location:http://www.yourdomain.com");
September 13, 2009 at 7:45 am #63957mattvotMemberredirect after logon to your website won’t work. the script creates a session which is not transferable.
I would say to just have the actual html form’s action pointing to the login script on your server.
September 14, 2009 at 5:21 pm #64046Capt OtisMemberHe is right, make the form submit to a page on your server. This can be a little dangerous, so keep that in mind if you are transferring important data. You should be ok from what I believe you want to do though.
-T
September 16, 2009 at 12:23 pm #64198ikthiusMemberwhat about if it is successful at loggin in, the do:
print "<meta http-equiv="refresh" content="0;URL=http://www.thesite.com">";mind you never done log in stuff yet…..
September 18, 2009 at 6:01 am #64349smilinmonki666MemberHey guys, just to let you know I’ve done it… after 3 days I managed to sort it out. It was simple.
Code:session_start(); if(!session_is_registered(myusername)){ header("location:beta/$myusername"); } else { echo "error: 401"'' } ?>I had already set myusername as Global & registered it to a session…
September 18, 2009 at 6:44 am #64351mattvotMemberso what happens when I find out a user’s username and go to:
http://www.domain.com/beta/mattvot
Am I now logged in without using a password?
September 18, 2009 at 10:24 am #64361cybershotParticipantthis is one issue I have seen. I know of a few tutorials out there that do login pages, but they don’t have a good tutorial showing how to handle the actual login. If you used an html refresh code to redirect to a new page, then if someone viewed the source code, they could see that html. Also the page you are redirecting to wouldn’t be password protected would it?
September 18, 2009 at 11:41 am #64368smilinmonki666MemberThis is where my problem lies.
Is there a PHP script i can make which will be like the following:
if username the allow to beta/$username
else redirect to login page
???
tried to use php to restrict but nothings working so far..?
September 18, 2009 at 12:14 pm #64369mattvotMemberSeptember 18, 2009 at 1:07 pm #64372cybershotParticipantwhy not just use cpanel to password protect your directory?
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.