1
wtravel
Getting variables from url for use in a block ?!?

Hi,

I cannot seem to get the variables from the url into the block code. The following is an extract of a custom block. The rest of the block code is working fine.

Quote:

function b_destblocks_show($options) {
global $xoopsDB;
if (isset($HTTP_GET_VARS['locdestid'])) {
$locdestid = intval($HTTP_GET_VARS['locdestid']);
}
...
}


The url I enter is for example:
http://www.worldtravelpublishers.com/modules/testlinks/location.php?locdestid=2

I cannot get the variable for locdestid out of the url for use in the code.

Does anyone have an idea of how to do this?

Thanks,

Martijn

2
wtravel
Re: Getting variables from url for use in a block ?!?

I also tried defining the variables in location.php as well, but I cannot use that definition in the file where the function for the desired block is used.

So what I would like to know is how I can get the variables I used in the URL into the function for showing a block.

With kind regards,

Martijn

3
dscg
Re: Getting variables from url for use in a block ?!?
  • 2003/10/14 17:07

  • dscg

  • Just popping in

  • Posts: 9

  • Since: 2002/6/7 8


In your function, try changing
global $xoopsDB;

to this
global $xoopsDB$HTTP_GET_VARS;

4
wtravel
Re: Getting variables from url for use in a block ?!?

Steve,

Worked like a charm! Thanks a lot for your help.

Best regards,

Martijn

Login

Who's Online

452 user(s) are online (307 user(s) are browsing Support Forums)


Members: 0


Guests: 452


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits