2015-07-01 77 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

相關問題