Zaloguj | Zarejestruj | FAQ
Anonymous

how to make a simple php contact form?

+ Odpowiedz

Posty: 4 Strona 1 z 1


how to make a simple php contact form?

przez freelancerboy » Śr kwi 01, 2015 3:40 pm

I am new in php.
anybody can help me, how can i make php contact form?
Avatar użytkownika

freelancerboy

  • Posty: 3
  • Dołączył(a): Śr kwi 01, 2015 3:33 pm
  • Lokalizacja: Bangladesh

Re: how to make a simple php contact form?

przez Chikwado » Śr kwi 01, 2015 9:45 pm

Have you try to read from any tutorials? If yes, then what have you understand so far? If no, then you can try your hands on tutorials. Your question should have be: How to process a form using php? You can read from here: http://www.html.net/tutorials/php/lesson11.php

Ostatnio edytowano Cz kwi 02, 2015 2:03 pm przez Chikwado, łącznie edytowano 1 raz

Avatar użytkownika

Chikwado

  • Posty: 94
  • Dołączył(a): Pn lip 29, 2013 11:36 pm
  • Lokalizacja: Nigeria
--
Focus On Advance Science And Programming.

Re: how to make a simple php contact form?

przez freelancerboy » Cz kwi 02, 2015 9:06 am

Chikwado napisał(a):Have you try to read from any tutorials? If yes, then what have you understand so far? If no, then you can try your hands on tutorials. Your question should have be "How to process a form using php?" You can read from here: http://www.html.net/tutorials/php/lesson11.php

thanks for good suggestions.
Avatar użytkownika

freelancerboy

  • Posty: 3
  • Dołączył(a): Śr kwi 01, 2015 3:33 pm
  • Lokalizacja: Bangladesh

Re: how to make a simple php contact form?

przez Veeramanikandan » Wt maja 05, 2015 12:55 pm

<?php
if ($_POST["email"]<>'') {
$ToEmail = 'youremail@site.com';
$EmailSubject = 'Site contact form';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "Name: ".$_POST["name"]."";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."";
$MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])."";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
?>
<?php
session_start();
$text = rand(10000,99999);
$_SESSION["vercode"] = $text;
$height = 25;
$width = 65;

$image_p = imagecreate($width, $height);
$black = imagecolorallocate($image_p, 0, 0, 0);
$white = imagecolorallocate($image_p, 255, 255, 255);
$font_size = 14;

imagestring($image_p, $font_size, 5, 5, $text, $white);
imagejpeg($image_p, null, 80);
?>
Your message was sent
<?php
} else {
?>
<form action="test.php" method="post">
<table width="400" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="29%" class="bodytext">Your name:</td>
<td width="71%"><input name="name" type="text" id="name" size="32"></td>
</tr>
<tr>
<td class="bodytext">Email address:</td>
<td><input name="email" type="text" id="email" size="32"></td>
</tr>
<tr>
<td class="bodytext">Comment:</td>
<td><textarea name="comment" cols="45" rows="6" id="comment" class="bodytext"></textarea></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td align="left" valign="top"><input type="submit" name="Submit" value="Send"></td>
</tr>
</table>
</form>
<?php
};
?>
<form action="submit.php" method="post">
Comment: <textarea name="coment"></textarea>
Enter Code <img src="captcha.php"><input type="text" name="vercode" />
<input type="submit" name="Submit" value="Submit" />
</form>
Avatar użytkownika

Veeramanikandan

  • Posty: 20
  • Dołączył(a): Pn wrz 22, 2014 4:03 pm


+ Odpowiedz

Strona 1 z 1