php - How to redirected to current page after processing the code and its result on other page? -
php - How to redirected to current page after processing the code and its result on other page? -
i have email newsletter on mutual footer file whch displayed ove site, have email newsletter section in footer.
now want newsletter input email processed , and homecoming same page news letter has been subscribed. not have permission redirect form footer.php.
please suggest thought create happen
if understand correctly have footer on every page link this: (correct me if i'm wrong)
<div id="footer"> <a href="/newsletter/subscribe.php">subscribe newsletter</a> </div>
let's you're on page url
/article/20100924
and want go page after processing /newsletter/subscribe.php
as usual there several possible answers this.
if configured correctly there should $_server['http_referer'] variable in server array pointing page click originated utilize that, , after processing form set
header('location: '.$_server['http_referer']);
at end of /newsletter/subscribe.php
if don't trust $_server['http_referer'] right set originating page link url this:
<a href="/newsletter/subscribe.php?backurl=%2farticle%sf20100924"> subscribe newsletter </a>
php redirect
Comments
Post a Comment