Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. if(($key = array_search($myCoupon, $coupons)) !== false) { $hasdiscount = true; // delete the coupon from the array using $key unset($coupons[$key]); file_put_contents('Vm1wS01HRXhVWGxWYmxKV1lrZG9VRlpyVmt0WGJGSllZM3BHVG1KSFVubFhhMXByWWtkR05sSnJXbFpXYldoeVZrZDRWMDVzV2xsYVIwWlhWakpvVkZaVldrWlBWa0pTVUZRd1BRPT0=.txt', implode("\r\n", $coupons)); } so does it even get in here?
  2. sorry but none of your other output showed it as false. if(($key = array_search($myCoupon, $coupons)) !== false) { $hasdiscount = true; // delete the coupon from the array using $key unset($coupons[$key]); file_put_contents('Vm1wS01HRXhVWGxWYmxKV1lrZG9VRlpyVmt0WGJGSllZM3BHVG1KSFVubFhhMXByWWtkR05sSnJXbFpXYldoeVZrZDRWMDVzV2xsYVIwWlhWakpvVkZaVldrWlBWa0pTVUZRd1BRPT0=.txt', implode("\r\n", $coupons)); } else if(($key = array_search($myCoupon, $coupons)) == false) { $hasdiscount = false; } put some echos in where ever $hasdiscount get's changed so you know when it changes or if it even gets into those if statements. if(($key = array_search($myCoupon, $coupons)) !== false) { i'm not sure if != vs !== will make a difference but I never use !== if(($key = array_search($myCoupon, $coupons)) != false) {
  3. if ($action == "" && $Song = "") { I'm guessing should be if ($action == "" && $Song == "") {
  4. sorry if it's confusing. I'm just trying to see what's actually in the array, and not what you're echoing. it looks like that one output shows hasadiscount as false.
  5. Check the page source. Both var_dump and print_r have different output than what you are giving. See the manual for what I mean. php.net/var_dump php.net/print_r It's likely your output formatting that's obscuring it.
  6. Ok I see where you're getting that output now. Just do print_r($_SESSION); And it will print out the entire session array like I posted above. Also in page2.php you are outputting undefined variables. sessionvars and taxheaders are not included, which are the files that define those variables, so any variables you output that aren't in the session will be null. ex. $myCoupon= $hasdiscount= $print_pur_po_total= $print_pur_po_total= will be blank because they are not defined.
  7. header() can only be used if there is no output to the browser yet. Why do you need to output html if you are just going to redirect them?
  8. Is this an actual print_r of $_SESSION? Usual output is something like Array ( [test_var] => 1 [text_var1] => testing )
  9. print_r($_SESSION); take a look at the session array to make sure it is even getting set.
  10. Best thing to do is echo your $sql variable and make sure it looks right. I'm guessing all the values are null because you don't have a method set in your form but not sure if it assumes a default if you don't define it. ie. <form action="TestSubmit.php" method="post">
  11. move taxheader above sessionvars. your setting the session variables before they are being defined in taxheader.
  12. where is taxheader.php being called in orderform.php?
  13. where are $myCoupon, $hasdiscount, $print_pur_po_total, $print_pur_po_total2 being defined?
  14. use php and add it to the user's session then redirect them?
  15. when I set up email piping to a php script, I tested with the piping file in an directory in httpdocs first so I could load up the script and see if there was any syntax/runtime errors. I also put a lot of mail() fns to see exactly where the script was going. hope this helps.
  16. I can't remember what it is exactly called in the php.ini file but basically <?= is the same as <?php echo The option has to be turned on if you php.ini file to be able to use it. ex. <?=$varable?> is much shorter than doing <?php echo $variable; ?>
  17. I normally do this by calling my image manipulation file through the source attribute of an image tag: ie. <img src='img_thumb.php'> there are lots of tutorials out there on PHP and GD use. Just search PHP and GD or image or thumbnail. Let me know how it goes.
  18. Put this above your if statement $id = $_POST['id']; That will get the ID posted from the form and should echo out the part info.
  19. schilly

    Join Help

    awesome. thanks so much. worked perfect. for the record, here's what I changed to: select * from users LEFT JOIN orders ON users.username = orders.username where (SELECT sum(id) FROM orders WHERE users.username = orders.username) IS NULL
  20. It looks like your search query is double quoted: '\"$trimmed\"' Try $query = "SELECT fulldescr, product, descr, keywords FROM products WHERE fulldescr LIKE '%$trimmed%' OR product LIKE '%$trimmed%' OR descr LIKE '%$trimmed%' OR keywords LIKE '%$trimmed%' order by product ASC"; Also make sure you output the mysql error which should help you as well.
  21. schilly

    Join Help

    I have a users and orders table. Both share the username field. I need to find all users who have no orders associated with their account. I'm pretty sure it needs a join but I don't have much practise with them so some help is needed. I'm guessing something like: select * from users INNER JOIN orders ON users.username = orders.username where (SELECT sum(id) FROM orders WHERE users.username = orders.username) = 0 I'm not getting any errors but also getting no results. Thx.
  22. ok well i figured it out. i left this piece of code out from htaccess which is from my coworker because of the comment on it: #-- No idea what this does RewriteCond %{REQUEST_FILENAME} -f [NC,OR] RewriteCond %{REQUEST_FILENAME} -d [NC] RewriteRule .* - [L] Can anyone explain what this does? After I added this code back in, everything worked.
  23. so i started making a new site based off the code from another. I'm hung up on this rewrite: RewriteRule ^account/(.*) account/index.php?sec=$1 [L] I test it by going to /account/prefs and printing out the _GET array. The _GET array shows this every time instead of "prefs", no matter the variable: Array ( [sec] => index.php ) How index.php is getting set as the sec variable beats me. It doesn't matter what /account/sub_sec_name i use, it always gets set to index.php. This code works fine on my other site so I'm not sure what the deal is. Anyone have any ideas? thx.
  24. Thanks Keith. I'll give it a try. GROUP BY operating_system LIKE "%Macintosh%" works but it seems like you would have to do a query for each OS you wanted as each time it returns 2 rows(LIKE and NOT LIKE)
×
×
  • 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.