Jump to content

xiao

Members
  • Posts

    163
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.gfx-depot.com/forum

Profile Information

  • Gender
    Not Telling

xiao's Achievements

Member

Member (2/5)

0

Reputation

  1. yea, but the problem is that I already have the array with all the names and I need to transform it.
  2. Is there a way to turn an array like this Array ( [somename] => Cat [someothername] => Bird [anothername] => Horse ) into Array ( [0] => Cat [1] => Bird [2] => Horse ) ?
  3. oh, sorry, typo. It deletes id = 1 and id = 0, not id = 2.
  4. I create my array like this: $_SESSION['ECpc'] = $productcodeEC; $_SESSION['ECid'] = $rij['products_id']; $_SESSION['ECprijs'] = $rij['products_price']; $_SESSION['ECnaam'] = $rij['products_name']; And add stuff to it like this: array_push($_SESSION['ECpc'], $productcodeEC); array_push($_SESSION['ECid'], $rij['products_id']); array_push($_SESSION['ECprijs'], $rij['products_price']); array_push($_SESSION['ECnaam'], $rij['products_name']); And I delete from it like this: array_splice($_SESSION['ECpc'],$id,1); array_splice($_SESSION['ECid'],$id,1); array_splice($_SESSION['ECprijs'],$id,1); array_splice($_SESSION['ECnaam'],$id,1); It all works fine, unless I delete $id = 0, then php always deletes $id = 0 and $id = 2... ???
  5. is it possible? Because I need to find an easy way to cache my query results. I have this: function sessie($qry,$product){ while($rij = mysql_fetch_assoc($qry)){ $_SESSION['qryProductid'][$product] = $rij['products_id']; $_SESSION['qryProductnaam'][$product] = $rij['products_name']; $_SESSION['qryProductprijs'][$product] = $rij['products_price']; } } If that works, how do I transform this? (old query result output) while($rij = mysql_fetch_array($qry)) { $prijs = number_format($rij['products_price'],2, ',', ''); echo "<option value=\"" . $rij['products_id'] . " - " . $prijs . "\""; if($_SESSION['productid'][$productsoort] == $rij['products_id']) echo " SELECTED "; echo ">" . $rij['products_name'] . " - €" . $prijs . "</option>\n"; }
  6. hmm, makes sense Thanks. makes me able to do another 20 minutes of programming. I'll be back with another silly question in a few minutes
  7. if(($_POST['processor'] != "(Make a choice)") && ($_SESSION['processor'] != $_POST['processor'])){ $_SESSION['processor'] = $_POST['processor']; } So it shouldn't overwrite everytime, right? It does though. i have a session_start(); (tried to remove it and got quite some errors) I don't have a session_destroy anywhere. I don't really get it...
  8. Is it normal that all session variables get lost when the page is being refreshed?
  9. According to that it should be working right? But that's weird, because I use it like this: if(($_POST['processor'] != "(Maak een keuze)") && ($_SESSION['processor'] != $_POST['processor'])){ $_SESSION['processor'] = $_POST['processor']; print_r ($_SESSION); echo "<hr>"; print_r ($_POST); splits($_SESSION["processor"], "processor"); } So the SESSION var only changes when the POST var changes. So the print_r should only work the first time I submit the form (as long as I don't alter POST['processor']) right? Because it prints it everytime I submit.
  10. session_start(); I don't have a session_destroy(); And if I echo session_id(); it works :-S Only my variables don't get filled
  11. for some reason my session variables aren't working. I use $_SESSION['processorfabrikant'] = $_POST['processorfabrikant']; and I have a session_start; What can I be doing wrong? ???
  12. Yea, I know, but the problem is that I'd have to do an if(!isset($_SESSION['variable'])) && ...rest of checks... about 40 to 50 times more in my script just to get rid of some errors. I'm only planning to turn off error reporting when everything else works fine.
×
×
  • 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.