KevinM1
Moderators-
Posts
5,222 -
Joined
-
Last visited
-
Days Won
26
Everything posted by KevinM1
-
Again, your echo in the else clause won't show. Technically, it will display, but the header command will be invoked immediately after, bringing the user to a new page that DOES NOT have that message.
-
The problem is the echo at the top of your code. For one, you can't send any output to the screen before calling header. That's just the way it works. But, second, your echo is pointless anyway because you're redirecting the user. They won't ever see that error message. --- Again, stop what you're doing and take the time to learn the basics. I realize that you find the documentation to be difficult to understand, but, really, the difficulty only goes up from there. Every script ever made is built upon the foundations of the language itself - how it ties into HTTP, how it can generate HTML, CSS, and JavaScript, etc. The idea that you can somehow magically get something working and then comb through it line-by-line to figure out why after the fact is illogical. At best, you'll be forced to learn all that stuff anyway. At worst, and more likely, you'll learn only one way to do something and never grow. We're not trying to berate you, but we see a guy who's drowning that's refusing to grab onto a ring buoy. Stubbornness and/or fear is a bad excuse to not learn. If you truly want to learn this stuff, then screw what others will think/see and just do it.
-
In USA (Miami) for a month, wondering about getting some freelance work
KevinM1 replied to Garethp's topic in Miscellaneous
Have you tried craigslist? Have you searched google for "Miami web freelancing/freelancer?" -
Password Varification Doesn't work, Doesn't Check Length of Variable
KevinM1 replied to TecTao's topic in PHP Coding Help
Okay, so 'not working' means what in this context? How are you testing the function? I do see a typo: if ($stln < 6 or $strln > 10){ $stln is not the same as $strln (notice the 'r'). Also, at the top of your script, you define: $pass =$_POST['pass1']; But in update.php, you have: list($sucsess,$response) = passver($pass1); Note that $pass is not $pass1. -
Password Varification Doesn't work, Doesn't Check Length of Variable
KevinM1 replied to TecTao's topic in PHP Coding Help
Are you actually invoking your passver() function anywhere? EDIT: You do know that none of your return (0); statements will ever execute, right? -
I've tried looking around but their are none near me. Are their sites on which you can learn PHP. I've seen some sites in which you can actually learn code on a website? Look at the links in the answers: http://stackoverflow.com/questions/4902432/is-there-a-php-fiddle
-
No. The header function sends an HTTP header to the client. The header can do multiple things (as the example code in the documentation illustrates). Among them, it can send the client to another resource (that's what 'Location: blah' does), it can set the HTTP status (like 500 for an internal server error, 404 not found, etc.), and other things as well. HTTP stands for HyperText Transfer Protocol. It's the primary protocol of the web, and essentially describes the format and behavior of messages sent and received by the client and server. HTTP headers are the beginning of those messages, and tell whichever thing (client or server) how to handle the rest of the message.
-
First, I'd check the PHP documentation (header). If I didn't understand what an HTTP header was, I'd do some research - there's a link to the HTTP specification in the PHP documentation for header(), so I'd check that out. I'd also check out wikipedia, as their programming articles are generally a decent Reader's Digest version of the actual topics. Not sure how to help you there, to be honest. Larry Ullman's Visual Quickstart Pro books are probably your best bet. They're very beginner friendly. Beyond that, I'm not sure.
-
All of this. The 'right way' to do something is usually a balance between complexity, performance, ease of use, and how it fits into your overall project. The best a 3rd party script or tutorial can do is point you in a general direction. There is always tweaking and modification that needs to be done. Sometimes small (rendered HTML/CSS), sometimes large (change the way the script talks to the back end, or the back end itself). This goes for professional solutions as well. WordPress, Joomla, et al. don't tend to address the edge use cases that a project's identity can depend on. Even with plugins, you'll likely find that you need to actually go under the hood from time to time. Just to be clear, we're not being critical to be mean. We're being critical because we were in your position once, too, and have been through the frustration of learning. We're trying to help you avoid common pitfalls that will merely have you wasting time and not really learning. One of the problems with 3rd party scripts is that unless you're experienced, you can't tell if the code is good or not. It's not just a matter of "Will this work?" It's a matter of "Will this work? Is it secure? Does it work well? Does it fit in with the rest of my code?" Handling input, stuffing data in a database, and displaying something on the screen is only part of the process. And there are a ton of shitty free scripts out there that will only teach you the wrong way to approach a problem. That's why I keep trying to hammer home the idea of learning from the ground up. You need to know the basics language itself before you can attempt to make your ideas a reality. The PHP site itself has some of the best online documentation in the business (http://www.php.net/manual/en/langref.php). There are plenty of good books on the subject (Larry Ullman's books are straightforward and gentle) as well. From there, it's a matter of doing research, asking questions, and practicing by writing small test scripts. No web developer has ever spawned fully formed. We've all had to make a gazillion number of rinky-dink, idiotic test scripts in our lives. I still like to prototype in that way.
-
Thanks for the links! making us all google, you jerk. *insert the "give a man a fish/teach a man to fish" parable here*
-
@justlukeyou - You're going about learning PHP in a very inefficient manner. What I've seen is that you have an idea for a site, and rather than learning in a linear manner, you scour the web for different small scripts to mash together in the hope that something will actually come of it. That's really the worst way to learn because you're focused more on the end result rather than the process. PHP is a language. It has syntax and grammar, and you'll be much better served if you do the tedious work of learning the building blocks rather than jumping to a finished project. To stretch a literary metaphor, right now you're trying to write a novel in French without understanding how verbs work. Not gonna happen. So instead of going through the painful "I'm going to blindly throw shit at the wall and examine what sticks" process, go back to the beginning and start again. That may sound horrible, but it's really the only way you'll become anything more than a dabbler.
-
I never get tired of that image.
-
For anyone interested in the tech behind it, EA/Maxis has some vids on YouTube describing their Glass Box system. It's pretty cool to see how they abstracted away various kinds of behavior (fires, water, electricity, and even people/traffic all operate under variations of the same idea). It looks very flexible.
-
If you're using PHP 5.3+, you can use the new DateTime functionality. It works both procedurally and in OOP. http://www.php.net/manual/en/datetime.construct.php http://www.php.net/manual/en/datetime.gettimestamp.php
-
Not that I have anything against Danica Patrick's chest....
-
Why not use an email_filter and escape the data before it hits the db? http://php.net/manual/en/filter.filters.validate.php
-
Also: http://lmgtfy.com/?q=forgot+password+php+tutorial
-
If its so bad why are people on here recommending it? A grand total of one person recommended it, and it was a poor recommendation. Yes, that's a better script. The basic idea is this: User clicks "Forgot Password" -> they are brought to a form where they're supposed to enter in their email address -> If the email address is in the system, stuff happens* and the email is sent -> user clicks on a link in the email, they're logged in and are brought to a form where they can enter in a new password. *Basically, you need to create some sort of temporary password for the user and store it in the system. You can either create a db table just for temp passwords (like the SO script does) or overwrite the user's existing password with the temp password. That's up to you, and how you think it should work. Regardless, the link present in the email should contain query string values ($_GET[]....) for the user's id and the temp password. They should be obfuscated or hashed. --- All that said, I'm still of the opinion that you desperately need to brush up on the basics. Not knowing what a hash is (among other things) while attempting to create a system that handles user data is concerning. I'm not saying this to pick on you, but rather as a security and privacy conscious end user. Take your time if you don't understand how this all works. Far better to go slow and do it right the first time than to slap something together and get a breach. Remember - most users tend to use the same email and passwords for many sites. That's one vector of identity theft and data loss - a small site with poor security is compromised, and months later that information is used to screw people over. Don't. Rush.
-
They have DOS attacks down to a science: http://arstechnica.com/business/2012/02/high-orbits-and-slowlorises-understanding-the-anonymous-attack-tools/ Given their distributed nature, popularity, and the existence of such script-kiddie friendly tools, they have an army of teens/young adults who are just itching to troll on a global scale.
-
Horrible script. Short tags, use of ereg functions for the regex checks (which should be triggering warnings if you're using PHP 5.3+), regex instead of built-in filters (which have been available by default since 5.2 - http://www.php.net/manual/en/filter.examples.validation.php). The best one will be the one you write yourself. You just need to slow down and learn the basics. You're trying to run before you can crawl, let alone walk, and even a 3rd party script won't help you much if you don't understand what you're looking at.
-
Okay, before you go any further, you really need to sit down and go over basic web security. Start here: http://www.amazon.com/Pro-PHP-Security-Application-Implementation/dp/1430233184/ref=sr_1_2?s=books&ie=UTF8&qid=1347297030&sr=1-2&keywords=php+security
-
Google - 3 Bing - 2
-
What do you mean by 'power'? Or, maybe that's because there's still a not insignificant number of web projects that don't need to incur the overhead of OOP? Or, maybe there's a ton of legacy systems out there that are cost prohibitive to rewrite from the ground up?
-
To shift the snark in a different direction, isn't this something the OP could have learned/determined by doing some research on their own? I mean, Java is a well-known platform, and presumably the OP has some experience in PHP. Surely it's not that difficult to compare and contrast the two languages. Even looking at their comparative Wikipedia descriptions would bear fruit.
-
Huh. So, do they not have function parameters? They do. This is a JavaScript example, which works on the same principle: var foo = 'bar'; function a() { console.log(foo); } a(); // foo ... function a() { var foo = 'bar'; } a(); console.log(foo); // undefined Okay, but in JavaScript, you can combat that a bit by forcing scope, either by an object literal or self-invoking anonymous function. Do Perl or Bash have any such mechanisms?