Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. Are you sure the request is reaching your category.php script? If not, try using a full URL here: $http.get('category.php')
  2. You have one image with the ID of "house". It looks like your script is working on that ID. I don't know that script, but it seems if you changed the image to be CLASS=house instead of ID=house, and then have multiple images with CLASS=house, and change the script to work with '.house' instead of '#house' it would work on all images with that class.
  3. Then most likely your query is failing, but you never check for that and just assume it runs . See how they do it in http://php.net/manual/en/function.mysql-query.php in the first example labeled "Example #1 invalid query" My guess is because you don't have a space after the WHERE and when you add to the query. As a side note, mysql is deprecated and will be removed from PHP in the future. You should be using PDO or mysqli if you don't want to have to rewrite all of this for newer upcoming versions of PHP. You're not doing yourself any favors by using something that is already deprecated.
  4. Requinix is saying that $query here, needs to be $squery: $numrows = mysql_num_rows($query);
  5. Well it looks like you are already grabbing the product info in AJAX_Quote.php here: $SQL_GetEquipment = "SELECT * FROM `new_equip` WHERE `id`='$EID' LIMIT 1;"; $R_GetEquipment = mysql_query($SQL_GetEquipment, $Link); $row = mysql_fetch_assoc($R_GetEquipment); So when building the $EmailBody text, you just need to add whatever extra columns you want to output based on what they're called in the db. It should already be present in $row. Something like: $EmailBody = "$Name has requested a quote from NAPE \n Information on quote request: \n Name: $Name \n Email: $Email \n Company: $Company \n Number: $Number \n \n Location: $Location \n Our Price: $OurPrice \n \n Product Name: {$row['product_name']}\n //display the product name Send a quote now: http://www.packagingequipment4sale.com/admin/Admin_Quote.php?Email=$Email&EID=$EID ";
  6. Actually I do see you already have that at the top of the form. I'm not sure what the problem is. Just grab the ID when the form is submitted and lookup the product in the db to get it's details.
  7. In your form that pops up, I'd create a hidden input that contains the Item ID so that it gets sent with the form. Then whatever handles your form processing can look the item up by the ID and populate the product details in the email.
  8. You aren't putting delimiters around your regex expression. Try if (preg_match("/[0-9]/", "2")) {
  9. You can always do a foreach() loop on the array to build the $stmt->bindParam()'s
  10. If you do want multiple projects/sites on your dev box, create a virtual host and you don't need to muck around with that stuff. Each project should have one. Then the url could just be "www.yoursite.dev" or whatever you want the domain name to be on your dev server instead of "localhost/projectname". Then when you create absolute links like "/post/12/postname" it would be correct, like www.yoursite.dev/post/12/postname. You also wouldn't need to alter settings between the dev and live servers.
  11. And then put it in the database like the other values (campaign/email/code/etc). When the person clicks the link and visits your site, retrieve the data from the db using the query string identifiers.
  12. I'd guess it's where you are generating the actual PDF. I don't see anything in your posted code that would do that as you only output an H3 tag and an empty table, but no code creating the PDF.
  13. Maybe you should post your current code with the changes you've implemented.
  14. Define "multi domains". If you mean www.domain1.com and www.otherdomain.net, then you can't. SSL certs are only good for a single domain. If you mean www.domain1.com and subdomain.domain1.com (same domain, different subdomains), then you can with a "wildcard" certificate but they're also more expensive, but they'll work for all subdomains of your main domain. Before giving blanket advice on what kind of certificate for you to get, it's really kind of important to know what it will be used for. Is this just to log into the site? eCommerce? Explain what you need the encryption for.
  15. You use nl2br() when you OUTPUT the stored data from the database. It converts the hidden line breaks (\n) that occur when hitting return in a textarea (and others form controls) back into HTML <br />'s. In your database they are stored as \n but you can't see them when viewing directly, as they're hidden control characters.
  16. You could try shortening all of those variables, but you'd have to recode where they are used in your app too...but a simple find/replace could help with that. They don't need to be "human readable" in the URL. Your app is the only thing than needs to understand them. hid = hotel_id cc = currency_code etc
  17. I believe it's just "CALL qselGetMonthDays('2015-01-01');"
  18. Try this: <?php include("AddStats_admin_connect.php"); //connect to database doDB(); //Function to build select options based on passed array function buildSelectOptions($options) { $optionsHTML = ''; foreach($options as $id => $label) { $optionsHTML .= "<option value='{$id}'>{$label}</option>\n"; } return $optionsHTML; } //Run query to get the ID and Name from the table //Then populate into an array $clist_sql = "SELECT CID, Country FROM Countries"; $clist_res= mysqli_query($mysqli, $clist_sql) or die(mysqli_error($mysqli)); if (mysqli_num_rows($clist_res) < 1) { //this Country not exist $display_block = "<p><em>You have selected an invalid Country.<br/> Please try again.</em></p>"; } $countries = array(); while($Ctry_info = mysqli_fetch_array($clist_res)) { $countries[$Ctry_info['CID']] = $Ctry_info['Country']; } $countryOptions = buildSelectOptions($countries); ?> <!DOCTYPE html> <html lang="en"> <head> <title>Stats</title> <link rel="stylesheet" href="stylesheets/style.css" /> <!--[if IE]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <form action="CountryOptions.php" method="post"> <!-- You need to set up the select element to house the options. This will be set in $_POST as $_POST['country'] --> <select name="country"> <?php echo $countryOptions; ?> </select> <input type="submit" value="Submit Choice"> </form> </body> </html>
  19. And remove this: $optionsHTML = "<select name=\"Countries\">\r\n"; You already have a <select> open and close tag.
  20. Another thing, your <form> open tag is commented out, so the form won't work.
  21. Also remove this line: $countries[] = array($Ctry_info['CID'], $Ctry_info['Country']); It's doing absolutely nothing and is being overwritten further down in your code here: $countries = array();
  22. <select name="country"><?php echo $optionsHTML; ?></select> You named that $countryOptions here (not $optionsHTML) $countryOptions = buildSelectOptions($countries); So you need to replace $optionsHTML with $countryOptions where you are outputting your <select> The only place $optionsHTML lives is in your buildSelectOptions() function, so only that function knows what it is. Do you have error reporting turned on? You should be getting PHP errors/warnings for using things that aren't defined like $optionsHTML where you output it in your <select>.
  23. Yes, if you used hash('sha256', $password) when they registered, and you stored that hash in the db. Also, these lines are unnecessary and could be causing issues as they can change the value of what you are running them against. They are also unnecessary/useless when using prepared statements: $username = mysqli_real_escape_string($conn, $_POST['username']); $password = mysqli_real_escape_string($conn, $_POST['password']); remove those.
  24. So when the user enters their password in the form, you need to hash their supplied value using the same hashing method as you did to store it in the db when they registered, so that the query will check if (hashed_value === stored_hash_value). Otherwise you're comparing apples to oranges and the password will never match. so this: $password = $_POST['password']; should be: $password = your_hashing_function($_POST['password']);
  25. You might want to use the TIME_TO_SEC(race_time_total) function in your query so that it converts hours/minutes/seconds into just seconds, and then divide. Then format your result back into H:M:S to display. That can actually all be done within the query without needing PHP.
×
×
  • 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.