Jaynesh
01-24-2006, 02:11 PM
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/showthread.php?t=59914&page=1&highlight=elseif ) :)
Heres the 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.
Ive written this code in dreamweaver ( Thanx for you tutorial MindTrix, https://vborg.vbsupport.ru/showthread.php?t=59914&page=1&highlight=elseif ) :)
Heres the 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.