Dynamic URL Redirecting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Php Beginner
Forum Commoner
Posts: 28
Joined: Fri Nov 04, 2011 9:04 am

Dynamic URL Redirecting

Post 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.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Dynamic URL Redirecting

Post 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>
Php Beginner
Forum Commoner
Posts: 28
Joined: Fri Nov 04, 2011 9:04 am

Re: Dynamic URL Redirecting

Post 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>
suresh010
Forum Newbie
Posts: 6
Joined: Thu Feb 09, 2012 12:54 am

Re: Dynamic URL Redirecting

Post 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
Post Reply