私は基本的に、私が作成した Bootstrap Web サイトに取り組んでいます。フォーラム (MyBB) を接続して、自分の Web サイトからログインできるようにしました。
問題は、まだPHPに慣れていないため、サインインテキストをユーザーの名前に置き換えようとして立ち往生していることと、ログアウトまたは切断してサインアップすることです。
これはこれまでのところどのように見えるかです:
そして、これは私が達成したいことです:
また、フォーラムのアバターを取得してバーに表示する
これは私のフォームです:
<?php
if($mybb->user['uid'])
{
// If the user if logged in, display a welcoming message.
echo "<div class='welcome-msg'>Welcome back ".$mybb->user['username']."!<br /></div>";
echo "<div class='warning'>Log out.";
}
else
{
// If the user is not logged in, display the login form.
echo "<form action='forums/member.php' method='post'>";
echo "<input type='hidden' name='action' value='do_login' />";
echo "<input type='hidden' name='url' value='../index.php' />";
echo "<input id='user_username' placeholder='Username' type='text' name='username' maxlength='30' /><br />";
echo "<input id='user_password' placeholder='Password' type='password' name='password' /><br />";
echo "<input class='btn btn-warning' style='clear: left; width: 100%; height: 32px; font-size: 13px;' type='submit' name='submit' value='Login' />";
echo "</form>";
}
?>
もちろん、誰かに実際に作ってもらうように頼んでいるわけではありません。どうすればそれを達成できるかについての参考資料が必要です。(例:どのタイプを使うか)