RE: [PHP] Help for passing variable to all pages
change: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a to: a href=?php print \welcome.php3?dbcnxid=$dbcnx\; ?test link/a -Original Message- From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 5:30 PM To: PHP List Subject: [PHP] Help for passing variable to all pages Hi All, I am new to PHP and learning as I go by reading many of the tutorials around. I have however come up against a problem that I can't seem to solve of find any other references to. I need to make some information available to every page and one of the series of articles by Kevin Yank which talks about PHP and MySql seemed to suggest how to do exactly what I wanted but I can't get it to work. His suggestion was to do something like A HREF=newpage.php?name=?php echo($myvar); ? A link /A I think my problem is in the ...A LINK.. bit - what exactly should go here? I tried some code to see if it worked and this is what I did: in login.html html head titleDMS Login/title ?php $dbcnx=@mysql_connect(localhost,DMS,); echo ( P Connection established on $dbcnx/P); if (!$dbcnx) { echo( PUnable to connect to MySql Server at this time./P}; exit(); } if (! @mysql_connect_db(DMS, $dbcnx) ) { echo( PUnable to connect to DMS database at this time./P}; exit(); } ? a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a FORM ACTION=welcome.php3 METHOD=GET First name: INPUT TYPE=TEXT NAME=firstnameBR Last Name: INPUT TYPE=TEXT NAME=lastname INPUT TYPE=SUBMIT VALUE=GO /FORM br br In the welcome.php3 file I have HTML HEAD TITLEToday's Date/TITLE /HEAD BODY PToday's date (according to this server) ?php echo( date(l, F dS Y.) ); echo (Welcome to our web site $firstname $lastname $dbcnxid ); echo ( $dbcnxid); echo ( $QUERY_STRING); ? /BODY /HTML What I get is on login page - the texttest linkin blue (i.e. a link?) and the login prompts. On the welcome page I get the firstname and lastname ok, but the other parameter is not in the $QUERY_STRING Does anyone have any ideas as to what I am doing wrong? Maybe there is a better way to have some information, that will be retrieved from the DB available to all pages in the session. We are not actually going to have all the users with logins to the DB - but have our own internal table of users, password and rights information, thus the userid form this table needs to be available to all pages. Many Thanks in advance for your help Janet Cook Software Engineer IT CM CSDD NEC Australia Pty Ltd Ph +613 9264 3813 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help for passing variable to all pages
a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a You can't pass resource types like database connection IDs in URLs as they are only relevant for the instance of the script in which they are created. The same goes for things like file identifiers (from fopen) and other stuff like that. Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help for passing variable to all pages
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... That's not a lot of help - its a new installation, as far as I know everything has been done to default settings. What can I do to check the server setup Janet -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 20 February 2002 10:59 To: 'WG4- Cook, Janet'; PHP List Subject: RE: [PHP] Help for passing variable to all pages that makes me think that your page isn't being executed through php. why this is happening, i don't know - maybe a misconfigured web server Martin -Original Message- From: WG4- Cook, Janet [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, February 20, 2002 10:50 AM To: Martin Towell; PHP List Subject: RE: [PHP] Help for passing variable to all pages Ok - I changed it to a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a First login page now has test linkthen the login stuff, and I still don't get the value through Janet -Original Message- From: Martin Towell [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, 20 February 2002 10:38 To: 'WG4- Cook, Janet'; PHP List Subject: RE: [PHP] Help for passing variable to all pages looks like there's a problem with this line: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a Just do a page with phpinfo() on it - if that works you know your server is parsing PHP. If not, more info about your setup would help for troubleshooting. -- David Robley Temporary Kiwi! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help for passing variable to all pages
Thanks for the suggestion but it made no difference! I am still getting nothing through I think its something to do with the test link bit - what actually should go in here - how does it relate this to all links? Janet -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Thursday, 21 February 2002 2:04 To: 'WG4- Cook, Janet'; PHP List Subject: RE: [PHP] Help for passing variable to all pages change: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a to: a href=?php print \welcome.php3?dbcnxid=$dbcnx\; ?test link/a -Original Message- From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 5:30 PM To: PHP List Subject: [PHP] Help for passing variable to all pages Hi All, I am new to PHP and learning as I go by reading many of the tutorials around. I have however come up against a problem that I can't seem to solve of find any other references to. I need to make some information available to every page and one of the series of articles by Kevin Yank which talks about PHP and MySql seemed to suggest how to do exactly what I wanted but I can't get it to work. His suggestion was to do something like A HREF=newpage.php?name=?php echo($myvar); ? A link /A I think my problem is in the ...A LINK.. bit - what exactly should go here? I tried some code to see if it worked and this is what I did: in login.html html head titleDMS Login/title ?php $dbcnx=@mysql_connect(localhost,DMS,); echo ( P Connection established on $dbcnx/P); if (!$dbcnx) { echo( PUnable to connect to MySql Server at this time./P}; exit(); } if (! @mysql_connect_db(DMS, $dbcnx) ) { echo( PUnable to connect to DMS database at this time./P}; exit(); } ? a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a FORM ACTION=welcome.php3 METHOD=GET First name: INPUT TYPE=TEXT NAME=firstnameBR Last Name: INPUT TYPE=TEXT NAME=lastname INPUT TYPE=SUBMIT VALUE=GO /FORM br br In the welcome.php3 file I have HTML HEAD TITLEToday's Date/TITLE /HEAD BODY PToday's date (according to this server) ?php echo( date(l, F dS Y.) ); echo (Welcome to our web site $firstname $lastname $dbcnxid ); echo ( $dbcnxid); echo ( $QUERY_STRING); ? /BODY /HTML What I get is on login page - the texttest linkin blue (i.e. a link?) and the login prompts. On the welcome page I get the firstname and lastname ok, but the other parameter is not in the $QUERY_STRING Does anyone have any ideas as to what I am doing wrong? Maybe there is a better way to have some information, that will be retrieved from the DB available to all pages in the session. We are not actually going to have all the users with logins to the DB - but have our own internal table of users, password and rights information, thus the userid form this table needs to be available to all pages. Many Thanks in advance for your help Janet Cook Software Engineer IT CM CSDD NEC Australia Pty Ltd Ph +613 9264 3813 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help for passing variable to all pages
Well I tried setting the variable to a constant value and it still didn't work. What I eventually want to pass is an ID retrieved from the DB that will be needed by every page Janet -Original Message- From: Simon Willison [mailto:[EMAIL PROTECTED]] Sent: Thursday, 21 February 2002 2:37 To: Rick Emery Cc: 'WG4- Cook, Janet'; PHP List Subject: Re: [PHP] Help for passing variable to all pages a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a You can't pass resource types like database connection IDs in URLs as they are only relevant for the instance of the script in which they are created. The same goes for things like file identifiers (from fopen) and other stuff like that. Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help for passing variable to all pages
looks like there's a problem with this line: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a try using this line instead: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a looks like you were missing the end quotes and closing bracket of the anchor tag See how that goes Martin -Original Message- From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:30 AM To: PHP List Subject: [PHP] Help for passing variable to all pages Hi All, I am new to PHP and learning as I go by reading many of the tutorials around. I have however come up against a problem that I can't seem to solve of find any other references to. I need to make some information available to every page and one of the series of articles by Kevin Yank which talks about PHP and MySql seemed to suggest how to do exactly what I wanted but I can't get it to work. His suggestion was to do something like A HREF=newpage.php?name=?php echo($myvar); ? A link /A I think my problem is in the ...A LINK.. bit - what exactly should go here? I tried some code to see if it worked and this is what I did: in login.html html head titleDMS Login/title ?php $dbcnx=@mysql_connect(localhost,DMS,); echo ( P Connection established on $dbcnx/P); if (!$dbcnx) { echo( PUnable to connect to MySql Server at this time./P}; exit(); } if (! @mysql_connect_db(DMS, $dbcnx) ) { echo( PUnable to connect to DMS database at this time./P}; exit(); } ? a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a FORM ACTION=welcome.php3 METHOD=GET First name: INPUT TYPE=TEXT NAME=firstnameBR Last Name: INPUT TYPE=TEXT NAME=lastname INPUT TYPE=SUBMIT VALUE=GO /FORM br br In the welcome.php3 file I have HTML HEAD TITLEToday's Date/TITLE /HEAD BODY PToday's date (according to this server) ?php echo( date(l, F dS Y.) ); echo (Welcome to our web site $firstname $lastname $dbcnxid ); echo ( $dbcnxid); echo ( $QUERY_STRING); ? /BODY /HTML What I get is on login page - the texttest linkin blue (i.e. a link?) and the login prompts. On the welcome page I get the firstname and lastname ok, but the other parameter is not in the $QUERY_STRING Does anyone have any ideas as to what I am doing wrong? Maybe there is a better way to have some information, that will be retrieved from the DB available to all pages in the session. We are not actually going to have all the users with logins to the DB - but have our own internal table of users, password and rights information, thus the userid form this table needs to be available to all pages. Many Thanks in advance for your help Janet Cook Software Engineer IT CM CSDD NEC Australia Pty Ltd Ph +613 9264 3813 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help for passing variable to all pages
Ok - I changed it to a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a First login page now has http://147.76.130.12/dms/demo/welcome.php3?dbcnxid=?php echo( test linkthen the login stuff, and I still don't get the value through Janet -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 20 February 2002 10:38 To: 'WG4- Cook, Janet'; PHP List Subject: RE: [PHP] Help for passing variable to all pages looks like there's a problem with this line: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a try using this line instead: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a looks like you were missing the end quotes and closing bracket of the anchor tag See how that goes Martin -Original Message- From: WG4- Cook, Janet [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, February 20, 2002 10:30 AM To: PHP List Subject: [PHP] Help for passing variable to all pages Hi All, I am new to PHP and learning as I go by reading many of the tutorials around. I have however come up against a problem that I can't seem to solve of find any other references to. I need to make some information available to every page and one of the series of articles by Kevin Yank which talks about PHP and MySql seemed to suggest how to do exactly what I wanted but I can't get it to work. His suggestion was to do something like A HREF=newpage.php?name=?php echo($myvar); ? A link /A I think my problem is in the ...A LINK.. bit - what exactly should go here? I tried some code to see if it worked and this is what I did: in login.html html head titleDMS Login/title ?php $dbcnx=@mysql_connect(localhost,DMS,); echo ( P Connection established on $dbcnx/P); if (!$dbcnx) { echo( PUnable to connect to MySql Server at this time./P}; exit(); } if (! @mysql_connect_db(DMS, $dbcnx) ) { echo( PUnable to connect to DMS database at this time./P}; exit(); } ? a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a FORM ACTION=welcome.php3 METHOD=GET First name: INPUT TYPE=TEXT NAME=firstnameBR Last Name: INPUT TYPE=TEXT NAME=lastname INPUT TYPE=SUBMIT VALUE=GO /FORM br br In the welcome.php3 file I have HTML HEAD TITLEToday's Date/TITLE /HEAD BODY PToday's date (according to this server) ?php echo( date(l, F dS Y.) ); echo (Welcome to our web site $firstname $lastname $dbcnxid ); echo ( $dbcnxid); echo ( $QUERY_STRING); ? /BODY /HTML What I get is on login page - the texttest linkin blue (i.e. a link?) and the login prompts. On the welcome page I get the firstname and lastname ok, but the other parameter is not in the $QUERY_STRING Does anyone have any ideas as to what I am doing wrong? Maybe there is a better way to have some information, that will be retrieved from the DB available to all pages in the session. We are not actually going to have all the users with logins to the DB - but have our own internal table of users, password and rights information, thus the userid form this table needs to be available to all pages. Many Thanks in advance for your help Janet Cook Software Engineer IT CM CSDD NEC Australia Pty Ltd Ph +613 9264 3813 Email: [EMAIL PROTECTED] -- PHP General Mailing List ( http://www.php.net/ http://www.php.net/ ) To unsubscribe, visit: http://www.php.net/unsub.php http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help for passing variable to all pages
that makes me think that your page isn't being executed through php. why this is happening, i don't know - maybe a misconfigured web server Martin -Original Message- From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:50 AM To: Martin Towell; PHP List Subject: RE: [PHP] Help for passing variable to all pages Ok - I changed it to a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a First login page now has http://147.76.130.12/dms/demo/welcome.php3?dbcnxid=?php echo( test linkthen the login stuff, and I still don't get the value through Janet -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 20 February 2002 10:38 To: 'WG4- Cook, Janet'; PHP List Subject: RE: [PHP] Help for passing variable to all pages looks like there's a problem with this line: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a try using this line instead: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a looks like you were missing the end quotes and closing bracket of the anchor tag See how that goes Martin -Original Message- From: WG4- Cook, Janet [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, February 20, 2002 10:30 AM To: PHP List Subject: [PHP] Help for passing variable to all pages Hi All, I am new to PHP and learning as I go by reading many of the tutorials around. I have however come up against a problem that I can't seem to solve of find any other references to. I need to make some information available to every page and one of the series of articles by Kevin Yank which talks about PHP and MySql seemed to suggest how to do exactly what I wanted but I can't get it to work. His suggestion was to do something like A HREF=newpage.php?name=?php echo($myvar); ? A link /A I think my problem is in the ...A LINK.. bit - what exactly should go here? I tried some code to see if it worked and this is what I did: in login.html html head titleDMS Login/title ?php $dbcnx=@mysql_connect(localhost,DMS,); echo ( P Connection established on $dbcnx/P); if (!$dbcnx) { echo( PUnable to connect to MySql Server at this time./P}; exit(); } if (! @mysql_connect_db(DMS, $dbcnx) ) { echo( PUnable to connect to DMS database at this time./P}; exit(); } ? a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a FORM ACTION=welcome.php3 METHOD=GET First name: INPUT TYPE=TEXT NAME=firstnameBR Last Name: INPUT TYPE=TEXT NAME=lastname INPUT TYPE=SUBMIT VALUE=GO /FORM br br In the welcome.php3 file I have HTML HEAD TITLEToday's Date/TITLE /HEAD BODY PToday's date (according to this server) ?php echo( date(l, F dS Y.) ); echo (Welcome to our web site $firstname $lastname $dbcnxid ); echo ( $dbcnxid); echo ( $QUERY_STRING); ? /BODY /HTML What I get is on login page - the texttest linkin blue (i.e. a link?) and the login prompts. On the welcome page I get the firstname and lastname ok, but the other parameter is not in the $QUERY_STRING Does anyone have any ideas as to what I am doing wrong? Maybe there is a better way to have some information, that will be retrieved from the DB available to all pages in the session. We are not actually going to have all the users with logins to the DB - but have our own internal table of users, password and rights information, thus the userid form this table needs to be available to all pages. Many Thanks in advance for your help Janet Cook Software Engineer IT CM CSDD NEC Australia Pty Ltd Ph +613 9264 3813 Email: [EMAIL PROTECTED] -- PHP General Mailing List ( http://www.php.net/ http://www.php.net/ ) To unsubscribe, visit: http://www.php.net/unsub.php http://www.php.net/unsub.php
RE: [PHP] Help for passing variable to all pages
That's not a lot of help - its a new installation, as far as I know everything has been done to default settings. What can I do to check the server setup Janet -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 20 February 2002 10:59 To: 'WG4- Cook, Janet'; PHP List Subject: RE: [PHP] Help for passing variable to all pages that makes me think that your page isn't being executed through php. why this is happening, i don't know - maybe a misconfigured web server Martin -Original Message- From: WG4- Cook, Janet [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, February 20, 2002 10:50 AM To: Martin Towell; PHP List Subject: RE: [PHP] Help for passing variable to all pages Ok - I changed it to a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a First login page now has test linkthen the login stuff, and I still don't get the value through Janet -Original Message- From: Martin Towell [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, 20 February 2002 10:38 To: 'WG4- Cook, Janet'; PHP List Subject: RE: [PHP] Help for passing variable to all pages looks like there's a problem with this line: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a try using this line instead: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a looks like you were missing the end quotes and closing bracket of the anchor tag See how that goes Martin -Original Message- From: WG4- Cook, Janet [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, February 20, 2002 10:30 AM To: PHP List Subject: [PHP] Help for passing variable to all pages Hi All, I am new to PHP and learning as I go by reading many of the tutorials around. I have however come up against a problem that I can't seem to solve of find any other references to. I need to make some information available to every page and one of the series of articles by Kevin Yank which talks about PHP and MySql seemed to suggest how to do exactly what I wanted but I can't get it to work. His suggestion was to do something like A HREF=newpage.php?name=?php echo($myvar); ? A link /A I think my problem is in the ...A LINK.. bit - what exactly should go here? I tried some code to see if it worked and this is what I did: in login.html html head titleDMS Login/title ?php $dbcnx=@mysql_connect(localhost,DMS,); echo ( P Connection established on $dbcnx/P); if (!$dbcnx) { echo( PUnable to connect to MySql Server at this time./P}; exit(); } if (! @mysql_connect_db(DMS, $dbcnx) ) { echo( PUnable to connect to DMS database at this time./P}; exit(); } ? a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a FORM ACTION=welcome.php3 METHOD=GET First name: INPUT TYPE=TEXT NAME=firstnameBR Last Name: INPUT TYPE=TEXT NAME=lastname INPUT TYPE=SUBMIT VALUE=GO /FORM br br In the welcome.php3 file I have HTML HEAD TITLEToday's Date/TITLE /HEAD BODY PToday's date (according to this server) ?php echo( date(l, F dS Y.) ); echo (Welcome to our web site $firstname $lastname $dbcnxid ); echo ( $dbcnxid); echo ( $QUERY_STRING); ? /BODY /HTML What I get is on login page - the texttest linkin blue (i.e. a link?) and the login prompts. On the welcome page I get the firstname and lastname ok, but the other parameter is not in the $QUERY_STRING Does anyone have any ideas as to what I am doing wrong? Maybe there is a better way to have some information, that will be retrieved from the DB available to all pages in the session. We are not actually going to have all the users with logins to the DB - but have our own internal table of users, password and rights information, thus the userid form this table needs to be available to all pages. Many Thanks in advance for your help Janet Cook Software Engineer IT CM CSDD NEC Australia Pty Ltd Ph +613 9264 3813 Email: [EMAIL PROTECTED] -- PHP General Mailing List ( http://www.php.net/ http://www.php.net/ http://www.php.net/ http://www.php.net/ ) To unsubscribe, visit: http://www.php.net/unsub.php http://www.php.net/unsub.php http://www.php.net/unsub.php http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help for passing variable to all pages
Create a new page with just the following in it ?php echo Running PHP; ? if you then load that page through your server and you don't see the just the words, then your server isn't executing your script... If it's not going through php, specify your OS, and server type and someone here should be able to help you. Martin -Original Message- From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 1:18 PM To: Martin Towell; WG4- Cook, Janet; PHP List Subject: RE: [PHP] Help for passing variable to all pages That's not a lot of help - its a new installation, as far as I know everything has been done to default settings. What can I do to check the server setup Janet -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 20 February 2002 10:59 To: 'WG4- Cook, Janet'; PHP List Subject: RE: [PHP] Help for passing variable to all pages that makes me think that your page isn't being executed through php. why this is happening, i don't know - maybe a misconfigured web server Martin -Original Message- From: WG4- Cook, Janet [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, February 20, 2002 10:50 AM To: Martin Towell; PHP List Subject: RE: [PHP] Help for passing variable to all pages Ok - I changed it to a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a First login page now has test linkthen the login stuff, and I still don't get the value through Janet -Original Message- From: Martin Towell [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, 20 February 2002 10:38 To: 'WG4- Cook, Janet'; PHP List Subject: RE: [PHP] Help for passing variable to all pages looks like there's a problem with this line: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a try using this line instead: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a looks like you were missing the end quotes and closing bracket of the anchor tag See how that goes Martin -Original Message- From: WG4- Cook, Janet [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, February 20, 2002 10:30 AM To: PHP List Subject: [PHP] Help for passing variable to all pages Hi All, I am new to PHP and learning as I go by reading many of the tutorials around. I have however come up against a problem that I can't seem to solve of find any other references to. I need to make some information available to every page and one of the series of articles by Kevin Yank which talks about PHP and MySql seemed to suggest how to do exactly what I wanted but I can't get it to work. His suggestion was to do something like A HREF=newpage.php?name=?php echo($myvar); ? A link /A I think my problem is in the ...A LINK.. bit - what exactly should go here? I tried some code to see if it worked and this is what I did: in login.html html head titleDMS Login/title ?php $dbcnx=@mysql_connect(localhost,DMS,); echo ( P Connection established on $dbcnx/P); if (!$dbcnx) { echo( PUnable to connect to MySql Server at this time./P}; exit(); } if (! @mysql_connect_db(DMS, $dbcnx) ) { echo( PUnable to connect to DMS database at this time./P}; exit(); } ? a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a FORM ACTION=welcome.php3 METHOD=GET First name: INPUT TYPE=TEXT NAME=firstnameBR Last Name: INPUT TYPE=TEXT NAME=lastname INPUT TYPE=SUBMIT VALUE=GO /FORM br br In the welcome.php3 file I have HTML HEAD TITLEToday's Date/TITLE /HEAD BODY PToday's date (according to this server) ?php echo( date(l, F dS Y.) ); echo (Welcome to our web site $firstname $lastname $dbcnxid ); echo ( $dbcnxid); echo ( $QUERY_STRING); ? /BODY /HTML What I get is on login page - the texttest linkin blue (i.e. a link?) and the login prompts. On the welcome page I get the firstname and lastname ok, but the other parameter is not in the $QUERY_STRING Does anyone have any ideas as to what I am doing wrong? Maybe there is a better way to have some information, that will be retrieved from the DB available to all pages in the session. We are not actually going to have all the users with logins to the DB - but have our own internal table of users, password and rights information, thus the userid form this table needs to be available to all pages. Many Thanks in advance for your help Janet Cook Software Engineer IT CM CSDD NEC Australia Pty Ltd Ph +613 9264 3813 Email: [EMAIL PROTECTED] -- PHP General Mailing List ( http://www.php.net/ http://www.php.net/ http://www.php.net/ http://www.php.net/ ) To unsubscribe, visit: http://www.php.net/unsub.php http://www.php.net/unsub.php http://www.php.net/unsub.php http://www.php.net/unsub.php