This topic is locked
[SOLVED]

 Session Variables

2/9/2011 4:45:32 PM
PHPRunner General questions
R
rlee6087 author

I have a little application that once I commit or save to the database it sends out 2 emails( Thanks to Trek) now I would like to provide the url as a link to the list page that contains the data, thus allowing the tech to just click on the link to login to the application and see his assigned work order. any and all help would be greatly appreaciated, thank you

Sergey Kornilov admin 2/10/2011

I guess you can simply copy and paste URL of the list page into your code.

T
trek46 2/10/2011

You had a great idea I hadn't thought of it. Here is what I came up with:
Take Sergy idea of copying the url then add the edit id's so the link will take you straight to the edit page of the record. In mine I have two keys so if you need more or less just add/delete the ."&editid2=".$keys["SECOND_ID"] for each key.

$msg.= "Goto: http://www.yourwebsite.com/YOUR_TABLE_NAME_edit.php?editid1=".$keys["FIRSTKEY_ID"]."&editid2=".$keys["SECONDKEY_ID";];




I have a little application that once I commit or save to the database it sends out 2 emails( Thanks to Trek) now I would like to provide the url as a link to the list page that contains the data, thus allowing the tech to just click on the link to login to the application and see his assigned work order. any and all help would be greatly appreaciated, thank you

T
trek46 2/10/2011

You wanted to do this from the add form, right? The code is little different since the PrimaryKeyID number isn't known you'll have to make a custom query:



$newID="";

// This makes it so the query will find the newest ID, the one you just added.

$FindNewID = CustomQuery("SELECT PrimaryKeyID FROM YOUR_TABLE ORDER BY YOUR_TABLE.PrimaryKeyID DESC LIMIT 1");

// This put that results into the array so we can use the results

$data_ID=db_fetch_array($FindNewID);

// This identifies the column to be used from the result

$newID=$data_ID["PrimaryKeyID"];

// This will create the link

$msg.= "Goto: http://www.yourwebsite.com/YOUR_TABLE_NAME_edit.php?editid1=".$newID;


Hope that helps!



You had a great idea I hadn't thought of it. Here is what I came up with:
Take Sergy idea of copying the url then add the edit id's so the link will take you straight to the edit page of the record. In mine I have two keys so if you need more or less just add/delete the ."&editid2=".$keys["SECOND_ID"] for each key.

$msg.= "Goto: http://www.yourwebsite.com/YOUR_TABLE_NAME_edit.php?editid1=".$keys["FIRSTKEY_ID"]."&editid2=".$keys["SECONDKEY_ID";];


R
rlee6087 author 2/10/2011



I have a little application that once I commit or save to the database it sends out 2 emails( Thanks to Trek) now I would like to provide the url as a link to the list page that contains the data, thus allowing the tech to just click on the link to login to the application and see his assigned work order. any and all help would be greatly appreaciated, thank you