hyperlink

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
User avatar
shiranwas
Forum Commoner
Posts: 53
Joined: Fri Jul 07, 2006 10:41 pm
Location: Colombo

hyperlink

Post by shiranwas »

Hi,

I have a html page with hyperlinks, i have use a session variable for user id, but this variable does not carry a value to the page it directs when i clik a hyperlink,
but it works in the page i have mentioned in the form tag

<form method="POST" action="complaintrdata.php">

this is my hyperlink

<a href="assign.php">assing</a>

can anyone tell me why is not this works.

thanks
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

are you calling session_start() at the top of your new page?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
shiranwas
Forum Commoner
Posts: 53
Joined: Fri Jul 07, 2006 10:41 pm
Location: Colombo

Post by shiranwas »

no i call session_start() only in the page where i have the session variable
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you must call it on any page where you wish to use session data.
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

Post by dibyendrah »

If you don't want to add session_start() in every page, you can change the php.ini in the [Session] section and change the line session.auto_start = 0 to session.auto_start = 1. After that, reload the configuration or restart the web sever.

:wink:
Dibyendra
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

session_start() is not that hard to add to your scripts. Just make sure you call it before you send any output to the browser. No blanks spaces, no <html>, no echo's, nothing. Then you should be golden.
User avatar
shiranwas
Forum Commoner
Posts: 53
Joined: Fri Jul 07, 2006 10:41 pm
Location: Colombo

Post by shiranwas »

thanks
Post Reply