sseeley Posted January 1, 2009 Share Posted January 1, 2009 Hi I am new to PHP can anyone tell me whether I can generate a message box just using PHP? If you have some sample code that would be great. Many thanks in advance. Stuart Quote Link to comment Share on other sites More sharing options...
chronister Posted January 1, 2009 Share Posted January 1, 2009 elaborate more please. What do you mean by a message box? PHP can generate HTML, so thereby you can use PHP to generate an HTML box. What are you looking for? nate Quote Link to comment Share on other sites More sharing options...
sseeley Posted January 1, 2009 Author Share Posted January 1, 2009 I am just looking for a message box that displays errors for example when a user enters a password that is not the correct length. 'Your password must be at least 8 characters long'. Thanks Quote Link to comment Share on other sites More sharing options...
DarkSuperHero Posted January 1, 2009 Share Posted January 1, 2009 in that case all you need is a set of if,else statements <?php if(strlen($_POST['password'] < { echo('Your password must be at least 8 characters long'); } else{ echo('GOOD JOB!'); } Quote Link to comment Share on other sites More sharing options...
revraz Posted January 1, 2009 Share Posted January 1, 2009 For a Message Box, I think you will want to use Javascript. Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted January 1, 2009 Share Posted January 1, 2009 For a Message Box, I think you will want to use Javascript. I would have to agree with this post for some realtime checking you would need to use AJAX (JavaScript) with PHP used as the called page. There should be some examples of this around the net. Quote Link to comment Share on other sites More sharing options...
ratcateme Posted January 1, 2009 Share Posted January 1, 2009 also if you make something in javascript that check the length a password you need to rerun the check in php again before you insert it into the database. because javascript checks can be easily bypassed. Scott. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.