This topic is locked

AfterSuccessfulLogin Redirect to another page

2/22/2007 16:36:02
PHPRunner General questions
B
bricris author

Help,
I have AfterSuccessfulLogin Redirect to another page the page it the view page but it will not show the users info the view page is blank?
How do I redirect to the view page and load the user data that just logged in?
This is what I have?
function AfterSuccessfulLogin()

{

//** Redirect to another page ****

header("Location: oak_loantrack_list.php");

exit();

}
Thanks
Brian

L
lawfour 2/22/2007

I think this is what you are looking for, check this thread
http://www.asprunner.com/forums/index.php?showtopic=3909

B
bricris author 2/24/2007

I spent a hour changing my view page and adding the code that is in the other post but it will not work.
This is what I have.
I have one database "oak_loantrack"
I have AfterSuccessfulLogin Redirect to another page set like this.
[codebox]//** Redirect to another page ****

header("Location: oak_loantrack_view.php");

exit();

}[/codebox]
It works great but there is no data for the user that just logged in?
This is the file oak_loantrack_view.php
When I went to change {$show_property_address} field to @$_SESSION["property_address"]

there is no Default boxes under properties to put the code in.
[codebox]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>Loan Track</TITLE>

<META http-equiv=Content-Type content="text/html; charset=windows-1252"><LINK

href="include/style.css" type=text/css rel=stylesheet>

<META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD>

<BODY bgColor=#c9dede>{include_if_exists file="include/header.php"}

<H1 align=center><FONT size=6>Your Loan Track</FONT></H1>{$message}{doevent name="ViewOnLoad"}

<DIV align=left>

<HR width=300 noShade SIZE=1>

</DIV> <A href="/test/index.php"></A><BR><BR>

<CENTER>

<P><B>{$show_borrower_name}</B><BR><B>

{$show_property_address}</B></P>

<P></P>

<DIV align=left>

<P align=left>Closing Date:

{$show_closing_date}<BR>Attorney: {$show_attorney}<BR>Real Estate

Agent: {$show_realtor}<BR>Appraiser: {$show_appraiser}</P>

<P><BR></P></DIV>

<TABLE style="WIDTH: 633px; HEIGHT: 314px" width=633 border=0>

<TBODY>

<TR>

<TD width=140>Loan Locked </TD>

<TD width=210>{$show_loan_locked}</TD>

<TD width=47> </TD>

<TD width=226>{$show_loan_locked_expiration_date}</TD>

<TR>

<TD width=140>Appraisal Ordered </TD>

<TD width=210>{$show_appraisal_ordered}</TD>

<TD width=47> </TD>

<TD width=226>{$show_appraisal_ordered_date}</TD>

<TR>

<TD width=140>Application Taken </TD>

<TD width=210>{$show_application_taken}</TD>

<TD width=47> </TD>

<TD width=226>{$show_application_taken_date}</TD>

<TR>

<TD width=140>Loan Submitted </TD>

<TD width=210>{$show_loan_submitted}</TD>

<TD width=47> </TD>

<TD width=226>{$show_loan_submitted_date}</TD>

<TR>

<TD width=140>Appraisal Received </TD>

<TD width=210>{$show_appraisal_received}</TD>

<TD width=47> </TD>

<TD width=226>{$show_appraisal_received_download_link}</TD>

<TR>

<TD width=140>Loan Approved </TD>

<TD width=210>{$show_loan_approved}</TD>

<TD width=47> </TD>

<TD width=226>{$show_loan_approved_date}</TD>

<TR>

<TD width=140>Title Binder Ordered </TD>

<TD width=210>{$show_title_binder_ordered}</TD>

<TD width=47> </TD>

<TD width=226>{$show_title_binder_ordered_date}</TD>

<TR>

<TD width=140>Ins. Declarations Ordered </TD>

<TD width=210>{$show_ins_declarations_ordered}</TD>

<TD width=47> </TD>

<TD width=226>{$show_ins_declarations_ordered_date}</TD>

<TR>

<TD width=140>Title Binder Received </TD>

<TD width=210>{$show_title_binder_received}</TD>

<TD width=47> </TD>

<TD width=226>{$show_title_binder_received_date}</TD>

<TR>

<TD width=140>Ins. Declarations Received </TD>

<TD width=210>{$show_ins_declarations_received}</TD>

<TD width=47> </TD>

<TD width=226>{$show_ins_declarations_received_date}</TD>

<TR>

<TD width=140>Closing Package Ordered </TD>

<TD width=210>{$show_closing_package_ordered}</TD>

<TD width=47> </TD>

<TD width=226>{$show_closing_package_ordered_date}</TD>

<TR>

<TD width=140>Closing Package at Attorney </TD>

<TD width=210>{$show_closing_package_at_attorney}</TD>

<TD width=47> </TD>

<TD width=226> </TD>

<TR>

<TD width=140>Loan Closed </TD>

<TD width=210>{$show_loan_closed}</TD>

<TD width=47> </TD>

<TD width=226> </TD></TR></TBODY></TABLE>

<P> </P>

<P> </P></CENTER>

<DIV align=left></DIV>

<DIV align=left></DIV>

<DIV align=left><A href="/test/index.php"></A><BR><BR></TD></TABLE>{include_if_exists file="include/footer.php"}</DIV></BODY></HTML>

[/codebox]
All I want the user to do is login and view there loan track data and log out. I don't want them to see the list page or edit just look at the view page.
Thanks
BriCris

J
Jane 2/26/2007

Hi,
you need to select id of added record and then use it the event:

global $conn;

$str = "select IDField from TableName where UserName='".$_SESSION["UserID"]."'";

$rs = db_query($str,$conn);

$data = db_fetch_array($rs);
header("Location: oak_loantrack_view.php?editid1=".$data["IDField"]);

exit();


To change default value of the field proceed to the Visual Editor tab (step 10) in the PHPRunner, choose Register page, double click on the field and change value in the Default value box.

B
bricris author 3/29/2007

Hi,

you need to select id of added record and then use it the event:
To change default value of the field proceed to the Visual Editor tab (step 10) in the PHPRunner, choose Register page, double click on the field and change value in the Default value box.


[color=#FF0000]I don't have a Register page. The people that are going to use this are setup as a user by the admin.
I realy need help with this I just want the user to login and then go to the view page and not the list page.
Thank You for your help
Brian

J
Jane 3/29/2007

Brian,
to redirect to the View page after login use AfterSuccessfulLogin event on the Events tab and code I've gave in the previous comment.

B
bricris author 3/30/2007

Brian,

to redirect to the View page after login use AfterSuccessfulLogin event on the Events tab and code I've gave in the previous comment.


Ok Jane I have the code in AfterSuccessfulLogin and the view page comes up but it's still blank. What or were do I put the code in to get it to show the users info.
My database is setup so they can only see there own records in view and the admin sets up the user account so I don't have a Register page.
I don't understand what to put in the field to make the record come up?
To change default value of the field proceed to the Visual Editor tab (step 10) in the PHPRunner, choose Register page, double click on the field and change value in the Default value box.
Thanks so much for your help. I have build a great database with phprunner all I have to do is fix this and i'm done.
Brian

Sergey Kornilov admin 4/4/2007

Brian,
a quick recap. Put the following into AfterSuccessfulLogin event.

Replace field names in bold with actual names.

global $conn;

$str = "select IDField from oak_loantrack where UserNameField='".$_SESSION["UserID"]."'";

$rs = db_query($str,$conn);

$data = db_fetch_array($rs);
header("Location: oak_loantrack_view.php?editid1=".$data["IDField"]);

exit();

B
bricris author 4/11/2007

Brian,

to redirect to the View page after login use AfterSuccessfulLogin event on the Events tab and code I've gave in the previous comment.


Wow I do not know what I was doing wrong but it works now. Thank you so much for your help I know have a working program that looks great.
BriCris <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=16840&image=1&table=forumreplies' class='bbc_emoticon' alt=':lol:' />