Jump to content

allworknoplay

Members
  • Posts

    385
  • Joined

  • Last visited

    Never

Everything posted by allworknoplay

  1. Well to access the google variable, it would be $_GET['c']. That would equal: google
  2. In any event, sessions is the best route anyways. 3 pages, 10 pages etc...I don't think anyone wants to be carrying over POST data from page to page...
  3. This is a curious question because session data is stored at the server side. I think the default is 20 mins. So as long as the user doesn't close the browser, I can't see why intermittent connections would cause the user to lose his session when his internet comes back? As long as it's within 20 mins....
  4. You're missing the DOT for .php... So use this... $MM_redirectLoginSuccess = "profile_" . $profile[0] . ".php";
  5. I think you have to use the actual directory on your server, not the full URL... I could be wrong though, I've never used cron via cPanel, only through the command line since I have full access to my server....
  6. I always like to use the time() function and insert the time data UNIX style into the DB...
  7. You could just take the XML data, put it into an array, and then use the shuffle() function to randomize the output...
  8. First change to $_POST['update_notepad'] I always like to use the name of the submit button to check against. Then for your DB, you need to INSERT, and if it's already there, then ON DUPLICATE KEY UPDATE... This way if the record isn't there, you INSERT a new one, if it is, you just UPDATE.
  9. As the others have said, it looks like a multi-dimensional array. How are you creating the array in the first place? It looks like you don't need to have that extra array in there...
  10. What about showing half stars? I think on Amazon, they will go further and even show a half star so say you have 4 1/2 stars...it would be 4 stars and a half filled star.... Of course you'd need to provide a "half star" image, but how do you think the loop would be structured?
  11. Good script, I will save that script myself for future purposes...
  12. No, what you should do is load that script on the new page on the top...this way right before the new page loads, you load the pop up...
  13. if ($result) { header("Location: http://$host$uri/contact_view.php"); } Because you're using header function, you need to have this at the top of your script, you cannot output anything before the header function....
  14. Hey, so doing this: is_int((int)$_GET['ID']); //TRUE Basically sets the value of $_GET['ID'] to an integer right? Could I also do this? $string = '1'; $number = (int) $string;
  15. I think it would be good practice to do it, but that's just me. NEVER TRUST user input. Just because it's not a form, it's still user input from a conceptual sense..... I would like to hear other point of views on this...
  16. can you show us your table structure? And also, how may records do you have in it now? And provide some sample output as well from your testing.....what you are getting and what you THINK you should get.....
  17. I'm not familiar with PHPmyadmin since I don't use it, but I would assume that when you use that, it uses loops too in order to display your records which you say is coming out correctly.. So why not use loops to see if you can get the same results?
  18. Parent 1 Sub Parent 1.1 Child 1000 Child 2000 Parent 2 Sub Parent 2.2 Child 3000 Child 4000 Parent 3 Sub Parent 3.3 if($parent1) { if($sub_parent1) { echo "child1000"; echo "child2000"; } }elseif($parent2) { if($sub_parent2) { echo "child3000"; echo "child4000"; }elseif($parent3) { if($sub_parent3) { echo "child5000"; } }
  19. I just use a custom access level table and apply the access levels to the users. And then use sessions to allow users to scour my site....
  20. Try this: 37 global $con; 38 $q = "SELECT ID FROM userinfo WHERE username = '".$user."' "; 39 $result = mysql_query($q, $con); 40 $result = mysql_fetch_array($result) or die ('error: ' .mysql_error()); 41 $i = 0; 42 while ($i <= mysql_num_rows($result)) 43 { 44 $r = $r . $result[$i]; 45 $i++; 46 } 47 48 return $r; 49 }
  21. You could try using ltrim. $testArray = array( array( 'apple', 'ball', 'tiger'), array( 'ball', 'square', 'tiger', 'apple'), array( 'ball', 'tire', 'square'), 'square' ); function flattenArray($array) { if(!is_array ( $array ) ){ $array = array ( $array ); } $arrayValues = array(); foreach ($array as $value) { if (is_scalar($value)) { $arrayValues[] = ltrim($value); } elseif (is_array($value)) { $arrayValues = array_merge($arrayValues, flattenArray(ltrim($value))); } else { $arrayValues[] = ltrim($value); } } return $arrayValues; } $wordCounts = array_count_values(flattenArray($testArray)); print_r($wordCounts);
  22. Ok I might have found my own answer, but I still wonder why it's 7 times faster...
  23. Hey guys, someone posted this link last week and I find it very useful. I'm posting it again for new guys who may have missed it. http://www.chazzuka.com/blog/?p=163 i have a question about one of the tricks...it says: Can someone explain why having single quotes makes it 7 times faster?? Thanks!
  24. Do it like this: $final_price = number_format(($price * £qty),2);
×
×
  • 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.