Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8694739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:51:21+00:00 2026-06-13T00:51:21+00:00

On a page on I’m working on, it can be password protected, so a

  • 0

On a page on I’m working on, it can be password protected, so a user would have to login before they can see the content. After they login the following code is called:

//In one file
function current_page_url() {
    return 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}

//In Another file
generate_page_cookie();
header('Location: ', current_page_url());
exit;

Which doesn’t work. The following however does:

generate_page_cookie();
header('Location: ', 'http://example.com');
exit;

It seems strange that using a string in the header function works, but a function call within the header function doesn’t.

I think it might have something to do with accessing the $_SERVER variable, but I’m not sure.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:51:24+00:00Added an answer on June 13, 2026 at 12:51 am

    Change your , to ., php use . to concat strings.

    header('Location: ' . current_page_url());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

page.xml.php will not show any output, in firebug I can see the get response
page: http://jsbin.com/eniva4/edit I have one main div: #main-content which contains two div's : #announcement
Page A has a meta refresh to redirect to another page, C , after
Page has menu items that would replace a 'div id=foo_(current menu item)' with 'div
I have a jquery bug and I've been looking for hours now, I can't
page = <!DOCTYPE HTML><html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'> + </head><body> + page + </body></html>; webContent.loadData(page,
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Page A has iframe B. In iframe B, I have a var store a
page I'm working with: http://jsbin.com/abewe4 I want the slogan div centered inside col3 div
Page Load: protected void Page_Load(object sender, EventArgs e) { tb.Columns.Add(Id, typeof(int)); tb.Columns.Add(FileName, typeof(string)); tb.Columns.Add(FilePath,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.