Hi
I have this PHP code that I have been told needs the script updating-changing. At the moment the website wont let anyone submit an email or quote. when they click the send nothing happens its as if they havent clicked! Someone told me the Script is wrong but both JS and PHP are a little bit confusing to me as newbie at this… Any guidance or help would be appreciated.
contact code
[php]<?php include "includes/top.php"?>
SEND A MESSAGE
Here is your chance to tell us what your needs are.
Complete the form below and we will respond as soon as possible.
<div id="BoxSendMessage">
<div id="TTCS"></div>
<div id="TTCD"></div>
<div id="TTT"></div>
<div id="TTL"></div>
<div id="TTR"></div>
<div id="SendMessageText">
<p id="T" style="font-size: 12px; font-style: normal; line-height: 100%;"> Name <br /> <br /> <br /> Email <br /> <br /> <br />Your Message </p>
</div>
<form action="actions.php?action=contact" method="POST" >
<input id="Nume" type="text" name="name" value="Your Name" style="border-radius: 4px; color:#888888;" onfocus="if (this.value=='Your Name') {this.value='';}"/>
<input id="Mail" type="text" name="mail" value="Your E-Mail" style="border-radius: 4px; color:#888888;" onfocus="if (this.value=='Your E-Mail') {this.value='';}"/>
<textarea id="Message" type="text" name="message" value="Your Message" style="border-radius: 4px; color:#888888;" onfocus="if (this.value==' Your Message ') {this.value='';}"> Your Message </textarea>
<a id="SendM" onmouseout="SEN()" onmouseover="SEND()" onclick="action(); return false;" style="cursor: pointer">
<div id="BColtS"> </div>
<div id="ABSs"> <p id="T" style="font-size: 12px; font-style: normal; line-height: 60%; margin-left: 9px;"> Send </p> </div>
<div id="BColtD"> </div>
</a>
</form>
</div>
</div>
</td>
[/php]
action code
[php]
<?php require_once('includes/variabile.php');$action = ($_POST['action'])? $_POST['action'] : $_GET['action'];switch($action){ case "contact": $name = $_POST['name']; $message = $_POST['message'];mail($email_patron,'Contact from a client', $message,'From: '.$name.' <'.$_POST['mail'].'>' . "\r\n"."Reply-to: " . $_POST['mail'] . "\r\n");Header('Location: contact.php?res=email_sent');die(); break;//not necessary, just for style case "quote": print_r($_POST); die(); Header('Location: instantquote.php'); die(); break;//not necessary, just for style case "email_client": $email = $_POST['email']; mail($email,'Your quote at christianvelectrical.com', urldecode($_POST['content']) , 'From: '.$name.' <'.$_POST['email'].'>' . "\r\n". "Reply-to: " . $_POST['email'] . "\r\n". "Content-type: text/html \r\n"); break; case "request_call": $numerc = $_POST['numerc']; $phonerc = $_POST['phonerc']; $now = $_POST['now']; $calendar = $_POST['calendar']; mail($sales,'Request a call', "Nume " . $numerc . "\r\n" . "Phonerc " . $phonerc . "\r\n" . "Date selected " . $calendar . "\r\n" ); /*'From: '.$name.' <'.$_POST['mail'].'>' . "\r\n". "Reply-to: " . $_POST['mail'] . "\r\n");*/ break; case "email_patron": //print_r($_FILES); //print_r($_POST); $file = $_FILES['file']['tmp_name']; $filename = $_FILES['file']['name']; $ext = pathinfo($filename,PATHINFO_EXTENSION ); if($file){ if(substr_count($filename,'.')>1) die('There must be exactly one . character in the filename'); if(!in_array($ext, array('gif','jpg','jpeg','bmp'))) die('File extension must be gif,png,jpg,jpeg or bmp!'); if(!imagecreatefromjpeg($file) && !imagecreatefrompng($file) && !imagecreatefromgif($file)) die('You must upload a valid gif,png,jpg,jpeg or bmp!'); if(is_uploaded_file($file)){ move_uploaded_file($file,'/var/www/vhosts/christianvelectrical.com/httpdocs/ups/'. $_FILES['file']['name']); }else{ //die('not ifile'); } } mail($email_patron,'Quote de client-ul ' . $_POST['name'], "\n\nNume " . $_POST['name']. "\n\n". "Email " . $_POST['email']. "
\n\n". "Tel " . $_POST['tel']. "
\n\n". "Total " . $_POST['total']. "
pounds
\n\n". "Comments " . $_POST['comments']. "
\n\n". 'Link poza http://christianvelectrical.com/ups/'.$filename. "
\n\n". urldecode($_POST['content']) , 'From: '.$name.' <'.$_POST['email'].'>' . "\r\n". "Reply-to: " . $_POST['email'] . "\r\n". "Content-type: text/html \r\n"); //die('email sent'); break; } ?>[/php]
If anyone can help it would be appreciated!