PHP - Sending Php Values Into A Javascript Var
Hey all,
What I want to do is send an array of PHP values into a variable I created in Javascript. PHP code: <? $result = mysql_query("SELECT A,B FROM USS"); $num_rows = mysql_numrows($result); for($i = 0; $i < $num_rows; $i++) { $nome_utilizador = mysql_fetch_row($result); $user = $nome_utilizador[0] . " ". $nome_utilizador[1]; $teste[] = $user; } ?> Then, right after this PHP code, i have the following JS code: <script type="text/javascript"> var contacts = [ {name:"<? echo $teste[0]?>",email:"ccc@ddd.com"}, {name:"fff",email:"fff@ccc.com"}]; </script> I managed to get one value printed into the var, but what I want is to create a cycle, inside the JS code, that would get all the values from my $teste[] array, and print it into the var I created. Hope I made myself explicit Thanks, Ruben Similar Tutorials
Table Issue - Multiple Location Values For User Pushes Values Out Of Row Instead Of Wrapping In Cell
I have a form that allows a user to select from several dropdowns, employees who will receive an email message. The email script works fine, however if an employee is selected more than once (which is not a rare) then the employee will receive as many email messages as their name appears. I would like for each employee to only receive the email once. For example: I am the submitter of the form and I am also the coordinator for this particular job. Therefore, my name & email are in the array twice and I will receive two emails on submit. Here is my email script: Code: [Select] $submitter = get_employee_email($user_id); $project_manager = get_employee_email($pm_id); $accountant = get_employee_email($a_id); $coordinator = get_employee_email($pc_id); $contractor = get_employee_email($contractor_id); $director = get_employee_email($dr_id); $to = array($submitter, $project_manager, $accountant, $coordinator, $contractor, $director); foreach ($to as $t){ $headers["From"] = "TEST <TEST@gmail.com>"; $headers["To"] = $t; $headers["Subject"] = "TESTING FOR JOB ID $job_id"; $text = "TESTING. Please review!"; $html = "<html><body>TESTING. Please review!</body></html>"; $file_path = "./$file"; $crlf = "\n"; $name = "TEST.csv"; $smtp_info["host"] = "TEST@gmail.com"; $smtp_info["port"] = "40"; $mime = new Mail_mime($crlf); $mime->setTXTBody($text); $mime->setHTMLBody($html); $content_type = "text/csv"; $mime->addAttachment($file_path, $content_type, $name); $body = $mime->get(); $hdrs = $mime->headers($headers); $SMTP = Mail::factory('smtp',$smtp_info); $mail = $SMTP->send($t, $hdrs, $body); } HI, I am trying to use pagination on the record getting displayed into the table and there's restriction on record that at a time total 15 records can be displayed and others will be displayed by clicking on NEXT (on which i did the following coding). In my SQL query 'where' clause there is select * from db where status = $query Code: [Select] <?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>?id=<?php echo $yes;?>">Next</a> <?php } // Show if not last page ?> The problem that i am facing is when i click on next then the $query gets equal to null which results to showing no record into the table kindly help how can i modify the above code so the previous value present in $query doesn't get NULL by clicking on next and show next 15 records sucessfully??? NOTE: The main purpose of the above mentioned code is to show next 15 records (which works fine if $query != NULL). This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=350049.0 From our website we are connecting to GMAIL to send our emails through SMTP. For some reason it is not sending the emails to the CC or BCC email address event though GMAIL shows it was included in the email. Am I missing something in the below code? Code: [Select] $currentTime = time(); $emailTo = "redbrad0@domain.com"; $emailCC = "brad@domain.com"; $emailBCC = "events@domain.com"; $emailSubject = "TEST Email at (" . $currentTime . ")"; $emailBody = "This is the body of the email"; $headers = array(); if (!empty($emailTo)) $headers['TO'] = $emailTo; if (!empty($emailCC)) $headers['CC'] = $emailCC; if (!empty($emailBCC)) $headers['BCC'] = $emailBCC; if (!empty($emailSubject)) $headers['Subject'] = $emailSubject; $headers['From'] = "events@domain.com"; $mime = new Mail_mime("\n"); $mime->setTXTBody($emailBody); $body = $mime->get(); $headers = $mime->headers($headers); $mail = Mail::factory('smtp', array ('host' => 'ssl://smtp.gmail.com', 'auth' => true, 'port' => 465, 'username' => 'events@domain.com', 'password' => 'thepasswordhere')); try { $result = $mail->send($emailTo, $headers, $emailBody); } catch (TixException $ex) { echo "<font color=red>Error:" . $ex->getCode() . "</font><br>"; } echo "Emailed at (" . $currentTime . ")<br>"; die; Since there have been some debates about how to safely pass PHP values to JavaScript, I hope I can clarify a few things.
One suggestion that kept recurring was to simply run the value through json_encode() and then inject the result into a script element. The JSON-encoding is supposed to (magically?) prevent cross-site scripting vulnerabilities. And indeed it seemingly works, because naïve attacks like trying to inject a double quote will fail.
Unfortunately, this approach doesn't work at all and is fundamentally wrong for several reasons:
json_encode() was never intended to be a security function. It simply builds a JSON object from a value. And the JSON specification doesn't make any security promises either. So even if the function happens to prevent some attack, this is implementation-specific and may change at any time.
JSON doesn't know anything about HTML entities. The encoder leaves entities like " untouched, not realizing that this represents a double quote which is dangerous in a JavaScript context.
The json_encode() function is not encoding-aware, which makes it extremely fragile and unsuitable for any security purposes. Some of you may know this problem from SQL-escaping: There used to be a function called mysql_escape_string() which was based on a fixed character encoding instead of the actual encoding of the database connection. This quickly turned out to be a very bad idea, because a mismatch could render the function useless (e. g. the infamous GBK vulnerability). So back in 2002(!), the function was abandoned in favor of mysql_real_escape_string(). Well, json_encode() is like the old mysql_escape_string() and suffers from the exact same issues.
Any of those issues can be fatal and enable attackers to perform cross-site scripting, as demonstrated below.
1)
The entire “security” of json_encode() is based on side-effects. For example, the current implementation happens to escape forward slashes. But the JSON standard doesn't mandate this in any way, so this feature could be removed at any time (it can also be disabled at runtime). If it does get disabled, then your application is suddenly wide open to even the most trivial cross-site scripting attacks:
<?php header('Content-Type: text/html; charset=UTF-8'); $input = '</script><script>alert(String.fromCharCode(88, 83, 83));</script><script>'; ?> <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>XSS</title> </head> <body> <script> var x = <?= json_encode($input, JSON_UNESCAPED_SLASHES) ?>; </script> </body> </html>2) In XHTML, a script element works like any other element, so HTML entities like " are replaced with their actual characters (in this case a double quote). But JSON does not recognize HTML entities, so an attacker can use them to bypass json_encode() and inject arbitrary characters: <?php header('Content-Type: application/xhtml+xml; charset=UTF-8'); $input = "";alert('XSS');""; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>XSS</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> </head> <body> <script type="text/javascript"> var x = <?= json_encode($input) ?>; </script> </body> </html>3) json_encode() blindly assumes that the input and the output should always be UTF-8. If you happen to use a different encoding, or if an attacker manages to trigger a specific encoding, you're again left with no protection at all: <?php header('Content-Type: text/html; charset=UTF-7'); $input = '+ACIAOw-alert(+ACI-XSS+ACI)+ADsAIg-'; ?> <!DOCTYPE HTML> <html> <head> <meta charset="utf-7"> <title>XSS</title> </head> <body> <script> var x = <?= json_encode($input) ?>; </script> </body> </html>(This particular example only works in Internet Explorer.) I hope this makes it very clear that json_encode() is not a security feature in any way. Relying on it is conceptually wrong and simply a very bad idea. It's generally not recommended to inject code directly into a script element, because any mistake or bug will immediately lead to a cross-site scripting vulnerability. It's also very difficult to do it correctly, because there are special parsing rules and differences between the various flavors of HTML. If you try it, you're asking for trouble. So how should one pass PHP values to JavaScript? By far the most secure and robust approach is to simply use Ajax: Since Ajax cleanly separates the data from the application logic, the value can't just “leak” into a script context. This is essentially like a prepared statement. If you're into micro-optimization and cannot live with the fact that Ajax may need an extra request, there's an alternative approach by the OWASP: You can JSON-encode the data, HTML-escape the result, put the escaped content into a hidden div element and then parse it with JSON.parse(): <?php header('Content-Type: text/html; charset=UTF-8'); $input = 'bar'; ?> <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>XSS</title> <style> .hidden { display: none; } </style> </head> <body> <div id="my-data" class="hidden"> <?php $json_object = json_encode(array( 'foo' => $input, )); // HTML-escape the JSON object echo htmlspecialchars($json_object, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5, 'UTF-8'); ?> </div> <script> var data = JSON.parse(document.getElementById('my-data').innerHTML); alert('The following value has been safely passed to JavaScript: ' + data.foo); </script> </body> </html> This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=348942.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=359130.0 Dear All Members here is my table data.. (4 Columns/1row in mysql table)
id order_no order_date miles How to split(miles) single column into (state, miles) two columns and output like following 5 columns /4rows in mysql using php code.
(5 Columns in mysql table) id order_no order_date state miles 310 001 02-15-2020 MI 108.53 310 001 02-15-2020 Oh 194.57 310 001 02-15-2020 PA 182.22
310 001 02-15-2020 WA 238.57 ------------------my php code -----------
<?php
if(isset($_POST["add"]))
$miles = explode("\r\n", $_POST["miles"]);
$query = $dbh->prepare($sql);
$lastInsertId = $dbh->lastInsertId(); if($query->execute()) {
$sql = "update tis_invoice set flag='1' where order_no=:order_no"; $query->execute();
} ----------------- my form code ------------------
<?php -- Can any one help how to correct my code..present nothing inserted on table
Thank You Edited February 8, 2020 by karthicbabuHi, My company has 240+ locations and as such some users (general managers) cover multiple sites. When I run a query to pull user information, when the user has multiple sites to his or her name, its adds the second / third sites to the next columns, rather than wrapping it inside the same table cell. It also works the opposite way, if a piece of data is missing in the database and is blank, its pull the following columns in. Both cases mess up the table and formatting. I'm extremely new to any kind of programming and maybe this isn't the forum for this question but figured I'd give it a chance since I'm stuck. The HTML/PHP code is below: <table id="datatables-column-search-select-inputs" class="table table-striped" style="width:100%"> <thead> <tr> <th>ID</th> <th>FirstName</th> <th>LastName</th> <th>Username</th> <th>Phone #</th> <th>Location</th> <th>Title</th> <th>Role</th> <th>Actions</th> </tr> </thead> <tbody> <?php //QUERY TO SELECT ALL USERS FROM DATABASE $query = "SELECT * FROM users"; $select_users = mysqli_query($connection,$query);
// SET VARIABLE TO ARRAY FROM QUERY while($row = mysqli_fetch_assoc($select_users)) { $user_id = $row['user_id']; $user_firstname = $row['user_firstname']; $user_lastname = $row['user_lastname']; $username = $row['username']; $user_phone = $row['user_phone']; $user_image = $row['user_image']; $user_title_id = $row['user_title_id']; $user_role_id = $row['user_role_id'];
// POPULATES DATA INTO THE TABLE echo "<tr>"; echo "<td>{$user_id}</td>"; echo "<td>{$user_firstname}</td>"; echo "<td>{$user_lastname}</td>"; echo "<td>{$username}</td>"; echo "<td>{$user_phone}</td>";
//PULL SITE STATUS BASED ON SITE STATUS ID $query = "SELECT * FROM sites WHERE site_manager_id = {$user_id} "; $select_site = mysqli_query($connection, $query); while($row = mysqli_fetch_assoc($select_site)) { $site_name = $row['site_name']; echo "<td>{$site_name}</td>"; } echo "<td>{$user_title_id}</td>"; echo "<td>{$user_role_id}</td>"; echo "<td class='table-action'> <a href='#'><i class='align-middle' data-feather='edit-2'></i></a> <a href='#'><i class='align-middle' data-feather='trash'></i></a> </td>"; //echo "<td><a href='users.php?source=edit_user&p_id={$user_id}'>Edit</a></td>"; echo "</tr>"; } ?>
<tr> <td>ID</td> <td>FirstName</td> <td>LastName</td> <td>Username</td> <td>Phone #</td> <td>Location</td> <td>Title</td> <td>Role</td> <td class="table-action"> <a href="#"><i class="align-middle" data-feather="edit-2"></i></a> <a href="#"><i class="align-middle" data-feather="trash"></i></a> </td> </tr> </tbody> <tfoot> <tr> <th>ID</th> <th>FirstName</th> <th>LastName</th> <th>Username</th> <th>Phone #</th> <th>Location</th> <th>Title</th> <th>Role</th> </tr> </tfoot> </table>
Hi all, I'm a first time poster here and I would really appreciate some guidance with my latest php challenge! I've spent the entire day googling and reading and to be honest I think I'm really over my head and need the assistance of someone experienced to advise the best way to go! I have a multi dimensional array that looks like (see below); the array is created by CodeIgniter's database library (the rows returned from a select query) but I think this is a generic PHP question as opposed to having anything to do with CI because it related to working with arrays. I'm wondering how I might go about searching the array below for the key problem_id and a value equal to a variable which I would provide. Then, when it finds an array with a the matching key and variable, it outputs the other values in that part of the array too. For example, using the sample data below. How would you recommend that I search the array for all the arrays that have the key problem_id and the value 3 and then have it output the value of the key problem_update_date and the value of the key problem_update_text. Then keep searching to find the next occurrence? Thanks in advance, as above, I've been searching really hard for the answer and believe i'm over my head! Output of print_r($updates); CI_DB_mysql_result Object ( [conn_id] => Resource id #30 [result_id] => Resource id #35 [result_array] => Array ( ) [result_object] => Array ( ) [current_row] => 0 [num_rows] => 5 [row_data] => ) Output of print_r($updates->result_array()); Array ( [0] => Array ( [problem_update_id] => 1 [problem_id] => 3 [problem_update_date] => 2010-10-01 [problem_update_text] => Some details about a paricular issue [problem_update_active] => 1 ) [1] => Array ( [problem_update_id] => 4 [problem_id] => 3 [problem_update_date] => 2010-10-01 [problem_update_text] => Another update about the problem with an ID of 3 [problem_update_active] => 1 ) [2] => Array ( [problem_update_id] => 5 [problem_id] => 4 [problem_update_date] => 2010-10-12 [problem_update_text] => An update about the problem with an ID of four [problem_update_active] => 1 ) [3] => Array ( [problem_update_id] => 6 [problem_id] => 4 [problem_update_date] => 2010-10-12 [problem_update_text] => An update about the problem with an ID of 6 [problem_update_active] => 1 ) [4] => Array ( [problem_update_id] => 7 [problem_id] => 3 [problem_update_date] => 2010-10-12 [problem_update_text] => Some new update about the problem with the ID of 3 [problem_update_active] => 1 ) ) Hi all, Just curious why this works: Code: [Select] while (($data = fgetcsv($handle, 1000, ",")) !== FALSE){ $import="INSERT into $prodtblname ($csvheaders1) values('$data[0]','$data[1]','$data[2]','$data[3]','$data[4]','$data[5]','$data[6]')"; } And this does not: $headdata_1 = "'$data[0]','$data[1]','$data[2]','$data[3]','$data[4]','$data[5]','$data[6]'"; while (($data = fgetcsv($handle, 1000, ",")) !== FALSE){ $import="INSERT into $prodtblname ($csvheaders1) values($headdata_1)"; }it puts $data[#'s] in the database fields instead of the actual data that '$data[0]','$data[1]'... relates to. I wrote a script to create the values in $headdata_1 based on the number of headers in $csvheaders1 but can't seem to get it working in the sql statement. Thanks Hi, I hope it is possible to establish, what I am going to ask Currently I am using a site where I am entering a xml code, that is sent to certain workflow. That workflow returns me a few csv files within the same http session. So simply, there is a page with the TEXTAREA - where i enter xml code and subsequently I click on the Submit button. After that the new page is opened where I have links to csv files. I wonder if would be possible to establish that using php code. I would like to run everything in background, sending xml code to that workflow and get those files. Everything without opening that site, entering xml code, submitin that ,and clicking on each link to download those files. I am not looking for exact answer. Just if you can tell me where I can start. My php knowledge is not great, but I have written a few things so far. So if you can help where to start, I would be more than happy Thanks Hi guys, I am using following code for sending out confirmation email after successful transaction to the user. But, I users are not getting any confirmation emails. Can somebody help me out here. May be I am doing wrong in "$to" function as $sender_email is at previous form, So how can I use Session here? If I am wrong here? Any someone help? Many Thanks in advance. $to = "$sender_email"; $subject = "Your Transaction"; $headers = "From: Company <company@abc.com>\n"; $headers .= "Reply-To: Company <company@abc.com>\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n"; $message = "Dear ".$rs["sender_name"].", ".$_email_nl.$_email_nl; $message .= "Your paid amount ".$amount." ".$rs["currency"]." has been added to desired account.".$_email_nl.$_email_nl; $message .= "Regards,"; $message .= "my company"; mail($to, $subject, $message, $headers); I need some help over here. I want to send an email to my friends by checking the database and extract the id. After extracting the id from the database, i want to include a URL with the id. E.g. www.abc.php?35 (35 is the id) www.abc.php?40 (40 is the id) May I know how to send an email with multiple url? Is it using a for loop in the php email function? Your help is greatly appreciated. Can someone help me understand why an email isn't being sent after clicking submit? Code: [Select] <?php error_reporting(E_ALL); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php extract ($_POST); if(!isset($submit)) { ?> <form action=" " method="post" name="test"> Name: <input name="name " type="text" id="name " size="8" /><br /> phone <input name="phone" type="text" size="13" /><br /> email <input name="email" type="text" size="9" maxlength="30" /><br /> <input name="submit" type="submit" value="submit" /> </form> <?php $Recipient = "$email"; $MsgSubject = "message subject"; $MsgHeader = "From Auntie Vic's Treatery <auntievics@gmail.com>\r\n"; $MsgBody = "message body."; mail($Recipient, $MsgSubject, $MsgBody, $MsgHeader); } else { echo " thank you for your order. It is being processed. Thank you for your business."; } ?> </body> </html> Hi guys; I have created a php form whereby users have the ability to upload a file to the server. After they click the submit button the form input is sent in an email with a path to the uploaded file. Whilst the email provides the direct path to the file it is not linkable. How do i do this. The code which sets the path is; Code: [Select] $body .= "\nPath: http://xxx/xxx/xxx/xxx/$target"; How can i change it so the path becomes a link in the email? Hi
I have below code :
<?php $_SERVER['SERVER_NAME']; $to = "info@domain.com"; $subject = "Test mail"; $body = $_SERVER['SERVER_NAME']; $from = "user@example.com"; $headers = "From:" . $from; mail($to, $subject, $body, $headers) ?>the email is sent correctly but without any body text . I use $_SERVER['SERVER_NAME']; but nothing show as body . I want to use this code load each day becuse I want to know which domain is used my script. but now the code not work. Alright, been having a problem with some websites lately. The host is GoDaddy (I know, I know...). <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <Title>Horticultural Service | Landscape Consultant | W. Florida Panhandle | Landscaping</Title> <META NAME="Author" CONTENT="Horticultural Service Group"> <META NAME="Subject" CONTENT="Horticultural Service Group offering landscape consulting and Horticultural pruning and trimming."> <META NAME="Description" CONTENT="Horticultural Service company serving the W. Florida Panhandle region. Offering landscape consulting service and horticultural correct pruning of trees and bushes. Residential landscaping, tree trimming and consulting service."> <META NAME="Keywords" CONTENT="horticultural service,horticulture, pruning,tree pruning,pruning plants,pruning bushes,tree trimming,landscaping, landscaping yards,residential landscaping,landscape architecture, backyard landscape,W. Florida Panhandle,FL panhandle"> <META NAME="Language" CONTENT="English"> <META NAME="Copyright" CONTENT="© Horticultural Service Group"> <META NAME="Revisit-After" CONTENT="15 Days"> <META NAME="Distribution" CONTENT="Global"> <META NAME="Robots" CONTENT="Follow, All"> <link href="css/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <!--=========================================================== Script: JavaScript Cross-Browser SlideShow Script With Cross-Fade Effect between Images Adjustable Timing and Unlimited Images Function: Displays images continuously in a slideshow presentation format, with a fade effect on image transitions. Browsers: All common browsers: NS3-6, IE 4-6 Fade effect only in IE; others degrade gracefully Author: etLux =========================================================== Step 1. Put the following script in the head of your page:--> <script> // (C) 2000 www.CodeLifter.com // http://www.codelifter.com // Free for all users, but leave in this header // NS4-6,IE4-6 // Fade effect only in IE; degrades gracefully // ======================================= // set the following variables // ======================================= // Set slideShowSpeed (milliseconds) var slideShowSpeed = 5000 // Duration of crossfade (seconds) var crossFadeDuration = 3 // Specify the image files var Pic = new Array() // don't touch this // to add more images, just continue // the pattern, adding to the array below Pic[0] = 'images/image_six.jpg' Pic[1] = 'images/image_two.jpg' Pic[2] = 'images/image_one.jpg' Pic[3] = 'images/image_seven.jpg' Pic[4] = 'images/image_eight.jpg' Pic[5] = 'images/image_nine.jpg' // ======================================= // do not edit anything below this line // ======================================= var t var j = 0 var p = Pic.length var preLoad = new Array() for (i = 0; i < p; i++){ preLoad[i] = new Image() preLoad[i].src = Pic[i] } function runSlideShow(){ if (document.all){ document.images.SlideShow.style.filter="blendTrans(duration=2)" document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)" document.images.SlideShow.filters.blendTrans.Apply() } document.images.SlideShow.src = preLoad[j].src if (document.all){ document.images.SlideShow.filters.blendTrans.Play() } j = j + 1 if (j > (p-1)) j=0 t = setTimeout('runSlideShow()', slideShowSpeed) } </script> <script type="text/javascript" src="js/validate.js"></script> </head> <body onload="MM_preloadImages('images/title_home_b.jpg','images/title_about_b.jpg','images/title_gallery_b.jpg','images/title_landscape_b.jpg','images/title_services_b.jpg','images/title_contact_b.jpg'), runSlideShow()"> <div align="center"> <table width="909" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" align="center" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"><img src="images/header_top.jpg" alt="Horticultural Services Inc." width="909" height="98" longdesc="index.html" /></td> </tr> <tr> <td width="602" align="left"><img src="images/header_left.jpg" alt="Horticulture Services Group Inc.Inc." width="602" height="185" longdesc="about.html" /></td> <td align="left"><img src="images/image_six.jpg" alt="Landschaft" name="SlideShow" width="308" height="185" id="SlideShow" longdesc="index.html" /></td> </tr> </table></td> </tr> <tr> <td width="81" height="29"><span class="buttoms_left"><img src="images/buttoms_left.jpg" width="81" height="29" /></span></td> <td width="474" align="right" bgcolor="#424242"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="56"><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','images/title_home_b.jpg',1)"><img src="images/title_home.jpg" alt="Home" name="Home" width="56" height="29" border="0" id="Home" /></a></td> <td width="75"><a href="about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('About Us','','images/title_about_b.jpg',1)"><img src="images/title_about.jpg" alt="About Us" name="About Us" width="75" height="29" border="0" id="About Us" /></a></td> <td width="63"><a href="gallery.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Gallery','','images/title_gallery_b.jpg',1)"><img src="images/title_gallery.jpg" alt="Gallery" name="Gallery" width="63" height="29" border="0" id="Gallery" /></a></td> <td width="125"><a href="wordpress/index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Landscape News','','images/title_landscape_b.jpg',1)"><img src="images/title_landscape.jpg" alt="Landscape News" name="Landscape News" width="125" height="29" border="0" id="Landscape News" /></a></td> <td width="71"><a href="services.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Services','','images/title_services_b.jpg',1)"><img src="images/title_services.jpg" alt="Services" name="Services" width="71" height="29" border="0" id="Services" /></a></td> <td align="left"><a href="contact.php"><img src="images/title_contact_b.jpg" alt="Contact" name="Contact" width="83" height="29" border="0" id="Contact" /></a></td> </tr> </table></td> <td width="354" align="right"><span class="buttoms_right"><img src="images/buttoms_right.jpg" width="354" height="29" /></span></td> </tr> <tr> <td height="46" colspan="3" class="bottom_header"> </td> </tr> </table> <table width="909" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="63" height="426" class="flowers_left"> </td> <td align="center" valign="top" class="content_repeat"><table width="725" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="420" align="left" valign="top" class="content_center"><h1><img src="images/titles_contact_us.jpg" alt="Contact Us" width="120" height="17" longdesc="index.html" /></h1> <? if(isset($_GET['q'])){ $error = explode(';',urldecode($_GET['q']));?> <p class="style1"> <? foreach ($error as $mensaje){ ?> <? echo $mensaje .'<BR>'; }?> </p> <? }?> <h2>Contact Form:</h2> <p>Please fill out the information below and a representative will contact you.</p> <form name="contactForm" id="contactForm" action="sendmail.php" method="post" onSubmit="return validate();"> <label>First Name:*<br /> <input name="fname" type="text" id="fname" style="border:1px solid #5E748C;" size="25" /> </label> <br /> <br /> <label>Last Name:*<br /> <input name="lname" type="text" id="lname" style="border:1px solid #5E748C;" size="25" /> </label> <br /> <br /> <label>Address:<br /> <input name="address" type="text" id="address" style="border:1px solid #5E748C;" size="25" /> </label> <br /> <br /> <label>City:<br /> <input name="city" type="text" id="city" style="border:1px solid #5E748C;" size="25" /> </label> <br /> <br /> <label>State:<br /> <select name="state" tabindex="4" id="state" style="border:1px solid #5E748C;"> <option value="" selected>Choose a State</option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DC">D.C.</option> <option value="DE">Delaware</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Louisiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachusetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebraska</option> <option value="NV">Nevada</option> <option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="PA">Pennsylvania</option> <option value="RI">Rhode Island</option> <option value="SC">South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="WV">West Virginia</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> </select> </label> <br /> <br /> <label>Zip:<br /> <input name="zip" type="text" id="zip" style="border:1px solid #5E748C;" size="25" /> </label> <br /> <br /> <label>Email:<br /> <input name="email" type="text" id="email" style="border:1px solid #5E748C;" size="25" /> </label> <br /> <br /> <label>Phone Number:*<br /> <input name="phone" type="text" id="phone" style="border:1px solid #5E748C;" size="25" /> </label> <br /> <br /> <label>Contact Method:<br /> <select name="metod" tabindex="4" id="metod" style="border:1px solid #5E748C;"> <option value="Telephone" selected>Telephone</option> <option value="Email">Email</option> </select> </label> <br /> <br /> <label>Questions or Comments:<br /> <textarea name="comments" cols="40" rows="5" wrap="virtual" id="comments" style="border:1px solid #5E748C;"></textarea> </label> <br /> <br /> <p>*Required Fields</p> <label> <input type="reset" style="border:1px solid #5E748C; background-color:#99CCFF; color:414141;" name="Reset" id="button" value="Reset" /> </label> <label> <input name="submit" style="border:1px solid #5E748C; background-color:#99CCFF; color:414141;" type="submit" value="Send"/> </label> </form> <br /> <div class="line"></div> <h2>Offices:</h2> <p align="center"><b>Horticultural Services Group, Inc.</b><br /> <b>Phone:</b> 850-603-9783<br /> <b>Fax:</b> 800-521-4213<br /> <b>Email:</b> <a href="mailto:slarue@hortservicesgroup.com">slarue@hortservicesgroup.com</a></p> <div align="center"> <!-- form should mail to jwclairmont@register.com --> </div></td> <td width="215" align="center" valign="top"> <h1>850-603-9783</h1><div align="right"><h2>Services we Offer:</h2> <p class="side_services"> <a href="commercial.html" title="commercial services">Commercial Landscape Maintenance</a><br/> <a href="commercial-landscape-design.html" title="commercial landscape design/build">Commercial Landscape Design/Build</a><br/> <a href="residential.html" title="residential services">Residential Landscape Design</a><br/> <a href="residential.html" title="residential services">Home Landscape Renovation</a><br/> <a href="residential.html" title="residential services">Landscape Construction</a><br/> <a href="commercial.html" title="commercial services">Palm Trees</a><br/> <a href="commercial.html" title="commercial services">Tree Installation</a><br/> <a href="commercial.html" title="commercial services">Fertilizer</a></p> </div> <a href="sign_up.php"><img src="images/subscribe_link.jpg" border="0" /></a><br /><br /> <img src="images/image_nature.jpg" alt="Nature" width="194" height="195" longdesc="index.html" /> <p><span class="highlighted">Horticultural Services Group</span><br /> Phone: <b>850-603-9783</b><br /> Fax: <b>800-521-4213</b></p> <p><a href="organizations.html"><strong>Organizations</strong></a></p> <p><a href="http://www.facebook.com/pages/Crestview-FL/Horticulture-Services-Group-Inc/126426941305?ref=ts" target="_blank"><img src="images/facebook.jpg" border="0" /></a></p></td> </tr> </table></td> <td width="51" height="426" class="flowers_right"> </td> </tr> </table> <table width="909" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="69" align="center" valign="top" class="footer"> <a href="index.html">Home</a> | <a href="about.html">About Us</a> | <a href="gallery">Gallery</a> | <a href="wordpress/index.php">Landscape Blog</a> | <a href="contact.php">Contact Us</a> | <a href="wordpress/wp-admin/index.php" style="text-decoration:underline;"><i>Panel Access Management</i></a><br /> <span id="footer">Copyright ©Horticultural Services Group Inc. All rights reserved. Powered by <a href="http://www.register.com/" target="_blank">Register.com</a></span> </td> </tr> </table> </div> </body> </html> Above is the HTML form. <?php if (isset($_POST['submit'])){ $error = array(); // ************************** // add fields validations here if(empty($_POST['fname'])){ $error[] = "Please enter your first name."; } if(empty($_POST['lname'])){ $error[] = "Please enter your last name."; } if(empty($_POST['phone'])){ $error[] = "Please enter a phone number."; } // ************************** if(count($error) > 0 ){ $q = urlencode(implode(';',$error)); header('Location: contact.php?q='.$q); } else { for($i=0;$i<25;$i++){ if(!empty($_POST['check'.$i]))$aChecks[] = $_POST['check'.$i]; } $industry = implode(" | ",$aChecks); $real_time = $_POST['real_time']; $hot_transfer = $_POST['hot_transfer']; $email = $_POST['email']; $fname = $_POST['fname']; $lname = $_POST['lname']; $metod = $_POST['metod']; $company = $_POST['company']; $phone = $_POST['phone']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $comments = $_POST['comments']; $Ssubject = "Form message submitted from ".$_SERVER['HTTP_HOST']."\r\n"; $Sheaders = "From: $name <$email>\r\n"; $Sheaders .= "Reply-To: $email\r\n"; $Sheaders .= "X-Mailer: PHP\r\n"; $Sheaders .= "Mime-Version: 1.0\r\n"; $Sheaders .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"; $Sheaders .= "Content-Transfer-Encoding: 8bit\r\n"; $Smsg = "Contact Information.\r\n\r\n"; $Smsg .= "--------------------------------------------------------------------------- \r\n"; $Smsg .= "First Name: $fname\r\n"; $Smsg .= "Last Name: $lname\r\n"; $Smsg .= "Address: $address\r\n"; $Smsg .= "City: $city\r\n"; $Smsg .= "State: $state\r\n"; $Smsg .= "Zip: $zip\r\n"; $Smsg .= "Email: $email\r\n"; $Smsg .= "Phone: $phone\r\n"; $Smsg .= "Contact Method: $metod\r\n"; $Smsg .= "Questions or Comments: $comments\r\n"; $Smsg .= "--------------------------------------------------------------------------- \r\n"; $sent = mail("todd@revivemediaservices.com", $Ssubject, $Smsg, $Sheaders); // echo "SENT:$sent -- EMAIL:$email -- SUBJECT:$Ssubject -- MSG:$Smsg -- HEADERS:$Sheaders "; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <Title>Horticultural Service | Landscape Consultant | W. Florida Panhandle | Landscaping</Title> <META NAME="Author" CONTENT="Horticultural Service Group"> <META NAME="Subject" CONTENT="Horticultural Service Group offering landscape consulting and Horticultural pruning and trimming."> <META NAME="Description" CONTENT="Horticultural Service company serving the W. Florida Panhandle region. Offering landscape consulting service and horticultural correct pruning of trees and bushes. Residential landscaping, tree trimming and consulting service."> <META NAME="Keywords" CONTENT="horticultural service,horticulture, pruning,tree pruning,pruning plants,pruning bushes,tree trimming,landscaping, landscaping yards,residential landscaping,landscape architecture, backyard landscape,W. Florida Panhandle,FL panhandle"> <META NAME="Language" CONTENT="English"> <META NAME="Copyright" CONTENT="© Horticultural Service Group"> <META NAME="Revisit-After" CONTENT="15 Days"> <META NAME="Distribution" CONTENT="Global"> <META NAME="Robots" CONTENT="Follow, All"> <link href="css/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <!--=========================================================== Script: JavaScript Cross-Browser SlideShow Script With Cross-Fade Effect between Images Adjustable Timing and Unlimited Images Function: Displays images continuously in a slideshow presentation format, with a fade effect on image transitions. Browsers: All common browsers: NS3-6, IE 4-6 Fade effect only in IE; others degrade gracefully Author: etLux =========================================================== Step 1. Put the following script in the head of your page:--> <script> // (C) 2000 www.CodeLifter.com // http://www.codelifter.com // Free for all users, but leave in this header // NS4-6,IE4-6 // Fade effect only in IE; degrades gracefully // ======================================= // set the following variables // ======================================= // Set slideShowSpeed (milliseconds) var slideShowSpeed = 5000 // Duration of crossfade (seconds) var crossFadeDuration = 3 // Specify the image files var Pic = new Array() // don't touch this // to add more images, just continue // the pattern, adding to the array below Pic[0] = 'images/image_eight.jpg' Pic[1] = 'images/image_two.jpg' Pic[2] = 'images/image_six.jpg' Pic[3] = 'images/image_seven.jpg' Pic[4] = 'images/image_one.jpg' Pic[5] = 'images/image_nine.jpg' // ======================================= // do not edit anything below this line // ======================================= var t var j = 0 var p = Pic.length var preLoad = new Array() for (i = 0; i < p; i++){ preLoad[i] = new Image() preLoad[i].src = Pic[i] } function runSlideShow(){ if (document.all){ document.images.SlideShow.style.filter="blendTrans(duration=2)" document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)" document.images.SlideShow.filters.blendTrans.Apply() } document.images.SlideShow.src = preLoad[j].src if (document.all){ document.images.SlideShow.filters.blendTrans.Play() } j = j + 1 if (j > (p-1)) j=0 t = setTimeout('runSlideShow()', slideShowSpeed) } </script> </head> <body onload="MM_preloadImages('images/title_home_b.jpg','images/title_about_b.jpg','images/title_gallery_b.jpg','images/title_landscape_b.jpg','images/title_services_b.jpg','images/title_contact_b.jpg'), runSlideShow()"> <div align="center"> <table width="909" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" align="center" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"><img src="images/header_top.jpg" alt="Horticultural Services Inc." width="909" height="98" longdesc="index.html" /></td> </tr> <tr> <td width="602" align="left"><img src="images/header_left.jpg" alt="Horticulture Services Group Inc.Inc." width="602" height="185" longdesc="about.html" /></td> <td align="left"><img src="images/image_eight.jpg" alt="Landschaft" name="SlideShow" width="308" height="185" id="SlideShow" longdesc="index.html" /></td> </tr> </table></td> </tr> <tr> <td width="81" height="29"><span class="buttoms_left"><img src="images/buttoms_left.jpg" width="81" height="29" /></span></td> <td width="474" align="right" bgcolor="#424242"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="56"><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','images/title_home_b.jpg',1)"><img src="images/title_home.jpg" alt="Home" name="Home" width="56" height="29" border="0" id="Home" /></a></td> <td width="75"><a href="about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('About Us','','images/title_about_b.jpg',1)"><img src="images/title_about.jpg" alt="About Us" name="About Us" width="75" height="29" border="0" id="About Us" /></a></td> <td width="63"><a href="gallery.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Gallery','','images/title_gallery_b.jpg',1)"><img src="images/title_gallery.jpg" alt="Gallery" name="Gallery" width="63" height="29" border="0" id="Gallery" /></a></td> <td width="125"><a href="wordpress/index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Landscape News','','images/title_landscape_b.jpg',1)"><img src="images/title_landscape.jpg" alt="Landscape News" name="Landscape News" width="125" height="29" border="0" id="Landscape News" /></a></td> <td width="71"><a href="services.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Services','','images/title_services_b.jpg',1)"><img src="images/title_services.jpg" alt="Services" name="Services" width="71" height="29" border="0" id="Services" /></a></td> <td align="left"><a href="contact.php"><img src="images/title_contact_b.jpg" alt="Contact" name="Contact" width="83" height="29" border="0" id="Contact" /></a></td> </tr> </table></td> <td width="354" align="right"><span class="buttoms_right"><img src="images/buttoms_right.jpg" width="354" height="29" /></span></td> </tr> <tr> <td height="46" colspan="3" class="bottom_header"> </td> </tr> </table> <table width="909" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="63" height="426" class="flowers_left"> </td> <td align="center" valign="top" class="content_repeat"><table width="725" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="420" align="left" valign="top" class="content_center"><h1><img src="images/titles_contact_us.jpg" alt="Contact Us" width="120" height="17" longdesc="index.html" /></h1> <p>Thanks! We will contact you soon, <a href="index.html">back to Home</a>.</p> </td> <td width="215" align="center" valign="top"> <a href="sign_up.php"><img src="images/subscribe_link.jpg" border="0" /></a><br /><br /> <img src="images/image_nature.jpg" alt="Nature" width="194" height="195" longdesc="index.html" /> <p><span class="highlighted">Horticultural Services Group</span><br /> Phone: <b>850-603-9783</b><br /> Fax: <b>800-521-4213</b></p> <p><a href="organizations.html"><strong>Organizations</strong></a></p> <p><a href="http://www.facebook.com/pages/Crestview-FL/Horticulture-Services-Group-Inc/126426941305?ref=ts" target="_blank"><img src="images/facebook.jpg" border="0" /></a></p></td> </tr> </table></td> <td width="51" height="426" class="flowers_right"> </td> </tr> </table> <table width="909" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="69" align="center" valign="top" class="footer"> <a href="index.html">Home</a> | <a href="about.html">About Us</a> | <a href="gallery">Gallery</a> | <a href="wordpress/index.php">Landscape Blog</a> | <a href="contact.php">Contact Us</a> | <a href="wordpress/wp-admin/index.php" style="text-decoration:underline;"><i>Panel Access Management</i></a><br /> <span id="footer">Copyright ©Horticultural Services Group Inc. All rights reserved. Powered by <a href="http://www.register.com/" target="_blank">Register.com</a></span> </td> </tr> </table> </div> </body> </html> That's the processing script right now. When we use that we do not receive an email. So trying to figure out what was up, we made this file: <?php mail("todd@revivemediaservices.com", "test message from godaddy", "this is a test message, if you are reading this the email was sent successfully."); ?> When we use that, we receive the email although it takes about 15+ minutes. In our troubleshooting, we took a script off of my website and tested it. That's this code: <?php require_once('wp-blog-header.php');?> <?php require_once('magpierss/rss_fetch.inc');?> <?php require_once('_inc/functions.php');?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <head profile="http://www.w3.org/2000/08/w3c-synd/#"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title> <link rel="stylesheet" href="wp-content/themes/bp/reset.css" type="text/css" media="screen" /> <link rel="stylesheet" href="wp-content/themes/bp/style.css" type="text/css" media="screen" /> <!--[if IE]> <link href="<?php bloginfo('template_url'); ?>/ie_only.css" rel="stylesheet" type="text/css"> <![endif]--> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <meta name="generator" content="Brandon Pence" /> <meta name="keywords" content="brandon pence, digital artist, florida, gulf coast, niceville, modern artist," /> <meta name="description" content="The official website of the artist Brandon Pence. Living in the Gulf Coast of Florida, Brandon Pence is a modern digital artist." /> <script type="text/javascript" src="http://ajax.googleapis I have found it a bit strange recently how i stopped receiving online emails from my website, we havnt changed the code as far as i am aware. but for some reason neither the user or staff receives an email the code below is our process for the mail. please could somebody advise why? <?php $host="localhost"; // Host name $username="HIDDEN"; // Mysql username $password="HIDDEN"; // Mysql password $db_name="HIDEEN"; // Database name $tbl_name="HIDDEN"; // Table name $name = $_POST['name']; $email = $_POST['email']; $web = $_POST['web']; $tel = $_POST['tel']; $sub = $_POST['sub']; $message = $_POST['message']; $ip = $_SERVER['REMOTE_ADDR']; $datetime=date("d-m-y"); //date time // validation function is_valid_email($email) { return preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $email); } if (!is_valid_email($email)) { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error\">"; exit; } $validationOK=true; if (Trim($name)=="") $validationOK=false; if (Trim($email)=="") $validationOK=false; if (Trim($tel)=="") $validationOK=false; if (Trim($sub)=="") $validationOK=false; if (Trim($message)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error\">"; exit; } $EmailFrom = Trim(stripslashes($_POST['email'])); $EmailTo = "info@msukgroup.co"; $Subject2 = Trim(stripslashes($_POST['sub'])); $Name = Trim(stripslashes($_POST['name'])); $Comments = Trim(stripslashes($_POST['message'])); $Subject = "MSUKGroup - Thankyou For Contacting "; // STAFF EMAIL $staffmail = ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MSUKGroup</title> <style> p { margin-top:0; margin-bottom:4px; } </style> </head> <body style="color: #666666; font-size:small; font-family:Franklin Gothic Book"> <table style="width: 516px; height: 42px;" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top" style="height: 42px; width: 516px"> <table style="width: 500px; height: 42px;" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top" style="height: 42px; width: 500px"> <img src="http://msukgroup.co/img/logos/orange.png" width="323" height="42" /></td> </tr> </table> </td> </tr> </table> <p>Dear ' . $name . ',</p> <p>Thankyou for contacting the MSUKGroup via our online submission form. A relevant representative will be with you within 24 hours to assist you further with your query. </p> <p>Here is what we gathered from your query:</p> <table style="width: 100%" cellspacing="4" cellpadding="0"> <tr> <td style="width: 60px" align="right"><strong> Name:</strong></td> <td> ' . $name . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Email:</strong></td> <td> ' . $email . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Website:</strong></td> <td> ' . $web . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Tel:</strong></td> <td> ' . $tel . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Subject:</strong></td> <td> ' . $sub . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Message:</strong></td> <td> ' . $message . '</td> </tr> </table> <p>In the meantime, if you have any unanswered questions please take a look around our website and you&#39;ll find out more about our group and services.</p> <p><img src="http://msukgroup.co/img/logo3.png" width="129" height="21" /></p> <p>Hosting - Designs - eCommerce - Solutions - Events and more...</p> <p><strong>Web:<br /> </strong><a href="http://www.msukgroup.co"><span style="color:#FF7800">http://www.msukgroup.co</span></a></p> <p><strong>Email:<br /> </strong><a href="http://www.msukgroup.co"><span style="color:#FF7800"> info@msukgroup.co</span></a></p> </body> </html> '; // USER EMAIL $usermail = ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MSUKGroup</title> <style> p { margin-top:0; margin-bottom:4px; } </style> </head> <body style="color: #666666; font-size:small; font-family:Franklin Gothic Book"> <table style="width: 516px; height: 42px;" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top" style="height: 42px; width: 516px"> <table style="width: 500px; height: 42px;" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top" style="height: 42px; width: 500px"> <img src="http://msukgroup.co/img/logos/orange.png" width="323" height="42" /></td> </tr> </table> </td> </tr> </table> <p>Hello Admin,</p> <p>' . $name . ' has sent a message using the contact form on the site.<br> <strong>Date Message Sent: ' . $datetime . ' <br> IP Address: ' . $ip . ' </strong><br> </p> <p>Here is what we gathered from their query:</p> <table style="width: 100%" cellspacing="4" cellpadding="0"> <tr> <td style="width: 60px" align="right"><strong> Name:</strong></td> <td> ' . $name . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Email:</strong></td> <td> ' . $email . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Website:</strong></td> <td> ' . $web . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Tel:</strong></td> <td> ' . $tel . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Subject:</strong></td> <td> ' . $sub . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Message:</strong></td> <td> ' . $message . '</td> </tr> </table> <p>He has been notified of a 24 hour wait so please respond within this time frame.</p> <p><img src="http://msukgroup.co/img/logo3.png" width="129" height="21" /></p> <p>Hosting - Designs - eCommerce - Solutions - Events and more...</p> <p><strong>Web:<br /> </strong><a title="MSUKGroup" href="http://www.msukgroup.co"><span style="color:#FF7800">http://www.msukgroup.co</span></a></p> <p><strong>Email:<br /> </strong><a href="http://www.msukgroup.co"><span style="color:#FF7800"> info@msukgroup.co</span></a></p> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: DO NOT REPLY - MSUKGroup <noreply@msukgroup.co>' . "\r\n"; // Mail it mail($EmailTo, $Subject2, $usermail, $headers); mail($EmailFrom, $Subject2, $staffmail, $headers); // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); $sql="INSERT INTO $tbl_name(name, email, web, tel, sub, message, date, ip)VALUES('$name', '$email', '$web', '$tel', '$sub', '$message', '$datetime', '$ip')"; $result=mysql_query($sql); //check if query successful if($result){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=successful\">"; } else { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error\">"; } mysql_close(); ?> |