| Author |
Problems with variable
|
|
| Maurice Schalker 2004-10-14, 3:56 pm |
| If got a menuscript on a site with variables
The link is :<a href='menu.php?menuid=1>
In menu.php the variabele is read:
if ($menuid=='1') {
echo"<a href='1-1.html' target='output' class=submenu>In het kort</a><BR>";}
This works on my own server : http://dragstra.mweb-design.nl/kc
But not here : http://www.keuzecentrum.nl
Help
| |
| Alvaro G Vicario 2004-10-14, 3:56 pm |
| *** Maurice Schalker wrote/escribió (Thu, 14 Oct 2004 11:45:15 +0200):
> If got a menuscript on a site with variables
> The link is :<a href='menu.php?menuid=1>
> In menu.php the variabele is read:
> if ($menuid=='1') {
Replace $menuid with $_GET['menuid'] and find some documentation about the
register_globals option in php.ini
--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--
| |
|
| Maurice,
I'm only guessing here, but perhaps you have a solo apostrophe in <a
href='menu.php?menuid=1>
which may be causing your problem?
-Ike
"Maurice Schalker" <info@fotoserver.nl> wrote in message
news:416e4aa2$0$568$e4fe514c@news.xs4all.nl...
> If got a menuscript on a site with variables
> The link is :<a href='menu.php?menuid=1>
> In menu.php the variabele is read:
> if ($menuid=='1') {
> echo"<a href='1-1.html' target='output' class=submenu>In het
kort</a><BR>";}
>
> This works on my own server : http://dragstra.mweb-design.nl/kc
>
> But not here : http://www.keuzecentrum.nl
>
> Help
>
>
| |
| Treefrog 2004-10-14, 3:56 pm |
|
"Alvaro G Vicario" <alvaro_QUITAR_REMOVE@telecomputeronline.com> wrote in
message news:1u1fz06srecz0$.yz4vud9emyuz.dlg@40tude.net...
> *** Maurice Schalker wrote/escribió (Thu, 14 Oct 2004 11:45:15 +0200):
>
> Replace $menuid with $_GET['menuid'] and find some documentation about the
> register_globals option in php.ini
Yes, later versions of PHP (4.2.0> ) turn off register globals by default. It
is very dangerous. See here http://uk2.php.net/register_globals
However, I tend to use $_REQUEST['menuid'] as this leaves your scripts
easily portable between get and post methods....
Nathan
|
|
|
|