Awptics Posted October 1, 2007 Share Posted October 1, 2007 Im a senior in highschool and my "server-scripting" professor gave me a project pertaining to HTML and PHP. The project reads: Write a program that will take your first name and last name initials and create an asterisk printout of those letters on your screen. The matrix is to be 16 by 16 for your letters. Also modify the program to handle any letters input from the first 10 in the alphabet (A-J) I have absolutely no clue what I'm doing and you guys seem like the right people to ask. Any clues or help as how to do this? Quote Link to comment https://forums.phpfreaks.com/topic/71428-help-with-small-php-project/ Share on other sites More sharing options...
Wuhtzu Posted October 1, 2007 Share Posted October 1, 2007 Someone has to suggest that you do some reading up on basic PHP and HTML so I'll start out by doing so: http://www.w3schools.com/php/php_forms.asp Quote Link to comment https://forums.phpfreaks.com/topic/71428-help-with-small-php-project/#findComment-359533 Share on other sites More sharing options...
Awptics Posted October 1, 2007 Author Share Posted October 1, 2007 I have a basic knowledge of PHP however I cannot get this to work, this is what I have been trying but he said something about an array and I have absolutely no clue what he is talking about. <?php $finitial=$_POST['finitial']; $linitial=$_POST['linitial']; if ($finitial=="a"){ echo " * <br> * * <br> * * <br> ***** <br> * * <br> * *<br> ";} if ($finitial=="b"){ echo " ***** <br> * *<br> ***** <br> * *<br> * *<br> ***** <br> ";} if ($finitial=="c"){ echo " **** <br> * *<br> * <br> * <br> * *<br> **** <br> ";} if ($finitial=="d") { echo " ***** <br> * *<br> * *<br> * *<br> * *<br> ***** <br> "; } if ($finitial=="e") { echo " ***** * ***** * * ***** "; } if ($finitial=="f") { echo " ***** * ***** * * * "; } if ($finitial=="g") { echo " **** * * * * *** * * **** "; } if ($finitial=="h") { echo " * * * * ****** * * * * * * "; } if ($finitial=="i") { echo " ****** ** ** ** ** ****** "; } if ($finitial=="j") { echo " ***** * * ***** * * * * ***** "; } ?> </font> Quote Link to comment https://forums.phpfreaks.com/topic/71428-help-with-small-php-project/#findComment-359538 Share on other sites More sharing options...
MmmVomit Posted October 1, 2007 Share Posted October 1, 2007 I would suggest you make good use of the <tt> tag. ** ** ******** ** ** ** ** ** ** ** ** **** ** ** ** ** ** ** ** ** ** ******** Quote Link to comment https://forums.phpfreaks.com/topic/71428-help-with-small-php-project/#findComment-359541 Share on other sites More sharing options...
MmmVomit Posted October 1, 2007 Share Posted October 1, 2007 I have a basic knowledge of PHP however I cannot get this to work, this is what I have been trying but he said something about an array and I have absolutely no clue what he is talking about. To give you an idea of what he's talking about. <?php $numbers = Array(); $numbers[0] = "zero"; $numbers[1] = "one"; $numbers[2] = "two"; //etc //this loop counts from zero to nine in actual words for($i = 0; $i < 10; $i++) { echo "$numbers[$i]<br />"; } ?> This type of trick is fairly common, and applies to any programming language, so I don't feel like I'm doing your homework for you. Much. No messy if statements. If you were going to use if statements like that, you'd be much better off using a switch statement. Quote Link to comment https://forums.phpfreaks.com/topic/71428-help-with-small-php-project/#findComment-359550 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.