This topic is locked

default page

10/28/2010 5:57:32 AM
PHPRunner General questions
T
tedwilder author

hello
Im using template members.

but that's the same for any project. how can I set the default page user get when they succesfully login??

Because for instance if I have lets say table A, B , C , D

when user log in it shows table A list page. I want them to see D list page..

I wasnt able to change the order of the in which tables appears..

any idea to set default page ?

A
ann 11/4/2010

Ted,
use After successful login event and Redirect to another page action on the Events tab to redirect the user to the desired page.

T
tedwilder author 11/9/2010

Hello.
yes but how can i display the right page .

in my member page system User pay for a login/password to access some other service.

I want user on successful login IF he has paid, to be redirect to the "view record" of his own in which he can get his login access.

here it is. I create a table called SSH. this table contains "username" ( same as memuser ). I want user to go his record and ony view it :http://www.xxxxx/ssh_view.php?editid1=75 . So in the event after successfull login I dont knwo how to specify the ?editid1=75 .. because of course it's not the same for every user. how do I get the number? DO i have to do an sql request to get this id ? Is it alway "editid1" ( the number 1 ) ?

Also view/list is considered to be the same in your software. to me List the whoel table or view only 1 record is not the same.As the table contains ssh login access I'm a bit worried about security. Is it for sure that a user wont be able to see the whole table list if he tweaks some url ?

thank you.

Sergey Kornilov admin 11/9/2010

You'll need to run a SQL query that retrieves the ID of this record from SSH table.
Example:

$sql = "select id from ssh where username='" . $_SESSION["UserID"] . "'";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

if ($data)

header('Location: http://www.xxxxx/ssh_view.php?editid1='.$data["id";]);
T
tedwilder author 11/10/2010

Ok I'm trying that.
in the help file I can read:
"

$_SESSION["MyURL"]

If user is trying to access one of password-protected pages directly e.g. pagename_edit.php?editid1=3 this page address is saved in $_SESSION["MyURL"] variable and user is redirected to the login page.
After successful login user will be redirected to that page.
"
It seems it's exactly what I need. how does this work?

thank you.

Sergey Kornilov admin 11/10/2010

That example from manual works if user knows the URL and trying to open it directly. In your case user doesn't know this URL - that's why you need to use supplied code sample.

T
tedwilder author 11/12/2010

I'm afraid it's not working and cant figure out why because it's very simple.. SO I opened a ticket and uploaded the project.