Forums

Passing Values to Pages (5 posts)

  1. mrtoner
    Member
    Posted 6 years ago #

    I'm using Autoresponder Plus on my site with WP and I'm wanting to use a custom subscribe failure page which will be called when the user is already subscribed, forgot to enter an e-mail address, etc. I've created the Page in WP.

    ARP adds '?code=Fnn' with the specific error to the custom subscribe failure URL. I've added some PHP to my Page to grab that error code (I'm using runPHP), but...

    With my permalinks looking like mydomain.com/lists/failure, '$_GET' returns nothing from mydomain.com/lists/failure?code=F09. I could use mydomain.com/?page_id=11, but ARP appends '?code=Fnn' instead of '&code=Fnn'.

    Any suggestions to get that passed value?

  2. Austin Matzko
    Member
    Posted 6 years ago #

    Have you tried $_SERVER['QUERY_STRING']?

  3. mrtoner
    Member
    Posted 6 years ago #

    Using $_SERVER['QUERY_STRING'] gives me the same results, blank for mydomain.com/lists/failure?code=F09.

    Two additional options I thought I'd try:

    1. Use mod_rewrite to change mydomain.com/?page_id=11?Fnn to mydomain.com/?page_id=11&Fnn, but try as I might I can't get the rule correct.

    2. Use explode() to parse the $_SERVER['QUERY_STRING'], but here's a weird one:

    <?php echo ($_SERVER['QUERY_STRING']); ?>

    returns page_id=11?Fnn, but

    <?php $p =($_SERVER['QUERY_STRING']); ?>
    <?php echo $p; ?>

    returns blank. I'm sure I'm just overlooking something simple in both cases.

  4. mrtoner
    Member
    Posted 6 years ago #

    I finally figured out #1:

    RewriteCond %{QUERY_STRING} page_id=11?code=(F[0-9][0-9])
    RewriteRule . /?page_id=11&code=%1 [R]

    but why is it that #2 doesn't work?

  5. mrtoner
    Member
    Posted 6 years ago #

    3. :-) I can't get a rewrite to work at all for mydomain.com/lists/failure?code=F09. The only variable that I see to be able to use is %{THE_REQUEST}, but

    RewriteCond %{THE_REQUEST} GET%20/lists/failure%3fcode=F09%20HTTP/1.1
    RewriteRule . /?page_id=11&code=F09 [R]

    doesn't work.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.