Sie sind nicht angemeldet.
![]() |
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
<!-- This is released to the public domain --> <html> <head> <title>Jabber Messaging Form</input> <head> <body> <h1>Send A Jabber Message</h1> <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post"> <div><textarea name="msg"></textarea></div> <div><input type="submit" value="Send"/></div> </form> <?php if ($_POST) { require_once('class.jabber.php'); $jabber = new Jabber(); # Configuration $jabber->server = 'example.com'; $jabber->port = 5222; $jabber->username = 'example'; $jabber->password = 'password'; $jabber->resource = 'webform'; $receiver = 'you@example.com'; $subject = sprintf('Message from website by %s (%s)', $_SERVER['REMOTE_ADDR'], getHostByAddr($_SERVER['REMOTE_ADDR'])); # /Configuration # Connect if (! @$jabber->Connect()) $result = 'Could not connect.'; # Authenticate elseif (! @$jabber->SendAuth()) $result = 'Authentication failed.'; # Send message elseif (! @$jabber->SendMessage($receiver, 'normal', NULL, array( 'subject' => $subject, 'body' => utf8_encode(htmlspecialchars($_POST['msg'])) ))) $result = 'Message could not be sent.'; else $result = 'Message sent.'; # Disconnect @$jabber->Disconnect(); echo '<p>' . $result . '</p>'; } ?> </body> </html> |
Zitat
blöööp
Zitat
sinnfrei aber okay ... *G*
Zitat
gehts?
-