Jump to content

heavyEddie

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by heavyEddie

  1. When I use ob_start(), it returns that it is on, but I still can't set cookies.  The CMS I use has Ggzip capability.  When that is turned on they also enable ob_start().  Everything works beautfully in that situations.  However, when I attempt to use ob_start() in my script/plugin, cookies will not save.  Any ideas?
  2. Well that was just to darned easy... I'm sorry I didn't research this one further.
  3. Is there a way to see if ob_start is currently on/active?  A script I'm working on needs to behave differently if it isn't.  Darn headers :)
  4. I've been working with PHP for about 9 months now.  I'm starting to look inside many other scripts and comparing to my own.  I've noticed many times folks will create an empty array.  Why?  Does this increase speed?
  5. Very good!  I will give it a try first thing in the morning.  Thanks for taking the time to help.
  6. Unfortunately, the array contains many different elements and in no particular order.  However, itm1 and quan1 will always go together.
  7. I have a 3rd party class that is returning some information in the form of an array.  So far so good.  I would like to combing these into a single array but am having some issues figuring out the logic.  I may have been looking at this to long. My array looks like this... [code]$data = array('item_number1' => 4455, 'item_qty1' => 44, 'item_number2' => 8523, 'item_qty2 => 66);[/code] I would like to convert this array so the itemnumbers become the key and the quantities become the value.  Like this... [code]$data = array(4455 => 44,  8523 => 66);[/code] If piddled with foreach and while statements... just not getting the pieces together.
  8. In my case this was a non issue anyway since It isn't anything sensitive in nature.  I won't be putting in SSN in a cookie that is for sure :)
  9. [url=http://www.php.net/manual/en/function.setcookie.php]This page[/url] on php.net states that using searilize with cookies is unsecure.  Why would this be?
  10. Thanks guys... I will give it a run for it's money tomorrow.
  11. I'm trying to work with cookies for the first time.  It seems like it should be simple enough, but alas, I'm having some problems. [code] for($i = 0; $i < count($_POST['pid']); $i++) { $cookie_name = 'cart_item[' . $_POST['pid'][$i] . ']'; setcookie($cookie_name, $_POST['qty'][$i], 0, '/'); } [/code] I'm trying use cookies to store an array.  The code seems to work as long as I'm setting all the cookies on the page at one time.  For instance... [list] [*]If I set a cookie called cart_item[22] = 2 it works fine. [*]If I set cookies called cart_item[22] =2  and another called cart_item[33] = 3 they are both stored fine. [*]However, if  cart_item[22] is already set and the script is run to set cart_item[33]... it appears cart_item[22] is overwritten with cart_item[33]. [/list]
  12. Worked like a dream!!!  Thank you very much for the help.
  13. I tried something very similar... thanks for the reply!  However, I think my regex may be screwing because your code produces the following. [code]test1.html} {FILE:test2.html[/code]
  14. I'm trying to find all the filenames in some large text articles.  They are flagged nicely like so... [b]{FILE:test.html}[/b].  I would then like all the text files dropped into an array to work with.  My code looks like this. [code]preg_match_all("/\{FILE:(.*)\}/s", $article, $matches);[/code] If using preg_match, it will output to $matches[1] with the name of the file perfectly.  However, with preg_match_all it all goes to heck.  So,  I guess the questions are... [list] [*]Is the regex correct? [*]How do I use the $matches array to get my list of filenames? [/list] I'm VERY new to regex, so any help would be greatly appreciated.  Didn't find much with a search.  Almost all array reference just say to use $match[1] with a regular preg_match.
×
×
  • 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.