pollita Mon Dec 27 22:17:27 2004 EDT
Modified files:
/phpdoc/en/reference/ssh2/functions ssh2-auth-password.xml
Log:
Simple example for ssh2_auth_password()
http://cvs.php.net/diff.php/phpdoc/en/reference/ssh2/functions/ssh2-auth-password.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc/en/reference/ssh2/functions/ssh2-auth-password.xml
diff -u phpdoc/en/reference/ssh2/functions/ssh2-auth-password.xml:1.1
phpdoc/en/reference/ssh2/functions/ssh2-auth-password.xml:1.2
--- phpdoc/en/reference/ssh2/functions/ssh2-auth-password.xml:1.1 Fri Dec
24 20:03:17 2004
+++ phpdoc/en/reference/ssh2/functions/ssh2-auth-password.xml Mon Dec 27
22:17:27 2004
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc.
-->
<refentry id="function.ssh2-auth-password">
<refnamediv>
@@ -17,9 +17,26 @@
<methodparam><type>string</type><parameter>password</parameter></methodparam>
</methodsynopsis>
- <para>
+ <simpara>
Authenticate over SSH using a plain password
- </para>
+ </simpara>
+
+ <example>
+ <title>Authenticating with a password</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$connection = ssh2_connect('shell.example.com', 22);
+
+if (ssh2_auth_password($connection, 'username', 'secret')) {
+ echo "Authentication Successful!\n";
+} else {
+ die('Authentication Failed...');
+}
+?>
+]]>
+ </programlisting>
+ </example>
</refsect1>
</refentry>