Jump to content

PHP- IF ELSE


anujchhabria

Recommended Posts

Hello,

 

This is my HTML file..

 

 

<html>

<body>

 

<form action="check.php" method="post">

Name: <input type="text" name="fname" />

<input type="submit" />

</form>

 

</body>

</html>

 

 

and this is my check.php file:

 

<?php

$question=substr($fname,0);

if ($question=="Bob Jones")

{

$answer=="admin";

}

 

echo $_POST["fname"];  echo ',' + $answer;

 

?>

 

 

 

For some reason it is not displaying anwser correctly

Link to comment
https://forums.phpfreaks.com/topic/264392-php-if-else/
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.