views:

344

answers:

5

How to create those message box in php, just like the one in facebook. Or any reference that you could give me that deals with designing.

+5  A: 

This has nothing to do with PHP, but is done on client side using HTML and Javascript.

Facebox is a very popular plugin based on JQuery.

This question has links to a number of others.

Pekka
+1  A: 

It's less a PHP server-side issue, more a client-side thing. So, one thing you could look at is doing it with is jQuery Dialogs

Paul Dixon
A: 

You will have to use php's GD to create a message box. Alternatively, you can simply echo out the javascript's message box using php with a code similar to this:

if ($success) {
  echo "<script>alert('information updated')</script>";
  echo "<script>navigate('other.php')</script>";
  exit();
} else {
  //....failed to update info
} 
Sarfraz
yeah thanks, I think this will do for a newbie like me.
+1  A: 

They are known as modal windows. Those are not achieved through PHP (although the content in them is loaded with PHP, so that might be what is making you think that). You can find many Facebook modal window clones, like Facebox.

Nate B
A: 

Most of the message boxes you see on websites such as Facebook are actually implemented in HTML, CSS and JavaScript. There are a number of examples of how to implement this with jQuery:

You could always wrap the code in a PHP function, however unless you are only using the message box in one place it would probably be simpler to put the code on each page.

Richard Slater