
allworknoplay
Members-
Posts
385 -
Joined
-
Last visited
Never
Everything posted by allworknoplay
-
Well to access the google variable, it would be $_GET['c']. That would equal: google
-
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...
-
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....
-
You're missing the DOT for .php... So use this... $MM_redirectLoginSuccess = "profile_" . $profile[0] . ".php";
-
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....
-
I always like to use the time() function and insert the time data UNIX style into the DB...
-
You could just take the XML data, put it into an array, and then use the shuffle() function to randomize the output...
-
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.
-
[SOLVED] Help singling out items in an array
allworknoplay replied to x2i's topic in PHP Coding Help
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... -
help with simple "star rating system"
allworknoplay replied to dark_hatchling's topic in PHP Coding Help
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? -
[SOLVED] Popup Message after form submitted
allworknoplay replied to karl_009's topic in PHP Coding Help
Good script, I will save that script myself for future purposes... -
[SOLVED] Popup Message after form submitted
allworknoplay replied to karl_009's topic in PHP Coding Help
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... -
[SOLVED] Popup Message after form submitted
allworknoplay replied to karl_009's topic in PHP Coding Help
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.... -
[SOLVED] Does this data need to be made safe for a database
allworknoplay replied to keeps21's topic in PHP Coding Help
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; -
[SOLVED] Does this data need to be made safe for a database
allworknoplay replied to keeps21's topic in PHP Coding Help
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... -
[SOLVED] TWO WEEKS AND STILL NO ANSWER ON THIS ONE!!
allworknoplay replied to medaswho's topic in PHP Coding Help
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..... -
[SOLVED] TWO WEEKS AND STILL NO ANSWER ON THIS ONE!!
allworknoplay replied to medaswho's topic in PHP Coding Help
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? -
[SOLVED] TWO WEEKS AND STILL NO ANSWER ON THIS ONE!!
allworknoplay replied to medaswho's topic in PHP Coding Help
Hi, how is your loop structured? -
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"; } }
-
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....
-
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 }
-
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);
-
Ok I might have found my own answer, but I still wonder why it's 7 times faster...
-
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!
-
issue with displaying price on shopping cart
allworknoplay replied to martinlucas's topic in PHP Coding Help
Do it like this: $final_price = number_format(($price * £qty),2);