Ideas, Complains, Suggestions, Comments for Zend PHP

Djpata

Member
Jun 26, 2006
9,540
23
0
elakiri0777 said:
:baffled: e mokakda banzz??
chinthaka.lk said:
Thanks machan
ok bro here you go;):D

Here You Have To Make The Page Below First:D
<html>
<head><title>My Mail Server</title></head>
<body>
<form action="mail.php" method="POST">
<b>Email</b><br>
<input type="text" name="email" size=60>
<p><b>Subject</b><br>
<input type="text" name="subject" size=60>
<p><b>Message</b><br>
<textarea cols=60 rows=20 name="message"></textarea>
<p><input type="submit" value=" Send ">
</form>
</body>
</html>

After That You Must Make This Page To Process Your Mail When You Press Submit Button In Your Mail Page/Form ;):D

<html>
<head><title>
My Mail Server</title></head>
<body>
<?php

/* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */
$email = $HTTP_POST_VARS['email'];
$subject = $HTTP_POST_VARS['subject'];
$message = $HTTP_POST_VARS['message'];

/* PHP form validation: the script checks that the Email field contains a valid email address and the Subject field isn't empty. preg_match performs a regular expression match. It's a very powerful PHP function to validate form fields and other strings - see PHP manual for details. */
if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email)) {
echo "<h4>Invalid email address</h4>";
echo "<a href='javascript:history.back(1);'>Back</a>";
} elseif ($subject == "") {
echo "<h4>No subject</h4>";
echo "<a href='javascript:history.back(1);'>Back</a>";
}

/* Sends the mail and outputs the "Thank you" string if the mail is successfully sent, or the error string otherwise. */
elseif (mail($email,$subject,$message)) {
echo "<h4>Thank you for sending email using
My Mail Server</h4>";
} else {
echo "<h4>Sorry! Can't send email to $email</h4>";
}
?>
</body>
</html>
 

tckrockz

Member
Sep 24, 2006
26,754
13
0
ela ela mchn...:P mama me tike gedara uth eka ne...meka hari igena gana puluwan :D help 1k onna nam kiyana :D
 

Djpata

Member
Jun 26, 2006
9,540
23
0
tckrockz said:
ela ela mchn...:P mama me tike gedara uth eka ne...meka hari igena gana puluwan :D help 1k onna nam kiyana :D

ow umba kanawai budiyanawai nikan gedartta wela:P me net eke mal kada kada inne nethuwa ohoma ekka wath igena ganing:P:lol:
 

MaD-DoC

Member
Oct 27, 2007
6,337
22
0
SLIIT/Malabe
PHP is a powerful server-side scripting language for creating dynamic and interactive websites.
PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. PHP is perfectly suited for Web development and can be embedded directly into the HTML code.
The PHP syntax is very similar to Perl and C. PHP is often used together with Apache (web server) on various operating systems. It also supports ISAPI and can be used with Microsoft's IIS on Windows.


PHP Tutorial