Location: PHPKode > scripts > phpWords > phpWordsArabic/functions.php
<?php

function doLogin( $titleMsg )
{
    //global $state;
    //echo "\$state= $state<br>";
?>
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<title>Word Database Authentication</title>
</head>

<body bgcolor="#ffffff">

<p>

<center>
<form method="POST" action="contact.php">
<table border="0"  width="70%">
    <tr bgcolor="#c8d8f8">
        <td>
            <br>
            <center><font size="+1">
            <b><? echo $titleMsg; ?></b>
            </font></center>
        </td>
    </tr>
    <tr bgcolor="#FFFFFF">
        <td width="100%" valign="top">
            <center><font size="-1">
            Username:
            <br>
            <input type="text" name="userid" size="15">
            <br>
            </font></center>
        </td>
    </tr>
    <tr bgcolor="#FFFFFF">
        <td width="100%" valign="top">
            <center><font size="-1">
            Password:
            <br>
            <input type="password" name="passwd" size="15">
            </font></center>
        </td>
    </tr>
    <tr bgcolor="#FFFFFF">
        <td>
            <center>
            <!--<input type="hidden" name="action" value="setcookie"> -->
            <input type="submit" name="Login1" value=" Login ">
            </center>
        </td>
    </tr>
</table>
</form>
</center>

</body>
</html>

<?
exit();
} // end of function doLogin


function Delete_Contact( $wid, $un )
{
   global $hostname, $dbname, $tablename, $user, $password;

//   mysql_pconnect( $hostname, $user, $password )
//        or die( "DB connection failed in function Delete_Contact" );
    mysql_connect($hostname, $user, $password) OR DIE ("Unable to connect to database in function Delete_Contact.");
    mysql_select_db($dbname);
	mysql_set_charset('utf8');

    $sql = "DELETE FROM $tablename WHERE wid='$wid'";

    if ( $un != "guest" ) {
        $success = mysql_db_query( $dbname, $sql )
            or die( "DB Query failed in function Delete_Contact, sql = '$sql'" );
    }
    else {
        echo( "Deleting not allowed!" );

        $success = 0;
    }
        
    if ( $success ) {
        $Form_Msg ="Word Deleted!";
    } else {
        $Form_Msg ="Delete Failed!!!";
    }
?>
<br><br>
<center>
<b><? echo $Form_Msg; ?></b>
</center>

<?
} // end of function Delete_Contact


function ConvertToUTF8( $str1, $enc1 ) {

	if ( strncmp( $enc1, "Windows-1256", 12 ) == 0 ) {
		return iconv( "Windows-1256", "UTF-8", $str1 );
	}
	else {
		return $str1;
	}
}

function ConvertToWindows1255( $str1, $enc1 ) {

	if ( strncmp( $enc1, "UTF-8", 12 ) == 0 ) {
		return iconv( "UTF-8", "Windows-1255", $str1 );
	}
	else {
		return $str1;
	}
}

function ConvertToWindows1256( $str1, $enc1 ) {

	if ( strncmp( $enc1, "UTF-8", 12 ) == 0 ) {
		return iconv( "UTF-8", "Windows-1256", $str1 );
	}
	else {
		return $str1;
	}
}

?>
Return current item: phpWords