Skip to content

Instantly share code, notes, and snippets.

@orinx
Created May 21, 2012 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orinx/2763064 to your computer and use it in GitHub Desktop.
Save orinx/2763064 to your computer and use it in GitHub Desktop.
<?php
if(isset($_POST["us_email"]) && isset($_POST["us_pw"]) && $_POST["us_email"] != "" && $_POST["us_pw"] != ""){
try{
$chk = imap_open("{mail.ntou.edu.tw:110/pop3/novalidate-cert}INBOX",$_POST["us_email"],$_POST["us_pw"]);
}catch (Exception $e){
echo 'Caught exception: ', $e->getMessage(), "\n";
}
if($chk =="")
echo "Status : login failed";
else
echo "Status : login success";
}else{ ?>
<div align="center">
<form action="" method="post">
<b>Username</b> : <input type="text" name="us_email"> </br>
<b>Password</b> : <input type="password" name="us_pw"></br>
<input type="submit">
</form>
</div>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment