Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Question!

  1. #1
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Question Question!

    Is there a code i can use for Freewebs to make a "member's area" so to speak? Where people have a username and password and can look at certain things that only they can see (because there a member)

    if not is there any free web hosting that can enable html and accepts that?

  2. #2
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default

    would this work???


    <!-- TWO STEPS TO INSTALL MULTIPLE USERS:

    1. Copy the first code into the HEAD of your HTML document
    2. Put the last coding into the BODY of your HTML document -->

    <!-- STEP ONE: Copy this code into the HEAD of your login HTML document -->

    <HEAD>

    <SCRIPT LANGUAGE="JavaScript">

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin
    function Login(){
    var done=0;
    var username=document.login.username.value;
    username=username.toLowerCase();
    var password=document.login.password.value;
    password=password.toLowerCase();
    if (username=="member1" && password=="password1") { window.location="page1.html"; done=1; }
    if (username=="member2" && password=="password2") { window.location="page2.html"; done=1; }
    if (username=="member3" && password=="password3") { window.location="page3.html"; done=1; }
    if (done==0) { alert("Invalid login!"); }
    }
    // End -->
    </SCRIPT>

    <!-- STEP TWO: Paste this code into the BODY of your HTML document -->

    <BODY>

    <center>
    <form name=login>
    <table width=225 border=1 cellpadding=3>
    <tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr>
    <tr><td>Username:</td><td><input type=text name=username></td></tr>
    <tr><td>Password:</td><td><input type=text name=password></td></tr>
    <tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
    </table>
    </form>
    </center>

    <p><center>
    <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>

    <!-- Script Size: 1.60 KB -->

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    No. The script above only works for users with JavaScript enabled.
    if not is there any free web hosting that can enable html and accepts that?
    Try funpic.org
    Freewebs doesn't allow PHP/MySql, and funpic.org (free) does. Learn about PHP first (or another server-side language) then you can make a "member page"
    - Mike

  4. #4
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default

    i know html... does that count??

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Er... No. HTML can't store data in any way shape or form. If you only know HTML you're out of luck.
    I have one question though: Do you want users to be able to make their own account and stuff, or do you want a general password everyone could enter?
    - Mike

  6. #6
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default

    general password

  7. #7
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default

    can i use html on funpic??

  8. #8
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    yes, but you will need something more to add a memebers area(real simple)

  9. #9
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Okay then. This can be done with PHP (without MySql).
    This would be your login page:
    Code:
    <form action="login.php" method="get">
     User: <input type="text" name="user">
     <br>Password: <input type="text" name="pass">
     <br><input type="submit" value="Login">
    </form>
    and this would be login.php:
    Code:
    <?php
    $password = $_POST['pass'];
    $username = $_POST['user'];
    if ($password != 'password_here' || $username != 'username_here') {
    	exit("<font color='red'>Invalid username or password. Please go back and try again.</font>");
    }
    ?>
    You can't use freewebs though
    - Mike

  10. #10
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default

    can u enlighten me on how to do a few things?:
    >I can't find the page to put all the codes and stuff (can't find out where to go to setup my page)
    >a code to make a username and password for a certain page?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •