Help a newbee save my job !


Posted on 16th Feb 2014 07:03 pm by admin

Hey guys i am dying here i am new to php and would like for someone to help me with this problem

i have a script that send information from a "form" but the probelm is that i need this to be autheticated (smtp) before sending the email.

here is the script that i am using: (If you know what i need to do to authenticate this smtp please HELP ME!)

<?php
$emailmanager = 'oscarm@crystalplace.com';

error_reporting(0);
$msg = '';
foreach ($_POST as $k => $v) { $msg .= $k.': '.$v."nn"; }

$email = trim($_POST['email']);
$Ok = ereg("^([a-zA-Z0-9_.-]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$", $email);


$headers = 'From: ' . $email . "n";
$headers .= 'MIME-Version: 1.0' ."n";
$headers .= 'Content-Type: text/plain; charset=iso-8859-1' ."n";
$headers .= 'Content-Transfer-Encoding: 8bit'. "nn";

if ($Ok) {
mail($emailmanager,'New Trade Form Request from Brilliante Crystal Cleaner',$msg,$headers);






?>
<script language = 'javascript'>
alert('Thank you For Submiting Your Application ---> Brilliante Crystal Cleaner Team <---');
window.close();
</script>
<?
} else {
?>
<script language = 'javascript'>
alert('Sorry, please complete the form.');
history.go(-1);
</script>
<?
}


?>

No comments posted yet

Your Answer:

Login to answer
129 Like 49 Dislike
Previous forums Next forums
Other forums

Run function every 5 mins ??
I have a function PostMessage()

How can I run it every 5 mins ??

CHECK A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect a

Variable uses and placement
I'm new to PL/SQL and am trying to learn about variable valid uses/placement (any pointers to any do

a dificult string search
Hi I don't know a way around this. I want the user to input a password, but to make it a bit complca

Question about ShowWindow()
Hello....

I'm struggling with sumpin, and I hope y'all can help.

I've got a CFormView

Simple Question
I know this is a simple question, that if I knew what it was technically called i could probably loo

How do I send data using an html link
Hi

If I have
<a href="main_file.php">

How do I send data t

Storing user data help?
Hey Guys,

I'm not use if this question is to broad but I can always give you more informatio

Upload simple problem
Really confused!! I run once and it worked, but when i tried today...it didn't work

Which par

License Issue - service type user
Hi,

I would like to understand the following issue regarding sap license.
I wish to

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash