Form Submit to lightbox

Hi Group.

I have an html page where a form submits to a php page. It works, but the php page loads an entire page to return just one variable. I was thinking there would be a better and neater way to return the php in the form of a lightbox or modal.

Here is my form code

[code]

[/code]

my doadd.php has the following.

$message = $_POST['message'];

It inserts this data into a database and then echos the results to the doadd.php page for the user to see.

The results are just a single line, hence the need for a simpler box.

Any help appreciated!

You could get rid of the other page altogether and use the current page if that’s the case.

[php]

<?php //example code $message = $_POST['message']; if(isset($_POST['submit']){ echo $message; } ?>

[/php]

That’s an interesting way. Can I get the result to show in a lightbox?

I don’t know what that is

Also called shadowboxes or modals

Try this #13

http://www.webdeveloper.com/forum/showthread.php?221637-POP-UP-quot-thank-you-for-contacting-us-quot-window-on-a-php-mail-form&p=1061211#post1061211

Or this one its timed
[php]

blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
Thanks!
Your message was sent.
[/php]

Would this be able to do more than say thank you? I need it to return a single item out of the database.

Sure, see this line
[php]

Thanks!
Your message was sent.

[/php]

Just edit the Thanks!
Your message was sent. part to be the output from your database. like you would a normal php echo statement for the data.

Sponsor our Newsletter | Privacy Policy | Terms of Service