Results 1 to 10 of 37
Thread: Script Warehouse
-
02-10-2003, 10:38 PM #1LogicGuest
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.
-
02-10-2003, 10:40 PM #2LogicGuest
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"; ?>
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!";} ?>
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>"; ?>
-
02-11-2003, 05:01 PM #3LogicGuest
Okay... :P I gotcha...
Nice... hehe...
-
02-12-2003, 09:52 AM #4stratiusGuest
I did a quick and simple formmail script:
<?php
//Change these:
$you = "you@bleh.net";
$redirect = "http://www.yourdomain.com/thanks.html";
//Main Program:
$buffer = $QUERY_STRING;
$buffer = ereg_replace( "&","\n",$buffer);
$buffer .= "\nIP: $REMOTE_ADDR";
mail($you,"Site Mailer",$buffer,"From: Site Mailer");
header("Location: " . $redirect);
?>
-
02-16-2003, 12:15 PM #5eminembladeGuestCode:
<? $file=file("counter.txt"); echo ("<font color=#0c4c79 face=arial size=1>[$file[0]]</font>"); $fp=fopen("counter.txt","w"); fwrite($fp,$file[0]+1); fclose($fp); ?> 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 "Microsoft sizes" To include this into your website use SSI or PHP SSI- <!--#include virtual="counter.php" --> PHP- <?php include 'counter.php'; ?>
-
02-16-2003, 05:56 PM #6LogicGuest
Okay man...
I understand your script perfectly, but... there is one problem... :P This is for people who don't know how to script, so when they look at it, they haven't got a clue what that does... So could you please fix it??
-
02-19-2003, 10:53 PM #7DmXGuest
I use this code to get a file count recursively on a folder
*********************************************
Code:<% Dim cnt Sub Recurse(Path) Dim fso, Root, WindowsFolder, Files, Folders, File, i, FoldersArray(10000) Set fso = Server.CreateObject("Scripting.FileSystemObject") Set Root = fso.getfolder(Path) Set Files = Root.Files Set Folders = Root.SubFolders Server.ScriptTimeout = 10000 For Each Folder In Folders Dim objFSO, objFolder Set objFSO=Server.CreateObject("Scripting.FileSystemObject") Set objFolder=objFSO.GetFolder(Folder.Path) cnt = cnt + objFolder.files.Count Set objFolder = Nothing Set objFSO = Nothing FoldersArray(i) = Folder.Path i = i + 1 Next For i = 0 To UBound(FoldersArray) if FoldersArray(i) <> "" Then Recurse FoldersArray(i) Else Exit For End if Next End Sub Recurse "D:\Folder to Count\" %>
-
02-20-2003, 03:05 PM #8LogicGuest
Well, I love ASP. I am 10 times better at it than I am at PHP, but... :P I'm still learning php so... I am at about the "intermediate" level of php now... :P
-
02-22-2003, 08:56 PM #9LogicGuest
you may think you know php because of your knowledge of c++ but there is a huge portion of it that cpp doesn't cover.
-
02-23-2003, 04:50 PM #10LogicGuest
yeah... there is a difference between in ASP and VB....
I love ASP but don't like VB...
Bookmarks