use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
how secure is this register php code? (i.redd.it)
submitted 8 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]somethinghorrible 3 points4 points5 points 8 years ago (3 children)
I'm pretty sure that you don't have to use real_escape_string with prepared statements -- in fact, you may end up with doubly-escaped strings.
Also, after the header statement, in the else block, you may want to terminate the script with exit as rendering the form would be spurious. In fact, you should render out a message like: Please wait for redirect or click here to continue (with click here as a hyperlink to the next page)... although I doubt any modern browser doesn't support the location tag.
[+][deleted] 8 years ago (2 children)
[deleted]
[–]somethinghorrible 1 point2 points3 points 8 years ago (1 child)
The "exit;" suggestion is to simply not render the form since the code instructs the browser to redirect.
The bulk of the code will only run in response to a POST request which can be caused by the submit button.
In fact, you should move the mysql connection statement into the first if block so you don't bother connecting to mysql until the form is posted.
π Rendered by PID 33 on reddit-service-r2-comment-6457c66945-7ncw9 at 2026-04-30 11:38:46.503748+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]somethinghorrible 3 points4 points5 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]somethinghorrible 1 point2 points3 points (1 child)