-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
if($query123 = 0) { need to be if($query123 == 0) {
-
You would need to use javascript to dynamically print "correct" next to it if it's typed in right, before submitting. But...a bot could easily just brute force your captcha until "correct" pops up on your screen...
-
I hear google has a lot of neat stuff for all kinds of occasions. You should check it out.
-
no...javascript does not get executed on the server. You cannot put javascript inside a php loop and expect the javascript to be run. That's not how it works. Did you read the error he posted? Fatal error: Call to undefined function updatetextbox() in C:\xampp\htdocs\formtest.php on line 27 It means javascript got to the line of code where it's calling updatetexbox and it can't find it.
-
Hmmm..... Is it just me or has your level of writing suddenly gotten markedly worse? I'm halfway tempted to think you did that on purpose in an attempt to lend credibility to this "dyslexia" thing. Everybody on the internet has dyslexia. It's a requirement for being online. Also, your parents have to be dead. And you have to know Chuck Norris. My sincere apologies to the 0.0001% of people who actually do have issues, but I hope you do understand why I take statements like this as a grain of salt. Anyways, google the things others have mentioned. But you aren't going to find much, because even the top people in those fields struggle with it. Natural side effect of only a handful of people working on something and struggling at it to boot, is that you're not going to find much info about it, let alone programs that will actually do anything for you. Which leads us back to the whole learning to program and master language thing, so that you can be a pioneer in the field.
-
I thought I was being helpful...seems to me if you want to write programs and algorithms having to do with a language, first place to start would be to master that language. At least, that's where I'd start if I were you, because I read your post and it's full of misspellings and grammatical errors and stuff. And before you start pointing the finger back at me...I'm not the one trying to undertake that project. How can you hope to have any measure of success in this venture if you don't even understand the data you're working with? If you were wanting to solve some problem that involved using calculus, but barely knew algebra, would you be offended if I told you to start by learning math? If you want to be offended because I pointed that out, then that's your deal. Good luck in your endeavor.
-
[SOLVED] fread(), file(), or get_file_contents() ..?
.josh replied to DamienRoche's topic in PHP Coding Help
from the manual: As others have pretty much said, unless you are wanting to use some function specific to file() (like the fact that it puts the lines into an array), use file_get_contents(). -
Well, yes. You can have a form where you enter in the value, and click a submit button, and use php to populate the textbox with that data, but that's not really "real time." Suppose it depends on what your goals are. If you want something "real time," then you need to stick with javascript, because php is parsed on the server.
-
You want to have a number stored in a file, and you want to increment that number each time something happens right? That's the same principle as a hit counter. If you google hit counters, you will find plenty that use a flatfile that simply open a file, increment the value, and close it, the end. Or are you saying that you don't want to use google, you'd rather be spoonfed stuff? Because that's not how it works around here.
-
post your entire display block
-
that's not php that's javascript. edit: And that error means that javascript can't find the function. As in, it's not in the file somewhere.
-
google page hit counters it's the same principle
-
save the number in your database or a flatfile. Each time someone searches the db, update the number in that field or file.
-
To answer your question, your query may or may not be returning only 1 result, but you are only pulling 1 row from the result source, instead of looping it.
-
going to go out on a limb and say he just c/p'ed part of his code and that it extends beyond this.
-
[SOLVED] Not getting anything returned from the database?
.josh replied to toxictoad's topic in PHP Coding Help
no errors huh...turn your error reporting on. You didn't properly use quotes. up ther ein your ...or die('I can't ... you closed your msg out and it's out of sync from there, all the way down your script. -
That's because with the first 3, $test = 'blah'; doesn't mean anything. It's all just random data. It's like doing this: $x = "$test = 'blah'"; and then expecting to echo $test. Include() will actually parse what's in the file. There are examples in the manual that show you how to open a file, write something to it, and close it.
-
whoa wait I didn't say all that. I had to go look up in the manual what "N" was. That's a deal killer. I just conceded it was shorter
-
No worries, I'm not wiggin'.... You can use file() to grab all the contents of the file and put each line in an array. You can then do some regex or depending on how each line is setup, further split each line into an array. Change the number, glue it all back together, and save the whole thing. I suppose you can look into using xml... But seriously, there is no "better" way to do it, because with a flatfile, it's all just bytes to the computer. How the data is structured is entirely up to you. So there's really no way to single out a single piece of data, change it, and then save only that part of the file. Each time you save it, it would be saving the file as a whole.
-
What'd you expect out of a flatfile? That's why databases are better.
-
Nah I'll admit I didn't think of it. However, add in all the error checking and it's barely better than what we had. Requires php5 tho.
-
Hahaha pwned. Except that he wants monday as 0 not 1, and so on. Not really sure why he is even needing it to be trimmed or strtolowered. Ideally an input like that should be from a dropdown or radio button, not a textfield. I hope you know Mr. OP, lots of people can't spell the days of the week correctly, so you're either going to have to a) write lots of conditions to look for mispellings, trying to guess what the user meant b) keep handing the user your existing error message until they get it right c) use a dropdown or radio button where the values are already coded
-
fopen, fwrite, fclose. Or google flatfile hit counters,as there are a million and one out there.
-
I edited it just now, forgot about strtolower.