-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
what do you mean by "leaves the text area"? And why would you have a button inside textarea tags?
-
As long as the browser is open, even if the user goes to another website, the session will persist. By default, if the server does not receive a request for 30 minutes, the session cookie will expire.
-
at face value, there's nothing wrong with what you posted. It would help if you posted what error you got.
-
http://www.phpfreaks.com/tutorial/php-basic-database-handling
-
print_r(glob('*',GLOB_ONLYDIR));
-
he was actually offline at the time. Unless he has me on ignore...which is quite possible, considering I went off on him this morning about receiving that nobel peace prize...
-
re: serializing the array Whether using functions to serialize/unserialize it, or manually building the array...I mean it might be technically faster, to do it, but in essence php is doing the same thing either way. Suppose you could try to run some tests and see which one loads faster, but offhand I don't think there's going to be much of a difference. Dunno though. Actually, depending on how complex the structure is, I might actually put my money on manually doing it (with file, explode etc.. whatever..dunno what the structure looks like so can't know for sure)
-
uh...I thought one of the things that differentiated professional code from amateur code was the little things, like...the code working...
-
hmm.. dunno if a session would be a good way to go, if he's got a ton of data. Alternatively you could go the route of having a temporary file created (based off a session id would be good), with the filtered data. I would use ajax to update the file as you filter it. then on the next page, simply grab the data from the file and display it.
-
how does your filter system work? what about instead of passing the filtered data, you pass the filter algorithm/logic/whatever to the new page and have it filter the data there?
-
you can use strpos to find the first occurance of "(" it will return the character position in the string. You can then use substr to extract the part you want, starting at 0, and using the # returned from strpos for the length.
-
well you know what they say...those who can't, teach. ...hmm...I guess that would make me an expert teacher...
-
content stealers make pandas sad.
-
Are you looking to just grab everything that is not within {block} ?
-
so...why do you make your visitors sit around on the 404 screen that long? personally, I hate it when websites do that.
-
If the images are being saved as files, why not just display them with regular html img tags?
-
Well first off, keep in mind, php is not c++. It is not capable of doing anywhere near the amount of stuff as c++. 2nd, scripts "getting out of hand" after it gets to be a certain length is kind of stretching it, considering we are just talking about temporary vars being used in loops...php has plenty of scope and namespacing for virtually everything else.
-
well, you are getting more than one "array" printed out, right? so that means at least one of your queries is succeeding. My guess is one of them is returning nothing or else otherwise failing.
-
how to add my website on the first page of google search engine?
.josh replied to asad_black's topic in Miscellaneous
It's Number One now. We did it! ... that is, number one of one. LOL SS'd for reference! Hey I wonder if posting this will some how create an infinite indexing loop... [attachment deleted by admin] -
how to add my website on the first page of google search engine?
.josh replied to asad_black's topic in Miscellaneous
I can't believe 8 replies and not one mention of the obvious: be the highest bidder for keywords you choose, on the major search engines (google, yahoo/msn, etc...). Why do you think those ads on the top and sides stand out? People bid on keywords. The more common the keyword/phrase, the higher people bid on it. Ebay for keywords. How do you think search engines make money? Dude, you can go the route others suggest and try to rank on the organic SERPs, but at best, that's like trying to ski uphill. Picking "unique" words will get you indexed on page 1 SERP fairly quickly but what's the point? Nobody searches for that stuff. -
Are you using the correct field names in your $row[...] 's (case sensitive)? Another thing I see that may be wrong is that you are using $i as a counter in two different places in your nested loops.
-
you use "Item" in your form, but my code had "items". Did you change that to what it should be?
-
I don't really see the disadvantage. It's more a matter of discipline than anything. If you are at the point of not knowing whether you used a variable in your script somewhere before, then I think the real issue is that you and/or your script aren't/isn't very organized. The only reason you should "forget" a variable is if it's outside of scope in the first place (abstracted into a function or class). Nonetheless, as mike mostly pointed out, if you make it a practice to have a naming convention for variables you use for whatever purpose, that should reduce/illuminate debugging on that count. IOW if you make it a practice to only use $c, $x, $count, etc.. as loop or counting variables: a) since they are usually counting or temp vars, their previous values shouldn't matter anyways, so you can just initialize/reset them to xyz before the loop. b) know that even if you don't do a), the only other place you would have used it was in some other loop. c) ...I got nothin'...but a) and b) are good enough. Point is, you ask what the advantage is, but I don't really see a disadvantage, especially when you practice a) and b), as they are good things to practice anyways.
-
Really? Instead of pointing out facts and charts and surveys, I'm just gonna say this: Ever wonder why the mac vs. pc commercials characterize pc as a stuffy prude in a business suit, who's idea of fun is crunching numbers?
-
hmm...dunno why you really need 2 foreach loops...you could probably optimize your code, but whatever, not within scope of this thread. foreach($search as $word){ $a[] = $word; } foreach($tags as $tag){ $a[] = $tag; } shuffle($a); foreach($a as $all_row){ echo $all_row; }