Support » Fixing WordPress » Passing a parameter to a WordPress page

  • Resolved loothi



    Newbie here, I have a newsletter registration page which needs to show the right message depending upon parameters called.


    CASE 1:
    Success for registering!

    CASE 2:
    We couldn’t register you.

    The newsletter page (a “Page” with custom PHP template) does not recognise the parameters.

    Test code in the template is

    <? if ($_GET[‘error’]==1) {
    echo ‘ERROR TRUE’;
    } else {
    echo ‘ERROR FALSE’;
    } ?>

    and ‘ERROR FALSE’ always shows.

    Am I doing something dumb? Any ideas?


Viewing 4 replies - 1 through 4 (of 4 total)
  • whooami



    obviously the $GET isnt being set.

    $mything = ( empty( $_GET['error'] ) ? '' : $_GET['error'] );
    if ($mything == 1)
    echo 'ERROR TRUE'; }
    else {
    echo 'ERROR FALSE';
    } ?>

    try that, it works for me.

    Do you have pretty permalinks on (Apache/mod_rewrite)?

    Odd. Works if param is called errorz but not error. Oh well, works now, thanks.




    error might be an internal variable of some kind to PHP, dunno.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Passing a parameter to a WordPress page’ is closed to new replies.