Hi all

I need some help with url links! I've switched register globals off in the ini file, but have now discovered that url links like:
http://www.myserver.com/index.php?idx=1&idx2=2
no longer work. The variables are not being passed.

Can someone please help me with this?

Thanks

    you need to access those variables like this:

    $_GET['variablepassed']

    instead of just:

    $variablepassed

    with register_globals off,

    if you are using post simple use:

    $_POST['postedvariable']

    voila

      Thanks mate - but I'm now getting "undefined index" errors...

        maybe post some code so we can check it out closer and what version of php are you using

          ok..
          I've got an image of a radar - on the radar I'm pulling data from the database and plotting points that can be clicked on. This opens a new window displaying data on that particular point on the radar.

          print"<area onClick=\"popupPage('http://www.myserver.com/radar_detail.php?idx=$row2[34]')\" shape=\"circle\" coords=\"$x_true_1,$y_true_1,6\">";

          This opens a new window and I have the following code in there:

          $query = " select * from database where idx = $_GET['idx'] ";

          The error I'm now getting is "undefined index idx".

          All help appreciated!
          thanks

            try putting

            extract($_GET);

            before any places where you need to access a $variable, and take out the $_GET['variable']

              Thanks. I've tried some other stuff too and finally got it to work using $REQUEST.
              I'm happy its working now - but am confused. Can anyone please explain why $
              GET didn't work, but $_REQUEST did?😕

                not too sure why it wouldn't work, but $REQUEST will get the variable whether it is a get, post, file, session or any other, however, if you are ensured that it was a get var you were trying to get, $GET should have worked, it could be a php version issue i suppose, you could also try $HTTP_GET_VARS i suppose, for testing purposes

                  Write a Reply...