simcoweb
Members-
Posts
1,104 -
Joined
-
Last visited
Everything posted by simcoweb
-
Not really frustrating. Just need to fully understand. The way it was explained made it sound like the doctors were buying the items from Dave at a wholesale price then selling it to the patients for retail price which would then pocket them the diff. If that's not the case and Dave is really selling the items to the patients and the docs are just referring then you need some type of affiliate/referral system. It's best that if in this case that you have the patients come to Dave's website, buy the item and as part of the checkout process enter the doctor's ID before they can purchase. That will track the sales. The key is, though, that the patient actually knows the doctor's ID. If they don't then it won't work. One way to make sure that doesn't happen is to provide also a list of the doctors and their ID so they can pull that up and make sure they have it right.
-
Change this: $numrows = mysql_affected_rows($res); to this: $numrows = mysql_affected_rows($dbc); and that error should go away. That is, of course, determined by the fact that $dbc defines your database connection parameters.
-
I'm not 100% clear on this. Ok, so 'Dave' is selling to 'doctors' who are selling to patients. If 'Dave' is selling them to the 'doctors' then why does he need to know from the patient what doctor sold it to them? Doesn't 'Dave' already give the 'doctors' a break on the price when he sells it to them? Who, in turn, sell it to the patient at a profit? Aside from all that, if 'Dave' isn't selling the product directly to the patient then there's no assurance that you can get the patient to come to your site and enter a code. Now, let's say that 'Dave' does sell directly to the patient and the patient is referred by the 'doctors' to come to the site and buy. In that case you could use an affiliate program that would track the referrals from the docs and their sales. There's plenty of carts that can do this or have the ability to monitor referrals as well as provide discount codes. All I do is install and set up ecommerce sites.
-
HUGE Problem! Site won't work on Internet Explorer!
simcoweb replied to MrAirsoft's topic in PHP Coding Help
He can leave it that way but then needs to make all his adjustments to his code to reference a secure location. -
No problemo
-
You have your html table code set for one <tr>. Change it so each <td> is in its own <tr> and it will take care of the problem. <tr><td>Code for display here</td></tr> <tr><td>next code for display here</td></tr> etc.
-
HUGE Problem! Site won't work on Internet Explorer!
simcoweb replied to MrAirsoft's topic in PHP Coding Help
When you use SSL you have to have all your images and external files referenced behind an https address. That includes your CSS file as well plus any external .js (javascript) files. Otherwise it will consider them non-secure and not display them. Change the references in your HTML code and it should work. Also, your SSL cert looks like it has been issued to the whole site instead of perhaps a sub-domain like secure.yoursite.com. You don't need to have SSL for everything, just the checkout portion. -
Hehehehe.... dohhhh...forgot to put method="POST" in the form Ok, got it to work now.
-
Toon, I edited my original post right afterward realizing that I had to set the $guess = $_POST['guess']; but somehow left the quotes there by accident. I had $guess = "3"; before that and in my haste I took out the 3 but left the quotes. Anyway, I can't get it to work using the $_POST. Here's my code again and taking into consideration the advice to move it further down as well. <html> <head> </head> <body> <form action="<?php $_SERVER['PHP_SELF']; ?>"> <input type="text" size="20" name="guess"> <input type="submit" value="submit" name="submit"> </form> <?php if (isset($_POST['submit'])){ // let us test out a switch parameter $guess = $_POST['guess']; switch ($guess) { case 1: echo "You chose first one"; break; case 2: echo "You chose second one"; break; case 3: echo "You chose third one"; break; default: echo "Make a choice you idiot!"; } } ?> </body> </html> Basically nothing happens. The form just submits and nothing is displayed.
-
I'm delving into 'switch' statements instead of if/else to test the waters. I'm confused on a couple of things. First, i've created a simple form assuming I can populate the $var with a post from a form field then have it check through the 'switch' statement, find the right case and display the appropriate code. Simple! here's my form: <?php if (isset($_POST['submit'])){ // let us test out a switch parameter $guess = "$_POST['guess']"; switch ($guess) { case 1: echo "You chose first one"; break; case 2: echo "You chose second one"; break; case 3: echo "You chose third one"; break; default: echo "Make a choice you idiot!"; } } ?> <html> <head> </head> <body> <form action="<?php $_SERVER['PHP_SELF']; ?>"> <input type="text" size="20" name="guess"> <input type="submit" value="submit" name="submit"> </form> </body> </html> I'm assuming the form field 'guess' would populate the $guess variable which would then run through the case statements for a match? What I am missing here? This doesn't work.
-
Is there just one contact.php code? Your form is displaying <br /> tags in the form fields which leads me to believe you've got some errors in how your form code is put together causing those tags to 'bleed' into your value areas.
-
Javascript and Smarty templates problem - anyone?
simcoweb replied to simcoweb's topic in Javascript Help
Ok, thanks mainewoods. That did the trick. And thanks for posting the link. I bookmarked that for future references. -
Hi. I'm doing some modifications to Xcart changing the design and want to insert a javascript/rollover menu. There's 3 elements I have to content with. The first goes in the <head> section. However, when I insert it I get a Smarty error. Here's the section of the cart that deals with the <head> section. This includes my inserted javascript you'll notice. {* $Id: home.tpl,v 1.19.2.5 2006/10/24 13:46:18 svowl Exp $ *} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> {if $printable ne ''} {include file="customer/home_printable.tpl"} {else} {config_load file="$skin_config"} <html> <head> <title> {if $config.SEO.page_title_format eq "A"} {section name=position loop=$location} {$location[position].0|strip_tags|escape} {if not %position.last%} :: {/if} {/section} {else} {section name=position loop=$location step=-1} {$location[position].0|strip_tags|escape} {if not %position.last%} :: {/if} {/section} {/if} </title> <script type="text/javascript"> <!-- function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } } function changeImages() { if (document.images && (preloadFlag == true)) { for (var i=0; i<changeImages.arguments.length; i+=2) { document[changeImages.arguments[i]].src = changeImages.arguments[i+1]; } } } var preloadFlag = false; function preloadImages() { if (document.images) { contact_over = newImage("images/contact-over.gif"); cart_over = newImage("images/cart-over.gif"); reseller_over = newImage("images/reseller-over.gif"); preloadFlag = true; } } // --> </script> {include file="meta.tpl" } <link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}" /> </head> The error it's throwing is this: For some reason Smarty is trying to parse the 'if' statements as though they were {if} statements instead of just reading the functions between the <script> tags. Anyone have any ideas/help/fixes for this? Thanks in advance!
-
Here we go again.. login page produces blank page
simcoweb replied to simcoweb's topic in PHP Coding Help
It's PHP 4.3.2 which, in this case, is the identical version used for the code utilized on another server as I posted in that other previous thread. The error messages show up fine and dandy on both. In other words, with the short tags the error messages display fine. Normally I use the full tags but this is a snippet I use over and over. The big question is... WHY does this login page work fine at one site and not the other? They are virtually identical in the core functionality. Here's the login form as used on two different sites. One works, the other doesn't. The one that doesn't simply displays a blank page upon submit. In the previous thread this was fixed by modifying the password references in the code to allow for the md5 encryption. Take a look at these: This one produces a blank page upon submit. <?php ob_start(); session_start(); $loginError = ""; // declare this so it is always available // Turn on magic quotes to prevent SQL injection attacks if(!get_magic_quotes_gpc()) set_magic_quotes_runtime(1); // Validate users input if(!empty($_POST)) { // Check username has a value if(empty($_POST['username'])) $loginError['username'] = "Please enter a user name!"; // Check password has a value if(empty($_POST['password'])) $loginError['password'] = "Please enter a password!"; // Check if any errors were returned and run relevant code if(empty($loginError)) { $username = $_POST['username']; $password = md5($_POST['password']); include 'db_config.php'; // Connect to database $con = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname, $con) or die(mysql_error()); // Get Record Set $sql = ("SELECT * FROM admin WHERE username = '$username' AND password = '$password'"); // mysql_query($sql) or die(mysql_error()); $results = mysql_query($sql, $con) or die(mysql_error()); $num_rows = mysql_num_rows($results) or die(mysql_error()); if ($num_rows == "1") { $_SESSION['loggedin'] = $_POST['loggedin']; header("Location: admin.php"); exit; } else { echo "Your user name and password do not match any in our database! Please try again. <a class='body' href='login.php'>Return to login page.<br>\n"; } } } include 'adminheader.php'; ?> <div align="center"> <table style="BORDER-COLLAPSE: collapse" bordercolor="#666666" cellpadding="4" width="530" border="0"> <tbody> <tr> <td> <h2 align="center">Login page</h2> <font color="red"><div align="center"> <? // Loop through all errors if(!empty($loginError)) { ?> <ul> <? foreach($loginError as $eg_message) { ?> <li id="validationError"><?= @$eg_message ?></li> <? } ?> </ul> <? } ?> </font></div> <table border="0" width="450" align="center"> <tr><td> <form action="<? $_SERVER['PHP_SELF'] ?>" name="login" method="post" > <input type="hidden" value="loggedin" name="loggedin"> <fieldset style="-moz-border-radius: 7pt;"><font face="Verdana" size="2"> <legend>Administration Login:</legend> <br />Username <input type="text" name="username" size="21" /><br><br> Password <input type="password" name="password" size="21" /> </font></fieldset> <br><input type="submit" value="Login"> </form> </td></tr></table> </td></tr> </tbody> </table> </div> <p> <? include 'adminfooter.php'; ?> This one works fine. <?php ob_start(); session_start(); $loginError = ""; // declare this so it is always available // Turn on magic quotes to prevent SQL injection attacks if(!get_magic_quotes_gpc()) set_magic_quotes_runtime(1); // Validate users input if(!empty($_POST)) { // Check username has a value if(empty($_POST['username'])) $loginError['username'] = "Please enter a user name!"; // Check password has a value if(empty($_POST['password'])) $loginError['password'] = "Please enter a password!"; // Check if any errors were returned and run relevant code if(empty($loginError)) { $username = $_POST['username']; $password = md5($_POST['password']); include 'dbconfig.php'; // Connect to database $con = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname, $con) or die(mysql_error()); // Get Record Set $sql = ("SELECT * FROM eastside_admin WHERE username = '$username' AND password = '$password'"); // mysql_query($sql) or die(mysql_error()); $results = mysql_query($sql, $con) or die(mysql_error()); $num_rows = mysql_num_rows($results) or die(mysql_error()); if ($num_rows == "1") { $_SESSION['loggedin'] = $_POST['loggedin']; header("Location: eastside_admin.php"); exit; } else { echo "Your user name and password do not match any in our database! Please try again. <a class='body' href='login.php'>Return to login page.<br>\n"; } } } include 'adminheader.php'; ?> <div align="center"> <table style="BORDER-COLLAPSE: collapse" bordercolor="#666666" cellpadding="4" width="530" border="0"> <tbody> <tr> <td> <h2 align="center">Login page</h2> <font color="red"><div align="center"> <? // Loop through all errors if(!empty($loginError)) { ?> <ul> <? foreach($loginError as $eg_message) { ?> <li id="validationError"><?= @$eg_message ?></li> <? } ?> </ul> <? } ?> </font></div> <table border="0" width="450" align="center"> <tr><td> <form action="<? $_SERVER['PHP_SELF'] ?>" name="login" method="post" > <input type="hidden" value="loggedin" name="loggedin"> <fieldset style="-moz-border-radius: 7pt;"><font face="Verdana" size="2"> <legend>Administration Login:</legend> <br />Username <input type="text" name="username" size="21" /><br><br> Password <input type="password" name="password" size="21" /> </font></fieldset> <br><input type="submit" value="Login"> </form> </td></tr></table> </td></tr> </tbody> </table> </div> <p> <? include 'adminfooter.php'; ?> -
I had this same issue once before ( http://www.phpfreaks.com/forums/index.php/topic,129403.0.html ) which was resolved. I'm using the exact same code that we used in the solving of that with the exception of a couple of minor snippets here and there in the queries. What I get when I enter username/password and hit submit is a blank page and the URL never changes. In other words, the login page is 'index.php' and when submitted it should redirect to 'admin.php'. Instead the url/address stays at 'index.php' and the page turns completely blank. In the previous thread, the problem turned out to be some missing indicator to the md5 encrypted password. Well, in this version, that's there! In fact, I used the ending scripts for that project in creating this project. So, why it won't work is a real mystery. Here's the login page code: <?php ob_start(); session_start(); $loginError = ""; // declare this so it is always available // Turn on magic quotes to prevent SQL injection attacks if(!get_magic_quotes_gpc()) set_magic_quotes_runtime(1); // Validate users input if(!empty($_POST)) { // Check username has a value if(empty($_POST['username'])) $loginError['username'] = "Please enter a user name!"; // Check password has a value if(empty($_POST['password'])) $loginError['password'] = "Please enter a password!"; // Check if any errors were returned and run relevant code if(empty($loginError)) { $username = $_POST['username']; $password = md5($_POST['password']); include 'db_config.php'; // Connect to database $con = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname, $con) or die(mysql_error()); // Get Record Set $sql = ("SELECT * FROM admin WHERE username = '$username' AND password = '$password'"); // mysql_query($sql) or die(mysql_error()); $results = mysql_query($sql, $con) or die(mysql_error()); $num_rows = mysql_num_rows($results) or die(mysql_error()); if ($num_rows == "1") { $_SESSION['loggedin'] = $_POST['loggedin']; header("Location: admin.php"); exit; } else { echo "Your user name and password do not match any in our database! Please try again. <a class='body' href='login.php'>Return to login page.<br>\n"; } } } include 'adminheader.php'; ?> <div align="center"> <table style="BORDER-COLLAPSE: collapse" bordercolor="#666666" cellpadding="4" width="530" border="0"> <tbody> <tr> <td> <h2 align="center">Login page</h2> <font color="red"><div align="center"> <? // Loop through all errors if(!empty($loginError)) { ?> <ul> <? foreach($loginError as $eg_message) { ?> <li id="validationError"><?= @$eg_message ?></li> <? } ?> </ul> <? } ?> </font></div> <table border="0" width="450" align="center"> <tr><td> <form action="<? $_SERVER['PHP_SELF'] ?>" name="login" method="post" > <input type="hidden" value="loggedin" name="loggedin"> <fieldset style="-moz-border-radius: 7pt;"><font face="Verdana" size="2"> <legend>Administration Login:</legend> <br />Username <input type="text" name="username" size="21" /><br><br> Password <input type="password" name="password" size="21" /> </font></fieldset> <br><input type="submit" value="Login"> </form> </td></tr></table> </td></tr> </tbody> </table> </div> <p> <? include 'adminfooter.php'; ?> Should be simple: * enter username/password, validates against the database records, if successful it sends you off to the admin.php page. If not, sends you back to the login page.
-
FIRST THING... Thank ALL of you! For your help and patience in working through this! :) Now, I found the problem! Unfortunately, until now, the customer's hosting account didn't have access to the error logs so I couldn't see what was causing the 500 error as everything else was working as it should. So, I got him to 'upgrade' his account (can't believe Godaddy charges extra to have error logs!) and was able to see immediately what the problem was: The mail function was looking for a value in a variable named $email which wasn't populated. This was causing the page/script to crash at the end causing the 500 error. I added the $email = $_POST['email']; params and voila! No more crash! Woohoo! I am HAPPILY MARKING THIS THREAD AS SOLLLLLVED!!
-
Ok, turns out it's NOT the eregi that's causing the 500 error. It's something after that. The script is doing everything it's supposed to do: 1: check the fields - OK 2: validate email - OK 3: run the query - OK 4: email the people - OK THEN it crashes with the 500 error. So it's something at the end of the script... ???
-
ARRRRRRRRGHHHHHH! I had tried the exact same code and produced a 500 server error. Just to make sure, I just copied/pasted your snippet over that part of the script and ran it. 500 server error! Honestly i'm beginning to think that this crap ass Godaddy hosting is the problem. Go figure. Here's exactly what's in the script up to the 'else' statement: <?php include 'db_config.inc'; // connect to db $link = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname, $link) or die(mysql_error()); //set variable arrays $field_names = array('first_name' => 'First Name', 'last_name' => 'Last Name','email' => 'Email', 'day_phone' => 'Day Phone', 'address' => 'Address', 'city' => 'City', 'state'=>'State', 'zip' => 'Zip'); $required_fields = array(); $property_fields = array(); $err_message = array(); $clean_data = array(); $qtmp = array(); $today = date("F j, Y, g:i a"); //run validation if (isset($_POST['submit_x'])) { foreach ($_POST as $fld => $val) { switch($fld) { case 'first_name': case 'last_name': case 'day_phone': if (strlen(trim(stripslashes($val))) == 0) { $required_fields[] = $field_names[$fld]; }else { $clean_data[$fld] = trim(stripslashes($val)); $qtmp[] = $fld . " = '" . mysql_real_escape_string($clean_data[$fld]) . "'"; } break; case 'address': case 'city': case 'state': case 'zip': if (strlen(trim(stripslashes($val))) == 0) { $property_fields[] = $field_names[$fld]; } else { $clean_data[$fld] = trim(stripslashes($val)); $qtmp[] = $fld . " = '" . mysql_real_escape_string($clean_data[$fld]) . "'"; } break; case 'email': if (strlen(trim(stripslashes($val))) == 0) $required_fields[] = $field_names[$fld]; elseif (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $val)) $err_message[] = $val. ' is not a valid email address. Please enter a valid email address.'; else { $clean_data[$fld] = trim(stripslashes($val)); $qtmp[] = $fld . " = '" . mysql_escape_string($clean_data[$fld]) . "'"; } break; case 'submit': case 'submit_x': case 'submit_y': break; default: $clean_data[$fld] = trim(stripslashes($val)); $qtmp[] = $fld . " = '" . mysql_real_escape_string($clean_data[$fld]) . "'"; } } // establish errors if (!empty($required_fields)) { $err_message[] = 'The following required fields were not entered:'; $err_message[] = implode(',',$required_fields); } if (!empty($property_fields)) { $err_message[] = '<br>The following property fields were not entered:'; $err_message[] = implode(',',$property_fields); } if (!empty($err_message)) { //echo "<span style='color:red'>" . implode("<br>\n",$err_message) . "<br>\n"; } else { ?> The weird part is that it's sending the mails AND inserting the data! But slams this funky 500 error trying to validate the email address as legit.
-
Ok, that makes perfect sense. Now the field entry shows up in the error message display. But, it's still showing an error yet it's executing the 'else' code which inserts into the db and sends the emails. Essentially it's stating an error but not stopping the script from running as if there was no error. In the eregi statement it references the $email variable again. I've tried replacing that with $val and that returned a 500 error. Not sure what to replace that with.
-
DOHHHHHHHH! ok, i'm ashamed on that one :-\ Alright, in testing it is doing it's job except for the email validation. Throwing an error that the email is invalid format when I know it's not. I think the eregi line might have a glitch. Also, Ken, so the person doesn't have to complete the form all over again if an error surfaces (which right now wipes the form clean) can I use the value="<? echo ".$clean_data['first_name']."; ?>" method to display their input?
-
Ken, ok...made those changes. For some reason the server doesn't like line 49: Line 49 is: The top of the page is covered with this error repeated about 15 times plus it's echoing the form field errors above the page. Check it out at: http://www.wahomesaver.com/response4.php I know it's throwing a MySQL error but i'm in the database without problems. Not sure why it's stating that.
-
Ok, made the change but the page still does nothing in response to the errors. I'm using this code to cycle through and display them in the page. But, nothing shows: <?php if(!empty($err_message)) { echo "<strong id='errorTitle'>One or more input fields on the form has not been completed</strong>"; echo "<ul>"; foreach ($err_message as $value) { echo "<li>$value</li>"; } echo "</ul>"; } ?> Here's the url: http://www.wahomesaver.com/response3.php
-
Good morning Here's the whole ball of wax with the 'tweaks' included: <?php include 'db_config.inc'; $err_message = array(); $clean_data = array(); $qtmp = array(); $today = date("F j, Y, g:i a"); if (isset($_POST['submit'])) { foreach ($_POST as $fld => $val) { switch($fld) { case 'first_name': case 'last_name': case 'email': case 'day_phone': if (strlen(trim(stripslashes($val))) == 0) $err_message[] = 'Your first name, last name, email address and daytime phone number are required. Please complete those fields and resubmit.'; else { $clean_data[$fld] = trim(stripslashes($val)); $qtmp[] = $fld . " = '" . mysql_real_escape_string($clean_data[$fld]) . "'"; } break; case 'address': case 'city': case 'state': case 'zip': if (strlen(trim(stripslashes($val))) == 0) $err_message[] = 'Please complete ALL fields in the property information section and resubmit'; else { $clean_data[$fld] = trim(stripslashes($val)); $qtmp[] = $fld . " = '" . mysql_real_escape_string($clean_data[$fld]) . "'"; } break; case 'email': if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) $err_message[] = $email. ' is not a valid email address. Please enter a valid email address.'; else { $clean_data[$fld] = trim(stripslashes($val)); $qtmp[] = $fld . " = '" . mysql_real_escape_string($clean_data[$fld]) . "'"; } break; case 'submit': break; default: $clean_data[$fld] = trim(stripslashes($val)); $qtmp[] = $fld . " = '" . mysql_real_escape_string($clean_data[$fld]) . "'"; } } } if (!empty($err_messge)) { echo "<span style='color:red'>" . implode("<br>\n",$err_message) . "<br>\n"; } else { $link = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname, $link) or die(mysql_error()); // run our query to insert the record $sql = "INSERT INTO leads set " . implode(', ',$qtmp); // this uses the alternative format of the MySQL insert command $results = mysql_query($sql, $link) or die(mysql_error()); $new_id = mysql_insert_id(); // start mail process $mailContent="--------CONTACT--------\n" ."Name: ".$clean_data['first_name']." ".$clean_data['lastname']."\n" ."Date: ".$today."\n" ."E-mail: ".$clean_data['email']."\n\n--------PHONE--------\n" ."Phone: ".$clean_data['day_phone']."\n" ."Alt Phone: ".$clean_data['alt_phone']."\n" ."Best time to call: ".$clean_data['best_time']."\n\n--------Details--------\n" ."Address: ".$clean_data['address']."\n" ."City: ".$clean_data['city']."\n" ."State: ".$clean_data['state']."\n" ."Zip: ".$clean_data['zip']."\n\n---------Foreclosure Info---------\n" ."Loan type: ".$clean_data['type_mortgage']."\n" ."First Mtg: ".$clean_data['first_company']."\n" ."Months behind: ".$clean_data['months_behind']."\n" ."Back payments: ".$clean_data['back_payments']."\n" ."Notice of foreclosure filed: ".$clean_data['notice_of_foreclosure']."\n" ."Auction date set: ".$clean_data['auction_date']."\n" ."Date of auction: ".$clean_data['date_of_auction']."\n" ."Second mortgage: ".$clean_data['second_company']."\n" ."Combined balances: ".$clean_data['combined_balances']."\n" ."Combined payments: ".$clean_data['combined_payments']."\n" ."Are you in bankruptcy: ".$clean_data['in_bankruptcy']."\n" ."Situation detail: ".$clean_data['situation']."\n" ."Keep or Sell: ".$clean_data['keep_property']."\n\n----------Other---------\n" ."Referred by: ".$clean_data['referred_by']."\n"; //---------------------------------- $toAddress="bsniff@gmail.com"; /* change this! */ $subject="WA HomeSaver Inquiry"; /* change this! */ $recipientSubject="WA HomeSaver Inquiry"; /* change this! */ $receiptMessage = "Thank you ".$fname." for inquiring at WAHomeSaver.com's website!\n\n\nHere is the contact information you submitted to us:\n\n" ."--------CONTACT--------\n" ."Name: ".$clean_data['first_name']." ".$clean_data['lastname']."\n" ."E-mail: ".$clean_data['email']."\n\n--------PHONE--------\n" ."Phone: ".$clean_data['day_phone']."\n" ."Alternate phone: ".$clean_data['alt_phone']."\n" ."Best time to contact? ".$clean_data['best_time']."\n"; //---------------------------------- mail($email, $subject, $receiptMessage,"From:$toAddress"); //---------------------------------- mail($toAddress,$recipientSubject,$mailContent,"From:".$clean_data['email'].""); } ?>
-
Ken, just for fun I modified the query to the more 'traditional' values statements like this: <? $sql = "INSERT INTO leads (first_name, last_name, email, day_phone, alt_phone, best_time, address, city, state, zip, type_mortgage, first_company, months_behind, back_payments, notice_of_foreclosure, auction_date, date_of_auction, second_company, combined_balances, combined_payments, in_bankruptcy, situation, keep_property, referred_by, date ) VALUES ('".$clean_data['first_name']."', '".$clean_data['lastname']."', '".$clean_data['email']."', '".$clean_data['day_phone']."', '".$clean_data['alt_phone']."', '".$clean_data['best_time']."', '".$clean_data['address']."', '".$clean_data['city']."', '".$clean_data['state']."', '".$clean_data['zip']."', '".$clean_data['type_mortgage']."', '".$clean_data['first_company']."', '".$clean_data['months_behind']."', '".$clean_data['back_payments']."', '".$clean_data['notice_of_foreclosure']."', '".$clean_data['auction_date']."', '".$clean_data['date_of_auction']."', '".$clean_data['second_company']."', '".$clean_data['combined_balances']."', '".$clean_data['combined_payments']."', '".$clean_data['in_bankruptcy']."', '".$clean_data['situation']."', '".$clean_data['keep_property']."', '".$clean_data['referred_by']."', '$today')"; ?> Now at least the page shows up But, when I click on submit without filling in any form fields I get this: No errors are displayed for empty fields or anything. Plus, the code runs for the mail and the insert without stopping for the validation Here's the message when first arriving on the page just for reference. This is before hitting submit or anything: This is such a baffler. All i'm trying to do is validate the entries, stop the form from running the query and send the mail until all required fields are inserted.