Jump to content

piznac

Members
  • Posts

    261
  • Joined

  • Last visited

Everything posted by piznac

  1. I think I just need to rethink this and do my validation in the first function.
  2. well I could but its very long,.. I think I see what your saying and I dont think thats gonna be possible for me,.. as Im calling one function in one place and the other in another place: <?php $go = $_SERVER['PHP_SELF']; if (!isset($_SESSION)) { session_start(); } if(isset($_SESSION['MM_Username'])){ $user = $_SESSION['MM_Username']; } if(isset($_POST['p_name'])){ $p_name = mysql_real_escape_string(trim(stripslashes($_POST['po']))); $po = mysql_real_escape_string(trim(stripslashes($_POST['p_name']))); $add1 = mysql_real_escape_string(trim(stripslashes($_POST['add1']))); $add2 = mysql_real_escape_string(trim(stripslashes($_POST['add2']))); $city = mysql_real_escape_string(trim(stripslashes($_POST['city']))); $state = mysql_real_escape_string(trim(stripslashes($_POST['state']))); $zip = mysql_real_escape_string(trim(stripslashes($_POST['zip']))); $ship_type = mysql_real_escape_string(trim(stripslashes($_POST['ship_type']))); $date_need = mysql_real_escape_string(trim(stripslashes($_POST['n_date']))); $c_name = mysql_real_escape_string(trim(stripslashes($_POST['c_name']))); //validate our order form +=+=+= if ($p_name == "" || $add1 == "" || $city == "" ||$state == "" || $zip == "" || $ship_type == "" || $date_need == ""){ $num2 = 1;}else{ $num2 = 0;} if (isset($_POST['firm'])){ $firm = mysql_real_escape_string(trim(stripslashes($_POST['firm']))); }else{ $firm = "N";} $p_po = mysql_real_escape_string(trim(stripslashes($_POST['p_po']))); $art = mysql_real_escape_string(trim(stripslashes($_POST['art']))); $num = ""; $add_inst = mysql_real_escape_string(trim(stripslashes($_POST['add_inst']))); $comm = mysql_real_escape_string(trim(stripslashes($_POST['comments']))); require_once("/var/www/html/include/classes/ordering.inc.php"); $this = new Order(); $this->insert_data($p_name, $po, $add1, $add2, $city, $state, $zip, $ship_type, $date_need, $firm, $p_po, $art, $num, $add_inst, $comm, $c_name, $num2); if(isset($_FILES['file'])){ $filename = $_FILES['file']['name']; if(isset($_FILES['file2'])){ $filename2 = $_FILES['file2']['name'];}else{$fliename2 = "";} if(isset($_FILES['file3'])){ $filename3 = $_FILES['file3']['name'];}else{$fliename3 = "";} if(isset($_FILES['file4'])){ $filename4 = $_FILES['file4']['name'];}else{$fliename4 = "";} if(isset($_FILES['file5'])){ $filename5 = $_FILES['file5']['name'];}else{$fliename5 = "";} if(isset($_POST['c_name'])){ $c_name = $_POST['c_name'];} require_once("/var/www/html/include/classes/ordering.inc.php"); if(isset($_SESSION['num'])){ $or_num = $_SESSION['num']; } $this = new Order(); $this->upload_file($filename,$filename2,$filename3,$filename4,$filename5,$c_name,$or_num); } } if(isset($_POST['item_qty']) && !isset($_POST['kk'])){ $item_num = mysql_real_escape_string(trim(stripslashes($_POST['item_num']))); $item_desc = mysql_real_escape_string(trim(stripslashes($_POST['item_desc']))); $item_qty = mysql_real_escape_string(trim(stripslashes($_POST['item_qty']))); $emb_loc1 = mysql_real_escape_string(trim(stripslashes($_POST['emb_loc1']))); $num = mysql_real_escape_string(trim(stripslashes($_POST['num']))); $size = mysql_real_escape_string(trim(stripslashes($_POST['size']))); $artwork = mysql_real_escape_string(trim(stripslashes($_POST['artwork']))); require_once("/var/www/html/include/classes/ordering.inc.php"); $this = new Order(); $this->insert_rows($item_num,$item_desc,$item_qty,$emb_loc1,$num,$size,$artwork); }elseif(isset($_POST['item_qty']) && isset($_POST['kk'])){ $item_num = mysql_real_escape_string(trim(stripslashes($_POST['item_num']))); $item_desc = mysql_real_escape_string(trim(stripslashes($_POST['item_desc']))); $item_qty = mysql_real_escape_string(trim(stripslashes($_POST['item_qty']))); $emb_loc1 = mysql_real_escape_string(trim(stripslashes($_POST['emb_loc1']))); $num = mysql_real_escape_string(trim(stripslashes($_POST['num']))); $size = mysql_real_escape_string(trim(stripslashes($_POST['size']))); $artwork1 = mysql_real_escape_string(trim(stripslashes($_POST['artwork1']))); $emb_loc2 = mysql_real_escape_string(trim(stripslashes($_POST['emb_loc2']))); $artwork2 = mysql_real_escape_string(trim(stripslashes($_POST['artwork2']))); $emb_loc3 = mysql_real_escape_string(trim(stripslashes($_POST['emb_loc3']))); $artwork3 = mysql_real_escape_string(trim(stripslashes($_POST['artwork3']))); $emb_loc4 = mysql_real_escape_string(trim(stripslashes($_POST['emb_loc4']))); $artwork4 = mysql_real_escape_string(trim(stripslashes($_POST['artwork4']))); $emb_loc5 = mysql_real_escape_string(trim(stripslashes($_POST['emb_loc5']))); $artwork5 = mysql_real_escape_string(trim(stripslashes($_POST['artwork5']))); require_once("/var/www/html/include/classes/ordering.inc.php"); $this = new Order(); $this->insert_multi($item_num,$item_desc,$item_qty,$emb_loc1,$num,$size,$artwork1,$emb_loc2,$artwork2,$emb_loc3,$artwork3,$emb_loc4,$artwork4,$emb_loc5,$artwork5); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/nuemage_template.dwt" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Nu Emage Embroidery</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="nuemagestyles.css" rel="stylesheet" type="text/css"> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> <script type="text/javascript"> <!-- function myPopup2() { window.open( "http://www.sewnice.biz/s_po.php", "myWindow", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=190,height=112,left = 240,top = 212,status=1" ) } //--> </script> <script type="text/javascript"> <!-- function myPopup3() { window.open( "http://www.sewnice.biz/s_da.php", "myWindow2", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=190,height=200,left = 240,top = 212,status=1" ) } //--> </script> <script type="text/javascript"> <!-- function myPopup4() { window.open( "http://www.sewnice.biz/cust_logo2.php", "myWindow3", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=400,left = 240,top = 212,status=1" ) } //--> </script> <SCRIPT LANGUAGE="JavaScript" SRC="CalendarControl.js"> </SCRIPT> <link href="CalendarControl[1].css" rel="stylesheet" type="text/css" /> </head> <body bgcolor="#CCCCCC"> <table width="750" border="0" align="center" cellpadding="0" cellspacing="0" > <tr> <td colspan="8"><img src="images/top_logo.jpg" alt="Nu Emage Embroidery" width="750" height="104"></td> </tr> </table> <table width="750" border="0" align="center" bgcolor="#830000"> <tr> <td width="49"> </td> <td width="65" class="nav"> <div align="center"><a href="index.php">HOME</a></div></td> <td width="112" class="nav"> <div align="center"><a href="digitizing.php">DIGITIZING</a></div></td> <td width="97" class="nav"> <div align="center"><a href="pricing.php">PRICING</a></div></td> <td width="114" class="nav"> <div align="center"><a href="ordering.php?t=1">ORDERING</a></div></td> <td width="204" class="nav"> <div align="center"><a href="production_schedule.php?n=<?php if(isset($_SESSION['MM_Username'])){echo $user;}?>">PRODUCTION SCHEDULE</a></div></td> <td width="86" class="nav"> <div align="center"><a href="contact.php">CONTACT</a></div></td> <td width="48"> </td> </tr> </table> <!-- InstanceBeginEditable name="maincontent" --> <table width="749" height="413" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <!--DWLayoutTable--> <tr> <td height="38" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="17" height="38" valign="top"><!--DWLayoutEmptyCell--> </td> <td width="489" valign="top"><br> <?php if(isset($_SESSION['MM_Username'])){ $user = $_SESSION['MM_Username']; require_once("/var/www/html/include/classes/csv_upload.inc.php"); $this = new Csv(); $this->cust_bar($user); } ?></td> <td width="243" valign="top"><div align="center" class="orlist"> <div align="right"><a href="client.php">Log In</a> | Change Password </div> </div></td> </tr> </table></td> </tr> <tr> <td width="16" height="31" valign="top"><!--DWLayoutEmptyCell--> </td> <td width="457" valign="top" class="titles">ORDERING</td> <td width="276" valign="top"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td height="410" colspan="3" align="center" valign="top"><?php if(isset($_SESSION['num'])){$num = $_SESSION['num'];} //if is a multi location order start here if(isset($_POST['multi']) && $_POST['multi'] == "Y"){ $this = new Order(); $numb = $_POST['num']; $this->multi($numb); }else{ //if just one location start here if (!isset($_SESSION['MM_Username'])) { echo "<table align=\"center\" class=\"orlist\"><tr><td></br>You must be logged in to view the ordering system.Not a customer yet? Please <a href=\"reg.php\">register</a> to place an order</td></tr></table>"; }elseif(isset($_SESSION['MM_Username']) && !isset($num) && !isset($_POST['item_qty'])||isset($_SESSION['MM_Username']) && isset($_GET['t'])){ echo "</br> <form action=\"$go\" method=\"POST\" name=\"or\" id=\"or\" enctype=\"multipart/form-data\"> <table align=\"center\" class=\"log\" bgcolor=\"E5E5E5\" cellspacing=\"0\"> <tr> <td colspan=\"4\" bgcolor=\"830000\"> <b><font color=\"ffffff\">Step One</font></b></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Project Name:</span></td> <td><input type=\"text\" name=\"p_name\"><font color=\"ff3300\"> *</font></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> P.O.#:</span></td> <td><input type=\"text\" name=\"po\"></td> <tr> <td class=\"nav\"><span class=\"pricelist\"> Ship Address:</span></td> <td class=\"nav\"><input type=\"text\" name=\"add1\"><font color=\"ff3300\"> *</font></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Ship Address 2:</span></td> <td class=\"nav\"><input type=\"text\" name=\"add2\"></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Ship City:</span></td> <td class=\"nav\"><input type=\"text\" name=\"city\"><font color=\"ff3300\"> *</font></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Ship State:</span></td> <td class=\"nav\"><select size=\"1\" name=\"state\"> <option>Alabama</option> <option>Alaska</option> <option>Arizona</option> <option>Arkansas</option> <option>California</option> <option>Colorado</option> <option>Connecticut</option> <option>Delaware</option> <option>Florida</option> <option>Georgia</option> <option>Hawaii</option> <option>Idaho</option> <option>Illinois</option> <option>Indiana</option> <option>Iowa</option> <option>Kansas</option> <option>Kentucky</option> <option>Louisiana</option> <option>Maine</option> <option>Maryland</option> <option>Massachusetts</option> <option>Michigan</option> <option>Minnesota</option> <option>Mississippi</option> <option>Missouri</option> <option>Montana</option> <option>Nebraska</option> <option>Nevada</option> <option>New Hampshire</option> <option>New Jersey</option> <option>New Mexico</option> <option>New York</option> <option>North Carolina</option> <option>North Dakota</option> <option>Ohio</option> <option>Oklahoma</option> <option>Oregon</option> <option>Pennsylvania</option> <option>Rhode Island</option> <option>South Carolina</option> <option>South Dakota</option> <option>Tennessee</option> <option>Texas</option> <option>Utah</option> <option>Vermont</option> <option>Virginia</option> <option>Washington</option> <option>Washington, DC</option> <option>West Virginia</option> <option>Wisconsin</option> <option>Wyoming</option> </select><font color=\"ff3300\"> *</font></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Ship Zip Code:</span></td> <td class=\"nav\"><input type=\"text\" name=\"zip\"><font color=\"ff3300\"> *</font></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Method Of Shipment:</span></td> <td class=\"nav\"><select size=\"1\" name=\"ship_type\"> <option>UPS Ground</option> <option>UPS Next Day Air Early AM</option> <option>UPS Next Day Air</option> <option>UPS Next Day Air Saver</option> <option>UPS 2nd Day Air Early AM</option> <option>UPS 2nd Day Air</option> <option>UPS 3 Day Select</option> <option>Customer Pick Up</option> <option>Courier</option> </select><font color=\"ff3300\"> *</font></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Date Needed:</span></td> <td class=\"nav\"><input type=\"text\" name=\"n_date\" onfocus=\"showCalendarControl(this);\"><font color=\"ff3300\"> *</font></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Firm For Event:</span></td> <td><input type=\"checkbox\" name=\"firm\" value=\"Y\"></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Previous P.O.#:</span></td> <td><input type=\"text\" name=\"p_po\"></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Artwork Filename:</span></td> <td><input type=\"text\" name=\"art\"></td> </tr> <tr valign=\"top\"> <td class=\"nav\"><span class=\"pricelist\" > Comments:</span></td> <td><textarea name=\"comments\"></textarea></td> </tr> <tr valign=\"top\"> <td class=\"nav\"><span class=\"pricelist\" > Additional Instructions:</span></td> <td><textarea name=\"add_inst\"></textarea></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\"> Multiple Logo Locations:</span></td> <td><input type=\"checkbox\" name=\"multi\" value=\"Y\"></td> </tr> <tr> <td class=\"nav\"><span class=\"pricelist\" > Estimated number of \"types\" of items:</span></td> <td><select size=\"1\" name=\"num\"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>20</option> <option>21</option> <option>22</option> <option>23</option> <option>24</option> <option>25</option> <option>26</option> <option>27</option> <option>28</option> <option>29</option> <option>30</option> <option>31</option> <option>32</option> <option>33</option> <option>34</option> <option>35</option> <option>36</option> <option>37</option> <option>38</option> <option>39</option> <option>40</option> <option>41</option> <option>42</option> <option>43</option> <option>44</option> <option>45</option> <option>46</option> <option>47</option> <option>48</option> <option>49</option> <option>50</option> </select> </tr> <tr><td colspan=\"3\" bgcolor=\"830000\"><font color=\"ffffff\"> <b>Upload Logo</b></font></td></tr> <tr><td class=\"nav\" colspan=\"3\"><span class=\"pricelist\"> Upload Logo File:</span></td></tr> <tr><td colspan=\"2\"><input type=\"file\" name=\"file\"></td></tr> <tr> <tr><td colspan=\"2\"><input type=\"file\" name=\"file2\"></td></tr> <tr> <tr><td colspan=\"2\"><input type=\"file\" name=\"file3\"></td></tr> <tr> <tr><td colspan=\"2\"><input type=\"file\" name=\"file4\"></td></tr> <tr> <tr><td colspan=\"2\"><input type=\"file\" name=\"file5\"></td></tr> <tr><td><input type=\"hidden\" name=\"c_name\" value=\"$_SESSION[MM_Username]\"> <tr> <td colspan=\"2\"><span class=\"pricelist\" ><font color=\"ff3300\"> * Required Fields</font></span></td></tr><tr> <td colspan=\"2\" align=\"center\"><INPUT type=\"submit\" value=\"Order 2nd Step>>\"></td> </tr> </table> </form> ";}elseif(!isset($_POST['item_qty']) && isset($num) && isset($_POST['num'])){ require_once("/var/www/html/include/classes/ordering.inc.php"); $this = new Order(); $numb = $_POST['num']; $this->rows($numb); }elseif(isset($_POST['num2']) && $_POST['num2'] >= 1){ require_once("/var/www/html/include/classes/ordering.inc.php"); $this = new Order(); $num = $_SESSION['num']; $this->display($num); $numb = $_POST['num2']; echo "</br>"; $this->rows($numb); }else{ echo "Your order has been submitted. Thank you, we will contact you if there are any problems. If you would like to place another order please <a href=\"ordering.php?t=1\">click here</a>"; require_once("/var/www/html/include/classes/ordering.inc.php"); $this = new Order(); $num = $_SESSION['num']; $this->email_data($num); $this->display_results($num); } } ?> <p> </p> <p> </p></td> </tr> </table> <!-- InstanceEndEditable --> <table width="750" border="0" align="center" cellpadding="4" cellspacing="0" class="footer"> <!--DWLayoutTable--> <tr> <td width="65"></td> <td width="60" valign="middle"><div align="right"><a href="home.php">HOME</a></div></td> <td width="5" valign="middle">|</td> <td width="80" valign="middle"><div align="center"><a href="digitizing.php">DIGITIZING</a></div></td> <td width="5" valign="middle">|</td> <td width="64" valign="middle"><div align="center"><a href="pricing.php">PRICING</a></div></td> <td width="5" valign="middle">|</td> <td width="80" valign="middle"><div align="center"><a href="ordering.php?t=1">ORDERING</a></div></td> <td width="5" valign="middle">|</td> <td width="148" valign="middle"><div align="center"><a href="production_schedule.php?n=<?php if(isset($_SESSION['MM_Username'])){echo $user;}?>">PRODUCTION SCHEDULE</a></div></td> <td width="5" valign="middle">|</td> <td width="77" valign="middle"><div align="left"><a href="contact.php">CONTACT</a></div></td> <td width="65"></td> </tr> <tr> <td class="copyright" height="20" colspan="13"><div align="center">2005 © Nu Emage Embroidery, Inc. All Rights Reserved</div></td> </tr> </table> </body> <!-- InstanceEnd --></html> Sorry if this is all junked up.
  3. Wait so your saying I would have to call the orginal function again?
  4. Yeah that worked,.. and sorry if Im a bit slow,.. but can you see why mine is not working. It seems to be the same.
  5. Ok but what if your trying to use the var in the next function,... class example { public $num2; public function foo() { $this->num2 = '100'; } public function shownum2() { // $this->num2 is accessible from here too! if($this->num2 == 100){ echo $this->num2; } } }
  6. Yeah just saw that myself,.. removed it and same. Can the var be assigned in one function and maintain that throughout other functions,.. or will it default back to var $num3? Like in your example,.. would echo $this->num2; return 100?
  7. Ok well Im not getting an error now ,.. but the if statement is not working,.. and the var $num2 is set to one cause I echo'd it. In the first function I assigned $this->num3 = $num2;,.. so it should be set to the same as the $num2 var correct? Which the $num2 var is set to 1.... <?php //start class class Order{ var $num3; //upload order data function function insert_data($p_name, $po, $add1, $add2, $city, $state, $zip, $ship_type, $date_need, $firm, $p_po, $art, $num, $add_inst, $comm, $c_name,$num2){ $in = "INSERT INTO `c_order` (`p_name`, `po`, `add1`, `add2`, `city`, `state`, `zip`, `ship_type`, `date_need`, `firm`, `p_po`, `art`, `num`, `add_inst`, `comm`, `c_name`) VALUES ('$p_name', '$po', '$add1', '$add2', '$city', '$state', '$zip', '$ship_type', '$date_need', '$firm', '$p_po', '$art', NULL, '$add_inst', '$comm', '$c_name')"; $in_query = mysql_query($in) or die ("Insert Data Error:". mysql_error()); $num = mysql_insert_id(); //put into session $_SESSION["num"] = $num; echo $num2; $this->num3 = $num2; } //register new customer function function reg_user($b_name, $c_name, $add1, $add2, $city, $state, $zip, $phone, $fax, $email, $pass, $pass2){ require_once('/var/www/html/include/conn/sew.php'); if($pass != $pass2){ echo "The two password entered do not match, please <a href=\"\">try again</a>"; }else{ $reg = "INSERT INTO `user` (`name`, `pass`, `stat`, `num`, `c_name`, `add1`, `add2`, `city`, `state`, `zip`, `phone`, `fax`, `email`) VALUES ('$b_name', '$pass', 'NA', 'NULL', '$c_name', '$add1', '$add2', '$city', '$state', '$zip', '$phone', '$fax', '$email')"; $order_reg = mysql_query($reg) or die ("Register query error:" . mysql_error()); $_SESSION['MM_Username'] = $b_name; header('Location: http://sewnice.biz/ordering.php'); } } //how many order rows function function rows($numb){ $this = new Order(); if($this->num3 == "1"){ echo "One or more of the required fields was not filled out. Please go <a href=\"http://sewnice.biz/ordering.php?t=1\">back</a> to correct this."; }else{ echo "<form action=\"$_SERVER[php_SELF]\" method=\"POST\" name=\"or2\" id=\"or2\"><table border=\"0\" class=\"log\" cellspacing=\"0\" bgcolor=\"E5E5E5\" name=\"main\"> <tr> ?> I guess its simply not holding the value of what I assigned to it in the first function.
  8. That would give me the impression that the $results field is not being pulled right. With you saying that I assume there is a url in the db field. Can you give me an example of a url in the field?
  9. echo "<a href=\"$results[url]\">My Link</a>"; Does that work?
  10. May not be the best way,.. but it works <?php $copyright = "<span class=\"smallwhite\">©" . date("Y") . "Stone Island Records </span>"; echo $copyright; ?>
  11. you would need to compare the number of fields in both the csv and the db. Make sure they are exact.
  12. The field count in your csv does not match up to the database field count. It might not be putting a comma in the last field.
  13. Well I don't have a clue what the error is,. but just out of curiosity is that a reef tank you have?.. I have one myself ,... prehaps you can share this progy your working on?
  14. Confused is hardly the word,. lol. Im getting a var sent to one function. Which I need to use in another function within a class. This is doable right? The var can be seen in the first function under the name $num2,.. and then I try to use it again under the rows function,.. I will attempt to highlight this var in black....Thanks! Yeah that didnt seem to work,. so just look for "this var==" <?php //start class class Order{ //upload order data function function insert_data($p_name, $po, $add1, $add2, $city, $state, $zip, $ship_type, $date_need, $firm, $p_po, $art, $num, $add_inst, $comm, $c_name,//this var===$num2){ $in = "INSERT INTO `c_order` (`p_name`, `po`, `add1`, `add2`, `city`, `state`, `zip`, `ship_type`, `date_need`, `firm`, `p_po`, `art`, `num`, `add_inst`, `comm`, `c_name`) VALUES ('$p_name', '$po', '$add1', '$add2', '$city', '$state', '$zip', '$ship_type', '$date_need', '$firm', '$p_po', '$art', NULL, '$add_inst', '$comm', '$c_name')"; $in_query = mysql_query($in) or die ("Insert Data Error:". mysql_error()); $num = mysql_insert_id(); //put into session $_SESSION["num"] = $num; $num2 = $num2; } //register new customer function function reg_user($b_name, $c_name, $add1, $add2, $city, $state, $zip, $phone, $fax, $email, $pass, $pass2){ require_once('/var/www/html/include/conn/sew.php'); if($pass != $pass2){ echo "The two password entered do not match, please <a href=\"\">try again</a>"; }else{ $reg = "INSERT INTO `user` (`name`, `pass`, `stat`, `num`, `c_name`, `add1`, `add2`, `city`, `state`, `zip`, `phone`, `fax`, `email`) VALUES ('$b_name', '$pass', 'NA', 'NULL', '$c_name', '$add1', '$add2', '$city', '$state', '$zip', '$phone', '$fax', '$email')"; $order_reg = mysql_query($reg) or die ("Register query error:" . mysql_error()); $_SESSION['MM_Username'] = $b_name; header('Location: http://sewnice.biz/ordering.php'); } } //how many order rows function function rows($numb){ if(//this var===$this->num2 == 1){ echo "One or more of the required fields was not filled out. Please go <a href=\"http://sewnice.biz/ordering.php\"> <<back </a> to correct this."; }else{ echo "<form action=\"$_SERVER[php_SELF]\" method=\"POST\" name=\"or2\" id=\"or2\"><table border=\"0\" class=\"log\" cellspacing=\"0\" bgcolor=\"E5E5E5\" name=\"main\"> <tr> <td class=\"nav\" bgcolor=\"#830000\"><span class=\"pricelist\"><font color=\"ffffff\"> Item #</font></span></td> <td class=\"nav\" bgcolor=\"#830000\"><span class=\"pricelist\"><font color=\"ffffff\"> Item Description</font></span></td> <td class=\"nav\" bgcolor=\"#830000\"><span class=\"pricelist\"><font color=\"ffffff\"> Quanity</font></span></td> <td class=\"nav\" bgcolor=\"#830000\"><span class=\"pricelist\"><font color=\"ffffff\"> Size</font></span></td> <td class=\"nav\" bgcolor=\"#830000\"><span class=\"pricelist\"><font color=\"ffffff\"> Emb Location</font></span></td> <td class=\"nav\" bgcolor=\"#830000\"><span class=\"pricelist\"><font color=\"ffffff\"> Artwork</font></span></td> <td class=\"nav\" bgcolor=\"#830000\"></td> </tr>"; for($i=0; $i<$numb; $i++){ ?>
  15. When you say all fields this implies to me that there are more then one? Yeah Im a bit confused on what your asking. If you just need to check the fiield and make sure it is set to complete. Just pull a query on that table and do this: if($row['status'] == "Complete"){ echo "Complete"; }else{ echo "Not Complete"; } Sorry if that is way off,..
  16. Ahh the perverbial lightbulb comes on ,.. ok I think I get it now. Again thanks. Im not going to post the finished code as there is way to much that has nothing to do with this. But yeah this works!
  17. Ok now Im really confused. How would I define my variable then? Like $sort which would come from the link: <a href=\"$_SERVER[php_SELF]?order=or_date&n=$SESSION[MM_Username]&$sort=ASC\">Order Date$pos</a> So like this the results will always be DESC because the $sort var is always ASC. See what Im saying?
  18. Thats funny,. becuase thats exactly what I came up with. I just figured it had to be more complicated then that lol. I'll continue with that and see what I get. Thanks for the help Thorpe
  19. Ok yes,. I have that. Now what if I wanted to also sort by ASC or DESC. Like if it is sorted by column A upon clicking the link by that column and by ASC. Then when clicking the link again it would be sorted by the column and by DESC. <?php if (isset($_GET['order'])) { $order = mysql_real_escape_string($_GET['order']); $sort = mysql_real_escape_string($_GET['sort']); $sql = "SELECT fld FROM tbl ORDER BY $order $sort"; } ?> Sort being either ASC or DESC depending on how many times the link is clicked or the sort in the first place. I hope this makes sense and sorry if Im over confusing it.
  20. Ok but if I wanted to change the ASC or DESC by a URL variable. How would I go about that.
  21. Im not sure where the error is coming from. But I would suggest everytime you run a "mysql_query" you also and "mysql_query($yourquery) or die ("this query error" . mysql_error())" or something like that to let you know if your queries are running fine. There could be a problem with your queries. It might not be that, but I feel its an very good practice.
  22. OK I did some searching on this and between being lazy and not really seeing an answer here I am Ive got some mysql results,.. and I have wrote a simple script to sort them by column headers. Little link and url var to tell the sql which way to sort. My problem is how to I go about assigning ASC or DESC? Now that seemed real simple to me,. but then the question came up. How is it sorted in the first place? If I could find out how it is sorted then it would be fairly simple to do an if statement to change the var in the ORDER BY clause. Anyone know how to tell which way the results are sorted to begin with?
  23. Set the value of the checkbox to 1 & the name to "check" (or whatever) then: if($_POST['check'] == "1"){ echo "Do Something"; }
  24. not a clue what you are asking. You might want to try rephrasing that.
×
×
  • 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.