Jump to content

FeralReason

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

FeralReason's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Alright -- never mind. Don't know what happened but it is working now. Perhaps the previous output was from the older browscap.ini. At any rate, this is the output I now get, which looks fine: browser_name_regex - ^mozilla/5\.0 (windows; .*; windows nt 5\.1; .*; rv:1\.9\..*) gecko/.* firefox/3\.5.*$ browser_name_pattern - Mozilla/5.0 (Windows; *; Windows NT 5.1; *; rv:1.9.*) Gecko/* Firefox/3.5* parent - Firefox 3.5 platform - WinXP win32 - 1 browser - Firefox version - 3.5 majorver - 3 minorver - 5 frames - 1 iframes - 1 tables - 1 cookies - 1 javaapplets - 1 javascript - 1 cssversion - 3 supportscss - 1 alpha - beta - win16 - win64 - backgroundsounds - cdf - vbscript - activexcontrols - isbanned - ismobiledevice - issyndicationreader - crawler - aol - aolversion - 0
  2. Ah.. the last time this happened to me was because the new site's DNS settings were pointing to the hosting service's default IP instead of my IP address. Could be you reset the DNS to point to your IP address and it just took a few hours for that to be updated by the hosting service.
  3. Should have included this: The version of browscap I downloaded was php_browscap.ini (http://browsers.garykeith.com/stream.asp?PHP_BrowsCapINI.) Is there a better one ? Thanx, Glenn
  4. Thanks for the quick reply. The output I have posted is already from that browcap.ini. I had already downloaded it this morning. (That was my first guess too.) Is there, by any chance, a newer one than that. Thanx, Glenn
  5. Any help on this would be appreciated ! When I echo $_SERVER['HTTP_USER_AGENT']; I get the following: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9 ( .NET CLR 3.5.30729) I can clearly tell from this that I am using Firefox 3.5.9. HOWEVER, when I use get_browser(), I get back an array that has no reference (that I can understand) to Firefox 3.5.9. How come ?? Here's a dump of my get_browser() output. browser_name_regex - ^mozilla/5\.0 (windows; .; windows nt 5\.1; .*rv:1\.9.*) gecko/.*$ browser_name_pattern - Mozilla/5.0 (Windows; ?; Windows NT 5.1; *rv:1.9*) Gecko/* parent - Mozilla 1.9 platform - WinXP win32 - 1 browser - Mozilla version - 1.9 majorver - 1 minorver - 9 alpha - 1 frames - 1 iframes - 1 tables - 1 cookies - 1 javaapplets - 1 javascript - 1 cssversion - 2 supportscss - 1 beta - win16 - win64 - backgroundsounds - cdf - vbscript - activexcontrols - isbanned - ismobiledevice - issyndicationreader - crawler - aol - aolversion - 0 (I'm testing this from localhost on xampp. Still trying to get my live server to change the php.ini file so that I can see browscap.ini but I'm guessing this should make no difference.) Thanx, Glenn
  6. Thanks much. That clarifies it for me. For the sake of others, here's the final code: $orderid = $_GET ['var']; if($orderid){ $mysqli=getDBconnection(); // START DB activity (my function) $delete_qry = "DELETE FROM orders WHERE orderid = '".$orderid."'"; $result = mysqli_query($mysqli, $delete_qry) // Note using mysqli_query -- not mysql_query or die(mysqli_error($mysqli)); if($result){ $count = mysqli_affected_rows($mysqli); } if($count>0){ echo "ORDER ".$orderid." DELETED.<br>"; } else{ echo "ORDER ".$orderid." not found.<br>"; } $delete_qry = "DELETE FROM order_items WHERE orderid = '".$orderid."'"; $result = mysqli_query($mysqli, $delete_qry) // mysqli_query returns TRUE on success or die(mysqli_error($mysqli)); if($result){ $count = mysqli_affected_rows($mysqli); } if($count>0){ echo $count."ORDER ITEMS(s) for ".$orderid." DELETED.<br>"; } else{ echo "No ORDER ITEMS for order ".$orderid." found.<br>"; } mysqli_close($mysqli); // close connection to MySQL } else{ echo "NO RECORD SELECTED. PLEASE SELECT A RECORD.<br>"; }
  7. Just put together a delete order function (which seems to delete orders appropriately) but I am noticing that, when using the mysqli_query function with a DELETE query, it returns TRUE whether or not records are found to delete. Is this what I should expect ? $orderid = $_GET ['var']; if($orderid){ $mysqli=getDBconnection(); // START DB activity $delete_qry = "DELETE FROM orders WHERE orderid = '".$orderid."'"; $result = mysqli_query($mysqli, $delete_qry) or die(mysqli_error($mysqli)); if($result==TRUE){ echo "ORDER ".$orderid." DELETED.<br>"; } $delete_qry = "DELETE FROM order_items WHERE orderid = '".$orderid."'"; $result = mysqli_query($mysqli, $delete_qry) or die(mysqli_error($mysqli)); if($result==TRUE){ echo " ORDER ITEMS(s) for ".$orderid." DELETED.<br>"; } mysqli_close($mysqli); // close connection to MySQL }
  8. Angel -- I like your logic. Let us know if you are able to acomplish step 3 and get reasonable results !
  9. Trying to find a PHP function to perform a particular task. Where is the appropriate place to post this question ?
  10. I'm assuming the products to be packed vary in size -- possibly in all 3 dimensions. I think the math will be fairly complex. I managed a project (all programming done by a contractor) for a robotic system to build pallets of a certain size from magazine bundles which only varied by height. This required a very complex algorithm which never worked quite right. The advantage you have is you know all product sizes before sizing your box (whereas the system I refer to had to make a real-time decision based on a limited look-ahead of product sizes.) However, if your products vary in size in all 3 dimensions, this may be much more work than you want to do. There may be code you can buy to do this but, for the site I'm working on, I decided this was a bridge too far. I am using USPS -- shipping cost more dependent on weight and distance -- so I decided not to pursue this. Good luck.
  11. Thanks for the response. Had a typo (misspelled username) -- dumb mistake. Thanx for your help.
  12. Alexia - you are correct on both points. I did try this code and although it seems to correctly format the floating point value in the form's textbox I was then unable to edit / save the value -- so I am not sure that the money_format() function was intended to be used inside a form's text box. (If anyone is using this in a form, I would love to see how you are doing it !) I am fairly new to PHP/HTML but in other environments, setting how values are formatted (currency,etc) at the presentation layer (in forms) has always seemed fairly straightforward. I must be missing something...
  13. Thanks much for your quick reply. Unfortunately I am on a WAMP stack and money_format does not seem to be defined on Windows. Looked good tho....
  14. I am making an HTML form to edit an inventory record (retrieved from MySql). Does anyone know how I can format a float in a text field as currency. (Using PHP. Prefer not to use Javascript unless that is the only way.) Thanx !
×
×
  • 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.