-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
umm, well I can't really be more specific than that without pouring over your entire code (which I'm not about to do sorry lol) I mean, I'm not necessarily seeing a problem with the code that you provided, so you're probably gonna have to backtrack and see what argument you're trying to pass to your functions. You just have to go through your code and make sure you didn't do anything like declare your variable somewhere else that's under the same jurisdiction as in this function (like a global variable) etc... p.s.- using $string in more than one function doesn't necessarily mean anything. They are both local variables that are trashed when the function breaks...but it might mean something if you have, as mentioned, a global version of it somewhere.
-
You need to update the database (run the query) for each checkbox value that's posted. Most people do this by passing the checkbox data in an array instead of an individual variable for each one, and then either loop through the array (putting the query inside the loop) or rephrasing the query (it really depends on the data etc.. as to what's best).
-
I think the problem has to do with you declaring a variable as one type (by virtue of assigning something to it, of course), and then trying to use it as a different type. I think.
-
I like the interactive quizzes/tutorials idea 448191 suggested. Also, I'd like to see the freelance forum removed from the boards, and put onto the main site somehow.
-
Okay so my brother calls me and says he went to turn on his computer and it starts up a system recovery, prompting him to skip or go ahead with it. He says if he opts to go ahead, it starts the process and when it's done, it restarts his computer, but it starts the system recovery all over again. He says if he opts to skip it, it restarts his computer, and same thing; system recovery. He says that it does not give any kind of error message or reason behind this system recovery. I am in no way shape or form any kind of expert when it comes to this area of computers, so I'm appealing to you guys to see if anybody might know what might be causing this, or point me in the right direction as far as googling or something. Any ideas?
-
There's some nasty people out there
.josh replied to asparagus's topic in PHPFreaks.com Website Feedback
My definition of a stupid question is a question that is asked that is covered in a FAQ/sticky. I think the days when people could write off not reading FAQs due to it being "some new thing," are long over. FAQs in forums have been commonplace for a very long time now, and there really is no excuse for not reading them before you ask your question, that would not warrant you receiving negative feedback. That is not to say that it's okay to flat-out call someone an idiot. I work at a fast food place. People ask me stupid questions all the time. Like, how much something is, when there is a 10 foot menu in front of their face. But I don't call them an idiot (at least, not where they can hear me). It's not the "professional" thing to do. -
Ah so that's what it's called. I knew there had to be something like that out there. Okay so I been googling that and it seems those things cost about the same as just buying a wireless router. I'm going to assume that overall performance would be better if I had one device (wireless router w/ a couple of cat5 ports) for all 3, rather than hooking up several devices to each other, so I guess I'll go shopping for a wireless router then. thanks all for the help
-
Okay so I have a dumb question. Currently I have 2 computers hooked up to the internet. The current setup is that I have a wirED router connected to a cable modem, and the 2 computers connected to the router. Recently my mom sent me her old laptop. I would like to be able to wireLESSly connect this to the internet. So my question is this: Can I do this without getting a wireless router for all 3 computers? cuz I know that performance will suffer on the 2 desktops if I do that. I was hoping there was some kind of device that I could hook up to one of the available slots on the router that would interact with the laptop's built in wireless card, but I have no idea if some such device exists. Failing that, I thought maybe I could buy a wireless router, but instead of hooking all 3 computers to it, maybe I could hook it up to the wired router, to act as afformentioned device, for the laptop. Thoughts? Suggestions?
-
Not that I've ever found (at one point in time it used to be my dream to make one, as well). Mainly because there's nothing set in stone as far as what you can and can't do. You just have to design your game on paper (the rules, object of the game, rewards, etc.. blahblahblah) and then code from there. There are, however, tons of tutorials on how to do more generalized things. For instance, you're game will more than likely end up needing some kind of data persistence, like keeping track of high scores, player stats, etc..(whatever your game involves). So, you can look up tutorials on how to store data long term (like with a database, and how to access it, add new info, alter it, delete info, etc..).
-
fixed.
-
He's not asking for some script to look at a sentence and determine whether a word is a noun, adjective, etc... I think what he is looking for is like when you go to dictionary.com and you enter in a word and it returns fields of information and one of the fields is the word's part of speech and what he wants to do is to have his script be able to submit a word to somewhere (like dictionary.com) and then grab the results and parse the part of speech field and flag it if 'noun' or 'adjective' is listed in the part of speech field.
-
well if you want to keep track of how many of each was downloaded, you're going to have to have something unique about each file, be it a name or id or something. You could setup a table in a database with as little as 2 fields: one called filename and one called amount (or whatever). whenever the file is downloaded, you would just run a query to update the row where filename = file that was clicked. You will have 217 rows of data, yes, but that's just a fact of life, and that number will vary, depending on how many files you have. However, you will still just use those 2 fields (columns) for each one.
-
why don't you just use mysql's built in count function?
-
http://www.google.com/tisp/ LoL edit: favorite quote: also they have http://mail.google.com/mail/help/paper/more.html
-
AI is such a broad term. Virtually any program or script you write that has even a single condition in it can be considered AI. What I suspect you mean by AI is simulated human behavior, right?
-
redarrow, it mostly just boils down to preference. That's why it's called shorthand. Like the others, I use it for short things. Mostly if I have a variable that's going to be assigned something based on either one thing or the other, and that's all that needs to be done for that condition, I simply use the ternary operator. I wouldn't recommend nesting ternary operators like that. If for no other reason, because it can easily become confusing to you, the programmer. You want to strive for elegant coding, but part of elegance is clarity and ease of reading (by humans).
-
well okay, that's sort of true, but not entirely relevant here.. the problem redarrow is that yes, a ternary operator is a condition. So the problem here is that you have a condition nested inside a condition. A condition will evaluate true or false. Look at your code: <?php $a=10; $b=20; if($a === $b ? $a : $b ){ echo " correct a is larger then b"; }else{ echo " not correct a is not larger then b"; } ?> You assign a value to $a and $b first. Next you have an 'if' condition. 'if' what? inside your 'if' statement you do a ternary operation. if $a === $b return $a if it's true, $b if it's false. So either way, it will return a value, since you assigned a value to both variables. Therefore, your original 'if' statement will always look like one of the two: if($a) { ...} or if($b) { ... } since you assigned something to both of them in the first place, it will always return true. edit: the point of the ternary operator is, as ken stated: a shorthand if..else statement. if(true) { $blah = something; else { $blah = something else; } can be shortened to a ternary operator like this: $blah = (true) ? something : something else; example: $x = 1; $blah = ($x == 1) ? "one" : "not one";
-
well, yes, it's possible to update dropdowns using only php, but he asked if it was possible to update it when he changes the value of checkbox #1. I'm am just going to assume (like all the 100's of other people who ask...) that he wants #2 to automatically update when he makes a new selection, before he actually does any kind of submitting or refreshing or anything. No, that's not possible (with only php). If the options are based on info in a database or something on the server, look into ajax.
-
looks like you have a solid battle plan there. so...are you just letting us know your goals, or do you actually have a question about something?
-
yes you need js for that. sorry.
-
you're in secondary school in year 8, don't know how to do basic stuff, and yet you pulled out of the contest because you didn't want to submit your source code? Then you turn around and post your stuff several days after the fact, asking for it to be 'judged.' Yeah right. I think I will move you to the list of people who used that as an excuse. p.s.- I'm splitting the thread at where you submitted a link to your game. This is the contest submission thread, not the mattal999's game critique thread.
-
for free? You could have at least gotten $20...
-
I'll buy your laptop for $20.
-
I'm guessing they used -> instead of . because they implemented . as concatenator [i]before[/i] oop was implemented, simple as that.
-
well i guess if your sole intentions for playing is to level up and be the biggest best most badass character with the biggest best most badass stuff, then sure, I'd agree with that. In fact, you could argue that that's pretty much the case for any game, so why play? I just play to mess around and have fun. I've played that game for a total of 2 years now and I have never gotten a character past level 40. I think somewhere along the lines people forgot the point of games: to have fun. And sorry, I won't accept the "game devs don't make good games" argument, either. How about actually sitting down and playing a game for the purpose of passing the time and having fun, instead of trying to "win," then get back to me on that. Games are supposed to be time sinks. That's the point. It's not like a job where you work all day long etc.. if you can't help but look at games from that perspective, then you need to untrain yourself. I suggest you play some games where there is no element of skill whatsoever involved. Pure chance, nothing else. Like the card game War. Just play it. Over and over again. Find some satisfaction from it. That is your first step in appreciating games for what they are. Go forth, young grasshoppers. Or go download (or telnet to) nethack and play that game. It's a nice little dungeon crawler where all of the cards are so completely stacked against you that it's a matter of when, not if, you die. And there's no coming back when you die. You'll learn to not be so frustrated at stuff and learn to just enjoy stuff in the moment. Also, it's a really cool game. Arguably the best damn game every invented.