Results 1 to 1 of 1

Thread: [RESOLVED] mail problem (whats wrong with this code?)

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Resolved [RESOLVED] mail problem (whats wrong with this code?)

    Code:
    <?php
    if (isset($_POST['submit']))
    {
        if (empty($_POST['emne'])) 
        {
            echo "Du skal indtaste et emne<br><br>"; 
        }
        elseif (empty($_POST['email']))
        {
            echo "Du skal indtaste din e-mail<br><br>"; 
        }
    	elseif (empty($_POST['mobilnr']))
        {
            echo "Du skal indtaste dit telefon nummer<br><br>";
        }
    	elseif (empty($_POST['besked']))
        {
            echo "Du skal indtaste en besked<br><br>"; 
        }
        else 
        {
            $modtager = ""; // removed mail from post
            $emne = $_POST['emne'];
            $besked = "Hej, Du har modtaget en mail fra en g&#230;st: \n 
                                Email: " . $_POST['email']. "\n
                                Telefon Nummer: " . $_POST['mobilnr']. "\n
                                Besked: " .
    							"\n" . "\n" . $_POST['besked'];
            
            mail($modtager, $emne, $besked);
            echo "Beskeden er nu send!<br><br>";
        }
    }
    ?> 
    
    <form name="email" action="?a=booking" method="POST">
    <table>
    <tr>
    <td>Emne:
    <br>&nbsp;&nbsp;<input type="text" name="emne" size="30"></td>
    </tr>
    <tr>
    <td>E-mail: 
    <br>&nbsp;&nbsp;<input type="text" name="email" size="30"></td>
    </tr>
    <tr>
    <td>Telefon Nummer: 
    <br>&nbsp;&nbsp;<input type="text" name="mobilnr" size="30"></td>
    </tr>
    <tr>
    <td>Besked: <br>&nbsp;&nbsp;<textarea name="besked" rows="10" cols="30"></textarea></td>
    </tr>
    <tr>
    <td><br>&nbsp;&nbsp;<input type="submit" name="submit" value="Send Besked"></td>
    </tr>
    </table>
    </form>
    i can't figure out whats wrong with this code, it used to work and now it doesn't, i haven't changed it a bit since i made it...

    edit: i figured out the problem, i corrected the code so if anyone needs it...
    Last edited by Justa Lol; Dec 30th, 2009 at 09:17 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width