0% found this document useful (0 votes)
92 views3 pages

Contact Forma Ukoliko Želite Da Vas Neko Kontaktira Na Vašem Sajtu Potreban Vam Je Sledeći HTML Kod I PHP

This document provides an HTML form code and PHP script to allow contact forms on a website. The HTML code includes fields for name, email, reason for contacting, URL, and a textarea for feedback. The accompanying PHP script sends the submitted form data to an email address, checks for spam, and confirms submission.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views3 pages

Contact Forma Ukoliko Želite Da Vas Neko Kontaktira Na Vašem Sajtu Potreban Vam Je Sledeći HTML Kod I PHP

This document provides an HTML form code and PHP script to allow contact forms on a website. The HTML code includes fields for name, email, reason for contacting, URL, and a textarea for feedback. The accompanying PHP script sends the submitted form data to an email address, checks for spam, and confirms submission.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 3

Contact forma

Ukoliko elite da vas neko kontaktira na vaem sajtu potreban vam je sledei HTML kod
i PHP

Crvenim slovima moete obrisati


HTML
_____________________________________________________________________________
_______________________

<form method="post" action="contact.php" >


Email: <input name="email" type="text" / value=""> <br />

Name: <input name="name" type="text" / value=""> <br />


Reason: <select name="reason">
<option>Comment</option>
<option>Question</option>
<option>Suggestion</option>
<option>Report a Bug</option>
<option>Tizag Store</option>
</select> <br />
<span id='url'>URL: <input name="url" type="text"/> <br /></span>
Feedback: <br/>
<textarea name="message" rows="15" cols="40"></textarea> <br /><br/><br />
<input type="submit" / value="Send Comment">
</form>
_____________________________________________________________________________
_________________________

Da bi ova forma radila morate uraditi i sledeu skriptu i nazvati je contact.php


Re napisana zelenom bojom stavite va email
PHP
_____________________________________________________________________________
____________________________

<?php
if(isset($_POST['submit'])) {
$to = your;
$subject = Form Tutorial;
$name_field = $_POST['name'];
$email_field = $_POST['email'];
if (eregi((\r|\n), $email_field)) {
die(Nemojte spammati.);
}
$message = $_POST['message'];
$body = From: $name_field\n E-Mail: $email_field\n Message:\n $message;
echo Data has been submitted to $to!;
mail($to, $subject, $body);
} else {
echo blarg!;
}
?>
_____________________________________________________________________________
__________________________________________

You might also like