How to layout php header location with a variable as the location?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Matthew3360
    New Member
    • May 2023
    • 5

    #1

    How to layout php header location with a variable as the location?

    Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
    Here is my code.
    Code:
     header("Location:".$urlback);
    Is this the right layout the redirect. I keep finding it is not redirecting and is just ignoring the request.




    Kind regards Matthew
  • Niheel
    Recognized Expert Moderator Top Contributor
    • Jul 2005
    • 2433

    #2
    Check the variable $urlback by echoing it before the header statement.

    If that checks out.

    Then try this.
    header("Locatio n: $urlback");
    niheel @ bytes

    Comment

    Working...