alin19 Posted November 8, 2007 Share Posted November 8, 2007 <?php if($_SERVER['REQUEST_METHOD'] == 'POST') { $a = $_POST['unu']; $b = $_POST['doi']; $x= number_format($a, 4, '.', ''); if ($b='JOHM') $procent=15; if ($='MIHAIL') $procent=25; $xmax = number_format(($a+($a*$procent/100)), 4, '.', ''); $xmin = number_format(($a-($a*$procent/100)), 4, '.', ''); } ?> <html> <body BACKGROUND="mapa2.jpg"> <form name="check" method="post"> </br></br></br></br></br></br> <table width="304" border="2" cellpadding="0" cellspacing="2" align="center"> <!--DWLayoutTable--> <tr> <td border="0">test</td><td valign=""align="center" ><font color="red" size="3">PRETUL NET</font></td> <td width="304" height="79" valign="" align="center"> <input name="unu" type="text" id="unu" /> </td><td> </tr> <tr><td border="0">test</td> <td valign=""><font color="red" size="3" align="center">PIATA</font></td> <td height="86" valign="" align="center" ><input name="doi" type="text" id="doi" /></td> </tr> <tr><td border="0">test</td> <td valign="" align="center" ><font color="red" size="3" align="green"></font></td> <td height="86" valign="" align="center"><input type="submit" name="CALCULEAZA" value="CALCULEAZA" /></td> </tr> <tr><td border="0">test</td> <td valign="top" align="center" ><font color="red" size="3" align="green"></font></td> <td height="35" valign="" align="center"> <font color="green" size="8" > <?php if(isset($xmax)) { echo $xmax; } ?></br> <font color="blue"> <?php if (isset ($x)) echo $x; ?> <font color="red"></br> <?php if(isset($xmin)) { echo $xmin; } ?> </font></td> </tr> </table> </form> </html> Link to comment https://forums.phpfreaks.com/topic/76519-i-need-to-compare-a-string-var/ Share on other sites More sharing options...
kenrbnsn Posted November 8, 2007 Share Posted November 8, 2007 Use "==" for comparing, "=" for assignment. Ken Link to comment https://forums.phpfreaks.com/topic/76519-i-need-to-compare-a-string-var/#findComment-387558 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.