Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP contact form problem
11-12-2016, 02:15 AM (This post was last modified: 11-12-2016 02:16 AM by deco20.)
Post: #1
PHP contact form problem
Imam problem sa PHP-om , kada napravim contact form ne mogu da posaljem pitanje sa drugog mail , nego samo sa moga ...
Npr :
Ako na "Enter your mail : " stavim (moj e mail ) : admin@mojweb.com - skripta pokupi sve podatke i posalje ih na moj mail admin@mojweb.com ,

Ali kad na "Enter yor mail : " stavim (drugi mail ) : npr deco@internetzarada.org - skripta nece poslati podatke na moj mail ... Ispod vam stavljam kod :


<?php
if (isset($_POST['contact_name']) && isset($_POST['contact_email']) && isset($_POST['contact_text'])){

$contact_name = $_POST['contact_name'];
$contact_email = $_POST['contact_email'];
$contact_text = $_POST['contact_text'];

if(!empty($contact_name) && !empty($contact_email) && !empty($contact_text)){

$to ='admin@mojweb.com';
$subject = 'Cotact form submitted';
$body = $contact_text;
$headers ='From:'.$contact_email;

if(@mail($to,$subject,$body,$headers)){

echo 'Email has been send to'.$contact_name;

}
} else{

echo 'All fields are required';
}
}
?>


<form action="index.php" method="POST">
Name : <br><input type="text" name="contact_name"><br><br>
Email adress : <br><input type="text" name="contact_email"><br><br>
Message:<<br>
<textarea name="contact_text" rows="6" cols="30"></textarea>
<br><br><br><input type="submit" value="Send!">
</form>



DA LI PROBLEM moze da bude (posto koristim 000webhost) da hosting nema podrsku za mail() ?
Send this user an email Find all posts by this user
Quote this message in a reply Thank you
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Form deco20 2 918 17-04-2015 05:02 PM
Last Post: shulk

Forum Jump:


User(s) browsing this thread: 1 Guest(s)