Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <form method="POST">
- <select name="maakond">
- <option value="1">Tartu maakond</option>
- <option value="2">Pärnu maakond</option>
- <option value="3">Harju maakond</option>
- <option value="4">Ida-viru maakond</option>
- </select>
- <input type="submit" value="OK" />
- </form>
- </body>
- </html>
- <?php
- // Seaded - emailid
- $tartuMaakond = Array("email@email.ee", "email2@email.ee");
- $parnuMaakond = Array("email@email.ee", "email2@email.ee");
- $harjuMaakond = Array("email@email.ee", "email2@email.ee");
- $idaMaakond = Array("email@email.ee", "email2@email.ee");
- // Seaded - emaili saaja näeb saatjana keda?
- $headers = 'From: <webmaster@example.com>' . "\r\n";
- if ($_POST)
- {
- if (isset($_POST['maakond']))
- {
- $maakond = $_POST['maakond'];
- switch ($maakond)
- {
- case 1:
- {
- // Send email to tartuMaakond
- for($i = 0; $i <= count($tartuMaakond) - 1; $i++)
- {
- //send_email_func()
- // Test output
- print ("Tartu: mail to=>" . $tartuMaakond[$i] . "<br>");
- }
- break;
- }
- case 2:
- {
- // Send email to parnuMaakond
- for($i = 0; $i <= count($parnuMaakond) - 1; $i++)
- {
- //send_email_func()
- // Test output
- print ("Pärnu: mail to=>" . $parnuMaakond[$i] . "<br>");
- }
- break;
- }
- case 3:
- {
- // Send email to harjuMaakond
- for($i = 0; $i <= count($harjuMaakond) - 1; $i++)
- {
- //send_email_func()
- // Test output
- print ("Harju: mail to=>" . $harjuMaakond[$i] . "<br>");
- }
- break;
- }
- case 4:
- {
- // Send email to idaMaakond
- for($i = 0; $i <= count($idaMaakond) - 1; $i++)
- {
- //send_email_func()
- // Test output
- print ("Ida: mail to=>" . $idaMaakond[$i] . "<br>");
- }
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement