Jump to content

modifying headers


Lethe

Recommended Posts

When I first run my php script I need to identify my script to others by modifying some sent header information as below...

 

ini_set('user_agent', 'somename');

header('From: myemail@someaddress.com');

flush();

 

I can confirm that ini_set is working by: echo ini_get('user_agent');

 

I can then check - in the same script - my headers using either:

 

foreach (getallheaders() as $name => $value) {

    echo "$name: $value<br />";

}

 

or

 

var_dump($_SERVER);

 

But neither of these show the changed headers. All the headers are still the same.

 

What am I doing wrong?

Link to comment
Share on other sites

Ummm, nope still nothing. I've already done everything mentioned in the post.

 

To confirm I try to change the headers before any html is outputted and there are no characters before or after the php tags. I've tried all the suggestions mentioned here http://ca.php.net/manual/en/function.flush.php

 

The header information returned is:

 

Host: localhost:8888

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Cache-Control: max-age=0

 

Any suggestions?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.