Page 1 of 1

Dynamic URL Redirecting

Posted: Wed Feb 08, 2012 5:30 am
by Php Beginner
Hi there,

I have a student database system and I am currently adding a simple discussion forum into it. I have no problem to add a link which connected to the forum, but having difficulty to link the forum back to the home page. The system flow is like this; Users login their account and there will be the home page which showing the main menu and their basic info. From the main menu, there is a tab for the forum. At this stage, there is no problem occur. Problem occurred when I redirecting the forum to the home page, it is an empty page which is not the original home page.

Usual home page: URL= http://localhost/Mentor Mentee System/test.php?student_id=12345
Image:
Image

Empty home page: URL = http://localhost/Mentor Mentee System/test.php?student_id= [After redirecting back from forum]
Image:
Image

I need the URL to be "http://localhost/Mentor Mentee System/test.php?student_id=12345" after redirecting from forum.
What can I do to correct that? Please advice.

Re: Dynamic URL Redirecting

Posted: Wed Feb 08, 2012 5:35 am
by Celauran
How are you currently redirecting? Where is student_id stored? I would imagine it would be something like

Code: Select all

<a href="test.php?student_id=<?php echo $_SESSION['id']; ?>">Home Page</a>

Re: Dynamic URL Redirecting

Posted: Wed Feb 08, 2012 6:26 am
by Php Beginner
This is how I wrote

Code: Select all

<a href="test.php?student_id=<?php echo $_SESSION['student_id']; ?>"color:# 004080">Home Page</a>

Re: Dynamic URL Redirecting

Posted: Thu Feb 09, 2012 1:09 am
by suresh010
so are you keeping the student_id in SESSION when you are login ( i mean in the login page.....) can you show me the your login page source code so that i can help you betterly