search
HomeBackend DevelopmentPHP Tutorial载转老外编写的一个maillist源代码_PHP

admin.php3





INCLUDE("layout.inc.php3");

INCLUDE("config.inc.php3");

INCLUDE("./lang/$language.inc.php3");

print_header("$admin_name");

print_navbar();

$string=implode($argv," ");

$string2=explode("&",$string);

if($string==’’)

{

echo"

$program_name Version: $ver



Administration:



admin
.php3?admin">









$admin_username:
$admin_password:
$send">




"
;

}



else if($string==’admin’)

{

if($adminuser1==$adminuser)

{

if($adminpass1==$adminpass)

{

echo"

$admin_name:



admin
.php3?send&$adminuser1&$adminpass1">$send_mail





admin
.php3?users&$adminuser1&$adminpass1">$show_users





admin
.php3?delall&$adminuser1&$adminpass1">$del_table





tablecreator
.php3">$create_table

"
;

}

else { echo"$noaccess"; }

}

else { echo"$noaccess"; }

}



else if($string2[0]==’delall’)

{

if($string2[1]==$adminuser)

{

if($string2[2]==$adminpass)

{

$query="DROP TABLE $maillist_table";

mysql_db_query($database_name,$query,$conn) or die("$cant_del_table");

echo"$table_deleted";

}

else { echo"$noaccess"; }

}

else { echo"$noaccess"; }

}



else if($string2[0]==’users’)

{

if($string2[1]==$adminuser)

{

if($string2[2]==$adminpass)

{

echo"

$headline_users





#000084">
width=25%>Name:
width=25%>?/td>

";

$query="SELECT * from $maillist_table";

$result=mysql_db_query($database_name,$query,$conn) or die("$database_error");

while($data=mysql_fetch_row($result))

{

echo"";

}

echo"

$prename: E-Mail
$data[0] $data[1] $data[2]
href="admin.php3?deluser&$string2[1]&$string2[2]&$data[2]">$delete


";





}

else { echo"$noaccess"; }

}

else { echo"$noaccess"; }

}



else if($string2[0]==’deluser’)

{

if($string2[1]==$adminuser)

{

if($string2[2]==$adminpass)

{

$query="DELETE FROM $maillist_table WHERE email=’$string2[3]’";

mysql_db_query($database_name,$query,$conn) or die("$string2[3] $could_not_be_deleted");

echo"$string2[3] has_been_deleted";

}

else { echo"$noaccess"; }

}

else { echo"$noaccess"; }

}





else if($string2[0]==’send’)

{

if($string2[1]==$adminuser)

{

if($string2[2]==$adminpass)

{

echo"

$send_mail:







$topic:





$message:







";

}

else { echo"$noaccess"; }

}

else { echo"$noaccess"; }

}



else if($string2[0]==’sendmail’)

{

if($string2[1]==$adminuser)

{

if($string2[2]==$adminpass)

{

$query="SELECT * FROM $maillist_table";

$result=mysql_db_query($database_name,$query,$conn) or die("$database_error");

while($data=mysql_fetch_row($result))

{

mail("$data[2]","$subject","$text","From: $fromnX-Mailer: $mailernReply-To: $replyn") or
die("$send_error");

}

echo"

$xxx_has_been_sent:





$topic:



$subject



$message:



$text



";

}

else { echo"$noaccess"; }

}

else { echo"$noaccess"; }

}



print_back();

print_footer();

?>







english
.inc.php3



$mailadd_text
="If you are in our Newsletter, you get an E-Mail with Informations

about our Homepage every month. Just fill in the following Form.

to unsubscribe click"
;



$remember_pass
="Please remember your Password, otherwise, you can’t delete your mailadress from

the list"
;

$wrong_mail="You’ve entered a bad E-Mail adress";

$admin_name="Newsletter Administration";

$program_name="Newsletter-Manager";

$admin_username="Admin-Username";

$admin_password="Admin-Password";

$send="submit";

$reset="reset";

$noaccess="access denied";

$send_mail="Send a Mail to the list";

$show_users="Show/delete members";

$del_table="Delete Table $maillist_table";

$create_table="Create Table $maillist_table";

$cant_del_table="Can’t delete Table $maillist_table";

$table_deleted="Table $maillist_table has been deleted";

$headline_users="Every user on one place:";

$prename="Prename";

$database_error="Error on Database: $database_name";

$delete="delete";

$could_not_be_deleted="could not be deleted";

$has_been_deleted="has been deleted";

$topic="Topic";

$message="Message";

$send_error="send error";

$xxx_has_been_sent="The following has been sent";

$already_there="You are already in the list!!!";

$xxx_has_been_entered="The following has been entered";

$password="Password";

$cant_find_entry="Can’t find entry!";

$isnt_in_db="$email is not entered in the Database";

$error_del="Error while trying to delete";

$entry_del="Entry has been deleted";

$here="HERE";

$click="";

$all_fields_must_be_edited="ERROR! All Fields have to be filled in completely!";

?>





tablecreator
.php3





INCLUDE"layout.inc.php3";

INCLUDE"config.inc.php3";

print_header("Create table $maillist_table");

print_navbar();

$query="CREATE TABLE $maillist_table

(name CHAR (50) not null , vorname CHAR (50) not null ,

email CHAR (255) not null , pass CHAR (10) not null ,

PRIMARY KEY (email), INDEX (email), UNIQUE (email))"
;



mysql_db_query
($database_name,$query,$conn) or die("Could not create table");

echo"Table "$maillist_table" has been created";

print_back();

print_footer();

?>



index
.php3





/******************************************************************************/

/* */

/* Mailinglisten-Manager */

/* */

/* by: Marcel Beerta */

/* http://www.supertown.de/computer/mazen/ */

/* marcel.beerta@gmx.net */

/* */

/******************************************************************************/



INCLUDE "config.inc.php3";

INCLUDE "./lang/$language.inc.php3";

INCLUDE "layout.inc.php3";



print_header
("$program_name");

print_navbar();

$string=implode($argv," ");



if ($string==’add’)

{

if($name&&$prename&&$email&&$pw)

{

$query="INSERT INTO $maillist_table(name,vorname,email,pass)

VALUES(’$name’,’$vorname’,’$email’,’$pw’)"
;

mysql_db_query($database_name,$query,$conn) or die("$already_there");



echo"

$xxx_has_been_entered





Name: $name



$prename: $vorname



E-Mail: $email



$password: $pw





$remember_pass



"
;

}

else

{

echo"$all_fields_must_be_edited";

}



}





else if($string==’delete’)

{

echo"

index
.php3?delme">









E-Mail:
$password:
$send">


















"
;



}

else if($string==’delme’)

{

$query1="SELECT * FROM $maillist_table WHERE $maillist_table.email LIKE ’$email’";

$result=mysql_db_query($database_name,$query1,$conn) or die("$cant_find_entry");

$data=mysql_fetch_row($result) or die("$isnt_in_db



"
);

if($data[3]==$pw)

{

$query="DELETE FROM $maillist_table WHERE email=’$email’";

mysql_db_query($database_name,$query,$conn) or die("$error_del");

echo"$entry_del";

}

else

{

echo"$noaccess";

}

}

else

{

echo"$mailadd_text

index
.php3?delete">$here $click ...



















Name:
$prename:
E-Mail:
$password:
$send">
































"
;

}



print_back
();

print_footer();

?>







layout
.inc.php3



/******************************************************************************/

/* */

/* Layout Datei ... */

/* */

/* Einfach auf eigene Layout-Wuensche anpassen ... */

/* */

/* by Marcel Beerta */

/* http://www.supertown.de/computer/mazen/ */

/* */

/******************************************************************************/



function print_header ($title)

{

echo"

Content
-Type" content="text/html; charset=ISO-8859-1">

description
"

content="
">

keywords
"

content="
">

distribution
" content="global">

robots
" content="index">

robots
" content="follow">

revisit
-after" CONTENT="1 days">

language
" content="">

author
" content="">

copyright
" content="">

programmer
" content="Marcel Beerta (www.game-center.de)">



$title



0
" leftmargin="0" bgColor=#040732 link=#ffc600 text=#ffffff vLink=#ffc600

style="
font-family: Verdana; color: #FFFFFF">";

}



function print_navbar ( )

{

echo"





";





}





function print_footer ( )

{

echo"









";

}





function print_back ( )

{

echo"







";

}



?>





config
.inc.php3

/*****************************************************************************/

/* */

/* Datenbank-Connector */

/* Marcel Beerta */

/* http://www.supertown.de/mazen/maillist */

/*****************************************************************************/



/**************************************/

/* Just edit the following few lines: */

/**************************************/

//Admin-username:

$adminuser=’szw’;

//Admin-password:

$adminpass=’szw’;

//language

$language
=’english’; //other Languages: ’german’,’english’

//The Hostname of the MySQL-Server

$hostname
= ’localhost’;

//MySQL-Server username

$user
= ’root’;

//MySQL-Server password

$pass
= ’’;

//Database-Name

$database_name
= ’maillist’;

//Maillinglist-Table

$maillist_table
=’marcel_maillist’;

//From-E-Mail

$from
=’sszw@163.net’;

//Reply-To-E-Mail

$reply
=’sszw@163.net’;

//X-Mailer

$mailer
=’PHP-Maillist by Mazen’;

/************************************************/

/* Don’t edit this, if you don’t know, what you */

/* do... */

/************************************************/

$conn=mysql_pconnect ($hostname,$user,$pass);

$ver
="1.0.0";

?&g

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Linux下更新curl版本教程!Linux下更新curl版本教程!Mar 07, 2024 am 08:30 AM

在Linux下更新curl版本,您可以按照以下步骤进行操作:检查当前curl版本:首先,您需要确定当前系统中安装的curl版本。打开终端,并执行以下命令:curl--version该命令将显示当前curl的版本信息。确认可用的curl版本:在更新curl之前,您需要确定可用的最新版本。您可以访问curl的官方网站(curl.haxx.se)或相关的软件源,查找最新版本的curl。下载curl源代码:使用curl或浏览器,下载您选择的curl版本的源代码文件(通常为.tar.gz或.tar.bz2

如何使用C#编写布隆过滤器算法如何使用C#编写布隆过滤器算法Sep 21, 2023 am 10:24 AM

如何使用C#编写布隆过滤器算法布隆过滤器(BloomFilter)是一种空间效率非常高的数据结构,可以用于判断一个元素是否属于集合。它的基本思想是通过多个独立的哈希函数将元素映射到一个位数组中,并将对应位数组的位标记为1。当判断一个元素是否属于集合时,只需要判断对应位数组的位是否都为1,如果有任何一位为0,则可以判定元素不在集合中。布隆过滤器具有快速查询和

如何使用C#编写动态规划算法如何使用C#编写动态规划算法Sep 20, 2023 pm 04:03 PM

如何使用C#编写动态规划算法摘要:动态规划是求解最优化问题的一种常用算法,适用于多种场景。本文将介绍如何使用C#编写动态规划算法,并提供具体的代码示例。一、什么是动态规划算法动态规划(DynamicProgramming,简称DP)是一种用来求解具有重叠子问题和最优子结构性质的问题的算法思想。动态规划将问题分解成若干个子问题来求解,通过记录每个子问题的解,

如何使用C++编写一个简单的酒店预订系统?如何使用C++编写一个简单的酒店预订系统?Nov 03, 2023 am 11:54 AM

酒店预订系统是一种重要的信息管理系统,它可以帮助酒店实现更高效的管理和更良好的服务。如果你想学习如何使用C++来编写一个简单的酒店预订系统,那么本文将为您提供一个基本的框架和详细的实现步骤。酒店预订系统的功能需求在开发酒店预订系统之前,我们需要确定其实现的功能需求。一个基本的酒店预订系统至少需要实现以下几个功能:(1)客房信息管理:包括客房类型、房间号、房

如何使用C++编写一个简单的学生选课系统?如何使用C++编写一个简单的学生选课系统?Nov 02, 2023 am 10:54 AM

如何使用C++编写一个简单的学生选课系统?随着科技的不断发展,计算机编程已经成为了一种必备的技能。而在学习编程的过程中,一个简单的学生选课系统可以帮助我们更好地理解和应用编程语言。在本文中,我们将介绍如何使用C++编写一个简单的学生选课系统。首先,我们需要明确这个选课系统的功能和需求。一个基本的学生选课系统通常包含以下几个部分:学生信息管理、课程信息管理、选

如何用Python编写KNN算法?如何用Python编写KNN算法?Sep 19, 2023 pm 01:18 PM

如何用Python编写KNN算法?KNN(K-NearestNeighbors,K近邻算法)是一种简单而常用的分类算法。它的思想是通过测量不同样本之间的距离,将测试样本分类到最近的K个邻居中。本文将介绍如何使用Python编写并实现KNN算法,并提供具体的代码示例。首先,我们需要准备一些数据。假设我们有一组二维的数据集,每个样本都有两个特征。我们将数据集分

java源码怎么查看java源码怎么查看Dec 27, 2023 pm 04:41 PM

查看步骤:1、找到安装目录或者在线查看;2、解压源代码;3、使用文本编辑器或集成开发环境;4、导航和查看源码。详细介绍:1、找到安装目录或者在线查看:如果安装了JDK,可以在JDK的安装目录中找到Java的源代码。在JDK的安装目录中,通常有一个 src.zip 或类似的压缩文件,里面包含了 Java 核心类库的源代码;在线查看Java源代码也是可能的等等。

Linux内核源代码存放路径解析Linux内核源代码存放路径解析Mar 14, 2024 am 11:45 AM

Linux内核是一个开源的操作系统内核,其源代码存储在一个专门的代码仓库中。在本文中,我们将详细解析Linux内核源代码的存放路径,并通过具体的代码示例来帮助读者更好地理解。1.Linux内核源代码存放路径Linux内核源代码存储在一个名为linux的Git仓库中,该仓库托管在[https://github.com/torvalds/linux](http

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),