2015-07-01 45 views
-2

我不确定我的解析错误是什么?链接到该文件的html文件确实有与之相关的正确文件。我完成了html文件格式,它显示了我的php文件的正确路径,但是在第4行给我一个分析错误?PHP解析错误?第4行错误?

<?php 
    $month = $_GET["month"]; 
    $color = $_GET["color"] 
    $colorFortune = color_fortune($color); 
    $fortune = yourFortune($month); 

function yourFortune($month) 
{ 
    if (strtoupper($month) == "JANUARY") { 
     return "all of your New Years resolutions will come true!"; 
    } 
    elseif (strtoupper($month) == "FEBRUARY") { 
     return "you will fall in love with a special someone!"; 
    } 
    elseif (strtoupper($month) == "MARCH") { 
     return "luck will shine upon you!"; 
    } 
    elseif (strtoupper($month) == "APRIL") { 
     return "a golden egg of opportunity will fall into your lap."; 
    } 
    elseif (strtoupper($month) == "MAY") { 
     return "never fear! The end of something marks the start of something new."; 
    } 
    elseif (strtoupper($month) == "JUNE") { 
     return "the sun will shine on you if you let it."; 
    } 
    elseif (strtoupper($month) == "JULY") { 
     return "you can’t steal second base and keep your foot on first."; 
    } 
    elseif (strtoupper($month) == "AUGUST") { 
     return "you will be sharing great news with all the people you love."; 
    } 
    elseif (strtoupper($month) == "SEPTEMBER") { 
     return "you have the power to write your own fortune."; 
    } 
    elseif (strtoupper($month) == "OCTOBER") { 
     return "you will be successful in your work."; 
    } 
    elseif (strtoupper($month) == "NOVEMBER") { 
     return "you will enjoy good health; you will be surrounded by luxury."; 
    } 
    elseif (strtoupper($month) == "DECEMBER") { 
     return "you will make change for the better."; 
    } 
    else { 
     return "Error: You didn't enter your birth month!"; 
    } 
} 

function color_fortune($color) 
{ 
    if (strtoupper($color) == "RED") { 
     return "Your ambitions will become real and "; 
    } 
    elseif (strtoupper($color) == "BLUE") { 
     return "You will experience trust and loyalty in your life and "; 
    } 
    elseif (strtoupper($color) == "PINK") { 
     return "You will experience unconditional love and "; 
    } 
    elseif (strtoupper($color) == "PURPLE") { 
     return "Your creativity will shine through and "; 
    } 
    elseif (strtoupper($color) == "WHITE") { 
     return "You will acheive a sense of wholeness in your life and "; 
    } 
    elseif (strtoupper($color) == "BLACK") { 
     return "You will uncover a mystery of life and "; 
    } 
    elseif (strtoupper($color) == "ORANGE") { 
     return "You will meet new people that will bring otimism to your life and "; 
    } 
    elseif (strtoupper($color) == "GREEN") { 
     return "You will find a four leaf clover that will bring you luck, balance, growth, and "; 
    } 
    elseif (strtoupper($color) == "YELLOW") { 
     return "You will learn new skills that will help you advance in your career "; 
    } 
    else { 
     return "I don't know that color! But, "; 
    } 
} 
?> 

<!DOCTYPE html> 
<html> 
<head> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> 
<title>Your Fortune</title> 
</head> 
<body> 
    <div class="container"> 
     <h1><?php echo $colorFortune . $fortune; ?></h1> 
    </div> 
</body> 
</html> 
+1

不相信一切PHP说;它不在*那条线上。 –

+0

第3行:'$ color = $ _GET [“color”] //缺少;' –

+0

谢谢!这是问题的重要组成部分。我盯着第4行,认为这有什么问题。 –

回答

1
$color = $_GET["color"] 

失踪;

+0

我觉得自己像个哑巴!谢谢!!! –

+0

Eh。偶尔会发生在每个人身上。 – twentylemon

相关问题