09/10/2018, 18:01
Hỏi về login cho trang web
Mình đã có 1 forum rồi, và giờ mình muốn tạo ra một trang web khác nhưng phần login lấy từ data của forum. Người xem phải đăng nhập (dùng user và password từ forum) để có thể vào trang web này ? Xin các bạn chỉ giúp cho
------------------
RCXH - Rồng Con Xứ Hàn
------------------
RCXH - Rồng Con Xứ Hàn
Bài liên quan





Khi đó, lúc log in thì bạn chỉ việc kiểm tra với dữ liệu trong db của forum thôi!
Bạn có thể copy nguyên phần log in của forum... Tuy nhiên, cũng phải chép luôn mấy phần phụ lằng nhằng ở đầu... Nói chung, nếu bạn không biết lập trình thì rất khó để tự làm.
Nếu copy nguyên cai source login của forum vào trang web thì khi login nó sẽ dẫn user vào forum mất !!! cái mình muốn là dẫn user vào trang web này chứ không phải vào forum???
Xin chỉ giúp!!!
Bạn bảo bạn biết lập trình nhưng tui ko nghĩ thế
- database thì đã có sẵn (của IPB)
- khi gọi log in, nó tạo form cho nhập pass
- khi thấy đã submit rồi (kiểm mảng $_POST) thì lấy usr/pwd so với trong database (1 câu select)
- nếu đúng thì ghi usr/pwd đó vào cookie, vào trang của bạn, sai thì báo lỗi
- trong các trang của bạn luôn kiểm tra cookie để tránh fake-login, hoặc là dùng session.
<form action="http://forums.invisio******.com/index.php?act=Login&CODE=01" method="post" name='LOGIN' onsubmit='return ValidateForm()'> <input type='hidden' name='referer' value="http://forums.invisio******.com/index.php" /> <div class="tableborder"> <div class="maintitle"><img src='style_images/1/nav_m.gif' border='0' alt='>' width='8' height='8' /> Log In</div> <div class='pformstrip'>Please enter your details below to log in</div> <table class="tablebasic" cellspacing="1"> <tr> <td class='pformleftw'>Please enter your name</td> <td class='pformright'><input type='text' size='20' maxlength='64' name='UserName' class='forminput' /></td> </tr> <tr> <td class='pformleftw'>Please enter your password</td> <td class='pformright'><input type='password' size='20' name='PassWord' class='forminput' /></td> </tr> </table> <div class="pformstrip">Options</div> <table class="tablebasic" cellspacing="1"> <tr> <td class='pformleftw'><b>Remember me?</b><br />If enabled, you will be automatically logged in again when you visit.<br />This is not recommended for shared computers.</td> <td class='pformright'><input type="radio" name="CookieDate" value="1" checked="checked" />Yes<br /><input type="radio" name="CookieDate" value="0" />No</td> </tr> <tr> <td class='pformleftw'><b>Privacy</b>, do you want to appear on the active users list?</td> <td class='pformright'><input type="checkbox" name="Privacy" value="1" />Don't add me to the active users list</td> </tr> </table> <div class="pformstrip" align="center"><input type="submit" name='submit' value="Log me in" class='forminput' /></div> </div> </form>