I found this script for sending emails, it works but if the email has <img src="image.jpg"/> it will send this <img src="image.jpg"> < I tried to replace < > < with the right characters but it doesn't work. Any suggestions?
Code: <?php
/* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$slashes= stripslashes($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,$slashes)) {
echo "<h4>Thank you for sending email</h4>";
} else {
echo "<h4>Can't send email to $email</h4>";
}
?>
insert/update functions for mysql, what do you think?
I am working on two really simple functions that automatically generate (and execute) insert and update mysql queries and I have some questions:Can there be any problems later on if functions treat
Form File Upload
I've read through tons of resources and tutorials and as far as I can tell, my code is accurate, but for some reason it's not working...My HTML Form:Code: <form action="script.php"
Getting rid of quotes when printing data
Hi Guys, I use the filter_var FILTER_SANITIZE_STRING to filter the textarea input. The function escapes any quotes (which is good) but when I print the data into the html the data is printed with the
writing my own sobel filter convolution - something is wrong
I am trying to keep it very simple, I cant see anything wrong with my logic, could anybody help point me to the right direction?!! Code: { int Shorizontal[] = {-1, 0, 1, -2, 0, 2, -1, 0, 1}; int
Calling strings from other php class
I have test1.php{$string1;$string2;....... //10 strings in this class $string10;}Another class test2.php{.........I want to use those 10 strings here, how should I do it?}
Am I setting up my sites oldschool?
Ok,When I create a site I open a basic template that I have created that consists of a css file an index page and a few php inserts for the header, nav and footer.It works fine and I am happy with it
Cloud Computing?
Hello,I was wondering if anyone could help explain this term to me. I'm starting to hear it a lot now. Tried looking up some definitions on it via Google and on Wikipedia but its all really technical
php code to accept and delete incoming data
Using following HTML Code please show me how to write PHP code to accept and delete the incoming data entered through the form below. from the following MySQL database and table.Database = hrmsTable =
problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of pointers. Following is the code:
ldap connection
We are using ldap to get user information from the domain controller. It was working before. Recently I found the application is hanging at ldap_connect. It doesn't return any message. i am not sure