Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

PhP Question


ghost's Avatar
0 0

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.


ynori7's Avatar
Future Emperor of Earth
0 0

Are you sure your server allows short tags?


ghost's Avatar
0 0

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?


ghost's Avatar
0 0

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.


ghost's Avatar
0 0

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[&#39;HTTP_CLIENTID&#39;] != 0) {
   header(&quot;Location: http://google.com&quot;)
} elseif ($_SERVER[&#39;HTTP_X_UP_SUBNO&#39;] != 0) {
     header(&quot;Location: http://hellboundhackers.org&quot;)
} elseif ($_SERVER[&#39;HTTP_XID&#39;] != 0) {
     header(&quot;Location: http://yahoo.com&quot;)
} else {
header(&quot;Location: http://hackthissite.org&quot;)
}

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.


ghost's Avatar
0 0

<? 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 :'(


ghost's Avatar
0 0

MoshBat wrote: Get something other than PHP to give you the value of HTTP_XID… See what it says, post back.

Just tried to request header in ASP. It does not send in the HTTP_XID request. So what does that mean? Its not a problem with PHP? But HTTP_XID itself?