Jump to content

Paramater Pick-Up Problem

Recommended Posts

I understand that to pass a paramater from one page to another 
from a call in a function I must have "?param=myparam" following my page id.

    function ancesterF(myparam)
    {location.href='mypage1.php? param=myparam';return false;
    window.open(location.href); return false;} 
and to pick-up the paramater in the called page, I need to use:

However, it doesn't work.  
The resulting pick-up is "myparam" instead of the 
value of "myparam" which is "10006"

Does anyone know how to pick-up the value passed?

I can't find anything about this in PHP documentation.

Many thanks

Link to post
Share on other sites

The clue is in what actually happened! 

?param=myparam (as in index = value)

$getmyparam=$_GET['param']; (apply index value to $getmyparam)

returns 'myparam' (the value)

myparam should be 10006.

Its treating myparam as a string, not parameter variable, you have to separate the variable from the string

{location.href='mypage1.php?param='+myparam;return false;
    window.open(location.href); return false;} 

'mypage1.php?param=' is string part, while +myparam will now join the value of myparam to rest of string

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...