Linked Questions

592 votes
25 answers
463k views

I have a page that allows the user to download a dynamically-generated file. It takes a long time to generate, so I'd like to show a "waiting" indicator. The problem is, I can't figure out ...
JW.'s user avatar
  • 51.9k
585 votes
11 answers
484k views

What is the difference between $_SERVER['HTTP_HOST'] and $_SERVER['SERVER_NAME'] in PHP? When would you consider using one over the other and why?
Emanuil Rusev's user avatar
266 votes
11 answers
191k views

Consider these 2 examples... $key = 'jim'; // example 1 if (isset($array[$key])) { // ... } // example 2 if (array_key_exists($key, $array)) { // ... } I'm interested in knowing if ...
alex's user avatar
  • 492k
223 votes
9 answers
545k views

I have my site on the server http://www.example.uk.com. On this server I have two domains: one.example two.example I would like to get the current domain using PHP, but if I use $_SERVER['HTTP_HOST']...
Tony Evyght's user avatar
  • 2,585
137 votes
15 answers
335k views

I moved a WordPress installation to a new folder on a Windows/IIS server. I'm setting up 301 redirects in PHP, but it doesn't seem to be working. My post URLs have the following format: http:://www....
CtrlDot's user avatar
  • 3,122
41 votes
17 answers
293k views

when I had my site on development environment - it was url: testurl.com Now on production server my codeigniter app's address has to be someurl.com/mysite/ I moved it there, and everytime I'm trying ...
pawel's user avatar
  • 6,226
109 votes
2 answers
21k views

Any variable that a user can control, an attacker can also control and is therefore a source of an attack. This is called a "tainted" variable, and is unsafe. When using $_SERVER, many of the ...
rook's user avatar
  • 67.1k
86 votes
2 answers
341k views

I want to get the domain name for where the script is running. How can that be done with PHP? I see that $_SERVER['HTTP_HOST'] as well as $_SERVER['SERVER_NAME'] contain this information. Will that ...
Francisc's user avatar
  • 80.9k
23 votes
3 answers
81k views

Possible Duplicate: HTTP_HOST vs. SERVER_NAME What is the difference between $_SERVER['HTTP_HOST'] and $_SERVER['SERVER_NAME'] ??
Eman's user avatar
  • 333
3 votes
1 answer
21k views

I have problem with getting domain name using HTTP_REFERER. The condition is like this: http://www.example.com send a curl post to my server. The things is, example.com does not send their url in ...
Ariff Azmi's user avatar
1 vote
1 answer
10k views

I am attempting to redirect in a template index.php i am building and getting a redirect loop. Am I missing something? What I am attempting to do is redirect the default page depending on the entry ...
TEN Design's user avatar
1 vote
1 answer
6k views

I need to validate domain names using PHP. Only this format should be allowed: google.com, subdomain.stack-overflow.org etc It should only allow - (in case of special characters) No other format ...
sash's user avatar
  • 85
-3 votes
1 answer
4k views

I know (and see) that this question has been asked for about a thousand times, but, after search and search, and somewhat confusing answers, i'm still looking for a right answer. All I need is to ...
uollaa's user avatar
  • 17
1 vote
1 answer
2k views

I want to prevent coping my custom made CMS from domain to domain and I want that it is operable only on a doain that it is bought for and onluy for the period 1, 2 years from the purchase. The code ...
Derfder's user avatar
  • 3,334
0 votes
1 answer
2k views

I'm having some pretty weird error when I want to set my session cookie. If I use the following rule: session_set_cookie_params(0, '/', $_SERVER['HTTP_HOST'], false, true); //$_SERVER['HTTP_HOST'] ...
J. Peters's user avatar

15 30 50 per page