chinese-horoscoop

Gesponsorde koppelingen

PHP script bestanden

  1. chinese-horoscoop

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php

$chinees
= array(
    0     => array(
            "DIER"     => "RAT",
            "MAAND" => "00"),
    1     => array(
            "DIER"     => "BUFFEL/OS",
            "MAAND" => "01"),
    2     => array(
            "DIER"     => "TIJGER",
            "MAAND" => "02"),
    3     => array(
            "DIER"     => "HAAS/KAT/KONIJN",
            "MAAND" => "03"),
    4     => array(
            "DIER"     => "DRAAK",
            "MAAND" => "04"),
    5     => array(
            "DIER"     => "SLANG",
            "MAAND" => "05"),
    6     => array(
            "DIER"     => "PAARD",
            "MAAND" => "06"),
    7     => array(
            "DIER"     => "GEIT",
            "MAAND" => "07"),
    8     => array(
            "DIER"     => "AAP",
            "MAAND" => "08"),
    9     => array(
            "DIER"     => "HAAN",
            "MAAND" => "09"),
    10     => array(
            "DIER"     => "HOND",
            "MAAND" => "10"),
    11     => array(
            "DIER"     => "ZWIJN/VARKEN",
            "MAAND" => "11")
);

    
if($_POST)
{

    $datum=$_POST["datum"];
    list($day,$month,$year) = explode("/",$datum);
    if(substr($year,1,1) != "0"){
        $year1 = substr($year,2,2);        
    }

    else{
        $year1 = substr($year,2,2);
        $year1 = $year1 + 100;    
        
    }
    

    for($i=0;$i<12;$i++){
        $year1 = $year1%12;
    
        if($chinees[$i]["MAAND"] == $year1)
        {

                
                
            
                if(($day > 15 && $month >= 2) || $month > 2)
                {
    

                    if($day < 32 && $month < 13)
                    {

                    print("Uw chinees sterrebeeld is ");
                    print($chinees[$i]["DIER"]);
                    }

                    else
                    {
                    print("Foute ingave! Vul een juiste datum in");
                    }
                }

                else
                {
                    if($day < 32 && $month < 13)
                    {

                        print("Uw chinees sterrebeeld is ");
                        if($i == 0)
                        {

                         $i = 12;
                        }

                    
                    print($chinees[$i-1]["DIER"]);
                    }

                    else
                    {
                    print("Foute ingave! Vul een juiste datum in");
                    }
                    
                }


                
        }
    }    
}

?>


<html>
<head>
<title>
</title>
</head>
<body>

<form action="" method="POST">
Datum: <input type="text" name="datum">(dd/mm/yyyy)<br><br><br>
<input type="submit" value="submit"><input type="reset">
</form>


</body>
</html>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.