Jump to content

Archived

This topic is now archived and is closed to further replies.

sseeley

PHP Message Box

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!');
}

 

Share this post


Link to post
Share on other sites

For a Message Box, I think you will want to use Javascript.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.