Презентация РНР hypertext preprocessor language онлайн
На нашем сайте вы можете скачать и просмотреть онлайн доклад-презентацию на тему РНР hypertext preprocessor language абсолютно бесплатно. Урок-презентация на эту тему содержит всего 30 слайдов. Все материалы созданы в программе PowerPoint и имеют формат ppt или же pptx. Материалы и темы для презентаций взяты из открытых источников и загружены их авторами, за качество и достоверность информации в них администрация сайта не отвечает, все права принадлежат их создателям. Если вы нашли то, что искали, отблагодарите авторов - поделитесь ссылкой в социальных сетях, а наш сайт добавьте в закладки.
Презентации » Устройства и комплектующие » РНР hypertext preprocessor language
Оцените!
Оцените презентацию от 1 до 5 баллов!
- Тип файла:ppt / pptx (powerpoint)
- Всего слайдов:30 слайдов
- Для класса:1,2,3,4,5,6,7,8,9,10,11
- Размер файла:475.33 kB
- Просмотров:68
- Скачиваний:0
- Автор:неизвестен
Слайды и текст к этой презентации:
№2 слайд
![Include Files The include or](/documents_6/e5c2153cf5b861e046d40d183ccef690/img1.jpg)
Содержание слайда: Include Files
The include (or require) statement takes all the text/code/markup that exists in the specified file and copies it into the file that uses the include statement.
Including files is very useful when you want to include the same PHP, HTML, or text on multiple pages of a website.
№4 слайд
![PHP include vs. require The](/documents_6/e5c2153cf5b861e046d40d183ccef690/img3.jpg)
Содержание слайда: PHP include vs. require
The require statement is also used to include a file into the PHP code.
However, there is one big difference between include and require; when a file is included with the include statement and PHP cannot find it, the script will continue to execute.
If we do the same example using the require statement, the echo statement will not be executed because the script execution dies after the require statement returned a fatal error.
№11 слайд
![Create The Upload File PHP](/documents_6/e5c2153cf5b861e046d40d183ccef690/img10.jpg)
Содержание слайда: Create The Upload File PHP Script
<?php
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}
}
?>
№14 слайд
![Limit File Type Allow certain](/documents_6/e5c2153cf5b861e046d40d183ccef690/img13.jpg)
Содержание слайда: Limit File Type
// Allow certain file formats
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
$uploadOk = 0;
}
//The code only allows users to upload JPG, JPEG, PNG, and GIF files. All other file types gives an error message
№15 слайд
![Complete Upload File PHP](/documents_6/e5c2153cf5b861e046d40d183ccef690/img14.jpg)
Содержание слайда: Complete Upload File PHP Script (part 1)
<?php
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}
}
№16 слайд
![Complete Upload File PHP](/documents_6/e5c2153cf5b861e046d40d183ccef690/img15.jpg)
Содержание слайда: Complete Upload File PHP Script (part 2)
// Check if file already exists
if (file_exists($target_file)) {
echo "Sorry, file already exists.";
$uploadOk = 0;
}
// Check file size
if ($_FILES["fileToUpload"]["size"] > 500000) {
echo "Sorry, your file is too large.";
$uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
$uploadOk = 0;
}
№17 слайд
![Complete Upload File PHP](/documents_6/e5c2153cf5b861e046d40d183ccef690/img16.jpg)
Содержание слайда: Complete Upload File PHP Script (part 3)
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo "Sorry, your file was not uploaded.";
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
}
?>
№24 слайд
![lt ?php path quot images quot](/documents_6/e5c2153cf5b861e046d40d183ccef690/img23.jpg)
Содержание слайда: <?php
$path = "images/"; // path to images folder
$file_count = count(glob($path . "*.{png,jpg,jpeg,gif}", GLOB_BRACE));
if($file_count > 0)
{
$fp = opendir($path);
while($file = readdir($fp))
{
$ext = pathinfo($file, PATHINFO_EXTENSION);
$ext_array = ['png', 'jpg', 'jpeg', 'gif'];
if (in_array($ext, $ext_array))
{
$file_path = $path . $file;?>
<div class="col-md-4 col-xs-6">
<a href="<?php echo $file_path; ?>" title="My Favorites" data-gallery><img src="<?php echo $file_path; ?>" class="img-responsive" /></a>
</div>
<?}
}
closedir($fp);
}
?>
№26 слайд
![Error Handling When creating](/documents_6/e5c2153cf5b861e046d40d183ccef690/img25.jpg)
Содержание слайда: Error Handling
When creating scripts and web applications, error handling is an important part. If your code lacks error checking code, your program may look very unprofessional and you may be open to security risks.
This tutorial contains some of the most common error checking methods in PHP.
We will show different error handling methods:
Simple "die()" statements
Custom errors and error triggers
Error reporting
№28 слайд
![Exception handling Exception](/documents_6/e5c2153cf5b861e046d40d183ccef690/img27.jpg)
Содержание слайда: Exception handling
Exception handling is used to change the normal flow of the code execution if a specified error (exceptional) condition occurs. This condition is called an exception.
This is what normally happens when an exception is triggered:
The current code state is saved
The code execution will switch to a predefined (custom) exception handler function
Depending on the situation, the handler may then resume the execution from the saved code state, terminate the script execution or continue the script from a different location in the code
№30 слайд
![Example of Try, throw and](/documents_6/e5c2153cf5b861e046d40d183ccef690/img29.jpg)
Содержание слайда: Example of Try, throw and catch
<?php
//create function with an exception
function checkNum($number) {
if($number>1) {
throw new Exception("Value must be 1 or below");
}
return true;
}
//trigger exception in a "try" block
try {
checkNum(2);
//If the exception is thrown, this text will not be shown
echo 'If you see this, the number is 1 or below';
}
//catch exception
catch(Exception $e) {
echo 'Message: ' .$e->getMessage();
}
?>
Скачать все slide презентации РНР hypertext preprocessor language одним архивом:
Похожие презентации
-
Codecraft PHP. PHP - PHP: Hypertext Preprocessor предварительный обработчик гипертекста. (Урок 1)
-
Скриптовые языки программирования. PHP Hypertext Preprocessor (Препроцессор Гипертекста)"
-
Назначение и возможности языка PHP. Переменные, константы и типы данных РНР. Лекция 1
-
Programming languages
-
Ruby programming language
-
Generations of programming language
-
Programming Languages. Compilers. Formal Languages
-
XPath (XML Path Language) язык запросов к элементам XML-документа
-
HTML. The standard markup language for creating Web pages
-
Prolog. A general-purpose logic programming language associated with artificial intelligence and computational linguistics