Im lerning php and just experimenting and messing around with a few stuff.
Ive written this code in dreamweaver ( Thanx for you tutorial MindTrix,
https://vborg.vbsupport.ru/showthrea...ghlight=elseif )
Heres the code:
Code:
<?php
$name = "Jaynesh";
if ( $name == "Bob" )
{
print "Yes my name is $name";
}
elseif ( $name == "Johnny" )
{
print "Yes, My name is Johnny";
}
elseif ( $name == "Mark" )
{
print "Yes, My name is mark";
}
elseif { $name == "Sarah" )
{
print "Yes, My name is sarah";
}
else {
print "No, My name is $name";
}
?>
How can i make it so i can select a name from a form instead of manually putting it in the php file.
e.g Imagine there is a form on a page, and when the user types the name Mark it will say Yes, My name is mark And if a user types a name which is not coded in the form it will say No, My name is Jaynesh.