PhP Question
Whats the problem to this script?
<?
if ($_SERVER['HTTP_XID'] != 0){
header("Location: http://example.com");}
?>
<?
echo $_SERVER['HTTP_XID'];
?>
For some reason it isnt redirecting people that have an XID header. The bottom part was there just so I could see if I was using HTTP_XID right.
Because with the same script I can redirect others
<?
if($_SERVER['HTTP_CLIENTID'] != 0) {
header("Location: http://google.com")}
?>
For some reason the problem is just HTTP_XID. Not HTTP_CLIENTID or any others. Also for some reason when users from verizon come onto my webpage they dont send an HTTP_XID header anymore. Is this a problem with verizon or just me?
to get ALL headers I use this script…
<?
foreach($_SERVER as $key_name => $key_value) {
$Header = ($key_name . " = " . $key_value . "\n");
echo $Header;
?>
Should this not send ever Header?
MoshBat wrote: Run this: <? echo "test"; ?>
And next: <?php echo "test2"; ?>
If those both work, begin to echo parts of the code, such as the header.
Those will both work. Its not the short tagg that is the problem. Its the HTTP_XID not sending the information thats the problem. I can even go as far as this
<? echo $_SERVER['HTTP_CLIENTID']; ?>
if I was a sprint phone and went to my page with that it would print out my clientid. Verizon on the other hand did work at one time and now it does. Verizon has the XID. I originally could use this script
<? echo $_SERVER['HTTP_XID']; ?>
and now its just a blank page meaning there isnt an HTTP_XID. No errors just a blank page.
MoshBat wrote: Error reporting on?
Yes Display_erorro_message in my php.ini is on. Is there a way you can try this out yourself? See if I made lets say this
if ($_SERVER['HTTP_CLIENTID'] != 0) {
header("Location: http://google.com")
} elseif ($_SERVER['HTTP_X_UP_SUBNO'] != 0) {
header("Location: http://hellboundhackers.org")
} elseif ($_SERVER['HTTP_XID'] != 0) {
header("Location: http://yahoo.com")
} else {
header("Location: http://hackthissite.org")
}
It would redirect me to google if I had a ClientID. It would redirect me to Hellboundhackers if I had a X_UP_SUBNO. I would redirect me to hackthissite.org if I had a XID. It would STILL redirect me to Hackthissite even if I had none of the above. For some reason XID isnt registering or something.
<? if ( $_SERVER["HTTP_XID"] != NULL) header("Location: http://google.com") ?>
Works.
<? if ( $_SERVER["HTTP_XID"] == NULL) header("Location: http://google.com") ?>
Works if I dont modify header XID.
<? if ( $_SERVER["HTTP_XID"] != 0) header("Location: http://google.com") ?>
doesnt.
<? if ( $_SERVER["HTTP_XID"] != NULL) header("Location: http://google.com") ?>
Works IF I modify my header. Other than that I need to try it out to see if it redirects my phone.
EDIT::: Doesnt redirect my phone :'(