Page 1 of 4 123 ... LastLast
Results 1 to 10 of 35
  1. #1
    Logic Guest
    If you want to share a script, post it in here. They will all be free, and there is no "bad script" (unless it doesn't work AT ALL :P).

    Feel free to share with us.

  2. #2
    Logic Guest
    Here is a Login Script that doesn't require a Database. I know its simple and useless for most of you, but if you don't have MySQL support... this'll help.

    Login Form:
    Code:
    <?
    print "<form name='login' method='post' action='passcheck.php'>\n";
    print "<table><tr><td>\n";
    print "Username:</td><td><input type='text' name='uname'>\n";
    print "</td></tr><tr><td>\n";
    print "Password:</td><td><input type='password' name='passw'>\n";
    print "</td></tr><tr><td>\n";
    print "<input type='submit' name='submit' value='Submit'>\n";
    print "</td></tr></table></form>\n";
    ?>
    Password Checking Script:
    Code:
    <?
    //Name: Password Check
    //Developer: Nick Colomb
    //Purpose: Check the Usernames and Passwords for logging in. *It includes using session data, user-levels, and is easily added onto.
    //Date: 12/30/2002
    //-------------------------------
    //Check if the fields are empty
    if(empty($uname))
    {
     * *print "You didn't enter a username.";
    }
    if(empty($passw))
    { * 
     * *print "You didn't enter a password.";
    }
    /* Now this is where you do the actual checking of the passwords */
    if(($uname == "User1") && ($passw === "Superfly"))
    {
     * *header("location: members.php"); * *//This sends them to the members area if the username and password are correct
     * *session_register("username", "level");
     * *$username="$uname";
     * *$level = "9";
    }
    elseif(($uname == "User2") && ($passw === "superman")) 
    {
     * *header("location: members.php");
     * *session_register("username", "level");
     * *$username="$uname";
     * *$level = "7";
    }
    elseif(($uname == "User3") && ($passw === "superduper")) 
    {
     * *header("location: members.php");
     * *session_register("username", "level");
     * *$username = "$uname";
     * *$level = "7";
    }
    elseif(($uname == "User4") && ($passw === "JumpinJupiter")) 
    {
     * *header("location: members.php"); * 
     * *session_register("username", "level");
     * *$username="$uname"; * *
     * *$level = "7";
    }
    elseif(($uname == "User5") && ($passw === "wordpass")) 
    {
     * *header("location: members.php");
     * *session_register("username", "level");
     * *$username="$uname"; * *
     * *$level = "7";
    }
    //This is my own personal error message for people who try to get into our site without an appropriate password! :P
    else {print "Ninjas would be good hackers because they are quick, unseen and silent... *But you... you are like a fat guy that's passing gas, and has a <b>real</b> bad body oder... *I know you're here, and you aren't coming in!";}
    ?>
    Here is how you can use your session data:
    Code:
    session_register("username", "level");
     * * * * * if ((session_is_registered("username") != "true") && (session_is_registered("level") != "true"))
     * * * * * * * {
     * * * * * * * * * *print "Now how did you get here?";
     * * * * * * * }
     * * * * * else
     * * * * * * * {
     * * * * * * * * * $top = "<link rel='stylesheet' type='text/css' href='styles.css'>";
     * * * * * * * * * print $top;
     * * * * * * * }
    $log = "Logged in as: <b>$username</b>";
    $lev = "Member Level: <b>$level</b>";
     * *
     * * * *//*-*- Output of the page -*-*
     * * * *print "<table width='100%'><tr><th colspan='3'align='right'><img src='images/heading.gif'></th></tr>";
     * * * *print "<tr><td class='info'>$log<br>$lev</td><td class='head'><center><b>::</b>Site Name<b>::</b></center></td></tr>";
     * * * *print "<tr><td class='menu'>Menu Area</td>";
     * * * *print "<td rowspan='2'>";
     * * * *print "Hey there $username! *This is the members area of Your site's Members Headquarters. *This is where the planning goes on at! *We figure out who we're gonna have a competition against, and we tell each other what we need to work on.";
     * * * *if ($level === "9")
     * * * *{
     * * * * * *print "<br><br><br><b>You are a site administrator.</b>";
     * * * *}
     * * * *elseif ($level === "7")
     * * * *{
     * * * * * *print "<br><br><br><b>You are a site moderator.</b>";
     * * * *}
     * * * *print "</td></tr>";
    
    ?>
    ENJOY!

  3. #3
    Logic Guest
    Okay... :P I gotcha... Nice... hehe...

  4. #4
    stratius Guest
    I did a quick and simple formmail script:
    <?php
    //Change these:
    &#036;you = "you@bleh.net";
    &#036;redirect = "http://www.yourdomain.com/thanks.html";

    //Main Program:
    &#036;buffer&nbsp; = &#036;QUERY_STRING;
    &#036;buffer&nbsp; = ereg_replace( "&","&#092;n",&#036;buffer);
    &#036;buffer .= "&#092;nIP: &#036;REMOTE_ADDR";
    mail(&#036;you,"Site Mailer",&#036;buffer,"From: Site Mailer");
    header("Location: " . &#036;redirect);
    ?>
    there is no checking so use at your own risk :lol:

  5. #5
    eminemblade Guest
    Code:
    &#60;?
    &#036;file=file&#40;&#34;counter.txt&#34;&#41;;
    echo &#40;&#34;&#60;font color=#0c4c79 face=arial size=1&#62;&#91;&#036;file&#91;0&#93;&#93;&#60;/font&#62;&#34;&#41;;
    &#036;fp=fopen&#40;&#34;counter.txt&#34;,&#34;w&#34;&#41;;
    fwrite&#40;&#036;fp,&#036;file&#91;0&#93;+1&#41;;
    fclose&#40;&#036;fp&#41;;
    ?&#62;
    
    The name of the file your counting in, in this case its in the same directory as the page
    The colour of the number that will appear on the page
    The font type that the numbers on the page will appear in 
    The size of the text, this is not in pixels. This is in &#34;Microsoft sizes&#34;
    
    To include this into your website use SSI or PHP
    
    SSI- &#60;&#33;--#include virtual=&#34;counter.php&#34; --&#62;
    PHP- &#60;?php include &#39;counter.php&#39;; ?&#62;

  6. #6
    Logic Guest
    Okay man... I understand your script perfectly, but... there is one problem... :P This is for people who don&#39;t know how to script, so when they look at it, they haven&#39;t got a clue what that does... So could you please fix it??

  7. #7
    DmX Guest
    I use this code to get a file count recursively on a folder
    *********************************************
    Code:
    &#60;% 
    Dim cnt 
    
    Sub Recurse&#40;Path&#41; 
    
    Dim fso, Root, WindowsFolder, Files, Folders, File, i, FoldersArray&#40;10000&#41; 
    
    Set fso = Server.CreateObject&#40;&#34;Scripting.FileSystemObject&#34;&#41; 
    Set Root = fso.getfolder&#40;Path&#41; 
    Set Files = Root.Files 
    Set Folders = Root.SubFolders 
    Server.ScriptTimeout = 10000 
    
    For Each Folder In Folders 
    
    Dim objFSO, objFolder 
    
    Set objFSO=Server.CreateObject&#40;&#34;Scripting.FileSystemObject&#34;&#41; 
    Set objFolder=objFSO.GetFolder&#40;Folder.Path&#41; 
    cnt = cnt + objFolder.files.Count 
    Set objFolder = Nothing 
    Set objFSO = Nothing 
    FoldersArray&#40;i&#41; = Folder.Path 
    i = i + 1 
    Next 
    
    For i = 0 To UBound&#40;FoldersArray&#41; 
    if FoldersArray&#40;i&#41; &#60;&#62; &#34;&#34; Then 
    Recurse FoldersArray&#40;i&#41; 
    Else 
    Exit For 
    End if 
    Next 
    
    End Sub 
    
    
    Recurse &#34;D&#58;&#092;Folder to Count&#092;&#34; 
    
    %&#62;

  8. #8
    Logic Guest
    Well, I love ASP. I am 10 times better at it than I am at PHP, but... :P I&#39;m still learning php so... I am at about the "intermediate" level of php now... :P

  9. #9
    Logic Guest
    you may think you know php because of your knowledge of c++ but there is a huge portion of it that cpp doesn&#39;t cover.

  10. #10
    Logic Guest
    yeah... there is a difference between in ASP and VB.... I love ASP but don&#39;t like VB...

Page 1 of 4 123 ... LastLast

Posting Permissions

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