Jul 27, 2008

Free Php Scripts

Free Web Hosting, No Ads > CONTRIBUTE > Freebie Stuff
Pages: 1, 2, 3

free web hosting

Free Php Scripts

ads-online
IP address Info !!!!!!!!!
CODE

<?php
$ip = $_SERVER['REMOTE_ADDR'];
echo "IP Address: " . $ip;
?>


Alternatively you could display the users browser information. to do that use the example below.

CODE

<?php

$info = $_SERVER['HTTP_USER_AGENT'];
echo "Browser Info: " . $info;

?>


Of course you could combine to the and add a few other functions to show some more information.
CODE

<?php
$ip = $_SERVER['REMOTE_ADDR'];
$hst = $_SERVER['HTTP_HOST'];
$url = $_SERVER['REQUEST_URI'];
$br = $_SERVER['HTTP_USER_AGENT'];

echo "Your IP: " . $ip . "<br>URL You Requested: " . $url . "<br>Your Browser Info: " . $br
?>
Notice from jlhaslip:
bbcode required on code entries

 

 

 


Reply

ads-online
PHP Redirect !!!!!!!!!

CODE
<?php

$url = $_GET['url'];

header("Location: $url");

?>
Notice from jlhaslip:
bbcode tags required for code entries

Reply

ads-online
Online Script : How peoples are on your web site .

CODE

<script src=http://fastonlineusers.com/online.php?d=www.yoursite.com></script> online<br>
Notice from jlhaslip:
bbcode tags required for code entries

Reply

ads-online
HTML Site Redirect .
CODE


4 Steps if you require the clock - 1 Step if you don't
==================================================================
Step 1 - Put this in your <head> tag

<META HTTP-EQUIV="REFRESH" CONTENT="10;URL=refresh2.html">

============================================================
Step 2 - The clock
===============================================================
<script LANGUAGE="JavaScript">



<!-- Begin
startday = new Date();
clockStart = startday.getTime();
function initStopwatch() {
var myTime = new Date();
var timeNow = myTime.getTime();  
var timeDiff = timeNow - clockStart;
this.diffSecs = timeDiff/1000;
return(this.diffSecs);
}
function getSecs() {
var mySecs = initStopwatch();
var mySecs1 = ""+mySecs;
mySecs1= mySecs1.substring(0,mySecs1.indexOf(".")) + " secs.";
document.form1.timespent.value = mySecs1
window.setTimeout('getSecs()',1000);
}
// End -->
</SCRIPT>

=============================================================
Step 3
=========================================================

<BODY onLoad="window.setTimeout('getSecs()',1)">

=============================================================
Step 4
=============================================================

<!-- A1 --><CENTER>
<FORM NAME="form1">
<input type="text" value="" name="timespent" size=10>
</FORM>
</CENTER><!-- -->

<!-- Script Size:  1.36 KB  -->
Notice from jlhaslip:
bbcode tags required for code entries

 

 

 


Reply

ads-online
PHP mail Form .
CODE

<?php
// ************Begin Configure***************
//Put where you want the email to go
$mailto = "";
//Put your subject in here
$subject = "";
//Put where you want to redirect after the mail have been sent .
$redirect = "";

// ************End Configure****************

foreach($HTTP_POST_VARS as $key => $value) {

     $message .= $key . ':  ' . $value;
     $message .= "\n";

}
 $headers = "From : $mailto ";

if (@mail($mailto, $subject, $message, $headers)) {  
header("Location: $redirect");
} else {
// This echo's the error message if the email did not send.    
// You could change  the text in between the <p> tags.  
echo('<p>Error .  Please use your back button to try again.</p>');
}
?>
Notice from jlhaslip:
bbcode tags required for code entries

Reply

ads-online
PHP Bulk Emailer :
CODE

<?
If ($action=="mysql"){


include "mysql.info.php";

if (!$sqlhost || !$sqllogin || !$sqlpass || !$sqldb || !$sqlquery){

print " MySQL information wrong.";

exit;

}

$db = mysql_connect($sqlhost, $sqllogin, $sqlpass) or die("Connection to MySQL Failed.");

mysql_select_db($sqldb, $db) or die("Could not select database $sqldb");

$result = mysql_query($sqlquery) or die("Query Failed: $sqlquery");

$numrows = mysql_num_rows($result);



for($x=0; $x<$numrows; $x++){

$result_row = mysql_fetch_row($result);

$oneemail = $result_row[0];

$emaillist .= $oneemail."\n";

}

}



if ($action=="send"){

$message = urlencode($message);

$message = ereg_replace("%5C%22", "%22", $message);

$message = urldecode($message);
$message = stripslashes($message);
$subject = stripslashes($subject);

}
$realname = $_POST['realname'];
$replyto = $_POST['replyto'];
$from = $_POST['from'];
$subject = $_POST['subject'];


?>
<title>Powered By murtyyy</title>
<form name="form1" method="post" action="" enctype="multipart/form-data">

<br>

<table width="100%" border="0">

<tr>

<td width="10%">

<div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Your

Email:</font></div>

</td>

<td width="18%"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">

<input type="text" name="from" value="<? print $from; ?>" size="30">

</font></td>

<td width="31%">

<div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Your

Name:</font></div>

</td>

<td width="41%"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">

<input type="text" name="realname" value="<? print $realname; ?>" size="30">

</font></td>

</tr>

<tr>

<td width="10%">

<div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Reply-To:</font></div>

</td>

<td width="18%"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">

<input type="text" name="replyto" value="<? print $replyto; ?>" size="30">

</font></td>

<td width="31%">

<div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Attach

File:</font></div>

</td>

<td width="41%"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">

<input type="file" name="file" size="30">

</font></td>

</tr>

<tr>

<td width="10%">

<div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Subject:</font></div>

</td>

<td colspan="3"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">

<input type="text" name="subject" value="<? print $subject; ?>" size="90">

</font></td>

</tr>

<tr valign="top">

<td colspan="3"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">
Message :
<textarea name="message" cols="60" rows="10"><? print $message; ?></textarea>

<br>

<input type="radio" name="contenttype" value="plain">

Plain

<input type="radio" name="contenttype" value="html" checked>

HTML

<input type="hidden" name="action" value="send">

<input type="submit" value="Send Message">

</font></td>

<td width="41%"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">
Mails :
<textarea name="emaillist" cols="30" rows="10"><? print $emaillist; ?></textarea>

<br>

</font></td>

</tr>

</table>

</form>



<?

if ($action=="send"){



if (!$from && !$subject && !$message && !$emaillist){

print "Please complete all fields before sending your message.";

exit;

}



$allemails = split("\n", $emaillist);

$numemails = count($allemails);



#Open the file attachment if any, and base64_encode it for email transport

If ($file_name){

@copy($file, "$file_name") or die("The file you are trying to upload couldn't be copied to the server");

$content = fread(fopen($file,"r"),filesize($file));

$content = chunk_split(base64_encode($content));

$uid = strtoupper(md5(uniqid(time())));

$name = basename($file);

}



for($x=0; $x<$numemails; $x++){

$to = $allemails[$x];

if ($to){

$to = ereg_replace(" ", "", $to);

$message = ereg_replace("&email&", $to, $message);

$subject = ereg_replace("&email&", $to, $subject);

print "Sending mail to $to.......";

flush();

$header = "From: $realname <$from>\r\nReply-To: $replyto\r\n";

$header .= "MIME-Version: 1.0\r\n";

If ($file_name) $header .= "Content-Type: multipart/mixed; boundary=$uid\r\n";

If ($file_name) $header .= "--$uid\r\n";

$header .= "Content-Type: text/$contenttype\r\n";

$header .= "Content-Transfer-Encoding: 8bit\r\n\r\n";

$header .= "$message\r\n";

If ($file_name) $header .= "--$uid\r\n";

If ($file_name) $header .= "Content-Type: $file_type; name=\"$file_name\"\r\n";

If ($file_name) $header .= "Content-Transfer-Encoding: base64\r\n";

If ($file_name) $header .= "Content-Disposition: attachment; filename=\"$file_name\"\r\n\r\n";

If ($file_name) $header .= "$content\r\n";

If ($file_name) $header .= "--$uid--";

mail($to, $subject, "", $header);

print "&nbsp; &nbsp; &nbsp; Sent !!! Powered By Murtyyy !!! <BR><BR>";

flush();

}

}



}



?>
Notice from jlhaslip:
bbcode tags required for code entries

Reply

ads-online
Ticker ::::::::
CODE


admin.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Admin Ticker Section</title>
</head>
<body>
<br><hr />

<form action="<?php echo $_SERVER[PHP_SELF];?>" method="POST">

<center>Insert Message <input type="text" name="message" maxlength="1000" />
<button type="submit" value="Insert">Insert</button></center>

</form>
<?php
include("conf.php");
$conectare = mysql_connect("$host", "$user", "$pass") or die("Incorect user/pass/host Please config conf.php");
 mysql_select_db("$database", $conectare);
$message = $_POST["message"];
$len = strlen($message);
if($len > 0)
{
$delold = "TRUNCATE `ticker`";
mysql_query($delold, $conectare);

$query = "INSERT INTO ticker (mesaj) VALUES ('$message')";
mysql_query($query, $conectare);
}
else echo "Message too short";
?>
</body>
</html>


/////////////////////////////////////////////////////////////////


conf.php

<?php
$host = "localhost"; //Edit here with the host of you database, if you don't know it leave localhost
$user = "**********"; //Edit here with your username
$pass = "**********"; // Edit here with your password
$database = "******"; //Edit here with your database name
?>

/////////////////////////////////////////////////////////////////


install.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Install Ticker</title>
</head>
<body>
<b><font size="5">Ticker Setup</font></b> <hr />
<br><br>
<b>Creating Tables.....
<?
include("conf.php");
$conectare = mysql_connect("$host", "$user", "$pass") or die("First config conf.php with the right account details");
 mysql_select_db("$database", $conectare);
 
 $tables = "CREATE TABLE `ticker` (`mesaj` text NOT NULL);";
 mysql_query($tables, $conectare);
?>Done</b><Br>

</body>
</html>

/////////////////////////////////////////////////////////////


ticker.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Ticker</title>
</head>
<body>
<?php
include("conf.php");
$conectare = mysql_connect("$host", "$user", "$pass") or die("Incorect user/pass/host Please config conf.php");
 mysql_select_db("$database", $conectare);
$query="SELECT * FROM ticker";
$result = mysql_query($query, $conectare);
for ($i = 0; $i < mysql_num_rows($result); $i++)
{
$mesaj = mysql_result($result, $i, "mesaj");
}
?>
<input type="text" size="100" align="middle" readonly="readonly" value="<?php echo $mesaj;?>"/>

</body>
</html>
Notice from jlhaslip:
bbcode tags required for code entries

Reply

ads-online
Login Script ::::::::
Notice from jlhaslip:
Upon review of the Topic you started this morning, (Free php Scripts) (http://www.trap17.com/forums/index.php?act=Post&CODE=08&f=163&t=30888&p=210836&st=5), it was required to insert 11 occurences of bbcodes for the 9 consecutive postings in the one topic.
Immediately prior to you starting this topic, you requested a Log-in script and within the hour, you posted a complete script.
This leads me to thinking the script was cut and pasted from elsewhere on the web.
Generic code such as what was posted can be found all over the web, and posting it on the trap17 site without crediting the original author is Plagarism, plain and simple, which is not tolerated at the trap17 forums.
Consequently, the credits for the Log-in script has been reversed in the amount of 66 credits. Since you are new to the trap, no deductions were issued for the other postings, however, please note that this will be your last warning of this sort. Any further plagarism posts will result in more severe punishment.

Please read the trap17 Readme information, as found near the top of every page, near the Shoutbox.

CODE

reset.php

<?
include 'config.php';

   $headers .= "MIME-Version: 1.0 \n";
   $headers .= "Content-type: text/html; charset=iso-8859-1 \n";
   $headers .= "from:AccountRecover@$domain\r\nCc:\r\nBcc:";

if($_POST[email] == ""){
echo "Username & Password recovery.<br>";
echo "<form action=\"./reset.php\" method=\"POST\">";
echo "Your email: <br><input type=\"text\" name=\"email\"><br>";
echo "<input type=\"submit\" value=\"Submit!\">";
echo "</form>";
} else {

$connection = mysql_connect($hostname, $user, $pass)
or die(mysql_error());
$db = mysql_select_db($database, $connection)
or die(mysql_error());


$sql = "SELECT password FROM users
WHERE email = '$_POST[email]'";

$result = mysql_query($sql)
or die ("Couldn't execute query.");

$num = mysql_num_rows($result);
if ($num == 1) {

$tmppass = mysql_result($result,0);

$sql2 = "SELECT username FROM users
WHERE email = '$_POST[email]'";

$result2 = mysql_query($sql2)
or die ("Couldn't execute query.");

$tmpname = mysql_result($result2,0);


mail ($_POST['email'], "Username & Password request", "Your username and password for " . $domain . " is : \n" . "Username = " . $tmpname . "\n" . "Password = " . $tmppass, $headers);
echo "Success, An email has been sent to you with your requested username & password!";
} else {
echo "Error, The email address doesnt exist";
}

}
?>



////////////////////////////////////////////////////////////////////////////////////


register.php


<?php

include 'config.php';

function is_alphachar($text) {

   for ($i = 0; $i < strlen($text); $i++) {

           if (!ereg("[A-Za-z0-9]", $text[$i])) {
                   return 1;
           }
   }
   }
function  checkEmail($email) {
if (!preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\._-] +)+$/" , $email)) {
 return false;
}
return true;
}


$form .= "Register a new username. Be sure to enter a <b>genuine</b> email as it will be used to recover your account.<br>";
$form .= "<form action=\"./register.php\" method=\"POST\">";
$form .= "Username: <br><input type=\"text\" name=\"username\" value=\"$_POST[username]\"><br>";
$form .= "Your email: <br><input type=\"text\" name=\"email\" value=\"$_POST[email]\"><br>";
$form .= "Password: <br><input type=\"password\" name=\"password\" value=\"$_POST[password]\"><br>";
$form .= "<input type=\"submit\" value=\"Create!\">";
$form .= "</form>";

if($_POST[username] == ""){
echo $form;
} elseif(strlen($_POST[password]) < 6){
echo $form;
echo "<br> Error password must be 6 characters or more";


} else {
$connection = mysql_connect($hostname, $user, $pass)
or die(mysql_error());
$db = mysql_select_db($database, $connection)
       or die(mysql_error());


$sql = "SELECT username FROM users
       WHERE username = '$_POST[username]'";

$sql2 = "SELECT email FROM users
       WHERE email = '$_POST[email]'";

$result = mysql_query($sql)
       or die ("Couldn't execute query.");

$result2 = mysql_query($sql2)
       or die ("Couldn't execute query.");

$num = mysql_num_rows($result);
$num2 = mysql_num_rows($result2);

if (is_alphachar($_POST[username]) == 1) {
echo $form;
echo "Invalid Username. Only numbers/letters are allowed.<br>";
die;
}
if ($num == 1) {


echo "Error, username already exists!";

} elseif ($num2 == 1) {
echo "Error, that email address has already been registered. Please select a different one.";
} else {

$query = "INSERT INTO users (username,password,email,vcode)
               VALUES ('$_POST[username]','$_POST[password]','$_POST[email]','')";
$resultB = mysql_query($query,$connection) or die ("Coundn't execute query.");

$cookie_name = "auth";
$cookie_value = "fook";
$cookie_expire = "0";
$cookie_domain = $domain;

setcookie($cookie_name, $cookie_value, $cookie_expire, "/", $cookie_domain, 0);

echo "Congratulations $tmpname. Your account has been created and added to database";
echo "<br>You are now logged in.";
echo "<br>Click <a href=\"index.php\">here</a> to goto members area";

}
}
?>


///////////////////////////////////////////////////////////////////////////


passwordreset.php


<?php

include 'config.php';
$step = $_GET['step'];

   $headers .= "MIME-Version: 1.0 \n";
   $headers .= "Content-type: text/html; charset=iso-8859-1 \n";
   $headers .= "from:AccountRecover@$domain\r\nCc:\r\nBcc:";

if(strlen($step) < 1){
       header ("Location: passwordreset.php?step=1");
       die;
}

if($step == 1){
echo "Please enter your email address you used when creating your account.";
echo "<br><br>";
echo "Your email:";
echo "<br>";
echo "<form method=\"POST\" action=\"passwordreset.php?step=2\">";
echo "<input type=\"text\" name=\"email\" size=\"20\">";
echo "<br>";
echo "<input type=\"submit\" value=\"Submit\" name=\"B1\"></p>";
echo "</form>";
}


if($step == 2){
$ticket = md5(uniqid(rand(), true));
$email = $_POST['mail'];

$connection = mysql_connect($hostname, $user, $pass)
or die(mysql_error());
$db = mysql_select_db($database, $connection)
       or die(mysql_error());


$sql = "SELECT email FROM users
       WHERE email = '$_POST[email]'";

$result = mysql_query($sql)
       or die ("Couldn't execute query.");

$sql2 = "SELECT vcode FROM users
       WHERE email = '$_POST[email]'";

$result2 = mysql_query($sql2)
       or die ("Couldn't execute query.");


$num = mysql_num_rows($result);

       if ($num == 1) {
           $tmpcode = mysql_result($result2,0);
                      if(strlen($tmpcode) < 1){
                      $query = "UPDATE users SET vcode = '$ticket'
                                WHERE email = '$_POST[email]'";
                      $resultB = mysql_query($query,$connection) or die ("Coundn't execute query.");
                      mail($_POST['email'],"Password Confirmation.","This is the confirmation code copy and paste it into the form provided" . "\n" . $ticket,$headers);
                      echo "An email has been sent with the confirmation code.";
                      } else {
                      mail($_POST['email'],"Password Confirmation.","This is the confirmation code copy and paste it into the form provided" . "\n" . $tmpcode,$headers);
                      echo "An email has been sent with the confirmation code.";
                      }
                      echo "<br>Paste the confirmation code in the box below.";
                      echo "<form method=\"POST\" action=\"passwordreset.php?step=3\">";
                      echo "<input type=\"text\" name=\"vcode\" size=\"20\">";
                      echo "<br>";
                      echo "<input type=\"submit\" value=\"Submit\" name=\"B1\"></p>";
                      echo "</form>";
       } else {
              Echo "Error, Email address was not found.";
              }
}

if($step == 3){
$vcode = $_POST['vcode'];

$connection = mysql_connect($hostname, $user, $pass)
             or die(mysql_error());
$db = mysql_select_db($database, $connection)
     or die(mysql_error());

$sql = "SELECT vcode FROM users
       WHERE vcode = '$vcode'";

$result = mysql_query($sql)
       or die ("Couldn't execute query.");

$num = mysql_num_rows($result);
      if($num == 1){
              echo "Please enter your new password";
              echo "<form method=\"POST\" action=\"passwordreset.php?step=4\">";
              echo "Old Password:";
              echo "<br>";
              echo "<input type=\"password\" name=\"oldpword\" size=\"20\">";
              echo "<br>";
              echo "Enter New Password:";
              echo "<br>";
              echo "<input type=\"password\" name=\"pword\" size=\"20\">";
              echo "<br>";
              echo "Confirm Password:";
              echo "<br>";
              echo "<input type=\"password\" name=\"cpword\" size=\"20\">";
              echo "<br><input type=\"hidden\" name=\"vcode\" size=\"20\" value=\"$vcode\">";
              echo "<br>";
              echo "<input type=\"submit\" value=\"Submit\" name=\"B1\"></p>";
              echo "</form>";
      } else {
              echo "The confirmation code you supplied is incorrect.<br>";
              }
}

if($step == 4){
$vcode = $_POST['vcode'];
$oldpword = $_POST['oldpword'];
$pword = $_POST['pword'];
$cpword = $_POST['cpword'];

$connection = mysql_connect($hostname, $user, $pass)
             or die(mysql_error());
$db = mysql_select_db($database, $connection)
     or die(mysql_error());

$sql = "SELECT password FROM users
       WHERE vcode = '$vcode'";

$result = mysql_query($sql)
       or die ("Couldn't execute query.");

$num = mysql_num_rows($result);
      if($num == 1){
         $tmpcode = mysql_result($result,0);
                   if($oldpword == $tmpcode){
                                    if($pword == $cpword){
                                       $query = "UPDATE users SET password = '$pword'
                                                 WHERE vcode = '$vcode'";
                                       $result2 = mysql_query($query)
                                                  or die ("Couldn't execute query.");
                                     } else {
                                       echo "Error, passwords don't match.";
                                       die;
                                     }
                                     $query3 = "UPDATE users SET vcode = ''
                                                WHERE vcode = '$vcode'";
                                     $result3 = mysql_query($query3)
                                                or die ("Couldn't execute query.");
                                     echo "Success, Your password has been changed.";
                                     echo "<br><a href=\"login.php\">Back to login area</a>";
                   } else {
                     echo "Error, old password is inncorrect.";
                   }

       } else {
         header ('Location: passwordreset.php?step=1');
       }
}
?>


/////////////////////////////////////////////////////////////////////////


members.php


<?php
include 'config.php';


if($_COOKIE['auth'] == "fook"){

$connection = mysql_connect($hostname, $user, $pass)
or die(mysql_error());
$db = mysql_select_db($database, $connection)
       or die(mysql_error());


$sql =  "SELECT * FROM users ORDER BY username";

$result = mysql_query($sql)
       or die ("Couldn't execute query.");

$result2 = mysql_query("SELECT * FROM table1");
$num_rows = mysql_num_rows($result);
echo "Below is a list of members which have registered at $domain";
echo "<br> Total members: $num_rows";
echo "<br><table border=\"1\" cellspacing=\"1\" cellpadding=\"3\">";
echo "<tr> <th>Username</th> <th>Email</th> </tr>";
while($row = mysql_fetch_array( $result )) {

echo "<tr><td>";
echo $row['username'];
echo "</td><td>";
echo $row['email'];
echo "</td></tr>";
}
echo "</table>";



} else {
       echo "Error, You have to be logged in to view this page.";
       echo "<br>Click <a href=\"login.php\">here!</a> to login.";
       }
?>


//////////////////////////////////////////////////////////////////////////////////////



login.php


<?php

include 'config.php';

ob_start();
echo "<center><font size\"2\" face=\"Tahoma\"> Login System</font></center><br>";
echo "Login..<br>";
echo "<form action=\"./login.php\" method=\"POST\">";
echo "Name: <br><input type=\"text\" name=\"username\"><br>";
echo "Pass: <br><input type=\"password\" name=\"password\"><br>";
echo "<input type=\"submit\" value=\"Login!\">";
echo "</form>";
echo "<br>Dont have an account? Register <a href=\"register.php\">here!</a>";
echo "<br>Forgot your password? Click <a href=\"reset.php\">here!</a>";
echo "<br>Click <a href=\"passwordreset.php?step=1\">here</a> to reset your password";

$connection = @mysql_connect($hostname, $user, $pass)
or die(mysql_error());
$dbs = @mysql_select_db($database, $connection) or
die(mysql_error());

$sql = "SELECT * FROM `users` WHERE username = '$_POST[username]' AND password = '$_POST[password]'";
$result = @mysql_query($sql,$connection) or die(mysql_error());
$num = @mysql_num_rows($result);

if ($num != 0) {
$cookie_name = "auth";
$cookie_value = "fook";
$cookie_expire = "0";
$cookie_domain = $domain;

setcookie($cookie_name, $cookie_value, $cookie_expire, "/", $cookie_domain, 0);
header ("Location: http://" . $domain  . $directory . "index.php");

ob_end_flush();

exit;
}
?>

//////////////////////////////////////////////////////////////////////////


install.php


<?php

include 'config.php';



$connection = mysql_connect($hostname, $user, $pass)
or die(mysql_error());
$db = mysql_select_db($database, $connection)
       or die(mysql_error());


       /* Creating user table. */
echo "Creating user table in database......";
$query = "CREATE TABLE users (username VARCHAR(255),email VARCHAR(255),password VARCHAR(255),vcode VARCHAR(255))";
if(mysql_query($query)){
echo "Sucessfully created uers table in database.<br>";
} else {
echo "Error, tables have not been created.<br>";
}

       /* Creating admin table. */
echo "Creating admin table in database......";
$query2 = "CREATE TABLE admin (username VARCHAR(255),email VARCHAR(255),password VARCHAR(255),vcode VARCHAR(255))";
if(mysql_query($query2)){
echo "Sucessfully created admin table in database.";
} else {
echo "Error, tables have not been created.";
}

       /* Inserting admin username and password into table. */
echo "<br>Inserting admin username and password into database......";
$query3 = "INSERT INTO admin (username,password,email,vcode)
               VALUES ('$AdminUsername','$AdminPass','$AdminEmail','')";
if(mysql_query($query3)){
echo "Sucessfully added admin into database.<br> <b>Now remove this file from the server!</b>";
} else {
echo "Error, Admin has not been added.<br>";
}
?>


////////////////////////////////////////////////////////////////////////////////


index.php


<?php
include 'config.php';
$tmp = $_GET['action'];
if($tmp == "signout"){
$cookie_name = "auth";
$cookie_value = "";
$cookie_expire = "0";
$cookie_domain = $domain;
setcookie($cookie_name, $cookie_value, $cookie_expire, "/", $cookie_domain, 0);
header ("Location: http://" . $domain . $directory . "login.php");
}

if($_COOKIE['auth'] == "fook"){
echo "Welcome to the members section";

echo "<br><a href=\"index.php?action=signout\">Sign Out</a> / Click <a href=\"members.php\">here!</a> to view all members!";
}else{
header ("Location: http://" . $domain . $directory . "login.php");
exit;
}
?>

<html>
<head>
</head>
<body>
<br>
<font size="2" face="Tahoma">Put all your content here!</font>
<br>


////////////////////////////////////////////////////////////////////////////////


config.php


<?php
$AdminUsername = "Chris";  /* Username for the administration area */
$AdminPass = "PASSWORD";  /* Password for the administration area */
$AdminEmail = "EMAIL@DOMAIN.com"; /* Email address used with your admin account */

$hostname = "localhost";  /* Hostname (usually localhost) */
$user = "DBUSERNAME";   /* Username for database */
$pass = "DBPASS";   /* Password for database */
$database = "DBNAME";   /* Database name */

$domain = "YOURDOMAIN.COM";  /* Do NOT enter www. or http:// */
$directory = "/login/";   /* this is the directory location of the script ie.. /login/ be sure to add a slash at the beginning and end */
?>


////////////////////////////////////////////////////////////////////////////////////


admin.php


<?php
include 'config.php';

$tmp = $_GET['action'];
if($tmp == "signout"){
$cookie_name = "adminauth";
$cookie_value = "";
$cookie_expire = "0";
$cookie_domain = $domain;
setcookie($cookie_name, $cookie_value, $cookie_expire, "/", $cookie_domain, 0);
header ("Location: http://" . $domain . $directory . "admin.php");
}
$connection = @mysql_connect($hostname, $user, $pass)
or die(mysql_error());
$dbs = @mysql_select_db($database, $connection) or
die(mysql_error());

$sql = "SELECT * FROM `admin` WHERE username = '$_POST[username]' AND password = '$_POST[password]'";
$result = @mysql_query($sql,$connection) or die(mysql_error());
$num = @mysql_num_rows($result);

if ($num != 0) {
$cookie_name = "adminauth";
$cookie_value = "adminfook";
$cookie_expire = "0";
$cookie_domain = $domain;
setcookie($cookie_name, $cookie_value, $cookie_expire, "/", $cookie_domain, 0);
}
if($_COOKIE['adminauth'] == "adminfook"){
echo "Logged in!<br>Select an account to edit.<br><br>";





if($_POST['tmpname'] == "") {
       } else {
               if($_POST[newpassword] == "") {
                       } else {
                               $query4 = "UPDATE users SET password = '$_POST[newpassword]'
                               WHERE username = '$_POST[tmpname]'";
                               $result4 = mysql_query($query4)
                               or die ("Couldn't execute query.");
                               echo "Success, Password Changed.<br>";
                               }

               $query3 = "UPDATE users SET email = '$_POST[newemail]'
               WHERE username = '$_POST[tmpname]'";
               $result3 = mysql_query($query3)
               or die ("Couldn't execute query.");
               echo "Success, Email changed.";
               }



       if($_POST['B2'] == "") {
       } else {
               $sql5 = "DELETE FROM users WHERE username = '$_POST[account]'";
               $result5 = mysql_query($sql5)
                          or die ("Couldn't execute query.");
                          echo "Success, Account has been deleted.";
                          echo "<br>Click <a href=\"admin.php\">here</a> to go back to account management.";
                          die;

              }
if($_POST['account'] == ""){

       } else {
               echo "<form method=\"POST\" action=\"admin.php\">";
               echo "Username: $_POST[account]";
               echo "<input name=\"tmpname\" type=\"hidden\" value=\"$_POST[account]\">";
               echo "<br>";
               $sql2 = "SELECT email FROM users
               WHERE username = '$_POST[account]'";
               $result2 = mysql_query($sql2)
               or die ("Couldn't execute query.");
               $tmpemail = mysql_result($result2,0);
               echo "Email:";
               echo "<br><input type=\"text\" name=\"newemail\" size=\"20\" value=\"$tmpemail\">";
               echo "<br>";
               echo "New Password (leave blank to keep current password)<br><input type=\"text\" name=\"newpassword\" size=\"20\">";
               echo "<br><br>";
               echo "<input type=\"submit\" value=\"Save Changes\" name=\"B1\">";
               echo "</form>";

               }



$sql =  "SELECT * FROM users ORDER BY username";
$result = mysql_query($sql)
       or die ("Couldn't execute query.");

echo "<form method=\"POST\" action=\"admin.php\">";
echo "<table border=\"1\" cellspacing=\"1\" cellpadding=\"3\" style=\"border-collapse: collapse\" bordercolor=\"#111111\">";
echo "  <tr>";
echo "    <td><center>Edit</center></td>";
echo "    <td><center>Username</center></td>";
echo "    <td><center>Email</center></td>";
echo "  </tr>";
echo "  <tr>";
while($row = mysql_fetch_array( $result )) {
echo " <td><input type=\"radio\" value=\"$row[username]\" name=\"account\"></td>";
echo " <td>$row[username]</td>";
echo " <td>$row[email]</td>";
echo "</tr>";
}
echo "</table>";
echo "<br><input type=\"submit\" value=\"Edit selected account!\" name=\"B1\">";
echo "<input type=\"submit\" value=\"Delete selected account!\" name=\"B2\">";
echo "</form>";


$result = mysql_query($sql)
       or die ("Couldn't execute query.");



echo "<br><a href=\"admin.php?action=signout\">Sign Out</a>";
} else {
       echo "Administration Login:";
       echo "<br><br>";
       echo "<form method=\"POST\" action=\"admin.php\">";
       echo "  Username:";
       echo "  <br>";
       echo "<input type=\"text\" name=\"username\" size=\"20\">";
       echo "  <br>";
       echo "  Password";
       echo "  <br>";
       echo "  <input type=\"password\" name=\"password\" size=\"20\">";
       echo "  <br>";
       echo "  <input type=\"submit\" value=\"Submit\" name=\"B1\"></p>";
       echo "</form>";
      }

?>
Notice from jlhaslip:
bbcode tags required for code entries

Reply

ads-online
Complex Clock ::::::::

CODE

<!-- this script and many others avaliable from A1 javascripts. [url=http://www.A1javascripts.com]http://www.A1javascripts.com[/url]. please keep this information if using this script- all credits to the unknown author -->
<script Language="JavaScript">
function tickClock()
{
       // this tells the browser to call the "tickClock()" function every 1 second
       setTimeout("tickClock()", 1000);

       thisTime = new Date()
       hours = thisTime.getHours()
       minutes = thisTime.getMinutes()
       seconds = thisTime.getSeconds()

       // convert the digit to string
       // make sure there're at least 2 digits
       if (hours>=12)
       {
               hours-=12
       }
               
       hourString="0"+hours+""
       minuteString="0"+minutes+""
       secondString="0"+seconds+""

       // format the hour
       hour1=parseInt(hourString.charAt(hourString.length-1))
       hour2=parseInt(hourString.charAt(hourString.length-2))

       // format the minute
       minute1=parseInt(minuteString.charAt(minuteString.length-1))
       minute2=parseInt(minuteString.charAt(minuteString.length-2))

       // format the seconds
       second1=parseInt(secondString.charAt(secondString.length-1))
       second2=parseInt(secondString.charAt(secondString.length-2))

       document.clockForm.clock.value=""+hour2+hour1+":"+minute2+minute1+":"+second2+second1
}
</script>

<!-- --><body onLoad="tickClock()"><!-- -->

<form name="clockForm">
     <p><input type="text" name="clock" size="8"> </p>
   </form>
<script LANGUAGE="JavaScript">
<!--
var date=new Date();
document.write(date);
//-->
</script>
<!-- support provided by A1 javascripts-->
Notice from jlhaslip:
bbcode tags required for code entries

Reply

DreamCore
Lol, you have got many good scripts out there. And thats very nice but you shuld use the code buttion on the add topic section.

Reply

Latest Entries

Mature Lamb
Wow thanks for posting PHP scripts. I don't really know how PHP works yet, so I'll just fiddle around. tongue.gif

Reply

bucksta
hotscripts also gives a rating so you can see which one is the right one! i love hotscripts. it has so many scripts in its database that you can waste 1GB if you have all of them! that wastes a lot of webspace but also makes ur site look better than yahoo! i dont know y but i thin the yahoo site looks cool.

Reply

courage
i know you get lot credits if you post, but i didn't saw admins edited his posts! the best scripts site is www.hotscripts.com smile.gif get all you need in there!

Reply

Plenoptic
Courage you don't get any credits off of codes. In fact he lost a lot more because they had to be editted by jlhaslip to add the code tag. Those are some pretty nice scripts. I knew a couple of them but I am not that great with php. Nice resources. Thanks for sharing.

Reply

courage
dude!! how many credits did you get biggrin.gif about those scripts: you know them or just copyed them? realy nice one wink.gif you can start a php page whit those smile.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2, 3
Similar Topics

Keywords : php, scripts

  1. Best Formmail Script Php Or Cgi
    Here best formmail scripts topic will be discussed (5)
  2. Snards Clan Scripts
    Snards Clan Scripts (1)
    Go to http://www.cheaptechsupport.net/forums/forumdisplay.php?f=48 to download free clan scripts
    by snards Only drawbacks are: they have ads, they don't support music, and they say Powered By
    Snard Free on them. but they still have all the other functions the original snards script has.....
  3. Wap Masters
    one of the best scripts for wapmasters (15)
    Hello all. I'm newbie here. I'm excited to be part of this community not just to earn
    credits LoL. Look what I have for everybody. To start up I've got something for you--a WAP
    script. This is totally for free. This is a community script (forums, chat, blogs, fun and games)
    like this here in Trap17 but it's for WAP to be accessed using your mobile phones. >. Have it a
    download! /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif"
    /> Do not provide copyrighted material for free. ....
  4. Free E-gold Games Scripts
    Free e-gold games: head or tale game, batch game....Where can I get th (1)
    Hello. I am going to open my own e-gold games site, so I need e-gold games scripts. Does someone
    know from where I can get them? THX.....
  5. Php Scripts And Tempsq
    (1)
    --link removed-- Free php scripts and templates Right Now the Server Is Offline Due To Some
    Issue's But We Will BE Back Soon So Just Keep Checking....
  6. Snard's Scripts Free
    Free for right now. I think... (4)
    Look around on the forums and you should be able to get snard free. It has some ads but works. If
    you have any questions about it, msg snard. He will hve all the info on the free scripts and
    hosting. I dont have much of the info on that. But I know he made a free version of it. I dunno what
    all it can do but it is free. And I dont 100% know how long it lasts. So... ya.....
  7. Www.bellsnwhistles.com
    A lot of free pics, scripts, and more. (6)
    This is another website that everything on it is free to use for your website. It contains animated
    pictures, still pictures, and horizontal rules. There is a lot of useful script on this site that
    was useful to me when the teacher of my high school was showing us how to compose html sites in
    Netscape Composer. I'm sure that you will find it useful too.....
  8. Free Hosted Scripts For Your Webpage!
    (11)
    If you have a webpage the likelihood is that you will be interested in knowing what kind of people
    come to your website. This website http://hosted-scripts.com gives you pre-coded scripts to put on
    your website in order to add various statistics. It has the following scripts: Online User counter
    - Shows how many users are online at any point in time. Text Hit Counter - How many hits you get on
    a page Ip logger + displayer - Shows the user their Ip has been logged and you can choose between
    showing them the IP log or hiding it from them. Show page load time - Shows....
  9. Free Good Clan Scripts
    (28)
    www.frozengaming.net sign up there u can dl nettek dastek a undisabled version of snard scripts all
    for free. it's amazing eh? well enjoy your free scripts.....
  10. Free Scripts/templates
    You can get unlimited scripts/templates from this site. (6)
    Hey if you were havin troubles finding those perfect scripts for cs, sc, bw, wc3, d2 etc... w/e you
    need... You can find it at http://www.clantemplates.com/ You can request sigs, buy expensive
    scripts, and best of all get free scripts/templates. I have used some of them for their layouts and
    coding because they work nicely for many differenty types of sites you need them for. They have a
    huge selection to choose from so don't worry about that. Just check it out and see what they
    have, I know you will be satisfied.....
  11. Free Basic Clan Scripts
    Coming hopefully sometime during the summer. (6)
    I am currently working on some basic clan scripts. They will be free and will hopefully be out
    sometime during the summer. They will be free to anyone who wants a copy. If you want to see the
    rough start than you can look at them at www.uca.trap17.com/test I will update them once inawhile
    so anyone can see them. If anyone wants to help I could use all the help I can get. If you want to
    help than talk to me on aim. I will list everyone that helps in the page about the scripts. I will
    give more detail on aim. My aim is: Generalds2001....
  12. Best Sites To Download Free Scripts
    Of all web languages (4)
    FREE Scripts - Of all Web Languages : CODE http://www.hotscripts.com
    http://www.allthescripts.com http://www.ezgoal.com http://www.devscripts.com
    http://www.scriptsearch.com http://www.scriptwiz.com http://www.bigwebmaster.com
    http://www.gotocode.com http://www.thecgisite.com http://www.cgiscript-directory.com
    http://www.freescripts.com http://www.planet-source-code.com
    http://www.sourceforge.net http://www2.aspcode.net http://www.onlyscripts.com
    http://www.metacollection.com http:....
  13. 24fun 77 Topscripts V1.0
    Grea and fun scripts, free, and for you (0)
    24Fun 77 TopScripts v1.0
    -------------------------------------------------------------------------------- This is probably
    the most exciting JavaScript and DHTML script-collection you get for less than $20!
    Download 77 TopScripts stuffed into 1 zip file. The zip file includes all files, images and
    instructions to run and install the 77 TopScripts. You may use them on both personal and commercial
    web sites. Below are the 77 TopScripts you get in this bundle?: Bikini Trailer animation. Add
    sunshine to your website with this happy summer cursor trailer. ....
  14. Hotscripts
    Free php/mysql cgi-/perl scripts (4)
    hello all here is a website for scripts for the website. Click Here Hotscripts I don't
    belive noone knows about it /tongue.gif' border='0' style='vertical-align:middle' alt='tongue.gif'
    /> XD....
  15. Dhtml Scripts Place
    (3)
    Hi guys just thought id let you know about some mega cool DHTML Scripts. From a site i call Dynamic
    Drive. the link is as follows: DD Thank me after u have looked at the scripts there:D
    GuySpook....
  16. Free Cgi Scripts
    They look good, but what do I know? (1)
    Scripts For Educators I'm a real newbie at this script stuff, but these look pretty
    interesting to me. If they really ain't so hot, somebody please straighten me out. Suz....
  17. Free Scripts
    (15)
    Hey everyone I got this site from my friend and its really great...you can find all these cool
    scripts from here..just try it www.Hotscripts.com /smile.gif' border='0'
    style='vertical-align:middle' alt='smile.gif' /> ....

    1. Looking for php, scripts

Searching Video's for php, scripts
advertisement



Free Php Scripts



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE