Jump to content

Craptacular

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by Craptacular

  1. It was a stupid DB issue. The script wasn't breaking anything. Thanks for all the help and suggestions for cleaning this feature up!
  2. Here are some updated files. I haven't applied the edits suggested yet but have reduced the extra lines of code by keeping only the relevant code in the files. Thanks for having a look! shippingQuote.php reply.php single.php
  3. Okay. But when I put the debugging code in there, nothing happens so it should be populating the DB. Hmmm. Well thanks for all the work and help with getting this thing looking less cluttered and running more efficiently!
  4. Hey guys, So I am adding to an already existing Shipping quote form and backend reply system. I basically just added one new item, tested if it was working on the front and backend (which it was), and then proceeded to add the other new items. BUT for some reason the database is not being populated. HOWEVER when the automated email is sent after the customer asks for a quote via this system, it shows all the correct information, but yet the database isn't showing anything, and the backend reply system doesn't show that they selected an item to get a quote on (if they select one, or all of the 6 new items). I know it's something silly I'm missing, but I am just not seeing it, and I have spent at least two days trying to find the issue! PLEASE HELP me! Thanks so much! (Sorry it's so much code in this post, I wanted to make sure I included it all so you can see what's all going on. I am only having issues with the Gun Vault Products GV2000S, GVB2000, GV3000, GVB3000, NV300, BB3000, the rest of the items work perfectly. I have attached the scripts.) So here is the HTML: <div class="gunvaults" style="float: left; margin-bottom: 1em;"> <!--BEGIN GUN VAULTS--> <h4 style="font-weight: bold; text-decoration: underline; margin-left: 1em;">Gun Vault Products</h4> <div class="ship-wrap"> <div class="checkbox"><label for="sv500"><input type="checkbox" name="sv500" id="sv500" /> Model SV500</label></div> <div id="quantity-21" class="quantity"><label for="quantity-sv500">Quantity: </label> <select name="quantity-sv500" id="quantity-sv500"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="svb500"><input type="checkbox" name="svb500" id="svb500" /> Model SVB500</label></div> <div id="quantity-22" class="quantity"><label for="quantity-svb500">Quantity: </label> <select name="quantity-svb500" id="quantity-svb500"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="gv1000s"><input type="checkbox" name="gv1000s" id="gv1000s" /> Model GV1000S</label></div> <div id="quantity-23" class="quantity"><label for="quantity-gv1000s">Quantity: </label> <select name="quantity-gv1000s" id="quantity-gv1000s"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="gv1000d"><input type="checkbox" name="gv1000d" id="gv1000d" /> Model GV1000D</label></div> <div id="quantity-24" class="quantity"><label for="quantity-gv1000d">Quantity: </label> <select name="quantity-gv1000d" id="quantity-gv1000d"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="gv2000s"><input type="checkbox" name="gv2000s" id="gv2000s" /> Model GV2000S</label></div> <div id="quantity-25" class="quantity"><label for="quantity-gv2000s">Quantity: </label> <select name="quantity-gv2000s" id="quantity-gv2000s"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="gvb2000"><input type="checkbox" name="gvb2000" id="gvb2000" /> Model GVB2000</label></div> <div id="quantity-26" class="quantity"><label for="quantity-gvb2000">Quantity: </label> <select name="quantity-gvb2000" id="quantity-gvb2000"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="gv3000s"><input type="checkbox" name="gv3000s" id="gv3000s" /> Model GV3000S</label></div> <div id="quantity-27" class="quantity"><label for="quantity-gv3000s">Quantity: </label> <select name="quantity-gv3000s" id="quantity-gv3000s"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="gvb3000"><input type="checkbox" name="gvb3000" id="gvb3000" /> Model GVB3000</label></div> <div id="quantity-28" class="quantity"><label for="quantity-gvb3000">Quantity: </label> <select name="quantity-gvb3000" id="quantity-gvb3000"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="nv300"><input type="checkbox" name="nv300" id="nv300" /> Model NV300</label></div> <div id="quantity-29" class="quantity"><label for="quantity-nv300">Quantity: </label> <select name="quantity-nv300" id="quantity-nv300"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="bb3000"><input type="checkbox" name="bb3000" id="bb3000" /> Model BB3000</label></div> <div id="quantity-30" class="quantity"><label for="quantity-bb3000">Quantity: </label> <select name="quantity-bb3000" id="quantity-bb3000"> <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> </select></div> </div> </div><!--/gun vaults--> </div><!--/shipping models--> The script that talks with the HTML shipping form (the above html) is called shippingQuote.php, and the script for displaying the requested items (the backend quoting system) and the backend replying area is called single.php and then the reply script after the quote is complete is called reply.php. (Now the following scripts have ALL products included, but I am only having issues with the Gun Vault Products: GV2000S, GVB2000, GV3000, GVB3000, NV300, BB3000). shippingQuote.php single.php reply.php
  5. Yeah... I was retarded and pasted the code twice. I am uploading the updated files now. Derp on me! It's been a long few days!
  6. Thanks you Psycho and mac_gyver. I inherited this code and haven't gotten around to the simplification you are talking about, because I totally agree!
  7. Hey guys, So I am adding to an already existing Shipping quote form and backend reply system. I basically just added one new item, tested if it was working on the front and backend (which it was), and then proceeded to add the other new items. BUT for some reason the database is not being populated. HOWEVER when the automated email is sent after the customer asks for a quote via this system, it shows all the correct information, but yet the database isn't showing anything, and the backend reply system doesn't show that they selected an item to get a quote on (if they select one, or all of the 6 new items). I know it's something silly I'm missing, but I am just not seeing it, and I have spent at least two days trying to find the issue! PLEASE HELP me! Thanks so much! (Sorry it's so much code in this post, I wanted to make sure I included it all so you can see what's all going on. I am only having issues with the Gun Vault Products GV2000S, GVB2000, GV3000, GVB3000, NV300, BB3000, the rest of the items work perfectly. I have attached the scripts.) So here is the HTML: <div class="ship-wrap"> <div class="checkbox"><label for="gv2000s"><input type="checkbox" name="gv2000s" id="gv2000s" /> Model GV2000S</label></div> <div id="quantity-25" class="quantity"><label for="quantity-gv2000s">Quantity: </label> <select name="quantity-gv2000s" id="quantity-gv2000s"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="gvb2000"><input type="checkbox" name="gvb2000" id="gvb2000" /> Model GVB2000</label></div> <div id="quantity-26" class="quantity"><label for="quantity-gvb2000">Quantity: </label> <select name="quantity-gvb2000" id="quantity-gvb2000"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="gv3000s"><input type="checkbox" name="gv3000s" id="gv3000s" /> Model GV3000S</label></div> <div id="quantity-27" class="quantity"><label for="quantity-gv3000s">Quantity: </label> <select name="quantity-gv3000s" id="quantity-gv3000s"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="gvb3000"><input type="checkbox" name="gvb3000" id="gvb3000" /> Model GVB3000</label></div> <div id="quantity-28" class="quantity"><label for="quantity-gvb3000">Quantity: </label> <select name="quantity-gvb3000" id="quantity-gvb3000"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="nv300"><input type="checkbox" name="nv300" id="nv300" /> Model NV300</label></div> <div id="quantity-29" class="quantity"><label for="quantity-nv300">Quantity: </label> <select name="quantity-nv300" id="quantity-nv300"> <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> </select></div> </div> <div class="ship-wrap"> <div class="checkbox"><label for="bb3000"><input type="checkbox" name="bb3000" id="bb3000" /> Model BB3000</label></div> <div id="quantity-30" class="quantity"><label for="quantity-bb3000">Quantity: </label> <select name="quantity-bb3000" id="quantity-bb3000"> <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> </select></div> The script that talks with the shipping form (the above html) is called single.php and the script for displaying the requested items (the backend quoting system) is called reply.php. (Now the following scripts have ALL products included, but I am only having issues with the Gun Vault Products: GV2000S, GVB2000, GV3000, GVB3000, NV300, BB3000). single.php reply.php
  8. Hey! Thanks! I am downloading it now so I can start playing!
  9. I know it's a lot, but I wanted to make sure everyone had the required information to maybe see what I'm doing. Thanks for the response! The problem with debugging is that it just says it's empty but the data is in the database.
  10. Thanks for the response. Yes all of the information is populating in the database. The weird thing is is that the first part: $model = "Shipping quote for $qt8e of Model T8-E.<br />"; is bringing all of the quantity and model and displaying it (left side of the page in the first image). But the second part of that part of the script: $model_quote = printInvoice("Residential - Curbside/Garage", "T8-E", 399, $qt8e, $t8e_quote_residence, $total); $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business1, $total); $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business, $total); $model_quote = $model_quote . printInvoice("Truck Terminal*", "T8-E", 399, $qt8e, $t8e_quote_terminal, $total); $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8-E", 399, $qt8e, 0.01, $total); $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>"; isn't displaying the same data. That's what I don't get. Thanks for the help, though! (right side in the first image)
  11. I have a shipping quote form that is adding information to a database just fine. Then on the back end I have a reply system for the employees to give the shipping quote. This is where I am having issues. The first part works and shows the replier the users contact info and requested product and quantity wanted, but the second part for the quoting doesn't show any of the form for quoting and says that the user didn't select a model or quantity. (Image included) I can't seem to figure out why. And the weird part is that all the other ones work for the other products, just fine... Any ideas. Oh andthe information from the user does show up in the database. The issue is with the t8e. Any help would be appreciated. Thanks! This is what the outcome for the T8-E is in the quoting system: This is what it's supposed to look like: require('config.php'); // from the form newest version $id = trim(strip_tags($_POST['reply-id'])); $status = trim(strip_tags($_POST['status'])); //SERIES T8 $t8_quote_terminal = trim(strip_tags($_POST['t8-quote-terminal'])); $t8_quote_business = trim(strip_tags($_POST['t8-quote-business'])); $t8_quote_business1 = trim(strip_tags($_POST['t8-quote-business1'])); $t8_quote_residence = trim(strip_tags($_POST['t8-quote-residence'])); $t8e_quote_terminal = trim(strip_tags($_POST['t8e-quote-terminal']));//This is the product having issues $t8e_quote_business = trim(strip_tags($_POST['t8e-quote-business'])); $t8e_quote_business1 = trim(strip_tags($_POST['t8e-quote-business1'])); $t8e_quote_residence = trim(strip_tags($_POST['t8e-quote-residence'])); //SERIES T14 $t14_quote_terminal = trim(strip_tags($_POST['t14-quote-terminal'])); $t14_quote_business = trim(strip_tags($_POST['t14-quote-business'])); $t14_quote_business1 = trim(strip_tags($_POST['t14-quote-business1'])); $t14_quote_residence = trim(strip_tags($_POST['t14-quote-residence'])); $ups = $_POST['ups']; $conway = $_POST['conway']; $yrc = $_POST['yrc']; $reddaway = $_POST['reddaway']; $terminal_name = trim(strip_tags($_POST['terminal_name'])); $terminal_location = trim(strip_tags($_POST['terminal_location'])); $estimated_time = trim(strip_tags($_POST['estimated_time'])); $replier = trim(strip_tags($_POST['replier'])); $reply_comments = trim(strip_tags($_POST['reply_comments'])); //Functions function printInvoice($shipping_method, $model, $model_price, $qty, $shipping_amount, $total) { $shipping_amount = str_replace("$", "", $shipping_amount); settype($shipping_amount, "float"); if (empty($shipping_amount)) { return false; } if ($shipping_amount === 0.01) { $shipping_amount = 0; } settype($qty, "integer"); $total = $shipping_amount+($model_price*$qty); settype($total, "float"); return "<tr><td>".$model."</td><td>".$shipping_method."</td><td>$".$model_price."</td><td>".$qty."</td><td>$".$shipping_amount."</td><td>$".$total."</td></tr>"; } $invoice_header = "<table cellpadding=\"8\" class=\"invoice\"><tr><th><b>Model</b></th><th><b>Delivery Method</b></th><th><b>Price</b></th><th><b>Qty</b></th><th><b>Shipping</b></th><th><b>Total</b></th></tr>"; date_default_timezone_set('America/Los_Angeles'); $the_date = date("g:ia, F j, Y"); $reply_date = date("F j, Y"); // Connect to Database to store information $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); if (mysqli_connect_errno()) { printf("Connect Failed: %s\n", mysqli_connect_error()); } else { $query = "SELECT * FROM tracker WHERE ID = $id"; $fullres = mysqli_query($mysqli, $query); $newArray = mysqli_fetch_array($fullres, MYSQL_ASSOC); $name = $newArray['Name']; $email = $newArray['Email']; $address = $newArray['Address']; $city = $newArray['City']; $state = $newArray['State']; $zip = $newArray['Zip']; $telephone = $newArray['Telephone']; $source = $newArray['Source']; //SERIES T8 $t8 = $newArray['t8']; $qt8 = $newArray['QT8']; $t8e = $newArray['t8e']; $qt8e = $newArray['QT8e']; //SERIES T14 $t14 = $newArray['t14']; $qt14 = $newArray['QT14']; $local = $newArray['LocalPickup']; $terminal = $newArray['Terminal']; $business1 = $newArray['Business1']; $business2 = $newArray['Business2']; $curbside = $newArray['Curbside']; $comments = $newArray['Comments']; $reply = $newArray['Reply']; $date = $newArray['Date']; mysqli_close($mysqli); } $model = ""; $model_quote = ""; //Begin Quote form //SERIES T8 if (!empty($t8e)) {$model = "Shipping quote for $qt8e of Model T8-E.<br />"; $model_quote = printInvoice("Residential - Curbside/Garage", "T8-E", 399, $qt8e, $t8e_quote_residence, $total); $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business1, $total); $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business, $total); $model_quote = $model_quote . printInvoice("Truck Terminal*", "T8-E", 399, $qt8e, $t8e_quote_terminal, $total); $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8-E", 399, $qt8e, 0.01, $total); $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>"; } if (!empty($t8)) {$model = "Shipping quote for $qt8 of Model T8.<br />";//This part works, the rest for this part of the script for the t8e does not work $model_quote = printInvoice("Residential - Curbside/Garage", "T8", 399, $qt8, $t8_quote_residence, $total); $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8", 399, $qt8, $t8_quote_business1, $total); $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8", 399, $qt8, $t8_quote_business, $total); $model_quote = $model_quote . printInvoice("Truck Terminal*", "T8", 399, $qt8, $t8_quote_terminal, $total); $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8", 399, $qt8, 0.01, $total); $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>"; } //SERIES T14 if (!empty($t14)) {$model = $model . "Shipping quote for $qt14 of Model T14.<br />"; $model_quote = $model_quote . printInvoice("Residential - Curbside/Garage", "T14", 479, $qt14, $t14_quote_residence, $total); $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T14", 479, $qt14, $t14_quote_business1, $total); $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T14", 479, $qt14, $t14_quote_business, $total); $model_quote = $model_quote . printInvoice("Truck Terminal*", "T14", 479, $qt14, $t14_quote_terminal, $total); $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T14", 479, $qt14, 0.01, $total); $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>"; } if ($model == "") {$model = "$name did not specify a model or quantity.<br />";} $model_quote = $model_quote . "</table>"; $shipping = ""; if (!empty($local)) {$shipping = "<br />Local Pickup";} if (!empty($terminal)) {$shipping = $shipping . "<br />Terminal Pickup";} if (!empty($business1)) {$shipping = $shipping . "<br />Business Delivery (Lift Gate Not Required)";} if (!empty($business2)) {$shipping = $shipping . "<br />Business Delivery (Lift Gate Required)";} if (!empty($curbside)) {$shipping = $shipping . "<br />Residential Delivery (Curbside)";} if (!empty($house)) {$shipping = $shipping . "<br />In-House Delivery";} if ($shipping == "") {$shipping = "<br />No Shipping Method Selected.";} if ($terminal_name !== "" && $terminal_location !== "") { $terminal_info = "<p>*The quoted terminal price is for the $terminal_name terminal in $terminal_location.</p>"; } else { $terminal_info = ""; }
  12. YEP! I was wrong... Tablesorter works perfectly. I got it working. It wasn't working because I was rushing to get it done, (on a Friday) and called the js before I included the librairies! Der! My bad guys. Thanks for the replies, folks!
  13. Hi, I am trying to make my search results table sortable. The content is obviously dynamic, so how would I do this? Tablesorter.js does not work… I am using CodeIgniter... Any help would be fantastic! Thanks
  14. Hi guys, I am trying to have unique meta tags for each page. So far, this code is only loading the DEFAULT meta tags, and I just can’t see why it isn’t working with my individual pages with their unique meta content. I have my header.php with this code directly after the opening head tag: <?php if(!isset($meta)) { $meta = array( array('name'=>'description', 'content'=>'A short but sweet DEFAULT description of this fine site'), array('name' =>'keywords', 'content'=>'some awesome DEFAULT keywords for those rascally web crawlers') ); } ?> <?php $this->load->helper('html'); ?> more php here..... ..... ..... ..... <title> ... </title> <link rel="shortcut icon" type="image/x-icon" href="img/fav.ico"> <meta charset="UTF-8" /> <!--This is where I am calling the meta function--> <?php echo meta($meta);?> More php and html goes here... And then this is what I am putting in all of my pages (except for my header.php, of course!), before I include the header: <?php $meta = array( array('name'=>'description', 'content'=>'Another short but sweet description'), array('name' =>'keywords', 'content'=>'Mmmmm. Yummy keywords for you to savor') ); $this->load->view('includes/header'); ?> html stuff goes here Any thoughts, or ideas on this matter, please? Thanks so much!
  15. Got it figured out! Thanks everyone!
  16. I have updated my code to: delete_user.php: <?php require('config.php'); // Connect to Database to store information $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAMETWO); $names = mysqli_real_escape_string($mysqli, $_POST['name']); if (mysqli_connect_errno()) { printf("Connect Failed: %s\n", mysqli_connect_error()); } else { $sql = "DELETE FROM users WHERE name = '$names' "; $res = mysqli_query($mysqli, $sql); echo "$names has been deleted!<br />"; echo "<a href=\"add_delete_users.php\">Go back to Manage more users</a><br /> <a href=\"index.php?&status=\">Go back to the main page</a><br />"; mysqli_close($mysqli); } // End Database interactions ?> and add_delete_users.php to: <?php require('config.php'); $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAMETWO); if (mysqli_connect_errno()) { die("Connection Failed"); } if (isset($_GET['pageno'])) { $pageno = $_GET['pageno']; } else { $pageno = 1; } // if ?> <!DOCTYPE html> <html> <head> <title>Manage Users</title> <link type="text/css" rel="stylesheet" href="/css/layout.css" /> <link type="text/css" rel="stylesheet" href="/css/admin.css" /> <!--[if lte IE 7]><link rel="stylesheet" href="/css/adminie7.css" type="text/css" media="screen" /><![endif]--> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="/js/contentArea.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#content .row:odd').addClass('odd'); $('#content .row:even').addClass('even'); }); </script> </head> <body id="index"> <div class="container-12"> <h1>Manage Users</h1> <div id="content"> <ul id="statuses"> <li <?php if ($status === "") {echo "class=\"current_page\"";}?>><a href="index.php?&status=" id="nav-new">New</a></li> <li <?php if ($status === "assigned") {echo "class=\"current_page\"";}?>><a href="index.php?&status=assigned" id="nav-assigned">Assigned</a></li> <li <?php if ($status === "completed") {echo "class=\"current_page\"";}?>><a href="index.php?&status=completed" id="nav-completed">Completed</a></li> <li><a href="bought.php">Bought</a></li> <li class="current_page"><a href="add_delete_users.php">Users</a></li> </ul> <div class="clear"></div> <?php $sql = "SELECT name FROM users WHERE (user_id <= '3' OR user_id >= '12')"; $result = mysqli_query($mysqli, $sql) or trigger_error("SQL", E_USER_ERROR); while ($row = mysqli_fetch_array($result)) { $name = $row['name']; $options.="<OPTION VALUE=". $name .">". $name ."</option>"; } //This is the delete user form echo"<lable><strong>Delete User</strong></lable><form class=\"delete-form\" method=\"post\" action=\"delete_user.php\"><select name=\"name\" id=\"name\">\n" . $options . "</select> <input type=\"submit\" value=\"&#45; Delete User\" /></form><br /><br />"; //This is the add form echo"<lable><strong>Add User</strong></lable><form class=\"add-form\" method=\"post\" action=\"add_user.php\"> <input type=\"hidden\" name=\"user_id\" value=\"\" /><br /> <lable for=\"user_name\">User Name: </lable><input type=\"text\" name=\"user_name\" value=\"\" /><br /> <lable for=\"email\">Email: </lable><input type=\"text\" name=\"email\" value=\"\" /><br /> <input type=\"hidden\" name=\"password\" value=\"2f0727a8fd0c695e52bfa79a97b6c08ab418c1db\" /> <lable for=\"name\">Name: </lable><input type=\"text\" name=\"name\" value=\"\" /><br /> <input type=\"hidden\" name=\"privileges\" value=\"admin\" /><br /> <input type=\"submit\" value=\"&#43; Add User\" /></form>"; mysqli_close($mysqli); ?> </div> </div> </div> </body> </html> and it's still not working... I changed everything to reflect that I wanted to grab the name and base my SQL actions off of that data, ONLY... Arrrrg!
  17. It says: DELETE FROM users WHERE user_name = 'Michelle' And Michelle isn't a user_name but rather the name! Silly!
  18. delete_user.php is the only one I updated: <?php require('config.php'); // Connect to Database to store information $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAMETWO); $names = mysqli_real_escape_string($mysqli, $_POST['user_name']); if (mysqli_connect_errno()) { printf("Connect Failed: %s\n", mysqli_connect_error()); } else { $sql = "DELETE FROM users WHERE user_name = '$names' "; $res = mysqli_query($mysqli, $sql); echo "$names has been deleted!<br />"; echo "<a href=\"add_delete_users.php\">Go back to Manage more users</a><br /> <a href=\"index.php?&status=\">Go back to the main page</a><br />"; mysqli_close($mysqli); } // End Database interactions ?> But here is the form page as well... <?php require('config.php'); $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAMETWO); if (mysqli_connect_errno()) { die("Connection Failed"); } if (isset($_GET['pageno'])) { $pageno = $_GET['pageno']; } else { $pageno = 1; } // if ?> <!DOCTYPE html> <html> <head> <title>Manage Users</title> <link type="text/css" rel="stylesheet" href="/css/layout.css" /> <link type="text/css" rel="stylesheet" href="/css/admin.css" /> <!--[if lte IE 7]><link rel="stylesheet" href="/css/adminie7.css" type="text/css" media="screen" /><![endif]--> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="/js/contentArea.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#content .row:odd').addClass('odd'); $('#content .row:even').addClass('even'); }); </script> </head> <body id="index"> <div class="container-12"> <h1>Manage Users</h1> <div id="content"> <ul id="statuses"> <li <?php if ($status === "") {echo "class=\"current_page\"";}?>><a href="index.php?&status=" id="nav-new">New</a></li> <li <?php if ($status === "assigned") {echo "class=\"current_page\"";}?>><a href="index.php?&status=assigned" id="nav-assigned">Assigned</a></li> <li <?php if ($status === "completed") {echo "class=\"current_page\"";}?>><a href="index.php?&status=completed" id="nav-completed">Completed</a></li> <li><a href="bought.php">Bought</a></li> <li class="current_page"><a href="add_delete_users.php">Users</a></li> </ul> <div class="clear"></div> <?php $sql = "SELECT * FROM users"; $result = mysqli_query($mysqli, $sql) or trigger_error("SQL", E_USER_ERROR); while ($row = mysqli_fetch_array($result)) { $name = $row['name']; $options.="<OPTION VALUE=". $name .">". $name ."</option>"; } echo"<lable><strong>Delete User</strong></lable><form class=\"delete-form\" method=\"post\" action=\"delete_user.php\"><select name=\"user_name\" id=\"user_name\">\n" . $options . "</select> <input type=\"submit\" value=\"&#45; Delete User\" /></form><br /><br />"; echo"<lable><strong>Add User</strong></lable><form class=\"add-form\" method=\"post\" action=\"add_user.php\"> <input type=\"hidden\" name=\"user_id\" value=\"\" /><br /> <lable for=\"user_name\">User Name: </lable><input type=\"text\" name=\"user_name\" value=\"\" /><br /> <lable for=\"email\">Email: </lable><input type=\"text\" name=\"email\" value=\"\" /><br /> <input type=\"hidden\" name=\"password\" value=\"2f0727a8fd0c695e52bfa79a97b6c08ab418c1db\" /> <lable for=\"name\">Name: </lable><input type=\"text\" name=\"name\" value=\"\" /><br /> <input type=\"hidden\" name=\"privileges\" value=\"admin\" /><br /> <input type=\"submit\" value=\"&#43; Add User\" /></form>"; mysqli_close($mysqli); ?> </div> </div> </div> </body> </html> Thanks
  19. I spoke too soon... It worked and then without changing any of the code, it stopped working. Very curious, no?
  20. It doesn't return anything. BUT because I was fried yesterday, after you told me to do the single quotes around the var, I didn't notice it was actually working!!! I noticed thins morning when I go to work and tested out the mysqli_error($mysqli). SO, thank you VERY much! I knew it was something simple I just wasn't able to see.... As usual! Thanks again, Barand!
  21. Nope... Still not working. :'(
  22. Okay. I did that, and it is showing the echo but isn't actually deleting it from my db...
  23. okay. This was my first post... Wasn't sure what to do. Thanks
×
×
  • 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.