Jump to content

TheBrandon

Members
  • Posts

    72
  • Joined

  • Last visited

    Never

Everything posted by TheBrandon

  1. Yeah didn't I have the hostname in my first example? Unless it was coded wrong? I don't know how to do this stuff very well. I've always had cron jobs I just copy/pasted so troubleshooting it is very hard for me. Can you show me an example of one using the hostname if my initial example wasn't correct?
  2. I have. They insist it's a scripting flaw and refuse to help.
  3. Okay so when I run this command: mysqldump -A -ucasting354sds -pCast85496 > /home/content/a/l/m/almo10000/html/casting-call-db/_DailyBackups/backup.sql I get this error: mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect But if I run: mysqldump -ucasting354sds -pCast85496 > /home/content/a/l/m/almo10000/html/casting-call-db/_DailyBackups/backup.sql It doesn't generate an error. However it fills the backup.sql with this: I really need to get this working. Does anyone have any ideas or suggestions? I'm at a complete loss as to why this isn't functioning.
  4. Yeah, I take a little offense at the fact that because you don't understand something you seem to think it is not "proper". What is not proper was your previous logic of running queries in a loop instead of using a simple JOIN. Did you even try the code I posted? Here is the SAME query without using aliases SELECT categories.id, categories.category_name, COUNT(categories.id) as active_count FROM categories LEFT JOIN category_relations ON category_relations.member_of = categories.id AND category_relations.active = 1 GROUP BY categories.id ORDER BY category_name That's definitely mpre c;uttered and less readable than what I originally posted: SELECT c.id, c.category_name, COUNT(c.id) as active_count FROM categories as c LEFT JOIN category_relations as cr ON cr.member_of = c.id AND cr.active = 1 GROUP BY c.id ORDER BY c.category_name Proper wasn't meant as an insult. It's the English side of me and I apologize. Yeah I did try it and it gave the error "#1054 - Unknown column 'cr.active' in 'on clause'" I think because the "active" field is in the discounts field not the other one. I'm sorry again for offending. I didn't mean to. I've never used aliases in queries before.
  5. -- phpMyAdmin SQL Dump -- version 3.2.4 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 05, 2010 at 10:03 PM -- Server version: 5.1.44 -- PHP Version: 5.3.1 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: `discountdemo` -- -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE IF NOT EXISTS `categories` ( `id` smallint(4) unsigned NOT NULL AUTO_INCREMENT, `category_name` varchar(80) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=24 ; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `category_name`) VALUES (1, 'Airlines'), (2, 'Arts & Collectibles'), (3, 'Automotive'), (4, 'Baby & Maternity'), (5, 'Other'), (6, 'Apparel, Shoes & Jewelry'), (8, 'Computers & Office'), (9, 'Books, Music & Video'), (10, 'Electronics'), (11, 'Finance'), (12, 'Flowers & Gifts'), (13, 'Food & Beverage'), (14, 'Health & Beauty'), (15, 'Home & Garden'), (16, 'Kids & Baby'), (17, 'Online Services'), (18, 'Pets'), (19, 'Phone & Services'), (20, 'Seasonal'), (21, 'Sports & Outdoors'), (22, 'Toys & Games'), (23, 'Travel & Gear'); -- -------------------------------------------------------- -- -- Table structure for table `category_ads` -- CREATE TABLE IF NOT EXISTS `category_ads` ( `cat_id` smallint(4) NOT NULL, `vendor_id` smallint(4) unsigned NOT NULL, `filename` varchar(80) NOT NULL, `priority` varchar(80) NOT NULL, `url` varchar(80) NOT NULL, PRIMARY KEY (`cat_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `category_ads` -- INSERT INTO `category_ads` (`cat_id`, `vendor_id`, `filename`, `priority`, `url`) VALUES (1, 0, './img/category_ads/bayside_shuttle.jpg', '', ''); -- -------------------------------------------------------- -- -- Table structure for table `category_relations` -- CREATE TABLE IF NOT EXISTS `category_relations` ( `id` int(10) NOT NULL, `member_of` int(10) unsigned NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `category_relations` -- INSERT INTO `category_relations` (`id`, `member_of`) VALUES (2, 2), (1, 1), (3, 1), (4, 1); -- -------------------------------------------------------- -- -- Table structure for table `discounts` -- CREATE TABLE IF NOT EXISTS `discounts` ( `id` smallint(5) NOT NULL AUTO_INCREMENT, `redeem` tinyint(3) NOT NULL, `discount_title` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `short_description` tinytext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `eligibility` blob NOT NULL, `url` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `coupon_code` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `start_date` datetime DEFAULT NULL, `end_date` datetime DEFAULT NULL, `long_description` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `logo` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `business_name` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `phone` varchar(80) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `store_location_street` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `store_location_city` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `store_location_state` char(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `store_location_zip` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `categories` blob NOT NULL, `level` tinyint(5) NOT NULL, `active` tinyint(1) NOT NULL, `user_id` varchar(2555) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `level` (`level`,`active`), KEY `user_id` (`user_id`(333)) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Dumping data for table `discounts` -- INSERT INTO `discounts` (`id`, `redeem`, `discount_title`, `short_description`, `eligibility`, `url`, `coupon_code`, `start_date`, `end_date`, `long_description`, `logo`, `business_name`, `phone`, `store_location_street`, `store_location_city`, `store_location_state`, `store_location_zip`, `categories`, `level`, `active`, `user_id`) VALUES (1, 0, '$2.00 Off Transportation', '', 0x4172726179, 'www.baysideshuttle.com', '', '2010-01-01 00:00:00', '2011-01-01 00:00:00', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer varius ipsum id justo pellentesque laoreet. Curabitur tempus tincidunt...', NULL, 'Bayside Airport Shuttle', '850-123-4567', NULL, NULL, NULL, NULL, 0x4172726179, 0, 1, '24'); -- -------------------------------------------------------- -- -- Table structure for table `eligibility` -- CREATE TABLE IF NOT EXISTS `eligibility` ( `eligibility_id` mediumint( unsigned NOT NULL, `discount_id` mediumint( unsigned NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `eligibility` -- INSERT INTO `eligibility` (`eligibility_id`, `discount_id`) VALUES (1, 4), (3, 4), (5, 4), (1, 6), (3, 6), (5, 6), (1, 2), (1, 3), (1, 4); -- -------------------------------------------------------- -- -- Table structure for table `eligibility_labels` -- CREATE TABLE IF NOT EXISTS `eligibility_labels` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `label` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; -- -- Dumping data for table `eligibility_labels` -- INSERT INTO `eligibility_labels` (`id`, `label`) VALUES (1, 'Active Duty'), (2, 'Veteran'), (3, 'Retiree'), (4, 'Reserve'), (5, 'National Guard'), (6, 'Government Employee'), (7, 'Military Families'); -- -------------------------------------------------------- -- -- Table structure for table `front_page_ads` -- CREATE TABLE IF NOT EXISTS `front_page_ads` ( `id` smallint(4) NOT NULL AUTO_INCREMENT, `vendor_id` smallint(4) unsigned NOT NULL, `filename` varchar(80) NOT NULL, `priority` smallint(4) NOT NULL, `url` varchar(80) NOT NULL, `ad_type` tinyint(5) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Dumping data for table `front_page_ads` -- INSERT INTO `front_page_ads` (`id`, `vendor_id`, `filename`, `priority`, `url`, `ad_type`) VALUES (1, 0, './img/front_page_ads/support_our_troops.jpg', 1, 'http://www.google.com/', 0), (2, 0, './img/front_page_ads/revive_media_services.jpg', 0, 'http://revivemediaservices.com', 0), (3, 0, './img/front_page_ads/fwb_chamber.jpg', 0, 'http://fwbchamber.org', 0); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int( NOT NULL AUTO_INCREMENT, `username` varchar(70) NOT NULL, `password` varchar(32) NOT NULL, `level` int( NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=29 ; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `password`, `level`) VALUES (1, 'admin', 'admin', 9); I'm not understanding some of your lines such as FROM categories as c? Can you please apply the proper names to your example so I can see what you're going for?
  6. That's what category_relations is, isn't it? It's simply the ID of the category and the ID of the discount. That's all that is in the table. The discounts.categories field isn't used at all. In fact, I need to remove it.
  7. Thanks. I'd love to learn a more efficient way of doing this as I do it a lot in programming.
  8. Hello all, I've built a database of coupons. Each coupon is assigned to a category (so all electronics coupons display under electronics). On my category list I'd like to display how many coupons is in each category. Currently this function displays my category list: function fetch_categories() { mysql_connect(SQL_HOST_NAME, SQL_USER_NAME, SQL_PASSWORD) or die(mysql_error()); mysql_select_db(SQL_DATABASE) or die(mysql_error()); $result = mysql_query("SELECT * FROM categories ORDER BY category_name")or die(mysql_error()); echo '<div id="category_list">'; echo '<ul class="cat_list">'; while($row=mysql_fetch_assoc($result)){ //get total of discounts in each category $count_result = mysql_query("SELECT * FROM category_relations, discounts WHERE category_relations.member_of = '$row[id]' AND discounts.active = '1'")or die(mysql_error()); $num_rows = mysql_num_rows($count_result); echo '<span class="numrows">('.$num_rows.')</span>'; echo '<li><a href="index.php?cat_ID='.$row['id'].'">'.$row['category_name'].' </a></li>'; } echo '</ul>'; echo '</div>'; } The above is a debug version so it's not all formatted correctly. However right now, that exports "3" for Airlines when right now, I have only one discount in the entire database. This is my category_relations table: -- -- Table structure for table `category_relations` -- CREATE TABLE IF NOT EXISTS `category_relations` ( `id` int(10) NOT NULL, `member_of` int(10) unsigned NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `category_relations` -- INSERT INTO `category_relations` (`id`, `member_of`) VALUES (2, 2), (1, 1), (3, 1), (4, 1); And this is my discounts table: -- -- Table structure for table `discounts` -- CREATE TABLE IF NOT EXISTS `discounts` ( `id` smallint(5) NOT NULL AUTO_INCREMENT, `redeem` tinyint(3) NOT NULL, `discount_title` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `short_description` tinytext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `eligibility` blob NOT NULL, `url` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `coupon_code` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `start_date` datetime DEFAULT NULL, `end_date` datetime DEFAULT NULL, `long_description` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `logo` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `business_name` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `phone` varchar(80) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `store_location_street` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `store_location_city` varchar(75) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `store_location_state` char(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `store_location_zip` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `categories` blob NOT NULL, `level` tinyint(5) NOT NULL, `active` tinyint(1) NOT NULL, `user_id` varchar(2555) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `level` (`level`,`active`), KEY `user_id` (`user_id`(333)) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Dumping data for table `discounts` -- INSERT INTO `discounts` (`id`, `redeem`, `discount_title`, `short_description`, `eligibility`, `url`, `coupon_code`, `start_date`, `end_date`, `long_description`, `logo`, `business_name`, `phone`, `store_location_street`, `store_location_city`, `store_location_state`, `store_location_zip`, `categories`, `level`, `active`, `user_id`) VALUES (1, 0, '$2.00 Off Transportation', '', 0x4172726179, 'www.baysideshuttle.com', '', '2010-01-01 00:00:00', '2011-01-01 00:00:00', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer varius ipsum id justo pellentesque laoreet. Curabitur tempus tincidunt...', NULL, 'Bayside Airport Shuttle', '850-123-3456', NULL, NULL, NULL, NULL, 0x4172726179, 0, 1, '24'); It seems to be completely ignoring my active check. How can I fix this, or is there a better way to do this query?
  9. Oh snap, you're right. I still need help with the syntax though. I'm still learning expressions like this. I've tried: $vendor_ID = preg_replace("^\*","",$key); $vendor_ID = preg_replace("\^\*","",$key); $vendor_ID = preg_replace("\^\*\","",$key); None seem to work?
  10. Yeah I've tried these: $subcat_ID = preg_match("\^\*\","",$key); $subcat_ID = preg_match("\^\*\",$key); $subcat_ID = preg_match("/^\*/","",$key); $subcat_ID = preg_match("/^\*/",$key); They all generate errors. That's why I'm asking for help.
  11. Hello all, I need to switch my code from ereg_replace to preg_match but I'm having trouble figuring out how to get the syntax right for this and keep the same functionality. $vendor_ID = ereg_replace("^\*","",$key); Any advice on how to maintain this functionality but use non-deprecated methods?
  12. Today it gave me this error: mysqldump: File '/usr/share/mysql/charsets/?.conf' not found (Errcode: 2) mysqldump: Character set '#33' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index' file mysqldump: Got error: 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client when trying to connect 0.0% Any idea what that means?
  13. Ok I'll try that tonight. Thanks! I'll let you know if it works.
  14. Yes, they were surrounded by brackets. So it should be: mysqldump --opt -Q -h [host] --user=user --password=password database | gzip -v9 - > [/home/content/a/l/m/almo10000/html/casting-call-db/_DailyBackups/MySQL-`/bin/date +\%a`.sql.gz] ??? Is database in the correct place/formatted correctly?
  15. Hello all, I'm sure this is an incredibly common request but I'm still learning the syntax of this. I'm trying to get a daily cron job running to backup my database on Godaddy. So far I am using this code: mysqldump --opt -Q -h [host] --user=[user] --password=[password] [database] | gzip -v9 - > [/home/content/a/l/m/almo10000/html/casting-call-db/_DailyBackups/MySQL-`/bin/date +\%a`.sql.gz] It's giving me the error: /bin/sh: line 1: [/home/content/a/l/m/almo10000/html/casting-call-db/_DailyBackups/MySQL-Fri.sql.gz]: No such file or directory mysqldump: Got error: 2005: Unknown MySQL Server Host '[host]' (1) when trying to connect For security reasons I changed the host, username, password and database in the above example to just be the label for what they are. I'm leaving the path though since paths on Godaddy can be annoying and confusing sometimes. Any advice on getting this to work? Is my syntax right? I'm not sure why it's telling me the file doesn't exist since that directory most definitely exists. Is my path wrong?
  16. 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:[email protected]">[email protected]</a></p> <div align="center"> <!-- form should mail to [email protected] --> </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("[email protected]", $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("[email protected]", "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.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.newsticker.js"></script> <script type="text/javascript"> $(document).ready( function() { $("#news").newsTicker(); parseSamples(); } ); </script> <script src="js/prototype.js" type="text/javascript"></script> <script src="js/protoformclass.js" type="text/javascript"></script> <script type="text/javascript"> Event.observe(window,"load",function() { new Protoform('test'); }); </script> <?php wp_head();?> </head> <body> <div id="container"> <?php include("inc/contact.php");?> <?php include("inc/top.php");?> <div id="menu"> <ul> <?php wp_list_pages('title_li='); ?> </ul> </div> <div class="clear"></div> <div class="hr"><hr /></div> <div id="box"> <form action="send.php" method="post" id="test"> <fieldset> <legend>Contact Brandon Pence</legend> <div> <label for="name_Req">Name<span class="asterisk"> *</span></label> <input type="text" id="name_Req" name="name" title="Required! Please enter your name" /> </div> <div> <label for="contact_Req_Email">E-mail<span class="asterisk"> *</span></label> <input type="text" id="contact_Req_Email" name="email" title="Required! Please enter a valid email address" /> </div> <div> <label for="telephone_Tel">Telephone</label> <input type="text" id="telephone" name="telephone" title="Please enter a valid telephone number" /> </div> <div> <label for="message_Req">Message<span class="asterisk"> *</span></label> <textarea id="message_Req" name="message" rows="5" cols="20" title="Required! Please enter your message"></textarea> </div> <div class="button"> <input type="submit" value="Send" /> </div> </fieldset> </form> </div><!-- /#box --> <div class="clear"></div> And it's processing script: <?php echo "<div id=\"response\">"; $name = $_POST['name']; $email = $_POST['email']; $telephone = $_POST['telephone']; $message = $_POST['message']; if ( ($name=='') && ($email=='') && ($telephone=='') && ($message=='')) { echo "<p>Please fill all the required fields<span>*</span></em></p>"; } else { $to = "[email protected]"; $subject = "[brandon.pence.com] contact form"; $body = 'Message: '.$message.' Telephone: '.$telephone.' Email: '.$email; if (mail($to, $subject, $body)) { echo("<h2>message sent!</h2>"); } else { echo("<h2>message failed</h2>"); } echo "<ul>"; echo "<li>Name: ".$name."</li>"; echo "<li>E-mail: ".$email."</li>"; echo "<li>Telephone: ".$telephone."</li>"; echo "<li>Message:".$message."</li>"; echo "</ul>"; } echo "</div>"; ?> This email was not received. Again in our troubleshooting, we tried another script we have... <?php include('includes/head-open.php');?> <title><?php echo $site_title; ?></title> <meta name="generator" content="Revive Media Services" /> <meta name="keywords" content="fort walton beach condo rentals, beach rentals, okaloosa island, beachfront rental, beachfront condo, okaloosa island condo, okaloosa island rental," /> <meta name="description" content="Rates, photos, and contact information for The Breakers on Fort Walton Beach. Accommodations include condo style rentals and beachfront access" /> <?php include('includes/style.php');?> <?php include('includes/head-close.php');?> <?php include('includes/body-open.php');?> <?php include('includes/head.php');?> <?php include('includes/menu.php');?> <?php include('includes/hr.php');?> <?php include('includes/content-open.php'); ?> <div style="margin:20px"> <h1>Contact the Breakers</h1> <form method="post" action="process.php"><table width="355" bgcolor="#EEEEEE" border="0"><tr><td valign="top">Name</td><td valign="top"><input type="text" name="t1"></td></tr><tr><td valign="top">Email Address</td><td valign="top"><input type="email" name="t2"></td></tr><tr><td valign="top">Message</td><td valign="top"><textarea name="t3" cols="20" rows="10">Your message here</textarea></td></tr><tr><td><input type="submit" value="Submit"></td></tr></table></form> </div> <?php include('includes/content-close.php'); ?> </div> </div> <?php include('includes/right-bg.php'); ?> <?php include('includes/body-close.php'); ?> And it's processing script... <? $mymail = '[email protected]'; //$mymail = '[email protected]'; $cc = 'Form submitted from your website'; $BoDy = ' '; $FrOm = 'FROM:' .$_POST['t1']; $FrOm .= 'Reply-To:' .$_POST['t1']; $FrOm .= 'X-MAILER: PHP'.phpversion(); $BoDy .= 'First Name: '; $BoDy .= $_POST['t1']; $BoDy .= "\n"; $BoDy .= 'Last Name: '; $BoDy .= $_POST['t5']; $BoDy .= "\n"; $BoDy .= 'Email Address: '; $BoDy .= $_POST['t2']; $BoDy .= "\n"; $BoDy .= 'Zip Code: '; $BoDy .= $_POST['t4']; $BoDy .= "\n"; $BoDy .= 'Message: '; $BoDy .= $_POST['t3']; $BoDy .= "\n"; $send = mail("$mymail", "$cc", "$BoDy", "$FrOm"); ///Redirect user to your homepage.... if($send) { echo '<html><head>'; echo '<meta http-equiv="refresh" content="0;URL=http://www.breakersfwb.com">'; echo '</head><body>Email send....'; echo '</body></html>'; } ?> That email worked. I guess my basic question is why do some of these work and some don't? We're sending emails in a bunch of different ways but I'd like to understand exactly which line is making it work or not work. I thought maybe it was the header info with the X-MAILER, but the 1 line mail() code worked and it doesn't have that. Can someone please shed some light on the intricacies of sending server generated emails from godaddy hosts to godaddy email accounts?
  17. Hmm, it works well and I implemented it but it takes 2 times for it to move past 1. So it goes 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4, 5 Any ideas on how to fix that? I'm using this code. I don't think I modified it. <?php session_start(); //Start a session. $images = array('1.jpg','2.jpg','3.jpg','4.jpg','5.jpg'); //An array that holds all of your images. $start = (isset($_SESSION['rotate'])) ? (int)$_SESSION['rotate'] : 0; //if the session is set, then return the session, otherwise return 0. $banner_array = array(); //start a banner array. $image_count = count($images); //count how many images are in the image array. $start = ($start > $image_count) ? 0 : $start; //if our start count is higher than the number of images, reset it back to 0. for($i = $start; $i < $image_count; $i++) { $banner_array[] = $images[$i]; //starting at our count, put the images in the banner array. } if($start > 0) { for($i = 0; $i < $start; $i++) { $banner_array[] = $images[$i]; //if our start count was higher than the first image, then get the remaining images onto the end of the banner array. } } $_SESSION['rotate'] = ($start + 1); //save the new start point to the session. echo '<pre>'; print_r($banner_array); echo '</pre>'; //print the array to the page, and lets see it work. ?>
  18. Wow, thank you! Your code does exactly what I needed it to! However just so I learn (not just copy and paste lol) what do these operators mean? $start = ($start > $image_count) ? 0 : $start; //if our start count is higher than the number of images, reset it back to 0. I guess what I'm confused about is how the syntax works. $var1 = ($var2 > $var3) includes the if statement? And then the ? 0: $start is the consequence of that if check? I normally use this as my reference: http://www.w3schools.com/PHP/php_operators.asp and sadly none of them are on there.
  19. Hello all, I need to make a rotating banner system for a client. They want about 5 banners to rotate with Javascript. However they want the visitor to sort of step through each one on each refresh. So if I have 5 banners and I go to the site, I see banner 1 and then the javascript rotates through each one. When I go back to the site, they want it to start with banner 2 and then the javascript will rotate through each one. Then on and on. Go back and see banner 3, then step through again. I have a nice Javascript image slider I'd like to use. It basically just requires the images in order. Like: <img src="1.jpg"/> <img src="2.jpg"/> <img src="3.jpg"/> <img src="4.jpg"/> <img src="5.jpg"/> I've thought about it and I think the best way to do this would just be using PHP and a cookie. So when the viewer first goes to the site, PHP checks for the cookie. If it exists, it pulls the starting image #. If it doesn't, it starts at 0 and sets the cookie. As for the images part, I figured an associate array would work well. The key would be what the cookie logic is based on, and then the image HTML would be in the array. So you visit the site without a cookie it would be... 0 => <img src="1.jpg"/> 1 => <img src="2.jpg"/> 2 => <img src="3.jpg"/> 3 => <img src="4.jpg"/> 4 => <img src="5.jpg"/> Then when you go back to the site, I need the array to be re-ordered like this: 0 => <img src="2.jpg"/> 1 => <img src="3.jpg"/> 2 => <img src="4.jpg"/> 3 => <img src="5.jpg"/> 4 => <img src="1.jpg"/> What's the best way to go about this array logic? My experience with manipulating data inside arrays is rather limited. Basically I need it to say "Start with key # and then reorder array based on that"
  20. Okay, so you're saying just make a database to contain the relations. Like an eligibility table that contains the eligibility option and the discount ID basically. Here's my current database: -- phpMyAdmin SQL Dump -- version 2.9.1.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Aug 18, 2010 at 04:15 PM -- Server version: 5.0.27 -- PHP Version: 5.2.0 -- -- Database: `discount` -- -- -------------------------------------------------------- -- -- Table structure for table `categories` -- DROP TABLE IF EXISTS `categories`; CREATE TABLE `categories` ( `id` smallint(4) unsigned NOT NULL auto_increment, `category_name` varchar(80) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -------------------------------------------------------- -- -- Table structure for table `category_ads` -- DROP TABLE IF EXISTS `category_ads`; CREATE TABLE `category_ads` ( `cat_id` smallint(4) NOT NULL, `vendor_id` smallint(4) unsigned NOT NULL, `filename` varchar(80) NOT NULL, `priority` varchar(80) NOT NULL, `url` varchar(80) NOT NULL, PRIMARY KEY (`cat_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `category_relations` -- DROP TABLE IF EXISTS `category_relations`; CREATE TABLE `category_relations` ( `id` int(10) NOT NULL, `member_of` int(10) unsigned NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `discounts` -- DROP TABLE IF EXISTS `discounts`; CREATE TABLE `discounts` ( `id` smallint(5) NOT NULL auto_increment, `redeem` tinyint(3) NOT NULL, `discount_title` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, `short_description` tinytext character set utf8 collate utf8_unicode_ci NOT NULL, `eligibility` blob NOT NULL, `url` varchar(100) character set utf8 collate utf8_unicode_ci default NULL, `coupon_code` varchar(75) character set utf8 collate utf8_unicode_ci default NULL, `start_date` datetime default NULL, `end_date` datetime default NULL, `long_description` text character set utf8 collate utf8_unicode_ci NOT NULL, `logo` varchar(255) character set utf8 collate utf8_unicode_ci default NULL, `business_name` varchar(75) character set utf8 collate utf8_unicode_ci NOT NULL, `store_location_street` varchar(75) character set utf8 collate utf8_unicode_ci default NULL, `store_location_city` varchar(75) character set utf8 collate utf8_unicode_ci default NULL, `store_location_state` char(2) character set utf8 collate utf8_unicode_ci default NULL, `store_location_zip` varchar(10) character set utf8 collate utf8_unicode_ci default NULL, `categories` blob NOT NULL, `level` tinyint(5) NOT NULL, `active` tinyint(1) NOT NULL, `user_id` varchar(2555) character set utf8 collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `level` (`level`,`active`), KEY `user_id` (`user_id`(333)) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; -- -------------------------------------------------------- -- -- Table structure for table `front_page_ads` -- DROP TABLE IF EXISTS `front_page_ads`; CREATE TABLE `front_page_ads` ( `id` smallint(4) NOT NULL auto_increment, `vendor_id` smallint(4) unsigned NOT NULL, `filename` varchar(80) NOT NULL, `priority` smallint(4) NOT NULL, `url` varchar(80) NOT NULL, `ad_type` tinyint(5) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -------------------------------------------------------- -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int( NOT NULL auto_increment, `username` varchar(11) NOT NULL, `password` varchar(32) NOT NULL, `level` int( NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; I did the same thing with the category table. I guess I was worried that eventually, I may have more eligibility options than I currently have, and I was hoping to make it as easy to maintain from a user standpoint but looking at that logic now, it would still be able to be managed by a user by simple inserting a new row. Thanks for the help, guys. So, just to explain it in words so I understand what it is I should do: Add a table for Eligibility options. Table should contain the text for the eligibility label (Children) and an ID Create a Discounts_To_Eligibility table that contains the ID for the Discount and the ID for the table Do joins based on the Discount ID to be able to pull specific eligibility options When a new discount is added, it is submitted as an array. (Eligibility option 1, 5, 7, 8, and 9). Loop over this submitted array and for every entry in the array, create a new row in the Discounts_To_Eligibility table That's basically it right? Did I forget or miss anything?
  21. Hello all, I'm currently working on a project and it is the first time I have had to store/retrieve an array with PHP and MySQL. Basically its a website that has a list of discounts/coupons on it. People can register and submit their discounts and such. I am storing an array for who is eligible for the discount, as well as which categories the discount falls under. I did some googling and there seems to be tons of thoughts on the best way to do this. Some say to use implode/explode, some say to serialize/unserialize, I was just wondering if there is a common, concrete way to do this? I will need to be able to search the array for its contents. So if children are eligible for the discount, I need to be able to store that in a database, retrieve it later, and search it for only "Children" so I can display the discounts available only to children. If someone could please advise the best way to do this and post some examples, it would be greatly appreciated. I learn best with examples that are explained properly.
×
×
  • 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.