[SOLVED] Â How to create a hyperlink using session variables? |
11/6/2007 9:02:51 PM |
PHPRunner General questions | |
R
runnerPHP2008 author
After users log in, they have a session variable that is associated with their record in the database. |
|
![]() |
Admin 11/6/2007 |
Take a look at the list of PHPRunner Session variables: |
R
|
runnerPHP2008 author 11/6/2007 |
THis is the link that I created based on the information you have given me: Take a look at the list of PHPRunner Session variables: http://www.xlinesoft.com/phprunner/docs/ph...n_variables.htm $_SESSION["UserID"] stores logged user name. If you like to use ID field for this purpose you need to write an extra code that pulls ID from login table based on user name. |
J
|
Jane 11/7/2007 |
Hi, global $conn; $str = "select ID from users where name='".$_SESSION["UserID"]."'"; $rs = db_query($str,$conn); if ($data = db_fetch_array($rs)) echo "<a href=\"http://www.domain.com/_Project_edit.php?ID=".$data["ID"]."\">Link</a>";
|
R
|
runnerPHP2008 author 11/18/2007 |
I am still having problems, but I understand your solution. Below is the code I have saved as a .php file. I am getting an error about the call to function not found "db_query" on line 5: |
J
|
Jane 11/19/2007 |
Hi, |
R
|
runnerPHP2008 author 11/26/2007 |
I do not want to add PHP code to a template, I have created a separate .php page. I just need to know what include files to add to this page and how to design it... Hi, to add PHP code to your template use custom events on the page (Insert PHP code snippet option on the Visual Editor tab). |
J
|
Jane 11/27/2007 |
Hi, include("include/dbcommon.php"); |