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 Link to comment https://forums.phpfreaks.com/topic/139126-php-message-box/ 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 Link to comment https://forums.phpfreaks.com/topic/139126-php-message-box/#findComment-727672 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 Link to comment https://forums.phpfreaks.com/topic/139126-php-message-box/#findComment-727674 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!'); } Link to comment https://forums.phpfreaks.com/topic/139126-php-message-box/#findComment-727676 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. Link to comment https://forums.phpfreaks.com/topic/139126-php-message-box/#findComment-727680 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. Link to comment https://forums.phpfreaks.com/topic/139126-php-message-box/#findComment-727688 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. Link to comment https://forums.phpfreaks.com/topic/139126-php-message-box/#findComment-727691 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.