Daniel
Daniel

Reputation: 21

Addin url paramater to current page(header location)

Instead of making few header location like:

 header("Location: pagename.php?alert=xxxx");

I want to add ?alert=xxx to current opened page, how to do it?

Upvotes: 0

Views: 19

Answers (1)

prasanth
prasanth

Reputation: 22500

Try with PHP_SELF

if(!isset($_REQUEST['alert']){
    header("Location: ".{$_SERVER['PHP_SELF']}."?alert=xxxx");
}

Upvotes: 1

Related Questions