Skocz do zawartości

gibek2

Użytkownicy
  • Zawartość

    100
  • Rejestracja

  • Ostatnio

  • Wygrane dni

    1

Posty napisane przez gibek2


  1. Witam mam sobie taki o to skrypt do formularza kontaktowego

    <?php
    /* Set e-mail recipient */
    $myemail = "gibekrecords@gmail.com";
    
    /* Check all form inputs using check_input function */
    $name = check_input($_POST['inputName'], "Your Name");
    $email = check_input($_POST['inputEmail'], "Your E-mail Address");
    $subject = check_input($_POST['inputSubject'], "Message Subject");
    $message = check_input($_POST['inputMessage'], "Your Message");
    
    /* If e-mail is not valid show error message */
    if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
    {
    show_error("Invalid e-mail address");
    }
    /* Let's prepare the message for the e-mail */
    
    $subject = "Someone has sent you a message";
    
    $message = "
    
    Someone has sent you a message using your contac form:
    
    Name: $name
    Email: $email
    Subject: $subject
    
    
    Message:
    
    $message
    
    ";
    
    /* Send the message using mail() function */
    mail($myemail, $subject, $message);
    
    /* Redirect visitor to the thank you page */
    header('Location: alert-page.html');
    exit();
    
    /* Functions we used */
    function check_input($data, $problem='')
    {
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    if ($problem && strlen($data) == 0)
    {
    show_error($problem);
    }
    return $data;
    }
    
    function show_error($myError)
    {
    ?>
    <html>
    <body>
    
    <p>Please correct the following error:</p>
    <strong><?php echo $myError; ?></strong>
    <p>Hit the back button and try again</p>
    
    </body>
    </html>
    <?php
    exit();
    }
    ?>
    
    <form name="contactform" method="post" action="mailer.php" class="form-horizontal" role="form">
    							<div class="form-group">
    								<label for="inputName" class="col-lg-2 control-label">Dane</label>
    								<div class="col-lg-8">
    									<input type="text" class="form-control" id="inputName" name="inputName" placeholder="Twoje imię i nazwisko">
    								</div>
    							</div>
    							<div class="form-group">
    								<label for="inputEmail" class="col-lg-2 control-label">Email</label>
    								<div class="col-lg-8">
    									<input type="text" class="form-control" id="inputEmail" name="inputEmail" placeholder="twój e-mail">
    								</div>
    							</div>
    							<div class="form-group">
    								<label for="inputSubject" class="col-lg-2 control-label">Temat</label>
    								<div class="col-lg-8">
    									<input type="text" class="form-control" id="inputSubject" name="inputSubject" placeholder="Temat wiadomości">
    								</div>
    							</div>
                            
                                
                                
    							<div class="form-group">
    								<label for="inputMessage" class="col-lg-2 control-label">Wiadomość</label>
    								<div class="col-lg-8">
    									<textarea class="form-control" rows="4" id="inputMessage" name="inputMessage" placeholder="Treść wiadomości..."></textarea>
    								</div>
    							</div>
    							<div class="form-group">
    								<div class=" text-center">
                                    	<div class="btn-center">
    									<button type="submit" class="btn btn-default">
    										Wyślij wiadomość
    									</button>
                                        </div>
    								</div>
                                    </div>
    						</form>
    
    

    i teraz jak dodać do tego listę rozwijaną aby też się wysyłała bo jak na razie jak chciałem sam to zrobić to nic się nie wykonywało, w tym momencie wszystko działa to u góry ale chciał bym dodać właśnie taką przykładową listę :

     <select class="form-control">
                                  <option>1</option> 
                                  <option>2</option>
                                  <option>3</option>
                                  <option>4</option>
                                  <option>5</option>
                                </select>
    

    Liczę na pomoc :)


  2. witam chcę skorzystać tak dla testu z google analytics i robię wszystko zgodnie z instrukcjami i poradnikami w sieci teorytycznie jest to najprostsza czynność ale u mnie cos nie "trybi".

     

    Wkleiłem kod przed </head> mineły juz jakieś 3h od dodania a tu nadal komunikat :

    Stan: Śledzenie niezainstalowane

    Data ostatniego sprawdzenia: 2014-06-05 03:48:25 PDT
    Nie wykryto kodu śledzenia Google Analytics na stronie głównej witryny. Aby śledzenie Analytics funkcjonowało poprawnie, administrator witryny musi umieścić kod na każdej stronie.
    Jak sobie z tym poradzić bo sam już nie wiem ? strona to : http://madeksbusy.pl/
×