Error summary PHP - constantly updated (must read for newbies)
Please enable all error prompts for development: error_reporting = E_ALL | E_STRICT
Blocking error prompts is equivalent to covering one’s ears and stealing the bell.
Write code in a standardized way and reduce errors by half.
1: Why can’t I get the variable?
I POST data name from one web page to another web page, why can’t I get any value when I output $name?
In PHP4.2 and later versions, register_global defaults to off
If you want to get the variables submitted from another page:
Method 1: Find register_global in PHP.ini and set it to on.
Method 2: Put this extract($_POST);extract($_GET);(note that there must be Session_Start() before extract($_SESSION)) at the front of the receiving web page.
Method 3: Read variables $a=$_GET["a"];$b=$_POST["b"], etc. one by one. Although this method is troublesome, it is safer.
2: Debug your program
You must know the value of a certain variable at runtime. This is what I did, create a file debug.php with the following content:
Ob_Start();
Session_Start();
Echo ""; Echo "The _GET variables obtained on this page are:"; Print_R($_GET); Echo "The _POST variables obtained on this page are:"; Print_R($_POST); Echo "This page obtained The _COOKIE variables are: "; Print_R($_COOKIE); Echo "The _SESSION variables obtained on this page are: "; Print_R($_SESSION); Echo "";
Then set include_path = "c:/php" in php.ini and place debug.php in this folder,
In the future, you can include this file in every web page and view the obtained variable names and values.
3: How to use session
Everything related to session must call the function session_start();
It is very simple to pay for the session, such as:
PHP code:------------------------------------------------ -----------------------
[php]
Session_start();
$Name = "This is a Session example";
Session_Register("Name");//Note, do not write: Session_Register("$Name");
Echo $_SESSION["Name"];
//After that $_SESSION["Name"] is "This is a Session example"
[/php]
------------------------------------------------ --------------------------
After php4.2, you can pay directly for the session:
PHP code:------------------------------------------------ ----------
[php]
Session_Start();
$_SESSION["name"]="value";
[/php]
------------------------------------------------ ----------
To cancel the session, you can do this:
PHP code:------------------------------------------------ ----------
[php]
session_start();
session_unset();
session_destroy();
[/php]
------------------------------------------------ ----------------------------------
There is a bug in canceling a certain session variable in php4.2 and above.
Note:
1: There cannot be any output before calling Session_Start(). For example, the following is wrong.
==========================================
1 line
2 lines [php]
3 lines Session_Start();//There was already output in the first line before
4 lines .....
5 lines [/php]
==========================================
Tip 1:
Whenever ".....headers already sent.........." appears, it means that information is output to the browser before Session_Start().
Remove the output and it will be normal. (This error will also occur in COOKIE, the cause of the error is the same)
Tip 2:
If your Session_Start() is placed in a loop statement and it is difficult to determine where the information was output to the browser before, you can use the following method:
1 line [php] Ob_Start(); [/php]
...Here is your program...
2: What error is this
Warning: session_start(): open(/tmpsess_7d190aa36b4c5ec13a5c1649cc2da23f, O_RDWR) failed:....
Because you did not specify the storage path of the session file.
Solution:
(1) Create the folder tmp on the c drive
(2) Open php.ini, find session.save_path, and change it to session.save_path= "c:/tmp"
4: Why when I send variables to another web page, I only get the first half, and all the ones starting with spaces are lost
PHP code:------------------------------------------------ ---------------
[php]
$Var="hello php";//Change to $Var="hello php"; Try to get the result
$post= "receive.php?Name=".$Var;
header("location:$post");
[/php]
---------------------------------------------
Contents of receive.php:
PHP code:--------------------------------
[php]
Echo ""; Echo $_GET["Name"]; Echo "";
[/php]
------------------------------------------------
The correct method is:
PHP code:--------------------------------
[php]
$Var="hello php";
$post= "receive.php?Name=".urlencode($Var);
header("location:$post");
[/php]
------------------------------------------------ ----------------------------------
You don’t need to use Urldecode() on the receiving page, the variables will be automatically encoded.
5: How to intercept Chinese characters of a specified length without ending with "[/php]", and replace the excess parts with "..."
Generally speaking, when the variable to be intercepted comes from Mysql, you must first ensure that the field length is long enough, usually char(200), which can hold 100 Chinese characters, including punctuation.
PHP code:------------------------------------------------ ----------------------------------
[php]
$str="This character is so long,^_^";
$Short_Str=showShort($str,4);//Intercept the first 4 Chinese characters, the result is: this character...
Echo "$Short_Str";
Function csubstr($str,$start,$len)
{
$strlen=strlen($str);
$clen=0;
for($i=0;$i
{
if ($clen>=$start+$len)
break;
if(ord(substr($str,$i,1))>0xa0)
{
if ($clen>=$start)
$tmpstr.=substr($str,$i,2);
$i++;
}
else
{
if ($clen>=$start)
$tmpstr.=substr($str,$i,1);
}
}
return $tmpstr;
}
Function showShort($str,$len)
{
$tempstr = csubstr($str,0,$len);
if ($str$tempstr)
$tempstr .= "..."; //Whatever you want to end with, just modify it here.
return $tempstr;
}
------------------------------------------------ ----------------------------------
6: Standardize your SQL statements
Add "`" in front of the table and fields, so that errors will not occur due to misuse of keywords,
Of course I don’t recommend you to use keywords.
For example
$Sql="INSERT INTO `xltxlm` (`author`, `title`, `id`, `content`, `date`) VALUES ('xltxlm', 'use`', 1, 'criterion your sql string ', '2003-07-11 00:00:00')"
How to input "`"? On the TAB key.
7: How to prevent the Html/PHP format string from being interpreted, but display it as it is
PHP code:------------------------------------------------ ----------------------------------
[php]
$str="
PHP
";
Echo "Explained: ".$str."
Processed: ";
Echo htmlentities(nl2br($str));
[/php]
------------------------------------------------ ----------------------------------
8: How to get the variable value outside the function in the function
PHP code:------------------------------------------------ ----------------------------------
[php]
$a="PHP";
foo();
Function foo()
{
global $a;//Delete this and see what the result is
Echo "$a";
}
[/php]
------------------------------------------------ ----------------------------------
9: How do I know what functions the system supports by default
PHP code:------------------------------------------------ ----------------------------------
[php]
$arr = get_defined_functions();
Function php() {
}
echo ""; Echo "This displays all the functions supported by the system, and the custom function phpn"; print_r($arr); echo "";
[/php]
------------------------------------------------ ----------------------------------
10: How to compare the difference between two dates
PHP code:------------------------------------------------ ----------------------------------
[php]
$Date_1="2003-7-15";//It can also be:$Date_1="2003-6-25 23:29:14";
$Date_2="1982-10-1";
$Date_List_1=explode("-",$Date_1);
$Date_List_2=explode("-",$Date_2);
$d1=mktime(0,0,0,$Date_List_1[1],$Date_List_1[2],$Date_List_1[0]);
$d2=mktime(0,0,0,$Date_List_2[1],$Date_List_2[2],$Date_List_2[0]);
$Days=round(($d1-$d2)/3600/24);
Echo "I have struggled for $Days days^_^";
[/php]
------------------------------------------------ ----------------------------------
11: Why did the original program appear full screen after I upgraded PHP? Notice: Undefined variable:
This is a warning, caused by the variable being undefined.
Open php.ini, find error_reporting at the bottom, and change it to error_reporting = E_ALL & ~E_NOTICE
For Parse error
error_reporting(0) cannot be closed.
If you want to turn off any error prompts, open php.ini, find display_errors, and set display_errors = Off. Any errors in the future will not be prompted.
So what is error_reporting?
12: I want to add a file at the beginning and end of each file. But adding one by one is very troublesome
1: Open the php.ini file
Set include_path= "c:"
2: Write two files
Auto_prepend_file.php and auto_append_file.php are saved in the c drive, and they will be automatically attached to the head and tail of each php file.
3: Found in php.ini:
Automatically add files before or after any PHP document.
auto_prepend_file = auto_prepend_file.php; attached to the head
auto_append_file = auto_append_file.php; attached to the end
From now on, each of your php files will be equivalent to
PHP code:------------------------------------------------ ----------------------------------
[php]
Include "auto_prepend_file.php" ;
....//Here is your program
Include "auto_append_file.php";
[/php]
------------------------------------------------ ----------------------------------
13: How to upload files using PHP
PHP code:------------------------------------------------ ----------------------------------
[php]
Please select the file:
$upload_file=$_FILES['upload_file']['tmp_name'];
$upload_file_name=$_FILES['upload_file']['name'];
if($upload_file){
$file_size_max = 1000*1000;//1M limit file upload maximum capacity (bytes)
$store_dir = "d:/";// Storage location of uploaded files
$accept_overwrite = 1;//Whether it is allowed to overwrite the same file
// Check file size
if ($upload_file_size > $file_size_max) {
echo "Sorry, your file size is larger than specified";
exit;
}
// Check read and write files
if (file_exists($store_dir . $upload_file_name) && !$accept_overwrite) {
Echo "A file with the same file name exists";
exit;
}
//Copy the file to the specified directory
if (!move_uploaded_file($upload_file,$store_dir.$upload_file_name)) {
echo "Failed to copy file";
exit;
}
}
Echo "
You uploaded a file:";
echo $_FILES['upload_file']['name'];
echo "
";
//The original name of the client machine file.
Echo "The MIME type of the file is:";
echo $_FILES['upload_file']['type'];
//The MIME type of the file, which requires the browser to provide support for this information, such as "image/gif".
echo "
";
Echo "Upload file size:";
echo $_FILES['upload_file']['size'];
//The size of the uploaded file, in bytes.
echo "
";
Echo "The file is temporarily stored as:" after uploading;
echo $_FILES['upload_file']['tmp_name'];
//The temporary file name stored on the server after the file is uploaded.
echo "
";
$Erroe=$_FILES['upload_file']['error'];
switch($Erroe){
case 0:
Echo "Upload successful"; break;
Case 1:
Echo "The uploaded file exceeds the limit of the upload_max_filesize option in php.ini."; break;
case 2:
Echo "The size of the uploaded file exceeds the value specified by the MAX_FILE_SIZE option in the HTML form."; break;
case 3:
Echo "Only part of the file was uploaded";break;
case 4:
Echo "No files uploaded";break;
}
[/php]
------------------------------------------------ ----------------------------------
14: How to configure the GD library
The following is my configuration process
1: Use dos command (you can also do it manually, copy all dll files in the dlls folder to the system32 directory) copy c:phpdlls*.dll c:windowssystem32
2: Open php.ini
Set extension_dir = "c:/php/extensions/";
3:
Extension=php_gd2.dll; Remove the comma in front of extension. If there is no php_gd2.dll, the same is true for php_gd.dll. Make sure this file does exist c:/php/extensions/php_gd2.dll
4: Run the following program to test
PHP code:------------------------------------------------ ----------------------------------
[php]
Ob_end_flush();
// Note that no information can be output to the browser before this. Please pay attention to whether auto_prepend_file is set.
header ("Content-type: image/png");
$im = @imagecreate (200, 100)
or die ("Unable to create image");
$background_color = imagecolorallocate ($im, 0,0, 0);
$text_color = imagecolorallocate ($im, 230, 140, 150);
Imagestring ($im, 3, 30, 50, "A Simple Text String", $text_color);
imagepng ($im);
[/php]
------------------------------------------------ ----------------------------------
15: What is UBB code
UBB code is a variant of HTML and a special TAG used by Ultimate Bulletin Board (a foreign BBS program, which is also used in many places in China).
Even if the use of HTML is prohibited, you can still use UBBCode?. Maybe you prefer to use UBBCode? instead of HTML, even if the forum allows the use of HTML, because it uses less code and is safer.
There are examples in Q3boy’s UBB, you can run the test directly
16: I want to change the MySQL user and password
First of all, let me declare that in most cases, modifying MySQL requires root permissions in mysql,
So general users cannot change passwords unless requesting an administrator.
Method 1
Using phpmyadmin, this is the easiest, modify the user table of the mysql library,
But don’t forget to use the PASSWORD function.
Method 2
Use mysqladmin, which is a special case stated earlier.
mysqladmin -u root -p password mypasswd
After entering this command, you need to enter the original password of root, and then the password of root will be changed to mypasswd.
Change root in the command to your username, and you can change your own password.
Of course, if your mysqladmin cannot connect to the mysql server, or you cannot execute mysqladmin,
Then this method is invalid.
And mysqladmin cannot clear the password.
The following methods are all used at the mysql prompt and must have mysql root permissions:
Method 3
mysql> INSERT INTO mysql.user (Host,User,Password)
VALUES('%','jeffrey',PASSWORD('biscuit'));
mysql> FLUSH PRIVILEGES
To be precise, this is adding a user, the username is jeffrey and the password is biscuit.
There is this example in the "mysql Chinese Reference Manual", so I wrote it out.
Be careful to use the PASSWORD function, and then use FLUSH PRIVILEGES.
Method 4
Same as method three, except using the REPLACE statement
mysql> REPLACE INTO mysql.user (Host,User,Password)
VALUES('%','jeffrey',PASSWORD('biscuit'));
mysql> FLUSH PRIVILEGES
Method 5
Use the SET PASSWORD statement,
mysql> SET PASSWORD FOR jeffrey@"%" = PASSWORD('biscuit');
You must also use the PASSWORD() function,
But there is no need to use FLUSH PRIVILEGES.
Method 6
Use GRANT ... IDENTIFIED BY statement
mysql> GRANT USAGE ON *.* TO jeffrey@"%" IDENTIFIED BY 'biscuit';
The PASSWORD() function is unnecessary here, and there is no need to use FLUSH PRIVILEGES.
Note: PASSWORD() [does not] perform password encryption in the same way as Unix password encryption.
17: I want to know which website he connected to this page through.
PHP code:------------------------------------------------ ----------------------------------
[php]
//You must enter through a super connection to have output
Echo $_SERVER['HTTP_REFERER'];
[/php]
------------------------------------------------ ----------------------------------
18: What should you pay attention to when putting data into the database and taking it out to display on the page
When put into storage
$str=addslashes($str);
$sql="insert into `tab` (`content`) values('$str')";
When leaving the warehouse
$str=stripslashes($str);
When displayed
$str=htmlspecialchars(nl2br($str));
19: How to read the current address bar information
PHP code:------------------------------------------------ ----------------------------------
[php]
$s="http://{$_SERVER['HTTP_HOST']}:{$_SERVER["SERVER_PORT"]}{$_SERVER['SCRIPT_NAME']}";
$se='';
foreach ($_GET as $key => $value) {
$se.=$key."=".$value."&";
}
$se=Preg_Replace("/(.*)&$/","$1",$se);
$se?$se="?".$se:"";
echo $s."?$se";
[/php]
------------------------------------------------ ----------------------------------
20: I clicked the back button, why did the previously filled out information disappear?
This is because you used session.
Solution:
PHP code:------------------------------------------------ ----------------------------------
[php]
session_cache_limiter('private, must-revalidate');
session_start();
…………
…………
[/php]
------------------------------------------------ ----------------------------------
21: How to display IP address in pictures
PHP code:------------------------------------------------ ----------------------------------
[php]
Header("Content-type: image/png");
$img = ImageCreate(180,50);
$ip = $_SERVER['REMOTE_ADDR'];
ImageColorTransparent($img,$bgcolor);
$bgColor = ImageColorAllocate($img, 0x2c,0x6D,0xAF); // Background color
$shadow = ImageColorAllocate($img, 250,0,0); // Shadow color
$textColor = ImageColorAllocate($img, oxff,oxff,oxff); // Font color
ImageTTFText($img,10,0,78,30,$shadow,"d:/windows/fonts/Tahoma.ttf",$ip); //Display background
ImageTTFText($img,10,0,25,28,$textColor,"d:/windows/fonts/Tahoma.ttf","your ip is".$ip); // Display IP
ImagePng($img);
imagecreatefrompng($img);
ImageDestroy($img);
[/php]
------------------------------------------------ ----------------------------------
22: How to obtain the user’s real IP
PHP code:------------------------------------------------ ----------------------------------
[php]
Function iptype1 () {
if (getenv("HTTP_CLIENT_IP")) {
Return getenv("HTTP_CLIENT_IP");
}
else {
return "none";
}
}
Function iptype2 () {
if (getenv("HTTP_X_FORWARDED_FOR")) {
return getenv("HTTP_X_FORWARDED_FOR");
}
else {
return "none";
}
}
Function iptype3 () {
if (getenv("REMOTE_ADDR")) {
return getenv("REMOTE_ADDR");
}
else {
return "none";
}
}
Function ip() {
$ip1 = iptype1();
$ip2 = iptype2();
$ip3 = iptype3();
if (isset($ip1) && $ip1 != "none" && $ip1 != "unknown") {
return $ip1;
}
elseif (isset($ip2) && $ip2 != "none" && $ip2 != "unknown") {
return $ip2;
}
elseif (isset($ip3) && $ip3 != "none" && $ip3 != "unknown") {
return $ip3;
}
else {
return "none";
}
}
Echo ip();
[/php]
------------------------------------------------ ----------------------------------
23: How to read all records within three days from the database
First, there must be a DATETIME field in the table to record the time,
The format is '2003-7-15 16:50:00'
SELECT * FROM `xltxlm` WHERE TO_DAYS(NOW()) - TO_DAYS(`date`)
24: How to remotely connect to Mysql database
There is a host field in the mysql table for adding users, change it to "%", or specify the IP address that allows the connection, so that you can call it remotely.
$link=mysql_connect("192.168.1.80:3306","root","");
25: How to use regular expressions
Click here
Special characters in regular expressions
26: After using Apache, the homepage appears garbled
Method 1:
AddDefaultCharset ISO-8859-1 changed to AddDefaultCharset off
Method 2:
AddDefaultCharset GB2312
================================================ =========
tip:
When you post the code, GB2312 will be interpreted as ??????
Change it to this and it won’t happen
GB2312
10: How to compare the number of days between two dates, (simpler algorithm)
PHP code:------------------------------------------------ ----------------------------------
[php]
$Date_1="2003-7-15";//It can also be:$Date_1="2003-7-15 23:29:14";
$Date_2="1982-10-1";
$d1=strtotime($Date_1);
$d2=strtotime($Date_2);
$Days=round(($d1-$d2)/3600/24);
Echo "I have struggled for $Days days^_^";
[/php]
------------------------------------------------ ----------------------------------
27: Why do single quotes and double quotes become ('")
on the acceptance page?Solution:
Method 1: Set: magic_quotes_gpc = Off in php.ini
Method 2: $str=stripcslashes($str)
28: How to keep the program running instead of stopping after 30 seconds
Set_time_limit(60)//The maximum running time is one minute
Set_time_limit(0)//Run until the program ends by itself, or stop manually
29: Calculate the number of people currently online
Example 1: Using text to implement
PHP code:------------------------------------------------ ----------------------------------
[php]
//First you must have permission to read and write files
//This program can be run directly. If an error is reported for the first time, it can be run later
$online_log = "count.dat"; //File to save the number of people,
$timeout = 30; //If there is no action within 30 seconds, it will be considered offline
$entries = file($online_log);
$temp = array();
for ($i=0;$i
$entry = explode(",",trim($entries[$i]));
if (($entry[0] != getenv('REMOTE_ADDR')) && ($entry[1] > time())) {
array_push($temp,$entry[0].",".$entry[1]."n"); //Get other browsers’ information, remove the timeout ones, and save it in $temp
}
}
array_push($temp,getenv('REMOTE_ADDR').",".(time() + ($timeout))."n"); //Update the viewer's time
$users_online = count($temp); //Calculate the number of people online
$entries = implode("",$temp);
//Write file
$fp = fopen($online_log,"w");
flock($fp,LOCK_EX); //flock() does not work properly in NFS and some other network file systems
fputs($fp,$entries);
flock($fp,LOCK_UN);
fclose($fp);
echo "Currently there are".$users_online."People are online";
[/php]
------------------------------------------------ ----------------------------------
Example 2:
Use database to implement online users
30: What is a template and how to use it
Here are several articles about templates
I use the phplib template
The following are the uses of several functions
$T->Set_File("Definition as you like", "Template file.tpl");
$T->Set_Block("defined in set_file"," ","define whatever you want");
$T->Parse("defined in Set_Block"," ",true);
$T->Parse("Output the results as you like", "Defined in Set_File");
Set the loop format to:
How to generate a static web page from a template
PHP code:------------------------------------------------ ----------------------------------
[php]
//Use phplib template here
............
............
$tpl->parse("output","html");
$output = $tpl->get("output");// $output is the entire web page content
Function wfile($file,$content,$mode='w') {
$oldmask = umask(0);
$fp = fopen($file, $mode);
if (!$fp) return false;
fwrite($fp,$content);
fclose($fp);
umask($oldmask);
return true;
}
// Write to file
Wfile($FILE,$output);
Header("location:$FILE");//Redirect to the generated web page
}
[/php]
------------------------------------------------ ----------------------------------
phplib download address smarty download address
31: How to use php to interpret characters
For example: input 2+2*(1+2), and automatically output 8
You can use the eval function
PHP code:------------------------------------------------ ----------------------------------
[php]
$str=$_POST['str'];
eval("$o=$str;");
Echo "$o";
[/php]
------------------------------------------------ ------------------

Python是一种面向对象的高级编程语言,具有简单、易读、易学等特点,因此被广泛应用于数据分析、人工智能、网站开发等领域。在Python编程过程中,我们常常会遇到函数未定义的错误,本文将介绍如何解决这个问题。定义函数首先,我们需要明确函数未定义错误的原因:通常是因为我们忘记或者未正确地定义某个函数。因此,我们需要检查代码中是否包含所有需要定义的函数,并确保它

Python是一种流行的编程语言,但在使用中,经常会遇到一些错误。其中一个常见的错误是“文件夹未找到”。这个错误很容易让新手或者不熟悉Python的人感到困惑。在本文中,我们将讨论如何解决这个问题。1.确认文件夹路径是否正确在Python中,处理文件和文件夹的时候,需要指定文件和文件夹的路径。如果路径设置错误,那么就会导致程序无法找到文件夹。因此,我们需要先

Python是一门易学易用的编程语言,然而在使用Python编写递归函数时,可能会遇到递归深度过大的错误,这时就需要解决这个问题。本文将为您介绍如何解决Python的最大递归深度错误。1.了解递归深度递归深度是指递归函数嵌套的层数。在Python默认情况下,递归深度的限制是1000,如果递归的层数超过这个限制,系统就会报错。这种报错通常称为“最大递归深度错误

<p>Xlive.dll是Microsoft的一个动态链接库(DLL),它是“WindowsLive游戏”的一部分。由Xlive.dll引起的错误可能是由于Xlive.dll文件的删除、放错位置、被恶意软件损坏或注册表项搞砸了。由于此错误而无法启动程序或游戏可能会令人沮丧。让我们看看解决这个问题的方法。此问题通常可以通过正确重新安装Xlive.dll文件来解决。</p><p><strong&

Python是一种非常流行的编程语言,由于其简洁明了的语法、易于学习以及丰富的生态系统得到了广泛的应用。然而,由于Python采用缩进作为代码块的标识,所以在编写Python程序的过程中,很容易遇到缩进错误的问题。缩进错误的原因可能是拼写错误、恰当使用缩进或可读性不好,这可能会导致代码运行失败或出现意想不到的结果。因此,在想要解决Python缩进错误的时候,

在Python编程中,当我们想要调用一个尚未实现的方法时,会出现NotImplementedError的错误提示。这个错误可以让我们感到困惑,因为它并没有明确告诉我们如何解决它。在本文中,我们将探讨NotImplementedError的原因,并提供一些解决方法,帮助您克服此错误。什么是NotImplementedError?NotImplementedEr

Go语言中的时间相关函数是非常常用的一部分,而time.Now()函数则是最常用的获取当前时间的方式。然而有时候我们在代码中调用这个函数却会出现"undefined:time.Now"的错误,那么我们该怎么解决这个问题呢?首先,我们需要了解一下这个错误的原因。Go语言的std库是根据当前Go版本编译生成的。当你的Go程序引入一个std

Python作为一种高级编程语言,在数据处理、科学计算、人工智能等领域广泛应用。不过,在这些应用场景中,Python的内存占用较高,甚至可能出现内存不足的情况。本文将介绍如何解决Python的内存不足错误。减少内存使用量Python语言本身并不是一个占用内存很大的语言。通常情况下,Python的内存使用量是由程序设计、数据结构、算法等因素共同决定的。因此,我


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

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),