Jump to content

Bavilo

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Everything posted by Bavilo

  1. Hello everyone, I'm helping a friend with some scripting. I made a register and login script that takes the raw input and puts it into a database, the password is encrypted in md5, that part works, aswell as the login part but i need to display a unique page for each user. Basically my friend will create the usernames and passwords with the register script, lets say the username is 123 and the password is 321, when i enter 123 in the login box and i successfully login the page should now display information about only the user "123" such as a schedule, of things this user has to do and so on. I was thinking about using something like this. [code] <?     if (isset($_SESSION['s_username'])) {     echo "<b>Welcome</b> ".$_SESSION['s_username']."!"; }   ?> [/code] This will display the name of the username that was entered in the login script, but instead i want it to check what username was entered, (in this case "123") take that username, check if its in the database and use that in the session code above instead of "username". Also, if 123 is logged in, it will not echo [code] <b>Welcome</b> ".$_SESSION['s_username']."!"; [/code] , but other php snippets, codes, html, whatever. Ok just to wrap it up, what i am trying to figure out is how to change the content on a page such as a schedule that will be different for every user that signs on. Hopefully someone can point me to some examples or explain how this could be done. If anything is unclear please let me know, i will try to explain it some more. Thanks Mike
  2. Hello everyone, I have posted before asking to help me with a problem of storing passwords as MD5 hashes in the database instead of plain text. This worked out great, but i have a new problem. When a user registers, the password is hashed and then submitted into the database. When the user logs in, the password he types is getting hashed, and then checked against the checked password in the database, this works great, but i have a forgot your password script that when you enter your email address, it looks for the username and password on the same row of that table and then sends you the information. The user will receive the Hashed password instead of the plain text password because thats how the password was stored when he registered. Is there a way to make it so the password he receives is the plain text password? Here are my scripts Register.php [code] <?php if (isset($_POST["username"])) { $username = $_POST["username"]; $password = md5($_POST["password"]); $cpassword = md5($_POST["cpassword"]); $email = $_POST["email"]; if (empty($username) || empty($password) || empty($cpassword) || empty($email)) { echo "A field was left blank."; }else{ if($password!=$cpassword) { echo "Passwords do not match"; } else { $checkuser = mysql_query("SELECT `username`, `email` FROM `users` WHERE `username` = '$username' OR `email` = '$email'") or die('SQL error: ' . mysql_error()); $user_exists = mysql_num_rows($checkuser); if ($user_exists > 0) { echo "The username or email is already in use"; } else { $query = "INSERT INTO users (`username`, `password`, `email`) VALUES('$username', '$password', '$email')"; mysql_query($query) or die(mysql_error());echo "The user \"$username\" has been successfully registered. You may now login."; } } } } ?> [/code] Login.php [code] <?php if ($_POST['username']) { $username=$_POST['username']; $password= $_POST['password'];         if (empty($username) || empty($password)) { echo "You didn't enter a username and/or password"; }else{ $password = md5($password); $query = mysql_query("SELECT `username`, `password` FROM `users` WHERE `username` = '$username' AND `password` = '$password'") or die(mysql_error()); $row = mysql_fetch_assoc($query); if (!$row)  { echo "The Login you entered is incorrect"; } else { $_SESSION['s_username'] = $row['username']; echo "<meta http-equiv='Refresh' content='0; url=index.php'>"; } } } ?> [/code] Forgot.php [code] if (!mysql_select_db($dbname)) die(mysql_error()); if($_POST['email']) { $email = $_POST['email']; $checkemail = mysql_query("SELECT username,password FROM users WHERE email='$email'"); $row = mysql_fetch_array($checkemail); $numrows = mysql_num_rows($checkemail); if ($numrows!=0) { $name = $row['username']; $password = $row['password']; $subject = "subject here"; $message = "Message here"; mail($email, $subject, $message, "From: \nX-Mailer:PHP/" . phpversion()); echo "<center>Password sent.<br /><br /></center>"; }else{ echo "<center>The supplied address does not exist in our database.<br /><br /></center>"; } } } ?> [/code] Thanks in advance Mike
  3. Ok it works now, the row for the passwords didn't allow enough characters for the hash. Fixed that and shes up and running. One more problem. I have a Forgot Password? script that sends you your username and password from the row of the email you entered. Well, now it sends the hash. Any way i can make it so it sends the actual password instead of the hash? Thanks Mike
  4. Thanks for the great tips! Everything works great except or the login part, it still says that the login is incorrect. I made sure that when i sign up the password is hashed in the table. I guess the login tries to check the actual password instead of the encrytped password? Im not really sure how to fix this. Any further help is appreciated. Btw is used the code you gave me. Here is the site btw, check it out and see for yourself. [a href=\"http://mike.eurodogcrates.com/login.php\" target=\"_blank\"]http://mike.eurodogcrates.com/login.php[/a] Mike
  5. Hello folks, I am making a Register and Login script for my site. It works great but i would rather have the passwords be encrypted using md5. Right now i have figured out how to store the password the user enteres in the registering page into md5 right into the database. Now i want to be able to have the user login, his password that he enters gets encrypted, and then checked with the one on the database. Im not sure how i would go about encrypting the password on the login script. I hope someone can help me out a little. Here are the 2 scripts. Register.php [code] <?php          $dbhost='localhost';           $dbusername='username';          $dbuserpass='password';          $dbname='database name';          mysql_connect ($dbhost, $dbusername, $dbuserpass);          mysql_select_db($dbname) or die("Cannot select database");          if (isset($_POST["username"])) {          $username = $_POST["username"];          $password = md5($_POST["password"]); //here the password was hashed and then submitted          $cpassword = md5($_POST["cpassword"]); //here the password was hashed and then submitted          $email = $_POST["email"];          if($username==NULL|$password==NULL|$cpassword==NULL|$email==NULL) {          echo "A field was left blank.";          }else{          if($password!=$cpassword) {          echo "Passwords do not match";          }else{          $checkuser = mysql_query("SELECT username FROM users WHERE username='$username'");          $username_exist = mysql_num_rows($checkuser);          $checkemail = mysql_query("SELECT email FROM users WHERE email='$email'");          $email_exist = mysql_num_rows($checkemail);          if ($email_exist>0|$username_exist>0) {          echo "The username or email is already in use";          }else{          $query = "INSERT INTO users (username, password, email) VALUES('$username','$password','$email')";          mysql_query($query) or die(mysql_error());          echo "The user \"$username\" has been successfully registered. You may now login.";          }          }          }          }          ?> [/code] Login.php [code] <?php          $dbhost='localhost';          $dbusername='username;          $dbuserpass='password';          $dbname='username database';          mysql_connect ($dbhost, $dbusername, $dbuserpass);          mysql_select_db($dbname) or die('Cannot select database');          if ($_POST['username']) {          $username=$_POST['username'];          $password=$_POST['password'];          if ($password==NULL) {          echo "You didn't enter a password";          }else{          $query = mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error());          $data = mysql_fetch_array($query);          if($data['password'] != $password) {          echo "The Login you entered is incorrect";          }else{          $query = mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error());          $row = mysql_fetch_array($query);          $_SESSION["s_username"] = $row['username'];          echo "<meta http-equiv='Refresh' content='0; url=loggedin.php'>";}          }          }          ?> [/code] Again, not sure how i would encrypt the password on the login script and have it succesfully check out on this line so it gets submitted "data = mysql_fetch_array($query); if($data['password'] != $password) {" Thanks in advance Mike
  6. Bavilo

    Help with CSS!

    Hello everyone, I have recently started to work on a website i have to make for school. I am having problems with the allignment of the different divs. For example, i have a header which should float in the top right, followed by a tab menu in its own wrapper div 20 pixels below the header, then a navigation menu floating on the left below the tab menu, and a content box floating on the right next to the navigation menu. Well it sounds simple, but its not coming out the way it should, i have to clear: both; the tab menu for it to even show up under the header, which i should have to do. Well here is a link to the page im working on. I hope someone can look over my code and tell me what i could change to make it work better. Also, im trying to keep the page resolution friendly, not sure how i would do that. Again, any help is much appreciated. Here is the link [a href=\"http://mike.eurodogcrates.net/test/\" target=\"_blank\"]http://mike.eurodogcrates.net/test/[/a] btw, i left the borders on so you can see whats going on. Seems the main container wont hold anything under the tab menu, dont know whats going on there aswell
  7. Ok this one should be relativly easy for you hardcore coders out there...I was browsing on Wiki one day and decided that my page needs those slick Tabs at the top aswell... I looked at quiet a few tutorials examples you name it. I got the Tabs looking nice and everything but i till have a slight problem. The "active" tab, the tab that is standing out from the other when its clicked. Annoyed, confused, and devestated, i spent several hours looking at more examples and this is what i found out. When ever you click a link, MAGICALLY the tab has a ID tag in the hyperlink. So instead of a href="blah.html"> it now has a href="blah.html" id="selected"> or the similar. This would be pretty much common sense, the link now has the propertied given by the style sheet under #selected. Only problem is...how in the HELL do you get that ID tag there in the first place? i mean all these tutorials are great, but they dont show me how they get this Tag there. I've even thought about using PHP, such as this (im not a php coder, so this WILL be wrong) a href="blah.html" value="selected"> then when you click the link, it will submit the value, such as a POST field in php, out it into a string, and then in my body id="$string"> thus giving me the effect. Is this possible? if so, how? I would much rather go the css route though. I hope ANYBODY out there could help me :( Thanks in advance Mike
  8. Hello, I was thinking about adding a search field on my site. A field where i just enter some text, click search, and then a new page pops up with the google results of that query. What i need to know is how to append the following: site:http://mysite.com so it actually calls for "blah blah site:http://mysite.com" Can i do this using php? Thanks Mike
  9. Ok, I am really frustrated right now...This has been going on for several weeks now and i just cannot find an answer. I have one index.php where i have the following code [code] <?         $val = $_GET['id'];         $val .= ".php";         $dirty = array("..");         $clean = array("");         $val = str_replace($dirty, $clean, $val);         if (isset($_GET['id'])) {         if (file_exists($val)) {         include "$val";         }           else {                 include "id/404.php";                }        }           else {                 include "id/start.php";        }     ?> [/code] I use this to navigate from page to page without having to make a complete new page for everything. So this basically just includes another page with the php extension into my main div. This works great for pages that do nothing but hold content. But it will not work if i try to link to a gallery or slideshow, or whatever, that has to include other pages. Once i include for example gallery.php, the gallery.php is now part of my index.php in the main div. It has no way of including all the other pages as its in the wrong directory. And i can't just go into the gallery.php and change every single link because it doesn't seem to work in this format. index.php?id=id/gallery/ I dont know what to do. How does everybody else pull this off?? Thanks in advance Mike
  10. Schweeeet it works great. Thanks!
  11. [!--quoteo(post=354097:date=Mar 11 2006, 10:20 PM:name=Prismatic)--][div class=\'quotetop\']QUOTE(Prismatic @ Mar 11 2006, 10:20 PM) [snapback]354097[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code]<?php if (!is_numeric($_POST['field']){     echo "Not a number!"; } else{     echo "Number!"; } ?>[/code] [/quote] Thanks i will try that in a bit
  12. Hello, I have a form which submits info and emails it to me. I have a few fields that should only take numerical values, such as the zip code field, and phone number field. Is there anyway i can validate those fields and give an error if anything besides numbers have been entered? Thanks in advance
  13. Hello everyone, I recently wrote a mail script. I am having a few problems with it though. For example, when i submit information from the form page, and leave out a field, the script will then process and echo back the form fields saying that something was missing...when i then try to submit the missing info from that page, it works sometimes...seriously...it works one time and doesn't another. I dont know why it would do this. Another problem i have is that when someone wants to enter a street address such as 123 first str. it will say some field was missing because it doens't like the ".", how could i fix this just for this one field? Here are the 2 codes, i hope someone can look over them and see if anything else is wrong with it. Also, the actual site where you can try for yourself is here htttp://spunge.org/~bavilo/EuroDogCrates/index.php?id=id/contact Btw, I haven't worked on the wrong email function yet, im gonna make it echo the same form like the missing field function. But i would like to get this sorted out first. Contant.php [code] <div class="inside">   <h4>For a free estimate, please supply us with the following information.</h4> <br /><br /><br />   <form id="form" method="post" action="index.php?id=id/test" enctype="multipart/form-data"> <table>   <tr>     <td>       First Name:     </td>     <td>       <input id="field" type="text" name="FirstName" value=""/>     </td>   </tr>   <tr>     <td>       Last Name:     </td>     <td>       <input id="field" type="text" name="LastName" value=""/>     </td>   </tr>   <tr>     <td>       Address:     </td>     <td>       <input id="field" type="text" name="Address" value=""/>     </td>   </tr>   <tr>   <tr>     <td>       City:     </td>     <td>       <input id="field" type="text" name="City" value=""/>     </td>   </tr>   <tr>     <td>       State:     </td>     <td>       <select name="State">         <option value='' >- - - - - -Please Select- - - - - -</option>       <option value='AK' >ALASKA</option>         <option value='AL' >ALABAMA</option>         <option value='AR' >ARKANSAS</option>         <option value='AZ' >ARIZONA</option>         <option value='CA' >CALIFORNIA</option>         <option value='CO' >COLORADO</option>         <option value='CT' >CONNECTICUT</option>         <option value='DC' >DISTRICT OF COLUMBIA</option>         <option value='DE' >DELAWARE</option>         <option value='FL' >FLORIDA</option>         <option value='GA' >GEORGIA</option>         <option value='HI' >HAWAII</option>         <option value='IA' >IOWA</option>         <option value='ID' >IDAHO</option>         <option value='IL' >ILLINOIS</option>         <option value='IN' >INDIANA</option>         <option value='KS' >KANSAS</option>         <option value='KY' >KENTUCKY</option>         <option value='LA' >LOUISIANA</option>         <option value='MA' >MASSACHUSETTS</option>         <option value='MD' >MARYLAND</option>         <option value='ME' >MAINE</option>         <option value='MI' >MICHIGAN</option>         <option value='MN' >MINNESOTA</option>         <option value='MO' >MISSOURI</option>         <option value='MS' >MISSISSIPPI</option>         <option value='MT' >MONTANA</option>         <option value='NC' >NORTH CAROLINA</option>         <option value='ND' >NORTH DAKOTA</option>         <option value='NE' >NEBRASKA</option>         <option value='NH' >NEW HAMPSHIRE</option>         <option value='NJ' >NEW JERSEY</option>         <option value='NM' >NEW MEXICO</option>         <option value='NV' >NEVADA</option>         <option value='NY' >NEW YORK</option>         <option value='OH' >OHIO</option>         <option value='OK' >OKLAHOMA</option>         <option value='OR' >OREGON</option>         <option value='PA' >PENNSYLVANIA</option>         <option value='PR' >PUERTO RICO</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='VA' >VIRGINIA</option>         <option value='VT' >VERMONT</option>         <option value='WA' >WASHINGTON</option>         <option value='WI' >WISCONSIN</option>         <option value='WV' >WEST VIRGINIA</option>         <option value='WY' >WYOMING</option>       </select>     </td>   </tr>   <tr>     <td>       Zip Code:     </td>     <td>       <input id="field" type="text" name="Zip" value=""/>     </td>   </tr>   <tr>     <td>       Phone:     </td>     <td>       (<input id="field" type="text" name="Area" size="3" maxlength="3" value=""/>) <input id="field" type="text" name="Pre" size="3" maxlength="3" value=""/> - <input id="field" type="text" name="Number" size="4" maxlength="4" value=""/>     </td>   </tr>   <tr>     <td>       Email:     </td>     <td>       <input id="field" type="text" name="Email" value="" />     </td>   </tr>   <tr>     <td>       Car Make:     </td>     <td>       <input id="field" type="text" name="Make" value=""/>     </td>   </tr>   <tr>     <td>       Model:     </td>     <td>       <input id="field" type="text" name="Model" value=""/>     </td>   </tr>   <tr>     <td>       Year:     </td>     <td>       <select name="Year">         <option value='' >- -Please Select- -</option>       <option value="1980">1980</option>       <option value="1981">1981</option>       <option value="1982">1982</option>       <option value="1983">1983</option>       <option value="1984">1984</option>       <option value="1985">1985</option>       <option value="1986">1986</option>       <option value="1987">1987</option>       <option value="1988">1988</option>       <option value="1989">1989</option>       <option value="1990">1990</option>       <option value="1991">1991</option>       <option value="1992">1992</option>       <option value="1993">1993</option>       <option value="1994">1994</option>       <option value="1995">1995</option>       <option value="1996">1996</option>       <option value="1997">1997</option>       <option value="1998">1998</option>       <option value="1999">1999</option>       <option value="2000">2000</option>       <option value="2001">2001</option>       <option value="2002">2002</option>       <option value="2003">2003</option>       <option value="2004">2004</option>       <option value="2005">2005</option>       <option value="2006">2006</option>       </select>     </td>   </tr>   <tr>     <td>       Single Crate:     </td>     <td>       <select name="SingleQuantity">         <option value='' >- -Please Select- -</option>         <option value='0' >0</option>         <option value='1' >1</option>         <option value='2' >2</option>       <option value='3' >3</option>       <option value='4' >4</option>       <option value='5' >5</option>       <option value='6' >6</option>       <option value='7' >7</option>       <option value='8' >8</option>       <option value='9' >9</option>       <option value='10' >10</option>       </select>     </td>   </tr>   <tr>     <td>       Single Crate with Drawer:     </td>     <td>       <select name="SingleDrawerQuantity">         <option value='' >- -Please Select- -</option>         <option value='0' >0</option>         <option value='1' >1</option>         <option value='2' >2</option>       <option value='3' >3</option>       <option value='4' >4</option>       <option value='5' >5</option>       <option value='6' >6</option>       <option value='7' >7</option>       <option value='8' >8</option>       <option value='9' >9</option>       <option value='10' >10</option>       </select>     </td>   </tr>   <tr>     <td>       Double Crate:     </td>     <td>       <select name="DoubleQuantity">         <option value='' >- -Please Select- -</option>         <option value='0' >0</option>         <option value='1' >1</option>         <option value='2' >2</option>       <option value='3' >3</option>       <option value='4' >4</option>       <option value='5' >5</option>       <option value='6' >6</option>       <option value='7' >7</option>       <option value='8' >8</option>       <option value='9' >9</option>       <option value='10' >10</option>       </select>     </td>   </tr>   <tr>     <td>       Double Crate with Drawer:     </td>     <td>       <select name="DoubleDrawerQuantity">         <option value='' >- -Please Select- -</option>         <option value='0' >0</option>         <option value='1' >1</option>         <option value='2' >2</option>       <option value='3' >3</option>       <option value='4' >4</option>       <option value='5' >5</option>       <option value='6' >6</option>       <option value='7' >7</option>       <option value='8' >8</option>       <option value='9' >9</option>       <option value='10' >10</option>       </select>     </td>   </tr>   <tr>     <td>       Breed:     </td>     <td>       <input id="field" type="text" name="Breed" value=""/>     </td>   </tr>     <tr>     <td>       Comments:     </td>     <td>       <textarea id="field" name="Comments" rows="5" cols="40"></textarea>     </td>   </tr>   <tr>     <td colspan="2">       <div align="center">         <input class="formbutton" type="submit" name="submit" value="Submit" />         <input class="formbutton" type="reset" name="Reset" value="Reset" />       </div>     </td>   </tr>     </table>   </form> </div> [/code] Mail Script [code] <?php if (!isset($_POST['submit'])) {    echo "<div class=\"inside\">";    echo "<h4>Error</h4>\n       <h4><p>Accessing this page directly is not allowed.</p></h4>";    echo "</div>";    echo "</div>";    echo "<div id=\"footer\">";    echo "</div>";    echo "</div>";    echo "</body>";    echo "</html>";    exit; } function cleanUp($data) {    $data = trim(strip_tags(htmlspecialchars($data)));    return $data; } $first      = cleanUp($_POST['FirstName']); $last       = cleanUp($_POST['LastName']); $address    = cleanUp($_POST['Address']); $city       = cleanUp($_POST['City']); $state      = cleanUp($_POST['State']); $zip        = cleanUp($_POST['Zip']); $area       = cleanUp($_POST['Area']); $pre        = cleanUp($_POST['Pre']); $number     = cleanUp($_POST['Number']); $email      = cleanUp($_POST['Email']); $make       = cleanUp($_POST['Make']); $model      = cleanUp($_POST['Model']); $year       = cleanUp($_POST['Year']); $single     = cleanUp($_POST['SingleQuantity']); $singledr   = cleanUp($_POST['SingleDrawerQuantity']); $double     = cleanUp($_POST['DoubleQuantity']); $doubledr   = cleanUp($_POST['DoubleDrawerQuantity']); $breed      = cleanUp($_POST['Breed']); $comments   = cleanUp($_POST['Comments']); $phone      = $area . '-' . $pre . '-' . $number; if ((empty($first))    || (empty($last))     || (empty($address))  ||     (empty($city))     || (empty($state))    || (empty($zip))      ||     (empty($make))     || (empty($model))    || (empty($year))     ||     (empty($single))   || (empty($singledr)) || (empty($double))   ||     (empty($doubledr)) || (empty($breed))    || (empty($area))     ||     (empty($pre))      || (empty($number)))      { echo "<div class=\"inside\">"; echo "<h4>Error</h4>"; echo "<h4><p>You have missed one or more fields. Please fill them in and try again</p></h4>"; echo "<form method=\"post\" action=\"index.php?id=id/test\" enctype=\"multipart/form-data\">"; echo "<table>"; echo "<tr>"; echo "<td>First Name:</td>"; echo "<td><input type=\"text\" name=\"FirstName\" value=\"$first\" /></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Last Name:</td>"; echo "<td><input type=\"text\" name=\"LastName\" value=\"$last\" /></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Address:</td>"; echo "<td><input type=\"text\" name=\"Address\" value=\"$address\" /></td>"; echo "</tr>"; echo "<tr>"; echo "<td>City:</td>"; echo "<td><input type=\"text\" name=\"City\" value=\"$city\" /></td>"; echo "</tr>"; echo "<tr>"; echo "<td>State:</td>"; echo "<td><select name=\"State\">         <option value=\"\" >- - - - - -Please Select- - - - - -</option>       <option value=\"AK\" >ALASKA</option>         <option value=\"AL\" >ALABAMA</option>         <option value=\"AR\" >ARKANSAS</option>         <option value=\"AZ\" >ARIZONA</option>         <option value=\"CA\" >CALIFORNIA</option>         <option value=\"CO\" >COLORADO</option>         <option value=\"CT\" >CONNECTICUT</option>         <option value=\"DC\" >DISTRICT OF COLUMBIA</option>         <option value=\"DE\" >DELAWARE</option>         <option value=\"FL\" >FLORIDA</option>         <option value=\"GA\" >GEORGIA</option>         <option value=\"HI\" >HAWAII</option>         <option value=\"IA\" >IOWA</option>         <option value=\"ID\" >IDAHO</option>         <option value=\"IL\" >ILLINOIS</option>         <option value=\"IN\" >INDIANA</option>         <option value=\"KS\" >KANSAS</option>         <option value=\"KY\" >KENTUCKY</option>         <option value=\"LA\" >LOUISIANA</option>         <option value=\"MA\" >MASSACHUSETTS</option>         <option value=\"MD\" >MARYLAND</option>         <option value=\"ME\" >MAINE</option>         <option value=\"MI\" >MICHIGAN</option>         <option value=\"MN\" >MINNESOTA</option>         <option value=\"MO\" >MISSOURI</option>         <option value=\"MS\" >MISSISSIPPI</option>         <option value=\"MT\" >MONTANA</option>         <option value=\"NC\" >NORTH CAROLINA</option>         <option value=\"ND\" >NORTH DAKOTA</option>         <option value=\"NE\" >NEBRASKA</option>         <option value=\"NH\" >NEW HAMPSHIRE</option>         <option value=\"NJ\" >NEW JERSEY</option>         <option value=\"NM\" >NEW MEXICO</option>         <option value=\"NV\" >NEVADA</option>         <option value=\"NY\" >NEW YORK</option>         <option value=\"OH\" >OHIO</option>         <option value=\"OK\" >OKLAHOMA</option>         <option value=\"OR\" >OREGON</option>         <option value=\"PA\" >PENNSYLVANIA</option>         <option value=\"PR\" >PUERTO RICO</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=\"VA\" >VIRGINIA</option>         <option value=\"VT\" >VERMONT</option>         <option value=\"WA\" >WASHINGTON</option>         <option value=\"WI\" >WISCONSIN</option>         <option value=\"WV\" >WEST VIRGINIA</option>         <option value=\"WY\" >WYOMING</option>       </select>     </td>"; echo "</tr>"; echo "<tr>"; echo "<td>Zip Code:</td>"; echo "<td><input type=\"text\" name=\"Zip\" value=\"$zip\" /></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Phone:</td>"; echo "<td>(<input id=\"field\" type=\"text\" name=\"Area\" size=\"3\" maxlength=\"3\" value=\"$area\" />) <input id=\"field\" type=\"text\" name=\"Pre\" size=\"3\" maxlength=\"3\" value=\"$pre\" /> - <input id=\"field\" type=\"text\" name=\"Number\" size=\"4\" maxlength=\"4\" value=\"$number\" /></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Email:</td>"; echo "<td><input type=\"text\" name=\"Email\" value=\"$email\" /></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Car Make:</td>"; echo "<td><input type=\"text\" name=\"Make\" value=\"$make\" /></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Model:</td>"; echo "<td><input type=\"text\" name=\"Model\" value=\"$model\" /></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Year:</td>"; echo "<td><select name=\"Year\">         <option value=\"\" >- -Please Select- -</option>       <option value=\"1980\">1980</option>       <option value=\"1981\">1981</option>       <option value=\"1982\">1982</option>       <option value=\"1983\">1983</option>       <option value=\"1984\">1984</option>       <option value=\"1985\">1985</option>       <option value=\"1986\">1986</option>       <option value=\"1987\">1987</option>       <option value=\"1988\">1988</option>       <option value=\"1989\">1989</option>       <option value=\"1990\">1990</option>       <option value=\"1991\">1991</option>       <option value=\"1992\">1992</option>       <option value=\"1993\">1993</option>       <option value=\"1994\">1994</option>       <option value=\"1995\">1995</option>       <option value=\"1996\">1996</option>       <option value=\"1997\">1997</option>       <option value=\"1998\">1998</option>       <option value=\"1999\">1999</option>       <option value=\"2000\">2000</option>       <option value=\"2001\">2001</option>       <option value=\"2002\">2002</option>       <option value=\"2003\">2003</option>       <option value=\"2004\">2004</option>       <option value=\"2005\">2005</option>       <option value=\"2006\">2006</option>       </select>     </td>"; echo "</tr>"; echo "<tr>"; echo "<td>Single Crate:</td>"; echo "<td><select name=\"SingleQuantity\">         <option value=\"\" >- -Please Select- -</option>         <option value=\"0\" >0</option>         <option value=\"1\" >1</option>         <option value=\"2\" >2</option>       <option value=\"3\" >3</option>       <option value=\"4\" >4</option>       <option value=\"5\" >5</option>       <option value=\"6\" >6</option>       <option value=\"7\" >7</option>       <option value=\"8\" >8</option>       <option value=\"9\" >9</option>       <option value=\"10\" >10</option>       </select>     </td>"; echo "</tr>"; echo "<tr>"; echo "<td>Single Crate with Drawer:</td>"; echo "<td><select name=\"SingleDrawerQuantity\">         <option value=\"\" >- -Please Select- -</option>         <option value=\"0\" >0</option>         <option value=\"1\" >1</option>         <option value=\"2\" >2</option>       <option value=\"3\" >3</option>       <option value=\"4\" >4</option>       <option value=\"5\" >5</option>       <option value=\"6\" >6</option>       <option value=\"7\" >7</option>       <option value=\"8\" >8</option>       <option value=\"9\" >9</option>       <option value=\"10\" >10</option>       </select>     </td>"; echo "</tr>"; echo "<tr>"; echo "<td>Double Crate:</td>"; echo "<td><select name=\"DoubleQuantity\">         <option value=\"\" >- -Please Select- -</option>         <option value=\"0\" >0</option>         <option value=\"1\" >1</option>         <option value=\"2\" >2</option>       <option value=\"3\" >3</option>       <option value=\"4\" >4</option>       <option value=\"5\" >5</option>       <option value=\"6\" >6</option>       <option value=\"7\" >7</option>       <option value=\"8\" >8</option>       <option value=\"9\" >9</option>       <option value=\"10\" >10</option>       </select>     </td>"; echo "</tr>"; echo "<tr>"; echo "<td>Double Crate with Drawer:</td>"; echo "<td><select name=\"DoubleDrawerQuantity\">         <option value=\"\" >- -Please Select- -</option>         <option value=\"0\" >0</option>         <option value=\"1\" >1</option>         <option value=\"2\" >2</option>       <option value=\"3\" >3</option>       <option value=\"4\" >4</option>       <option value=\"5\" >5</option>       <option value=\"6\" >6</option>       <option value=\"7\" >7</option>       <option value=\"8\" >8</option>       <option value=\"9\" >9</option>       <option value=\"10\" >10</option>       </select>     </td>"; echo "</tr>"; echo "<tr>"; echo "<td>Breed:</td>"; echo "<td><input type=\"text\" name=\"Breed\" value=\"$breed\" /></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Comments:</td>"; echo "<td><textarea name=\"Comments\" rows=\"5\" cols=\"40\">$comments</textarea></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"2\">"; echo "<div align=\"center\">"; echo "<input class=\"formbutton\" type=\"submit\" name=\"submit\" value=\"Submit\" /> <input class=\"formbutton\" type=\"reset\" name=\"Reset\" value=\"Reset\" />"; echo "</div>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</form>"; echo "</div>"; echo "</div>"; echo "<div id=\"footer\">"; echo "</div>"; echo "</body>"; echo "</html>";   exit; } if (!ereg("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$",$email)) { echo "<h2>Error</h2> <p>The e-mail address \"$email\" is not a valid e-mail address. Please edit it and try again</p>";    exit; } $email = preg_replace("([\r\n])", "", $email); $find = "[content-type|Content-Type|bcc:|cc:]"; if (preg_match($find, $first) || preg_match($find, $email) || preg_match($find, $last) || preg_match($find, $comments)) {    echo "<h1>Error</h1>\n       <p>No meta/header injections, please.</p>";    exit; } $recipient = "mikew88@gmail.com"; $subject   = "EuroDogCrates.com Quote"; $message   = "First Name: $first \n"; $message  .= "Last Name: $last \n"; $message  .= "Address: $address \n"; $message  .= "City: $city \n"; $message  .= "State: $state \n"; $message  .= "Zip Code: $zip \n"; $message  .= "Phone: $phone \n"; $message  .= "Email: $email \n"; $message  .= "Car Make: $make \n"; $message  .= "Model: $model \n"; $message  .= "Year: $year \n"; $message  .= "Single Crate: $single \n"; $message  .= "Single Crate with Drawer: $singledr \n"; $message  .= "Double Crate: $double \n"; $message  .= "Double Crate with Drawer: $doubledr \n"; $message  .= "Breed: $breed \n"; $message  .= "Comments: $comments \n"; $headers   = "From: Quote \r\n"; $headers  .= "Reply-To: $email"; if (mail($recipient,$subject,$message,$headers)) {    echo "<div class=\"inside\">";    echo "<h4><p>Mail sent successfully.</p></h4>";    echo "</div>";    } else {    echo "<div class=\"inside\">";    echo "<h4><p>Sorry, But the mail could not be sent. Please try again later.</p></h4>";    echo "</div>"; } ?> [/code]
  14. [!--quoteo(post=351525:date=Mar 3 2006, 08:22 PM:name=michaellunsford)--][div class=\'quotetop\']QUOTE(michaellunsford @ Mar 3 2006, 08:22 PM) [snapback]351525[/snapback][/div][div class=\'quotemain\'][!--quotec--] your code looks like a bunch of variable declarations, where is the email portion? [/quote] Hi sorry, I didn't post the rest because its ALOT well here it goes...: [code]$send_copy[0]="no";     $send_copy_format[0]="vert_table";     $send_copy_fields[0]="Name,Comments";     $send_copy_attachment_fields[0]="";     $copy_subject[0]="Subject of Copy Email";     $copy_intro[0]="Thanks for your inquiry, the following message has been delivered.";     $copy_from[0]="Email";     $copy_tomail_field[0]="Email"; // Result options     $header[0]="";     $footer[0]="";     $error_page[0]="";     $thanks_page[0]=""; // options to use if hidden field "config" has a value of 1 // recipient info     $charset[1]="";     $tomail[1]="";     $cc_tomail[1]="";     $bcc_tomail[1]=""; // Mail contents config     $subject[1]="";     $reply_to_field[1]="";     $reply_to_name[1]="";     $required_fields[1]="";     $required_email_fields[1]="";     $attachment_fields[1]="";     $return_ip[1]="";     $mail_intro[1]="";     $mail_fields[1]="";     $mail_type[1]="";     $mail_priority[1]=""; // Send back to sender config     $send_copy[1]="";     $send_copy_format[1]="";     $send_copy_fields[1]="";     $send_copy_attachment_fields[1]="";     $copy_subject[1]="";     $copy_intro[1]="";     $copy_from[1]="";     $copy_tomail_field[1]=""; // Result options     $header[1]="";     $footer[1]="";     $error_page[1]="";     $thanks_page[1]=""; ///////////////////////////////////////////////////////////////////////// // Don't muck around past this line unless you know what you are doing // ///////////////////////////////////////////////////////////////////////// ob_start(); $config=$_POST["config"]; $reply_to_field=$reply_to_field[$config]; $reply_to_name=$reply_to_name[$config]; $copy_tomail_field=$copy_tomail_field[$config]; if($header[$config]!="")     include($header[$config]); if($_POST["submit"] || $_POST["Submit"] || $_POST["submit_x"] || $_POST["Submit_x"]) { //////////////////////////// // begin global functions // //////////////////////////// // get visitor IP     function getIP()     {         if(getenv(HTTP_X_FORWARDED_FOR))             $user_ip=getenv("HTTP_X_FORWARDED_FOR");         else             $user_ip=getenv("REMOTE_ADDR");         return $user_ip;     } // get value of given key     function parseArray($key)     {         $array_value=$_POST[$key];         $count=1;         extract($array_value);         foreach($array_value as $part_value)         {             if($count > 1){$value.=", ";}             $value.=$part_value;             $count=$count+1;         }         return $value;     } // stripslashes and autolink url's     function parseValue($value)     {         $value=preg_replace("/(http:\/\/+.[^\s]+)/i",'<a href="\\1">\\1</a>', $value);         return $value;     } // html header if used     function htmlHeader()     {         $htmlHeader="<html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$charset[$config]."\"></head>\n<body>\n<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"600\">\n";         return $htmlHeader;     } // html footer if used     function htmlFooter()     {         $htmlFooter="</table>\n</body>\n</html>\n";         return $htmlFooter;     } // build verticle table format     function buildVertTable($fields, $intro, $to, $send_ip)     {         $message=htmlHeader();         if($intro != "")             $message.="<tr>\n<td align=\"left\" valign=\"top\" colspan=\"2\">".$intro."</td>\n</tr>\n";         $fields_check=preg_split('/,/',$fields);         $run=sizeof($fields_check);         for($i=0;$i<$run;$i++)         {             $cur_key=$fields_check[$i];             $cur_value=$_POST[$cur_key];             if(is_array($cur_value))             {                 $cur_value=parseArray($cur_key);             }             $cur_value=parseValue($cur_value);             $message.="<tr>\n<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>".$cur_key."</b></td>\n<td align=\"left\" valign=\"top\" width=\"100%\">".nl2br($cur_value)."</td>\n</tr>\n";         }         if($send_ip=="yes" && $to=="recipient")         {             $user_ip=getIP();             $message.="<tr>\n<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>Sender IP</b></td>\n<td align=\"left\" valign=\"top\" width=\"100%\">".$user_ip."</td>\n</tr>\n";         }         $message.=htmlFooter();         return $message;     } // build horizontal table format     function buildHorzTable($fields, $intro, $to, $send_ip)     {         $message=htmlHeader();         $fields_check=preg_split('/,/',$fields);         $run=sizeof($fields_check);         if($intro != "")             $message.="<tr>\n<td align=\"left\" valign=\"top\" colspan=\"".$run."\">".$intro."</td>\n</tr>\n";         $message.="<tr>\n";         for($i=0;$i<$run;$i++)         {             $cur_key=$fields_check[$i];             $message.="<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>".$cur_key."</b></td>\n";         }         if($send_ip=="yes" && $to=="recipient")             $message.="<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>Sender IP</b></td>\n";         $message.="</tr>\n";         $message.="<tr>\n";         for($i=0;$i<$run;$i++)         {             $cur_key=$fields_check[$i];             $cur_value=$_POST[$cur_key];             if(is_array($cur_value))             {                 $cur_value=parseArray($cur_key);             }             $cur_value=parseValue($cur_value);             $message.="<td align=\"left\" valign=\"top\">".nl2br($cur_value)."</td>\n";         }         $message.="</tr>\n";         $message.="<tr>\n";         if($send_ip=="yes" && $to=="recipient")         {             $user_ip=getIP();             $message.="<td align=\"left\" valign=\"top\">".$user_ip."</td>\n";         }         $message.="</tr>\n";         $message.=htmlFooter();         return $message;     } // build plain text format     function buildTextTable($fields, $intro, $to, $send_ip)     {         $message="";         if($intro != "")             $message.=$intro."\n\n";         $fields_check=preg_split('/,/',$fields);         $run=sizeof($fields_check);         for($i=0;$i<$run;$i++)         {             $cur_key=$fields_check[$i];             $cur_value=$_POST[$cur_key];             if(is_array($cur_value))             {                 $cur_value=parseArray($cur_key);             }             $cur_value=parseValue($cur_value);             $message.="".$cur_key.": ".$cur_value."\n\n";         }         if($send_ip=="yes" && $to=="recipient")         {             $user_ip=getIP();             $message.="Sender IP: ".$user_ip."\n";         }         return $message;     } // get the proper build fonction     function buildTable($format, $fields, $intro, $to, $send_ip)     {         if($format=="vert_table")             $message=buildVertTable($fields, $intro, $to, $send_ip);         else if($format=="horz_table")             $message=buildHorzTable($fields, $intro, $to, $send_ip);         else             $message=buildTextTable($fields, $intro, $to, $send_ip);         return $message;     } // referrer checking security option     function checkReferer()     {         if($check_referrer=="yes")         {             $ref_check=preg_split('/,/',$referring_domains);             $ref_run=sizeof($ref_check);             $referer=$_SERVER['HTTP_REFERER'];             $domain_chk="no";             for($i=0;$i<$ref_run;$i++)             {                 $cur_domain=$ref_check[$i];                 if(stristr($referer,$cur_domain)){$domain_chk="yes";}             }         }         else         {             $domain_chk="yes";         }         return $domain_chk;     } // checking required fields and email fields     function checkFields($text_fields, $email_fields, $reply_to_name, $reply_to_field)     {           $error_message="";           if($reply_to_name != "" && (eregi("\r",$reply_to_name) || eregi("\n",$reply_to_name)))             $error_message.="<li>A name or text field contains characters that are not allowed for security reasons.</li>\n";         if($reply_to_field != "" && (eregi("\r",$reply_to_field) || eregi("\n",$reply_to_field)))             $error_message.="<li>An email address contains characters that are not allowed for security reasons.</li>\n";         if($text_fields != "")         {             $req_check=preg_split('/,/',$text_fields);             $req_run=sizeof($req_check);             for($i=0;$i<$req_run;$i++)             {                 $cur_field_name=$req_check[$i];                 $cur_field=$_POST[$cur_field_name];                 if($cur_field=="")                 {                     $error_message.="<li>You are missing the <b>".$req_check[$i]."</b> field</li>\n";                 }             }         }         if($email_fields != "")         {             $email_check=preg_split('/,/',$email_fields);             $email_run=sizeof($email_check);             for($i=0;$i<$email_run;$i++)             {                 $cur_email_name=$email_check[$i];                 $cur_email=$_POST[$cur_email_name];                 if($cur_email=="" || !eregi("^[-a-z0-9!#$%&\'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&\'*+/=?^_`{|}~]+)*@(([a-z]([-a-z0-9]*[a-z0-9]+)?){1,63}\.)+([a-z]([-a-z0-9]*[a-z0-9]+)?){2,63}$",$cur_email))                 {                     $error_message.="<li>You are missing the <b>".$email_check[$i]."</b> field or it is not a valid email address.</li>\n";                 }             }         }         return $error_message;     } // attachment function     function getAttachments($attachment_fields, $message, $content_type, $border)     {         $att_message="This is a multi-part message in MIME format.\n\n";         $att_message.="--{$border}\n";         $att_message.=$content_type."\n";         $att_message.="Content-Transfer-Encoding: 7bit\n\n";         $att_message.=$message."\n\n";         $att_check=preg_split('/,/',$attachment_fields);         $att_run=sizeof($att_check);         for($i=0;$i<$att_run;$i++)         {             $fileatt=$_FILES[$att_check[$i]]['tmp_name'];             $fileatt_name=$_FILES[$att_check[$i]]['name'];             $fileatt_type=$_FILES[$att_check[$i]]['type'];             if (is_uploaded_file($fileatt))             {                 $file=fopen($fileatt,'rb');                 $data=fread($file,filesize($fileatt));                 fclose($file);                 $data=chunk_split(base64_encode($data));                 $att_message.="--{$border}\n";                 $att_message.="Content-Type: {$fileatt_type}; name=\"{$fileatt_name}\"\n";                 $att_message.="Content-Disposition: attachment; filename=\"{$fileatt_name}\"\n";                 $att_message.="Content-Transfer-Encoding: base64\n\n".$data."\n\n";             }         }         $att_message.="--{$border}--\n";         return $att_message;     } // function to set content type     function contentType($charset, $format)     {         if($format=="vert_table")             $content_type="Content-type: text/html; charset=\"".$charset."\"\n";         else if($format=="horz_table")             $content_type="Content-type: text/html; charset=\"".$charset."\"\n";         else             $content_type="Content-type: text/plain; charset=\"".$charset."\"\n";         return $content_type;     } ////////////////////////// // end global functions // ////////////////////////// //////////////////////////////// // begin procedural scripting // ////////////////////////////////     $domain_chk=checkReferer();     if($domain_chk=="yes")     {         $error_message=checkFields($required_fields[$config], $required_email_fields[$config], $reply_to_name[$config], $reply_to_field[$config]);         if($error_message=="")         { // build appropriate message format for recipient             $content_type=contentType($charset[$config], $mail_type[$config]);             $message=buildTable($mail_type[$config], $mail_fields[$config], $mail_intro[$config], "recipient", $return_ip[$config]); // build header data for recipient message             if($_POST[$reply_to_name]!="")                 $extra="From: ".$_POST[$reply_to_name]." <".$_POST[$reply_to_field].">\n";             else                 $extra="From: ".$_POST[$reply_to_field]."\n";             if($cc_tomail[$config]!="")                 $extra.="Cc: ".$cc_tomail[$config]."\n";             if($bcc_tomail[$config]!="")                 $extra.="Bcc: ".$bcc_tomail[$config]."\n";             $extra.="X-Priority: ".$mail_priority[$config]."\n"; // get attachments if necessary             if($attachment_fields[$config]!="")             {                 $semi_rand=md5(time());                 $border="==Multipart_Boundary_x{$semi_rand}x";                 $extra.="MIME-Version: 1.0\n";                 $extra.="Content-Type: multipart/mixed; boundary=\"{$border}\"";                 $message=getAttachments($attachment_fields[$config], $message, $content_type, $border);             }             else             {                 $extra.="MIME-Version: 1.0\n".$content_type;             } // send recipient email             mail("".$tomail[$config]."", "".stripslashes($subject[$config])."", "".stripslashes($message)."", "$extra"); // autoresponse email if necessary             if($send_copy[$config]=="yes")             { // build appropriate message format for autoresponse                 $content_type=contentType($charset[$config], $send_copy_format[$config]);                 $message=buildTable($send_copy_format[$config], $send_copy_fields[$config], $copy_intro[$config], "autoresponder", $return_ip[$config]); // build header data for autoresponse                 $copy_tomail=$_POST[$copy_tomail_field];                 $copy_extra="From: ".$copy_from[$config]."\n"; // get autoresponse  attachments if necessary                 if($send_copy_attachment_fields[$config]!="")                 {                     $semi_rand=md5(time());                     $border="==Multipart_Boundary_x{$semi_rand}x";                     $copy_extra.="MIME-Version: 1.0\n";                     $copy_extra.="Content-Type: multipart/mixed; boundary=\"{$border}\"";                     $message=getAttachments($send_copy_attachment_fields[$config], $message, $content_type, $border);                 }                 else                 {                     $copy_extra.="MIME-Version: 1.0\n".$content_type;                 } // send autoresponse email                 mail("$copy_tomail", "".$copy_subject[$config]."", "$message", "$copy_extra");             } // showing thanks pages from a successful submission             if($thanks_page[$config]=="")             {                 echo "<p>$thanks_page_title</p>\n";                 echo "<p>$thanks_page_text</p>\n";             }             else             {                 header("Location: ".$thanks_page[$config]);             }         }         else         { // entering error page options from missing required fields             if($error_page[$config]=="")             {                 echo "<p>$error_page_title</p>\n";                 echo "<ul>\n";                 echo $error_message;                 echo "</ul>\n";                 echo "<p>$error_page_text</p>\n";                         echo "</ul>\n";                   }             else             {                 header("Location: ".$error_page[$config]);             }         }     }     else     { // message if unauthorized domain trigger from referer checking option         echo "<p>Sorry, mailing request came from an unauthorized domain.</p>\n";     } ////////////////////////////// // end procedural scripting // ////////////////////////////// } else {     echo "<p>Error</p>";     echo "<p>No form data has been sent to the script</p>\n"; } if($footer[$config]!="")     include($footer[$config]); ob_end_flush(); ?> [/code]
  15. Is it even possible to put a variable in another variable? because the $phone doesn't seem to work...
  16. Hey everyone, Have a bit of a "problem" here. I have a form which has several field such as name, address...etc. now...i have a phone number field which consists of 3 fields. phone1, phone2, phone3, for area code...etc. I have a php script that sends me an email with whatever field i specify, but it doesn't have the option for such a phone field. So i did this [code] <?php       $phone = array($_POST['phone1'], $_POST['phone2'], $_POST['phone3']);      // General Variables     $check_referrer="no";     $referring_domains=""; // Default Error and Success Page Variables     $error_page_title="Error - Missed Fields";     $error_page_text="Please use your browser's back button to return to the form and complete the required fields.";       $thanks_page_title="Message Sent";     $thanks_page_text="Thanks for your inquiry"; // options to use if hidden field "config" has a value of 0 // recipient info     $charset[0]="iso-8859-1";     $tomail[0]="mikew88@gmail.com";     $cc_tomail[0]="";     $bcc_tomail[0]=""; // Mail contents config     $subject[0]="GHS Student Photography";     $reply_to_field[0]="Email";     $reply_to_name[0]="Name";     $required_fields[0]="Name,Address,$phone,City,State,Make,Model,Year,SingleQuantity,SingleDrawerQuantity,DoubleQuantity,DoubleDrawerQuantity,Breed,Comments";     $required_email_fields[0]="Email";     $attachment_fields[0]="";     $return_ip[0]="yes";     $mail_intro[0]="GHS Student Photography";     $mail_fields[0]="Name,Address,City,State,$phone,Email,Make,Model,Year,SingleQuantity,SingleDrawerQuantity,DoubleQuantity,DoubleDrawerQuantity,Breed,Comments";     $mail_type[0]="text";     $mail_priority[0]="1"; [/code] I added the upper array for each form field, so it puts em together. And in the lower section where it says $mail_fields, I added the $phone variable. But it wont send, the form tells me to fill out the "" field. yes, it just leaves the required field blank. Not sure if i can include a variable like that in that field. Any help is appreciated. btw, i previewed this code, and it replaces the "$" with "& #036;" it doesn't do that in wordpad, or notepad. Again, weird... Mike
×
×
  • 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.