Hej
Det er sådan at jeg har fundet/download en kontakt siden og jeg er lige pt i gang med at tilpasse den til siden sådan at den passer.
jeg har arbejde på den hele morgen/nat for at få den til at virker 100%
Dog skal du lige finde dig i at jeg ikke har fået tilpasse det til dansk endnu da jeg fået vil klart problemet.
Du kan se det
her;
- <div id="contact">
- <form method="post" action="/kontakt-godkendt/" name="contactform" id="contactform">
-
- <div id="message"></div>
-
- <fieldset>
-
- <legend>Udfyld nedenstående formular til at kontakte os</legend>
-
- <label for="name" accesskey="U"><span class="required">*</span> Navn</label>
- <input name="name" type="text" id="name" size="30" value="" />
-
- <br />
- <label for="email" accesskey="E"><span class="required">*</span> Email</label>
- <input name="email" type="text" id="email" size="30" value="" />
-
- <br />
- <label for="phone" accesskey="P"><span class="required">*</span> Mobil</label>
- <input name="phone" type="text" id="phone" size="30" value="" />
-
- <br />
- <label for="subject" accesskey="S">Muligheder</label>
- <select name="subject" id="subject">
- <option value="Support">Feedback</option>
- <option value="a Sale">Problemer</option>
- <option value="a Bug fix">Programmering</option>
- </select>
-
- <br />
- <label for="comments" accesskey="C"><span class="required">*</span> Din Kommentar</label>
- <textarea name="comments" cols="40" rows="3" id="comments" style="width: 350px;"></textarea>
-
- <p><span class="required">*</span> Are you human?</p>
-
- <label for="verify" accesskey="V"> 3 + 1 =</label>
- <input name="verify" type="text" id="verify" size="4" value="" style="width: 30px;" /><br /><br />
-
- <input type="submit" class="submit" id="submit" value="Submit" />
-
- </fieldset>
-
- </form>
-
- </div>
Det er så den her file: /kontakt-godkendt/- <?php
-
- if(!$_POST) exit;
-
- $name = $_POST['name'];
- $email = $_POST['email'];
- $phone = $_POST['phone'];
- $subject = $_POST['subject'];
- $comments = $_POST['comments'];
- $verify = $_POST['verify'];
-
- if(trim($name) == '') {
- echo '<div class="error_message">Attention! You must enter your name.</div>';
- exit();
- } else if(trim($email) == '') {
- echo '<div class="error_message">Attention! Please enter a valid email address.</div>';
- exit();
- } else if(trim($phone) == '') {
- echo '<div class="error_message">Attention! Please enter a valid phone number.</div>';
- exit();
- } else if(!is_numeric($phone)) {
- echo '<div class="error_message">Attention! Phone number can only contain digits.</div>';
- exit();
- } else if(!isEmail($email)) {
- echo '<div class="error_message">Attention! You have enter an invalid e-mail address, try again.</div>';
- exit();
- }
-
- if(trim($subject) == '') {
- echo '<div class="error_message">Attention! Please enter a subject.</div>';
- exit();
- } else if(trim($comments) == '') {
- echo '<div class="error_message">Attention! Please enter your message.</div>';
- exit();
- } else if(!isset($verify) || trim($verify) == '') {
- echo '<div class="error_message">Attention! Please enter the verification number.</div>';
- exit();
- } else if(trim($verify) != '4') {
- echo '<div class="error_message">Attention! The verification number you entered is incorrect.</div>';
- exit();
- }
-
- if(get_magic_quotes_gpc()) {
- $comments = stripslashes($comments);
- }
-
- //Prøve lige engang..
- $address = "test@test.dk";
-
- $e_subject = 'You\'ve been contacted by ' . $name . '.';
-
- $e_body = "You have been contacted by $name with regards to $subject, their additional message is as follows." . PHP_EOL . PHP_EOL;
- $e_content = "$comments";
- $e_reply = "You can contact $name via email, $email or via phone $phone";
-
- $msg = wordwrap($e_body . $e_content . $e_reply, 70);
-
- $headers = "From: $email";
- $headers .= "Reply-To: $email";
- $headers .= "MIME-Version: 1.0";
- $headers .= "Content-type: text/plain; charset=utf-8";
- $headers .= "Content-Transfer-Encoding: quoted-printable";
-
- if(mail($address, $e_subject, $msg, $headers)) {
-
- echo "<fieldset>";
- echo "<div id='success_page'>";
- echo "<h1>Email Sent Successfully.</h1>";
- echo "<p>Thank you <strong>$name</strong>, your message has been submitted to us.</p>";
- echo "</div>";
- echo "</fieldset>";
-
- } else {
-
- echo 'ERROR!';
-
- }
Style ser sådan her ud;
- #contact {
- display: block;
- border: 1px solid #cbcbcb;
- background-color: #FFF;
- }
-
- /* Form style */
-
- #contact label {
- display: inline-block;
- float: left;
- height: 26px;
- line-height: 26px;
- width: 155px;
- font-size: 1.5em;
- -webkit-border-radius:5px;
- }
- #contact input, textarea, select {
- width: 280px;
- margin: 0;
- padding: 5px;
- color: #666;
- background: #f5f5f5;
- border: 1px solid #ccc;
- margin: 5px 0;
- font:1.5em "Lucida Grande", "Lucida Sans Unicode", Arial, sans-serif
- }
- #contact input:focus, textarea:focus, select:focus {
- border: 1px solid #999;
- background-color: #fff;
- color:#333;
- }
- #contact input.submit {
- width: 85px;
- cursor: pointer;
- border: 1px solid #222;
- background:#333;
- color:#fff;
- }
- #contact input.submit:hover {
- background:#444;
- }
- #contact input[type="submit"][disabled] {
- background:#888;
- }
- #contact fieldset {
- padding:20px;
- border:1px solid #eee;
- }
- #contact legend {
- padding:7px 10px;
- font-weight:bold;
- color:#000;
- border:1px solid #eee;
- -webkit-border-radius:5px;
- -moz-border-radius:5px;
- margin-bottom:0 !important;
- margin-bottom:20px;
- }
- #contact span.required{
- font-size: 13px;
- color: #ff0000;
- }
- #message {
- margin: 10px 0;
- padding: 0;
- }
-
- .error_message {
- display: block;
- height: 22px;
- line-height: 22px;
- background: #FBE3E4 url('/assets/error.gif') no-repeat 10px center;
- padding: 3px 10px 3px 35px;
- color:#8a1f11;
- border: 1px solid #FBC2C4;
- -webkit-border-radius:5px;
- }
- .loader {
- padding: 0 10px;
- }
- #contact #success_page h1{
- background: url('/assets/success.gif') left no-repeat;
- padding-left:22px;
- }
- acronym {
- border-bottom:1px dotted #ccc;
- }
og min jQuery kode ser sådan her ud;
- jQuery(document).ready(function(){
-
- $('#contactform').submit(function(){
-
- var action = $(this).attr('action');
-
- $("#message").slideUp(750,function() {
- $('#message').hide();
-
- $('#submit')
- .after('<img src="/assets/ajax-loader.gif" class="loader" />')
- .attr('disabled','disabled');
-
- $.post(action, {
- name: $('#name').val(),
- email: $('#email').val(),
- phone: $('#phone').val(),
- subject: $('#subject').val(),
- comments: $('#comments').val(),
- verify: $('#verify').val()
- },
- function(data){
- document.getElementById('message').innerHTML = data;
- $('#message').slideDown('1000');
- $('#contactform img.loader').fadeOut('1000',function(){$(this).remove()});
- $('#submit').removeAttr('disabled');
- if(data.match('success') != null) $('#contactform').slideUp('1000');
-
- }
- );
-
- });
-
- return false;
-
- });
-
- });
Det som problemet er pt nu og her det at den der load ting køre og køre bare og ske intet. den sende ikke nogle email eller ligne..
Håber du kan hjælp mig videre!