Jump to content

$_GET variable goes to 0


visionaire

Recommended Posts

Hello all,

 

I am terribly confused about the following code, for some reason $tourn keeps going back to 0 for no reason!

 

This code:

<?php

include 'header.php';

$tourn = $_GET['extourn'];

echo "first ".$tourn."<br />";

if($tourn=0){
echo "tourn1 is ".$tourn."<br />";
}

else{
echo "tourn2 is ".$tourn."<br />";
}

?>

returns this:

first 4

tourn2 is 0

 

While tourn2 should return 4 as well. I have tried a million different versions, including switches and everything and just can't understand it. Please help!

Link to comment
https://forums.phpfreaks.com/topic/216651-_get-variable-goes-to-0/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.