mercredi 7 juin 2017

PHP if statement only returning 1

I don't know whats up here but the if statement redirects me to wifi.php and not the else statement even when the file contents isn't equal to 1.

<?php
$r = file_get_contents('/iotfw/wifi');
if ($r = "1") {
    header('Location: http://ift.tt/2s3xK5U');
    exit;
} else {
    header('Location: http://ift.tt/2sCFJ7h');
    exit;
}
?>

Aucun commentaire:

Enregistrer un commentaire