Jump to content

Psycho

Moderators
  • Posts

    12,157
  • Joined

  • Last visited

  • Days Won

    129

Everything posted by Psycho

  1. Is that how the data is formatted in the current hard-coded array? If so, how do you determine how many posts there are in a sub-category. Also, how are the sub-categories related to the main category - if it is by primary index then each main category could only have one sub-category. Please give exact details about the current format of the hard-coded array and how this data is obtained (from db query?).
  2. ^^ - In total agreement. Store all input in it's "native" format. Only transform it for display purposes at run time: i.e. nl2br(), date(), number_format(), etc.
  3. Furthermore, anything the user is viewing in a web page has already been downloaded to their computer! It's just sitting in their cache. What you are asking for is pointless. It would be like a library allowing people to check out books but trying to prevent them from copying the book. Just not possible. What IS possible is using means such as watermarks on images & video to make it difficult, but not impossible, for others to use your content and pass it off as their own.
  4. Some characters should always be escaped and some only need to be escaped sometimes. But, it doesn't cause a problem to escape a character when it doesn't need to be. So instead of having to put any though into it, I just escape some characters by default. Saves time - plus it makes the code more regression proof. What if some yahoo was modifying the code later and decided to define the pattern with single quotes rather than double quotes? My pattern would keep on working whereas if the single quotes were not escaped it would break. How is that similar? It *looks* like you are trying to match all characters between two single quotes. Which this would be the correct pattern: "%'(.*)'%" However, that will NOT work for what you want. For one it doesn't care where those quotes exist. Two it would not find the text in double quotes which I assume you want also. Third, and most importantly it finds the text from the first single quote to the LAST single quote. Also, preg_match() will stop after the first match instead of finding all matches. If this was your text: <a href='somesite1.com'>Some Site 1</a> <a href='somesite2.com'>Some Site 2</a> The regex above would return this: somesite1.com'>Some Site 1</a> <a href='somesite2.com Because the * modifier is "greedy" - it will match all characters until the last match. You could make it non-greedy by also using the ? after the *: "%'(.*?)'%" But, my understanding is that using that method is not efficient and you should use the method I described above of matching all characters that do not mathc the ending character: "%'([^']*)%"
  5. Here's a simple function for you <HTML> <HEAD> <script> function formatCurrency(fieldObj) { if (isNaN(fieldObj.value)) { return false; } fieldObj.value = '$ ' + parseFloat(fieldObj.value).toFixed(2); return true; } </script> </HEAD> <BODY> <input type="text" name="amount" onchange="formatCurrency(this);" /> </BODY> </HTML>
  6. Here is an explanation of the RegEx pattern: "/<a href=[\'\"]([^\'\"]*)[^>]*([^<]*)/" The pattern first looks for any string starting with "<a href=" Then it looks for a signle or double quote mark. Note, the quote marks need to be escaped using a backslash to indicate it is not the end of the pattern: [\'\"] Then it uses parenthesis to mark mathing text that should be returned. And it matches any character that is NOT a single or double quote ( the ^ indicates not within the square brackets). The asterisk tells it to match as many characters as possible (so it will get all of the text up until the next quote mark.: ([^\'\"]*) Next it mathes every character up until the closing braket for the opening A tag: "[^>]*" Lastly, it captures every character that is NOT a '<' which would presumably be the opening for the closing A tag: "([^<]*)"
  7. There's no way someone can teach you RegEx in a forum post. There are a lot of tutorials out there. Although, I consider RegEx to be one of the more abstract areas of programming and I struggle with it on occasion. So I understand your difficulty. Here is a pattern to get the results you asked about above. I noticed that you had some urls in single quotes and some in double quotes. This will work on both: $text = "<a href='somesite1.com'>Some Site 1</a> <a href=\"somesite2.com\">Some Site 2</a> <a href=\"somesite3.com\">Some Site 3</a>"; preg_match_all("/<a href=[\'\"]([^\'\"]*)/", $text, $matches); print_r($matches[1]); Output: Array ( [0] => somesite1.com [1] => somesite2.com [2] => somesite3.com ) Although, this might prove more useful as it will get the URLs and the text descriptions for the links: <?php $text = "<a href='somesite1.com'>Some Site 1</a> <a href=\"somesite2.com\">Some Site 2</a> <a href=\"somesite3.com\">Some Site 3</a>"; preg_match_all("/<a href=[\'\"]([^\'\"]*)[^>]*([^<]*)/", $text, $matches); print_r($matches[1]); print_r($matches[2]); ?> Output: Array ( [0] => somesite1.com [1] => somesite2.com [2] => somesite3.com ) Array ( [0] => >Some Site 1 [1] => >Some Site 2 [2] => >Some Site 3 )
  8. New and improved verision. I've made it into a function so you only have to call the function with the region name: <?php function getRegionData($region) { $domain = "http://wiki.eveonline.com/"; $url = "{$domain}en/wiki/Category:{$region}_%28Region%29"; $content = file_get_contents($url); //Process the data preg_match( "/<td>Name<\/td><td>\s*([^<]*)/s", $content, $nameMatch); preg_match( "/<td>Average.*?<\/td><td>\s*([^<]*)/s", $content, $avgMatch); preg_match( "/<td>Number of constellations<\/td><td>\s*([^<]*)/s", $content, $constMatch); preg_match( "/<td><a[^>]*>Sovereignty<\/a><\/td><td>\s*<a href=\"([^\"]*)[^>]*>([^<]*)/s", $content, $sovMatch); preg_match( "/<td>Adjacent Regions<\/td><td>\s*<ul>(.*?)<\/ul>\s*<\/td>/s", $content, $regionsList); preg_match_all( "/<li>\s*<a href=\"([^\"]*)[^>]*>([^<]*)/s", $regionsList[1], $regionsMatch); $appendDomain = create_function('&$item, $key, $domain', '$item = $domain.$item;'); array_walk( $regionsMatch[1], $appendDomain, $domain ); //Add data to array $regionData = array(); $regionData['name'] = trim($nameMatch[1]); $regionData['average'] = trim($avgMatch[1]); $regionData['constellations'] = trim($constMatch[1]); $regionData['sovereignty'] = trim($sovMatch[2]); $regionData['sovereignty_url'] = $domain . trim($sovMatch[1]); $regionData['regions'] = array_combine($regionsMatch[2], $regionsMatch[1]); return $regionData; } //Call function with region name $regionData = getRegionData('Everyshore'); echo "<pre>\n"; print_r($regionData); echo "\n<pre>"; ?>
  9. OK, here you go. This script will pull all the values from the table on that page and dump into an associative array $url = 'http://wiki.eveonline.com/en/wiki/Category:Aridia_%28Region%29'; $content = file_get_contents($url); $data = array(); //Process the data preg_match( "/<td>Name<\/td><td>\s*([^<]*)/s", $content, $nameMatch); preg_match( "/<td>Average.*?<\/td><td>\s*([^<]*)/s", $content, $avgMatch); preg_match( "/<td>Number of constellations<\/td><td>\s*([^<]*)/s", $content, $constMatch); preg_match( "/<td><a[^>]*>Sovereignty<\/a><\/td><td>\s*<a href=\"([^\"]*)[^>]*>([^<]*)/s", $content, $sovMatch); preg_match( "/<td>Adjacent Regions<\/td><td>\s*<ul>(.*?)<\/ul>\s*<\/td>/s", $content, $regionsList); preg_match_all( "/<li>\s*<a href=\"([^\"]*)[^>]*>([^<]*)/s", $regionsList[1], $regionsMatch); //Add data to array $data['name'] = trim($nameMatch[1]); $data['average'] = trim($avgMatch[1]); $data['constellations'] = trim($constMatch[1]); $data['sovereignty'] = trim($sovMatch[1]); $data['sovereignty_url'] = trim($sovMatch[2]); $data['regions'] = array_combine($regionsMatch[2], $regionsMatch[1]); echo "<pre>\n"; print_r($data); echo "\n<pre>"; Output: Array ( [name] => Aridia [average] => 0.244786045 [constellations] => 11 [sovereignty] => Amarr Empire [sovereignty_url] => /en/wiki/Category:Amarr_Empire_%28Faction%29 [regions] => Array ( [solitude] => /en/wiki/Category:Solitude_%28Region%29 [Khanid] => /en/wiki/Category:Khanid_%28Region%29 [Fountain] => /en/wiki/Category:Fountain_%28Region%29 [Delve] => /en/wiki/Category:Delve_%28Region%29 [Kor-Azor] => /en/wiki/Category:Kor-Azor_%28Region%29 [Genesis] => /en/wiki/Category:Genesis_%28Region%29 ) )
  10. This will get the first three values from the table. I'd do the other two but I have a meeting preg_match( "/<td>Name<\/td><td>\s*([^<]*)\s*/", $content, $nameMatch); $name = $nameMatch[1]; preg_match( "/<td>Average.*?<\/td><td>\s*([^<]*)\s*/", $content, $avgMatch); $avg = $avgMatch[1]; preg_match( "/<td>Number of constellations<\/td><td>\s*([^<]*)\s*/", $content, $constMatch); $contellations = $constMatch[1];
  11. There are better methods that will work with this and be less error prone. I think using regular expressions and/or the DOM XML parser would make more sense. For example, to get the Name you could do this: $url = "[url=http://wiki.eveonline.com/en/wiki/Category:Aridia_%28Region%29]http://wiki.eveonline.com/en/wiki/Category:Aridia_%28Region%29[/url]"; $content = file_get_contents($url); preg_match( "/<td>Name<\/td><td>\s*([^<]*)\s*/", $content, $nameMatch); $name = $nameMatch[1]; echo $name;
  12. Just to add to ialsoagree, storing the ids as a comma separated list defeats the who purpose of having a relational database. For a normalized database you would need three tables: tbl_cart tbl_services tbl_cartSvcs The first tables stores just the cart information, the second stores the service types and the third stores the associations between the carts and services. You then access/manipulate the information using appropriate JOINs. By the fact that you are gathering the comma separated list, and then looping through it to do additional queries leads me to believe you aren't familiar or comfortable using JOINs. You should never do queries within loops unless there is absolutely no other way (and that is almost never the case). Whit small databases/usage you will not notice much. But as soon as you start putting more records and more users on the system these looping queries will bring your application to a crawl. I suggest looking for some tutorials on MySQL JOINs
  13. Right, if users can be assigned to a department, but not a sub-department, then you pretty much need separate associative tables. However, that is based upon the fact that departments and sub-departments are logically different objects. For example, if departments records need to store information such as department head, office number, phone, etc. and sub-department records need to store totally different information you need those separate tables. However, based upon TapeGun007's last post that is apparently not the case and he will be storing the exact same information for departments and subdepartments, so his approach of one table for both should work as well. Here is the query I would use with a single table for departments and sub departments as illustrated above: SELECT u.User_Name as name, d.Dept_Name as department, dp.Dept_Name as parent FROM Users u JOIN User_Dept ud ON ud.User_ID = u.User_ID JOIN Departments d ON d.Dept_ID = ud.Dept_ID JOIN Departments dp ON dp.Dept_ID = d.Parent_Dept_ID It all depends on whether departments and sub-departments should be logically different entities. If you are capturing all the same information for both, then the three tables will suffice.
  14. There wre a couple of minor typos, but you should have received errors on them. Anyway, I have made those corrections and also added a "basic" form to the bottom. If you merge the form and your processing code in this manner you can repopulate the form with what the user entered when there is a validation error. Give it a try <?php if (isset($_POST['submit'])) { $to = "ainurdesign@gmail.com"; //Trim all the values foreach($_POST as $key => $value) { $_POST[$key] = trim($value); } //Check for missing data $errors = array(); if(empty($_POST['Email'])) { $errors[] = "You have not entered an email, please return and try again"; } if(empty($_POST['Company'])) { $errors[] = "You have not entered a company name, please return and try again"; } if(empty($_POST['Contact'])) { $errors[] = "You have not entered a contact name, please return and try again"; } if(empty($_POST['Phone'])) { $errors[] = "You have not entered a phone number, please return and try again"; } if(empty($_POST['Street'])) { $errors[] = "You have not entered a street address, please return and try again"; } if(empty($_POST['City'])) { $errors[] = "You have not entered a city, please return and try again"; } if(empty($_POST['State'])) { $errors[] = "You have not entered a state, please return and try again"; } if(empty($_POST['Zip'])) { $errors[] = "You have not entered a zip code, please return and try again"; } if(empty($_POST['Interest'])) { $errors[] = "You have not entered your selection for drop-shipping or wholesale, please return and try again"; } if(empty($_POST['Agree'])) { $errors[] = "You have not selected Yes to the agreement, please return and try again"; } if (count($errors)>0) { //There was missing data echo "The following errors occured<br>\n"; echo "<ul>\n"; foreach($errors as $error) { echo "<li>{$error}</li>\n"; } echo "</ul>\n"; } else { //No validation errors, create the email content //Data fro email #1 $subject1 = "Retailer Form Information"; $headers1 = "From: $from"; $body = "Wholesaler info is as follows:\n\n"; $bodyfields = array('Company', 'Contact', 'Email', 'Phone', 'Street', 'City', 'State', 'Zip', 'Interest', 'License', 'Business', 'URL', 'Comments', 'Agree'); foreach($bodyfields as $field) { $body .= sprintf("%20s: %s\n", $field, $_POST[$field]); } //Data for email #2 $subject2 = "Thank you for contacting GrowFrame"; $autoreply = "Thank you for contacting us. Someone will get back to you as soon as possible, usually within 48 hours. If you have any immediate questions, please feel free to call our Sales Manager, Traci Elliott, at 1 (805) 407-3471."; $headers2 = "From: Trevor @ GrowShow/GrowFrame.com"; //Send the emails $send = mail($to, $subject1, $body, $headers1); $send2 = mail($_POST['Email'], $subject2, $autoreply, $headers2); if(!$send || !$send2) { //Errors in sending the emails echo "We encountered an error sending your email, please confirm your address is correct and try again."; } else { //No errors returned header( "Location: http://thegrowframe.com/return.html" ); exit(); } } } ?> <html> <body> <form name="" action="" method="POST"> * Email: <input type="text" name="Email" value="<?php echo $_POST['Email']; ?>" /><br /> * Company: <input type="text" name="Company" value="<?php echo $_POST['Company']; ?>" /><br /> * Contact: <input type="text" name="Contact" value="<?php echo $_POST['Contact']; ?>" /><br /> * Phone: <input type="text" name="Phone" value="<?php echo $_POST['Phone']; ?>" /><br /> * Street: <input type="text" name="Street" value="<?php echo $_POST['Street']; ?>" /><br /> * City: <input type="text" name="City" value="<?php echo $_POST['City']; ?>" /><br /> * State: <input type="text" name="State" value="<?php echo $_POST['State']; ?>" /><br /> * Zip: <input type="text" name="Zip" value="<?php echo $_POST['Zip']; ?>" /><br /> * Interest: <input type="text" name="Interest" value="<?php echo $_POST['Interest']; ?>" /><br /> License: <input type="text" name="License" value="<?php echo $_POST['License']; ?>" /><br /> Business: <input type="text" name="Business" value="<?php echo $_POST['Business']; ?>" /><br /> URL: <input type="text" name="URL" value="<?php echo $_POST['URL']; ?>" /><br /> Comments: <input type="text" name="Comments" value="<?php echo $_POST['Comments']; ?>" /><br /> * Agree: <input type="text" name="Agree" value="<?php echo $_POST['Agree']; ?>" /><br /> <button type="submit">Submit</button><br /><br /> * required fields <input type="hidden" name="submit" value="true" /> </form> </body> </html>
  15. Well, there are still some unanswered questions. Can a user be associated with a department BUT not associated with any sub-department? If the answer is no then you would need the following tables: - Users - Departments - Sub_Departments - Dept_SubDept (associate sub departments to departments) - User_Sub_Dept (associate users to sub departments) In that example, since users are associates to sub-departments and sub-departments are associated with departments, you don't need a table to associate users to departments as it is inferred. BUt, in my example in the previous post that was only about users and departments, here is what the query would look like to get a list of users and their associated departments using the three tables: SELECT u.User_Name, d.Dept_Name FROM Users u JOIN User_Dept ud ON ud.User_ID = u.User_ID JOIN Departments d ON ud.Dept_ID = d.Dept_ID The results would look like this User_Name | Dept_Name ====================== Bob Music Bob History Jane Music Alex Business
  16. Your HTML is all messed up, so there is no telling how the browser will render it. Here are just a few problems I saw before I stopped looking: 1. You have DIV tag between an opening TABLE tag and an opening TR tag. You cannot put content inside anything other than a TD/TH tag within a table. 2. There is a TD with nothin in it except SCRIPT code. There are so many embedded tables and the code is not formatted to show logical structure so it is really difficult to follow. My guess is that there are some problems with the table structure and/or trying to apply the class to a div in-between table objects is causing the problem. Assign the noprint class on the "tables" you don't want printed. Well, ideally you would get rid of tables for the layout entirely (except the table of records) and use CSS for layout. Sorry, but I just don't have the time to dig through all of that mess. When I am creating a page such as that I will create an empty page: just a template of the sections: header, menu, content, footer, etc. Then before I actually start putting content into those sections, apply the styles and such. Following that appraoch it would be easy to apply the noprint class to a particular section. Then start adding the content.
  17. No, it is completely different. You suggested adding two fields to the user table for department and sub-department. However, as per the requirements there is a many-to-one relatinship between users and departments/sub-departments. So, you need a secondary table to associate the users with 0 to many departments/sub-departments. That is database design 101, read up on database normalization. The suggestion I made was totally different. The current structure has users and departments tables (where the users are associated with departments via a foreign key in the departments table. However, this is not normalized as the department names are duplicitive data. The Departments should be unique records and have their own table. So, you would use a third table to associate departments to users. This gives a greater flexibility over the data. For example, if you need to change a department name, you just change one record in the Department table. The current design would require you to update all the association records because the department name is assigned to each user not a foreign key: Here is an example structure of what I am talking about Table: Users (One record for each user) User_ID | User_Name 1 Bob 2 Jane 3 Alex Table: Departments (One record for each Dept) Dept_ID | Dept_Name 8 Music 9 Business 10 History Table: User_Dept (Record for each User/Dept assoc) User_ID | Dept_ID 1 8 1 10 3 9 2 8 You should be able to see that the user "Bob" is associated with both Music and History.
  18. In the original description TapeGun007 declared that the user would be associated with mutiple departments and multiple sub-departments. Trying to jam the department associations into the user table would be a very poor method. The only change *I* would make is to have separate tables for the Department and Sub-department names. Then in the current tables you only need the user ID and the department/sub-department ID to make the association. But, let's go with what you have: One thing that does not make sense is that there is no association between the sub-departments and either the department or the user. Isn't there a Department_ID field in the Sub_Department table to identify which sub-departmtents belong to which department? Also, should the sub-departments be associated with the users or is it assumed that a user is associated with all the sub-departments of any departments they are associated with?
  19. That is not the HTML output - that is the PHP script. Run the script by pointing your browser at the page to load it from the web server. Then get the source of the rendered page. As I stated your problem is something to do with the HTML code and trying to figure out exactly what your HTML would look like while reading all the echo statemetns will be a pain in the a**. Although you state you only want the table to be in the printout, so why are you applying the noprint class to the div that contains the table? <div class="noprint"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 class="th-a">
  20. First off, have you tested the query in phpmyadmin to ensure it is returning results? For testing purposes you should always be validating that your query is running correctly and, if not, checking the errors. You're not even checking for errors. Also, whay are you querying fields and using AS to give them the same name they already have? You only need to do that if you are pulling two fields with the same name so thay have unique names in the result set. Or, you might do that if the value is being used in the script for a different purpose than the name would apply. In this query it is just making it difficult to read. however there is an error in your query. You are pulling three values in the SELECT clause and there is no comma between the second and third values. Here is what I would suggest $query = "SELECT ecb.bookingdate, ecb.location, els.name FROM `efed_content_booking` AS ecb INNER JOIN `efed_list_shownames` AS els ON ( ecb.event_id = els.id ) WHERE ecb.status_id = '3' ORDER BY ecb.bookingdate LIMIT 5"; So, now that you have a query that is more likely toi work, you should include proper error handling. This is just an example: $result = mysql_query($query); if (!$result) { echo "The query failed!<br /><br />"; echo "Query:<br />{$query}<br />"; echo "Error:<br />" . mysql_error(); } else if (mysql_num_rows($result)==0) { echo "No results returned"; } else { //Process and display the results } Even if the query works now, try changing it so it will fail and you can see the error details that will be displayed. By the way, this IF statement will always return true. A single equal sign is used for an assignment. So, since the processor will have no problem assinging a 0 to the variable $rows it will always return true. You need to use double equal signs for comparison. if ($rows = 0)
  21. There is definitely something wrong with your query. SELECT ecb.status_id AS statusid, ecb.bookingdate AS bookingdate, ecb.location AS location FROM `efed_content_booking` AS ecb INNER JOIN `efed_list_shownames` AS els ON ecb.event_id = els.id WHERE ecb.event_id = '$id' AND ecb.status_id = '3' ORDER BY ecb.bookingdate LIMIT 5 You are joining the `efed_list_shownames`, but you are not using it - at all. There are no values from that table selected in the SELECT clause, there are no values used by that table in the WHERE clause and no values from that table in the ORDER by clause. In other words, that JOIN does absolutely nothing. There are also other problems in the logis to process/display the query results. But, assuming this is a homework problem I don't want to provide too much help.
  22. The logic is messed up if(!$result = mysql_query ($query)) if(mysql_num_rows($result) == 0){ Basically, that is saying IF the query fails then check IF the number of results equals 0. If the query fails you can't check if any results were returned. You need to fix that logic as well as fix your query (which is failing).
  23. Your problem is an HTML/CSS one, not a PHP problem (moving to appropriate forum). It is difficult for me to understand what/where the problem is. Please post the HTML output of the script and I can help further.
  24. Before I get to the problem, let me just say: You don't have to define the same element for screen and print if the style is the same for both (i.e. the html & body where you set the same properties for both). In this case I assume all styles are to be the same for screen & print except for the "noprint" style to be used on items that, well, shouldn't print. So, for the default styles don't declare a media value. I have never used different STYLE blocks for different media types. I have always used the @media property within a single STYLE block to define different media styles. I don't know which method is right or wrong, but a little testing showed me why you are experiencing this problem. And, it is an interesting difference. When using different STYLE blocks for different media types, if you declare a class in one media style block and not another, the browser is applying that class to all media types. So, in your code above you did not define the noprint class in the print media style block. I guess the browser then defaulted to the properties for that class in the print media style block. The method I typically used didn't have this behavior. Example: <html> <head> <style type="text/css"> /* media neutral styles go here */ @media print { .noprint { display: none; } } </style> </head> <body> <div>This will print</div> <div class="noprint">This will NOT print</div> </body> </html>
  25. Here's a rewrite of your original code. I think its a little more efficinet and logically laid out. Give it a try: <?php //$to = $_REQUEST['sendto'] ; $to = "ainurdesign@gmail.com"; //Trim all the values foreach($_REQUEST as $key => $value) { $_REQUEST[$key] = trim($value); } //Check for missing data $errors = array(); if(empty($_REQUEST['Email'])) { $errors{} = "You have not entered an email, please return and try again"; } if(empty($_REQUEST['Company'])) { $errors{} = "You have not entered a company name, please return and try again"; } if(empty(($_REQUEST['Contact'])) { $errors{} = "You have not entered a contact name, please return and try again"; } if(empty($_REQUEST['Phone'])) { $errors{} = "You have not entered a phone number, please return and try again"; } if(empty($_REQUEST['Street'])) { $errors{} = "You have not entered a street address, please return and try again"; } if(empty($_REQUEST['City'])) { $errors{} = "You have not entered a city, please return and try again"; } if(empty($_REQUEST['State'])) { $errors{} = "You have not entered a state, please return and try again"; } if(empty($_REQUEST['Zip'])) { $errors{} = "You have not entered a zip code, please return and try again"; } if(empty($_REQUEST['Interest'])) { $errors{} = "You have not entered your selection for drop-shipping or wholesale, please return and try again"; } if(empty($_REQUEST['Agree'])) { $errors{} = "You have not selected Yes to the agreement, please return and try again"; } if (count($errors)>0) { //There was missing data echo "The following errors occured<br>\n"; echo "<ul>\n"; foreach($errors as $error) { echo "<li>{$error}</li>\n"; } echo "</ul>\n"; } else { //No validation errors, create the email content //Data fro email #1 $subject1 = "Retailer Form Information"; $headers1 = "From: $from"; $body = "Wholesaler info is as follows:\n\n"; $bodyfields = array('Company', 'Contact', 'Email', 'Phone', 'Street', 'City', 'State', 'Zip', 'Interest', 'License', 'Business', 'URL', 'Comments', 'Agree'); foreach($bodyfields as $field) { $body .= sprintf("%20s: %s\n", $field, $_REQUEST[$field]); } //Data for email #2 $subject2 = "Thank you for contacting GrowFrame"; $autoreply = "Thank you for contacting us. Someone will get back to you as soon as possible, usually within 48 hours. If you have any immediate questions, please feel free to call our Sales Manager, Traci Elliott, at 1 (805) 407-3471."; $headers2 = "From: Trevor @ GrowShow/GrowFrame.com"; //Send the emails $send = mail($to, $subject1, $body, $headers1); $send2 = mail($_REQUEST['Email'], $subject2, $autoreply, $headers2); if(!$send || !$send2) { //Errors in sending the emails echo "We encountered an error sending your email, please confirm your address is correct and try again."; } else { //No errors returned header( "Location: http://thegrowframe.com/return.html" ); exit(); } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.