The document discusses various topics related to PHP including syntax, variables, strings, and operators. It provides tutorials and instructions on PHP installation, writing PHP code, data types like variables and strings, and operators. Code examples are given to demonstrate different PHP concepts. The document also mentions using a local host server and IDEs for PHP development.
Spring scala - Sneaking Scala into your corporationHenryk Konsek
Spring Scala provides an API for defining beans in Scala and wrappers for existing Spring functionality. It allows defining beans as functions, using Scala collections and options instead of Java APIs, and aspect-oriented programming without inner classes. While pure Java configuration can be used with Scala, Spring Scala offers a more Scala-friendly experience when integrating Scala code with existing Spring applications and services. Introducing Spring Scala in an incremental, evolutionary manner is recommended over rewriting large projects.
Representing Material Culture Online: Historic Clothing in OmekaArden Kirkland
In June 2014 I was invited to present at the New York City Digital Humanities (NYCDH) Omeka User’s Group Workshop at the Bard Graduate Center. I spoke about my work with two different collections of historic clothing that are using Omeka as their platform, and shared some of the challenges of representing material culture online. This includes some details of the nuts and bolts behind each project, including samples of customized PHP for showing related items.
This builds on the presentation I gave at the annual symposium for the Costume Society of America, "One of Many Small Collections."
¡Ups! código inseguro: detección, explotación y mitigación de vulnerabilidade...Software Guru
This document discusses code that is vulnerable to various exploits and summarizes explanations of exploits. It includes code for writing notes to a file that is vulnerable to format string bugs and buffer overflows. It also includes code for searching notes that could be exploited through malformed input to read arbitrary files or crash the program. The document walks through examples of exploiting buffer overflows, format string bugs, and other vulnerabilities.
The why and how of moving to php 5.4/5.5Wim Godden
With PHP 5.5 out and many production environments still running 5.2 (or older), it's time to paint a clear picture on why everyone should move to 5.4 and 5.5 and how to get code ready for the latest version of PHP. In this talk, we'll look at some handy tools and techniques to ease the migration.
This document discusses PHP 7 and alternative PHP implementations like HHVM. It provides an overview of PHP 7 features like a reworked engine and true 64-bit support. It also discusses alternative implementations like HHVM, which uses a just-in-time compiler to compile PHP to native machine code, and Zephir, which allows PHP code to be compiled to C code for performance benefits. Finally, it shares benchmarks showing performance improvements of these implementations over PHP 5.
This document provides an overview of the Python programming language in under 90 minutes. It covers Python basics like Hello World, variables, data types, objects, functions, conditionals, and more. The goal is to teach readers enough Python to read, write, and understand basic Python programs in a short period of time. It also provides references to additional resources like the author's book for learning Python in more depth.
Migration is one of the most scary migration: it requires sharp tools to find incompatibilities in the code, and even more know-how to adapt it to the future environnement. During this workshop, we'll work on your code, systematically targeting incompatibilities and scouting for opportunities to use the new features. Along the way, we'll get right of dead code, slow routines and instable functions. After querying the code, we'll discuss the various solutions and learn even more about using PHP for the best.
The document provides an overview of PHP (Hypertext Preprocessor) which is a server-side scripting language used for web development. It discusses what PHP is, PHP files and syntax, variables, operators, control structures like if/else and switch statements, arrays, looping, functions, forms and user input handling, and interacting with databases.
Spring scala - Sneaking Scala into your corporationHenryk Konsek
Spring Scala provides an API for defining beans in Scala and wrappers for existing Spring functionality. It allows defining beans as functions, using Scala collections and options instead of Java APIs, and aspect-oriented programming without inner classes. While pure Java configuration can be used with Scala, Spring Scala offers a more Scala-friendly experience when integrating Scala code with existing Spring applications and services. Introducing Spring Scala in an incremental, evolutionary manner is recommended over rewriting large projects.
Representing Material Culture Online: Historic Clothing in OmekaArden Kirkland
In June 2014 I was invited to present at the New York City Digital Humanities (NYCDH) Omeka User’s Group Workshop at the Bard Graduate Center. I spoke about my work with two different collections of historic clothing that are using Omeka as their platform, and shared some of the challenges of representing material culture online. This includes some details of the nuts and bolts behind each project, including samples of customized PHP for showing related items.
This builds on the presentation I gave at the annual symposium for the Costume Society of America, "One of Many Small Collections."
¡Ups! código inseguro: detección, explotación y mitigación de vulnerabilidade...Software Guru
This document discusses code that is vulnerable to various exploits and summarizes explanations of exploits. It includes code for writing notes to a file that is vulnerable to format string bugs and buffer overflows. It also includes code for searching notes that could be exploited through malformed input to read arbitrary files or crash the program. The document walks through examples of exploiting buffer overflows, format string bugs, and other vulnerabilities.
The why and how of moving to php 5.4/5.5Wim Godden
With PHP 5.5 out and many production environments still running 5.2 (or older), it's time to paint a clear picture on why everyone should move to 5.4 and 5.5 and how to get code ready for the latest version of PHP. In this talk, we'll look at some handy tools and techniques to ease the migration.
This document discusses PHP 7 and alternative PHP implementations like HHVM. It provides an overview of PHP 7 features like a reworked engine and true 64-bit support. It also discusses alternative implementations like HHVM, which uses a just-in-time compiler to compile PHP to native machine code, and Zephir, which allows PHP code to be compiled to C code for performance benefits. Finally, it shares benchmarks showing performance improvements of these implementations over PHP 5.
This document provides an overview of the Python programming language in under 90 minutes. It covers Python basics like Hello World, variables, data types, objects, functions, conditionals, and more. The goal is to teach readers enough Python to read, write, and understand basic Python programs in a short period of time. It also provides references to additional resources like the author's book for learning Python in more depth.
Migration is one of the most scary migration: it requires sharp tools to find incompatibilities in the code, and even more know-how to adapt it to the future environnement. During this workshop, we'll work on your code, systematically targeting incompatibilities and scouting for opportunities to use the new features. Along the way, we'll get right of dead code, slow routines and instable functions. After querying the code, we'll discuss the various solutions and learn even more about using PHP for the best.
The document provides an overview of PHP (Hypertext Preprocessor) which is a server-side scripting language used for web development. It discusses what PHP is, PHP files and syntax, variables, operators, control structures like if/else and switch statements, arrays, looping, functions, forms and user input handling, and interacting with databases.
PHP 7.1 is all ready to replace 7.0, adding even more features and goodness to the ground-breaking previous version.
Visibility for class constant, key specifications for list, void return type, mcrypt() deprecation, negative offset and warning for integer conversion.
We'll cover new features, deprecated ones and incompatibilities, so you're ready for your next migration.
This document provides an overview of the Python programming language, including its history, key features, syntax examples, and common uses. It also discusses how Python can be used under Linux and some potential issues.
REST est devenu un standard pour les APIs web. Mais malgré sa popularité, il est plein de défauts. Son successeur existe et il vient de Facebook. Venez découvrir en détail le principe, la mise en oeuvre et l’écosystème de GraphQL.
The why and how of moving to PHP 5.5/5.6Wim Godden
With PHP 5.6 out and many production environments still running 5.2 or 5.3, it's time to paint a clear picture on why everyone should move to 5.5 and 5.6 and how to get code ready for the latest version of PHP. In this talk, we'll look at some handy tools and techniques to ease the migration.
With PHP 5.4 out and many production environments still running 5.2 (or older), it's time to paint a clear picture on why everyone should move to 5.3 and 5.4 and how to get code ready for the latest version of PHP. In this talk, we'll migrate an old piece of code using some standard and some very non-standard tools and techniques.
This document provides tips, tricks, and examples of common gotchas in PHP programming. It demonstrates unexpected behaviors that can occur due to PHP's highly dynamic nature and weakly typed system. A series of code snippets are shown with their expected versus actual outputs to illustrate issues one may encounter with variables, strings, arrays, and type coercion. The document also provides best practices for PHP development and an overview of common topics covered in the PHP certification exam.
The why and how of moving to PHP 5.4/5.5Wim Godden
With PHP 5.5 out and many production environments still running 5.2 (or older), it's time to paint a clear picture on why everyone should move to 5.4 and 5.5 and how to get code ready for the latest version of PHP. In this talk, we'll migrate an old piece of code using some standard and some very non-standard tools and techniques.
Writing concurrent program is hard; maintaining concurrent program even is a nightmare. Actually, a pattern which helps us to write good concurrent code is available, that is, using “channels” to communicate.
This talk will share the channel concept with common libraries, like threading and multiprocessing, to make concurrent code elegant.
It's the talk at PyCon TW 2017 [1] and PyCon APAC/MY 2017 [2].
[1]: https://tw.pycon.org/2017
[2]: https://pycon.my/pycon-apac-2017-program-schedule/
If you want to be a WordPress theme developer, you have to know the WordPress Loop inside out. In this presentation I'll try to introduce it, with some examples and references.
PHP 7 is on track, ready to hit the road later this year. What does it bring?
What other alternative do we have in the PHP World? Be from alternative implementations point of views, like hhvm or other, or do we have existing solutions to speed up PHP already? Using the existing versions?
Caching and tuning fun for high scalability @ FrOSCon 2011Wim Godden
The document discusses using caching and tuning techniques to improve scalability for websites. It covers caching full pages, parts of pages, SQL queries, and complex processing results. Memcache is presented as a fast and distributed caching solution. The document also discusses installing and using Memcache, as well as replacing Apache with Nginx as a lighter-weight web server that can serve static files and forward dynamic requests.
It is the slides for COSCUP[1] 2013 Hands-on[2], "Learning Python from Data".
It aims for using examples to show the world of Python. Hope it will help you with learning Python.
[1] COSCUP: http://coscup.org/
[2] COSCUP Hands-on: http://registrano.com/events/coscup-2013-hands-on-mosky
The document discusses conducting a PHP code audit. It outlines steps like interviewing developers, performing black box testing, and conducting an open code audit. When auditing code, the speaker searches for injections like SQL, PHP, and HTML injections. Variables used in includes are reviewed, as are comments, variables, functions, and conditions. Register_globals is identified as a risk that can be emulated. The report would provide an executive summary, problems summary, and details on vulnerabilities found. Community involvement and continuous auditing are recommended for security.
This is the sixth set of slightly updated slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
Version 5.0 will include version 2.0 of the Zend Engine
New object model is more powerful and intuitive
Objects will no longer be passed by value; they now will be passed by reference
Increases performance and makes OOP more attractive
This document provides an overview of server-side technologies PHP. It begins with an introduction to PHP that describes what PHP is, what PHP files are, and what PHP can do. It then covers PHP features, syntax, variables, operators, conditions and loops, functions, string manipulation, and arrays. The document also includes sample code examples for each topic. It aims to teach the fundamentals of PHP for developing dynamic web applications.
This document provides an introduction to PHP, covering its history, core concepts like variables, arrays, operators, control structures, and how to include external files. PHP is a server-side scripting language commonly used for web development. It was created in 1994 and has evolved through several versions. Key points covered include PHP's loose typing, how variables work and are assigned, the various operators available, using arrays to store multiple values, and control structures like if/else statements and loops to control program flow. The document also discusses including other files to reuse code and read external data files.
This document provides an introduction and overview of PHP. It begins with a brief history of PHP, noting it was created in 1994 and is now one of the premier open source projects. It discusses PHP's server-side scripting capabilities and mentions variables, arrays, operators, functions and control structures as topics that will be covered. The document provides background on PHP and how it is well-suited for dynamic web content. It also discusses PHP parsing and architecture.
This document summarizes security issues in PHP applications. It discusses three lesser known vulnerabilities: 1) PHP path normalization can be bypassed on Windows through special characters like angle brackets or double quotes, allowing access to files that should not be accessible. 2) Double-byte character sets can be escaped to bypass input validation in SQL injection and XSS attacks. 3) Variables in double quotes may be evaluated, allowing code injection through functions like phpinfo(). It provides solutions like proper input validation, output encoding, and using single quotes instead of double quotes.
This document summarizes security issues in PHP applications. It discusses three lesser known vulnerabilities: 1) PHP path normalization can be bypassed on Windows through special characters like double dots and pipes, allowing access to files outside the web root. 2) Double-byte character sets can be escaped to bypass input validation in SQL injection and XSS attacks. 3) Variables in double quotes undergo string evaluation, which can enable code injection through functions like phpinfo(). The document provides solutions like sanitizing special characters, proper UTF-8 encoding, and avoiding eval-like functions.
Anatomy of a PHP Request ( UTOSC 2010 )Joseph Scott
This document provides an overview of the PHP request lifecycle, including how a PHP file is read, parsed, compiled, executed, and outputs. It discusses how PHP is handled by different web servers like Apache, Nginx, and FastCGI. It also covers topics like opcode caching with APC, profiling PHP performance with Xdebug, and analyzing PHP opcodes with Vulcan Logic Dumper.
PHP 7.1 is all ready to replace 7.0, adding even more features and goodness to the ground-breaking previous version.
Visibility for class constant, key specifications for list, void return type, mcrypt() deprecation, negative offset and warning for integer conversion.
We'll cover new features, deprecated ones and incompatibilities, so you're ready for your next migration.
This document provides an overview of the Python programming language, including its history, key features, syntax examples, and common uses. It also discusses how Python can be used under Linux and some potential issues.
REST est devenu un standard pour les APIs web. Mais malgré sa popularité, il est plein de défauts. Son successeur existe et il vient de Facebook. Venez découvrir en détail le principe, la mise en oeuvre et l’écosystème de GraphQL.
The why and how of moving to PHP 5.5/5.6Wim Godden
With PHP 5.6 out and many production environments still running 5.2 or 5.3, it's time to paint a clear picture on why everyone should move to 5.5 and 5.6 and how to get code ready for the latest version of PHP. In this talk, we'll look at some handy tools and techniques to ease the migration.
With PHP 5.4 out and many production environments still running 5.2 (or older), it's time to paint a clear picture on why everyone should move to 5.3 and 5.4 and how to get code ready for the latest version of PHP. In this talk, we'll migrate an old piece of code using some standard and some very non-standard tools and techniques.
This document provides tips, tricks, and examples of common gotchas in PHP programming. It demonstrates unexpected behaviors that can occur due to PHP's highly dynamic nature and weakly typed system. A series of code snippets are shown with their expected versus actual outputs to illustrate issues one may encounter with variables, strings, arrays, and type coercion. The document also provides best practices for PHP development and an overview of common topics covered in the PHP certification exam.
The why and how of moving to PHP 5.4/5.5Wim Godden
With PHP 5.5 out and many production environments still running 5.2 (or older), it's time to paint a clear picture on why everyone should move to 5.4 and 5.5 and how to get code ready for the latest version of PHP. In this talk, we'll migrate an old piece of code using some standard and some very non-standard tools and techniques.
Writing concurrent program is hard; maintaining concurrent program even is a nightmare. Actually, a pattern which helps us to write good concurrent code is available, that is, using “channels” to communicate.
This talk will share the channel concept with common libraries, like threading and multiprocessing, to make concurrent code elegant.
It's the talk at PyCon TW 2017 [1] and PyCon APAC/MY 2017 [2].
[1]: https://tw.pycon.org/2017
[2]: https://pycon.my/pycon-apac-2017-program-schedule/
If you want to be a WordPress theme developer, you have to know the WordPress Loop inside out. In this presentation I'll try to introduce it, with some examples and references.
PHP 7 is on track, ready to hit the road later this year. What does it bring?
What other alternative do we have in the PHP World? Be from alternative implementations point of views, like hhvm or other, or do we have existing solutions to speed up PHP already? Using the existing versions?
Caching and tuning fun for high scalability @ FrOSCon 2011Wim Godden
The document discusses using caching and tuning techniques to improve scalability for websites. It covers caching full pages, parts of pages, SQL queries, and complex processing results. Memcache is presented as a fast and distributed caching solution. The document also discusses installing and using Memcache, as well as replacing Apache with Nginx as a lighter-weight web server that can serve static files and forward dynamic requests.
It is the slides for COSCUP[1] 2013 Hands-on[2], "Learning Python from Data".
It aims for using examples to show the world of Python. Hope it will help you with learning Python.
[1] COSCUP: http://coscup.org/
[2] COSCUP Hands-on: http://registrano.com/events/coscup-2013-hands-on-mosky
The document discusses conducting a PHP code audit. It outlines steps like interviewing developers, performing black box testing, and conducting an open code audit. When auditing code, the speaker searches for injections like SQL, PHP, and HTML injections. Variables used in includes are reviewed, as are comments, variables, functions, and conditions. Register_globals is identified as a risk that can be emulated. The report would provide an executive summary, problems summary, and details on vulnerabilities found. Community involvement and continuous auditing are recommended for security.
This is the sixth set of slightly updated slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
Version 5.0 will include version 2.0 of the Zend Engine
New object model is more powerful and intuitive
Objects will no longer be passed by value; they now will be passed by reference
Increases performance and makes OOP more attractive
This document provides an overview of server-side technologies PHP. It begins with an introduction to PHP that describes what PHP is, what PHP files are, and what PHP can do. It then covers PHP features, syntax, variables, operators, conditions and loops, functions, string manipulation, and arrays. The document also includes sample code examples for each topic. It aims to teach the fundamentals of PHP for developing dynamic web applications.
This document provides an introduction to PHP, covering its history, core concepts like variables, arrays, operators, control structures, and how to include external files. PHP is a server-side scripting language commonly used for web development. It was created in 1994 and has evolved through several versions. Key points covered include PHP's loose typing, how variables work and are assigned, the various operators available, using arrays to store multiple values, and control structures like if/else statements and loops to control program flow. The document also discusses including other files to reuse code and read external data files.
This document provides an introduction and overview of PHP. It begins with a brief history of PHP, noting it was created in 1994 and is now one of the premier open source projects. It discusses PHP's server-side scripting capabilities and mentions variables, arrays, operators, functions and control structures as topics that will be covered. The document provides background on PHP and how it is well-suited for dynamic web content. It also discusses PHP parsing and architecture.
This document summarizes security issues in PHP applications. It discusses three lesser known vulnerabilities: 1) PHP path normalization can be bypassed on Windows through special characters like angle brackets or double quotes, allowing access to files that should not be accessible. 2) Double-byte character sets can be escaped to bypass input validation in SQL injection and XSS attacks. 3) Variables in double quotes may be evaluated, allowing code injection through functions like phpinfo(). It provides solutions like proper input validation, output encoding, and using single quotes instead of double quotes.
This document summarizes security issues in PHP applications. It discusses three lesser known vulnerabilities: 1) PHP path normalization can be bypassed on Windows through special characters like double dots and pipes, allowing access to files outside the web root. 2) Double-byte character sets can be escaped to bypass input validation in SQL injection and XSS attacks. 3) Variables in double quotes undergo string evaluation, which can enable code injection through functions like phpinfo(). The document provides solutions like sanitizing special characters, proper UTF-8 encoding, and avoiding eval-like functions.
Anatomy of a PHP Request ( UTOSC 2010 )Joseph Scott
This document provides an overview of the PHP request lifecycle, including how a PHP file is read, parsed, compiled, executed, and outputs. It discusses how PHP is handled by different web servers like Apache, Nginx, and FastCGI. It also covers topics like opcode caching with APC, profiling PHP performance with Xdebug, and analyzing PHP opcodes with Vulcan Logic Dumper.
The document provides an overview and introduction to PHP including:
- PHP is a server-side scripting language used for web development. It was created by Rasmus Lerdorf in 1995.
- It discusses PHP basics like syntax, variables, strings, arrays, functions, and how to interact with forms and retrieve data from web pages.
- It also covers using PHP to communicate with backend databases and services to fetch and parse XML/JSON data.
An introduction to exploit development.
I gave this talk at Hack the North 2014, and most of this information is pulled out of classics like Smashing the Stack for Fun and Profit, so there shouldn't be anything novel in here.
Vibrant Technologies is headquarted in Mumbai,India.We are the best php training provider in Navi Mumbai who provides Live Projects to students.We provide Corporate Training also.We are Best php classes in Mumbai according to our students and corporators
Brian hogg word camp preparing a plugin for translationwcto2017
You have a plugin, but you want users to be able to use it in their native language. Learn how to get it ready for translation, things to watch out for, and tips for maintaining it as you change the plugin over time.
Custom, in depth 5 day PHP course I put together in 2014. I'm available to deliver this training in person at your offices - contact me at rich@quicloud.com for rate quotes.
Preparing a WordPress Plugin for TranslationBrian Hogg
You have a plugin, but you want users to be able to use it in their native language. Learn how to get it ready for translation, things to watch out for, and tips for maintaining it as you change the plugin over time.
PHP is a server-side scripting language commonly used for web development. The document provides an introduction to PHP including a brief history, how PHP scripts are parsed, variables, arrays, operators, control structures, and including external files. It discusses PHP's architecture and how scripts are executed on the server before being sent to the browser.
PHP is a server-side scripting language commonly used for web development. It allows developers to add dynamic content to websites. Key points:
- PHP scripts are executed on the server and output HTML, JavaScript, or other code to browsers.
- PHP supports variables, arrays, functions, classes, and control structures like if/else statements.
- External data like from text files or databases can be easily incorporated into dynamic web pages using PHP.
- PHP files have a .php extension and PHP code is delimited by <?php ?> tags within HTML files or standalone PHP files.
PHP is a widely used open source scripting language that can be embedded into HTML. PHP code is executed on the server and outputs HTML that is sent to the browser. PHP is free to download and use and can be used to create dynamic web page content, connect to databases, send and receive cookies, and more. Some key things needed to use PHP include a web server with PHP support, PHP files with a .php extension, and PHP code delimited by <?php ?> tags.
PHP is a server-side scripting language used for web development. It allows developers to add dynamic content and functionality to websites. Some key points about PHP from the document:
- PHP code is embedded into HTML and executed on the server to create dynamic web page content. It can be used to connect to databases, process forms, and more.
- PHP has many data types including strings, integers, floats, booleans, arrays, objects, null values and resources. Variables, operators, and conditional statements allow for control flow and data manipulation.
- Common PHP structures include if/else statements for conditional logic, loops like for/while/foreach for iteration, and functions for reusability. Ar
Javascript fundamentals for php developersChris Ramakers
Javascript fundamentals from a PHP developers' point of view. Compares some of the principles of javascript with their php counterpart. Introduces a way to build simple robust modules in Javascript.
You can view the source of the slides (html+js) here: https://bitbucket.org/chrisramakers/talk-javascript-for-php-developers
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
1. eieieiei
AAAA.... eieieiei
1. i s
2.
3. Syntax
4. (Variables)
5. s (String)
6. a (Operators)
7. n s n
8. (Loop)
9. While
10. For
11. a (Array)
12. (Function)
13. PHP
14. $_GET
15. $_POST
BBBB....a n eia n eia n eia n ei
• 1111....a n ei ua n ei ua n ei ua n ei u |||| ( Advanced PHP Tut or i al i n Bangl a)( Advanced PHP Tut or i al i n Bangl a)( Advanced PHP Tut or i al i n Bangl a)( Advanced PHP Tut or i al i n Bangl a)
• 2222.... ei uei uei uei u ( PHP Dat e Funct i on Tut or i al i n Bangl a)( PHP Dat e Funct i on Tut or i al i n Bangl a)( PHP Dat e Funct i on Tut or i al i n Bangl a)( PHP Dat e Funct i on Tut or i al i n Bangl a)
• 3333.... ei i k uei i k uei i k uei i k u ( PHP I ncl ude Funct i on Tut or i al i n Bangl a)( PHP I ncl ude Funct i on Tut or i al i n Bangl a)( PHP I ncl ude Funct i on Tut or i al i n Bangl a)( PHP I ncl ude Funct i on Tut or i al i n Bangl a)
• 4444.... eieieiei ( PHP r eq( PHP r eq( PHP r eq( PHP r equi r e Funct i on Tut or i al i n Bangl a)ui r e Funct i on Tut or i al i n Bangl a)ui r e Funct i on Tut or i al i n Bangl a)ui r e Funct i on Tut or i al i n Bangl a)
• 5555.... ei i uei i uei i uei i u ( PHP Fi l e Funct i on Tut or i al i n Bangl a)( PHP Fi l e Funct i on Tut or i al i n Bangl a)( PHP Fi l e Funct i on Tut or i al i n Bangl a)( PHP Fi l e Funct i on Tut or i al i n Bangl a)
• 6666.... ei i uei i uei i uei i u ( PHP Fi l e Upl oad Tut or i al i n Bangl a)( PHP Fi l e Upl oad Tut or i al i n Bangl a)( PHP Fi l e Upl oad Tut or i al i n Bangl a)( PHP Fi l e Upl oad Tut or i al i n Bangl a) 7777.... ei kei kei kei k
uuuu ( PHP Cooki e Tut or i al i n Bangl a)( PHP Cooki e Tut or i al i n Bangl a)( PHP Cooki e Tut or i al i n Bangl a)( PHP Cooki e Tut or i al i n Bangl a)
• 8888.... ei uei uei uei u ( PHP Sessi on Tut or i al i n Bangl a)( PHP Sessi on Tut or i al i n Bangl a)( PHP Sessi on Tut or i al i n Bangl a)( PHP Sessi on Tut or i al i n Bangl a)
• 9999.... ei e h uei e h uei e h uei e h u ( PHP Er r or Handl er Tut or i al i n Bangl a)( PHP Er r or Handl er Tut or i al i n Bangl a)( PHP Er r or Handl er Tut or i al i n Bangl a)( PHP Er r or Handl er Tut or i al i n Bangl a)
• 10.10.10.10. eieieiei iiii ( PHP Mai l Funct i on Tut or i al i n Bangl a)( PHP Mai l Funct i on Tut or i al i n Bangl a)( PHP Mai l Funct i on Tut or i al i n Bangl a)( PHP Mai l Funct i on Tut or i al i n Bangl a)
• 11111111.... ei l uei l uei l uei l u ( PHP Fi l t er Tut or i al i n Bangl a)( PHP Fi l t er Tut or i al i n Bangl a)( PHP Fi l t er Tut or i al i n Bangl a)( PHP Fi l t er Tut or i al i n Bangl a)
CCCC.... ei oei oei oei o
• 1111.... ei o uei o uei o uei o u |||| ( PHP Fr amewor k Tut or i al i n Bangl a)( PHP Fr amewor k Tut or i al i n Bangl a)( PHP Fr amewor k Tut or i al i n Bangl a)( PHP Fr amewor k Tut or i al i n Bangl a)
• 2222....a яk a p g e eia яk a p g e eia яk a p g e eia яk a p g e ei ( OOP & PHP Tut or i al i n Bangl a)( OOP & PHP Tut or i al i n Bangl a)( OOP & PHP Tut or i al i n Bangl a)( OOP & PHP Tut or i al i n Bangl a)
• a яka яka яka яk aaaa eieieiei ( OOPHP Tut or i al i n Bangl a)( OOPHP Tut or i al i n Bangl a)( OOPHP Tut or i al i n Bangl a)( OOPHP Tut or i al i n Bangl a)
• :::: ---- |||||||| ::::6666---- 10101010 |||||||| : 11: 11: 11: 11---- 15 | |15 | |15 | |15 | | : 16: 16: 16: 16---- 23232323
2. • 4444.... i i u e i si i u e i si i u e i si i u e i s ( CodeI gni t er Downl oad & I nst al l Tut or i al i n( CodeI gni t er Downl oad & I nst al l Tut or i al i n( CodeI gni t er Downl oad & I nst al l Tut or i al i n( CodeI gni t er Downl oad & I nst al l Tut or i al i n
Bangl a)Bangl a)Bangl a)Bangl a)
• 5. u T sT uu T sT uu T sT uu T sT u ( MVC St r uct ur e Tut or i al i n Bangl a)( MVC St r uct ur e Tut or i al i n Bangl a)( MVC St r uct ur e Tut or i al i n Bangl a)( MVC St r uct ur e Tut or i al i n Bangl a)
• 6666.... i ii ii ii i ( CodeI gni t er Conf i gur e Tut or i al i n Bangl a)( CodeI gni t er Conf i gur e Tut or i al i n Bangl a)( CodeI gni t er Conf i gur e Tut or i al i n Bangl a)( CodeI gni t er Conf i gur e Tut or i al i n Bangl a)
• 7777.... i ii ii ii i e p e pe p e pe p e pe p e p ( Cr eat i ng Fi r st Appl i cat i on wi t h CodeI gni t er )( Cr eat i ng Fi r st Appl i cat i on wi t h CodeI gni t er )( Cr eat i ng Fi r st Appl i cat i on wi t h CodeI gni t er )( Cr eat i ng Fi r st Appl i cat i on wi t h CodeI gni t er )
AAAA.... eieieiei
1.1.1.1.
ei uei uei uei u |||| ( PHP Basi c)( PHP Basi c)( PHP Basi c)( PHP Basi c)
: яoяoяoяo
ei e i sk p m e я :
sk p c p g b e c instruction e run s k я
।“ iiii ” c ei skp iuя mu nt handle
u ei o я я o ei Process :
(Picture,Content etc) (math calculation,file operation etc) e
HTML e n iuя o b uя ।
eieieiei (PHP) ?:
PHP Hypertext Preprocessor e i ,k p ,HTML-embedded sk p я ei e
syntax C,Perl,Java ei я u d o я d i ।
eieieiei (PHP) яяяя :
1.HTML . HTML Form.
2. C я ।
3.я skp
o p яo p яo p яo p я ?:?:?:?:
o ei hosting(я ) e я e s
3. ।
я я mu i o i s e я m k o i s
mu -
* oooo
1.e PHP -compitable o : apache
2.PHP
*k ink ink ink in oooo
1.o b uя я k(e i s i )
2.e k e : ei e я Specialized e o s ।
webcoachbd.com eeee uuuu eieieiei ।।।।
2.
ei i sei i sei i sei i s ( PHP I nst al l at i on Tut or i al i n Bangl a)( PHP I nst al l at i on Tut or i al i n Bangl a)( PHP I nst al l at i on Tut or i al i n Bangl a)( PHP I nst al l at i on Tut or i al i n Bangl a)
: яoяoяoяo
p u e k in o i e i s
o apache e a i ei e o o i s :MySQL, я
e o o e k o я e я
c e e e o i s e i i s i s
o c XAMPP.XAMPP e u i s
http://www.apachefriends.org/download.php?xampp-win32-1.7.3.exe a o e i s
।
in s XAMPP e e i k o a a - i
i s i e XAMPP Control Panel i a C i i s
C:Program Filesxampp C:xampp ei e start click (Apache
e MySql)।
4. Apache o MySql b uя e http://localhost e я
English k ।
ei я i s mn a mu e я
( )
3.
5. eieieiei ( PHP Code Wr i t t i ng)( PHP Code Wr i t t i ng)( PHP Code Wr i t t i ng)( PHP Code Wr i t t i ng)
: яoяoяoяo
C driveC driveC driveC drive eeee XAMPPXAMPPXAMPPXAMPP i s ei li s ei li s ei li s ei l htdocshtdocshtdocshtdocs llll
web contentweb contentweb contentweb content g ।g ।g ।g ।
www k n i k c “C:xampphtdocs”( a i i s :D drive
e “D:xampphtdocs”). e ei i k “mytest.php” i e
a e -b uя e http://localhost/mytest.php
c e , e ? ? ei я
s iя o : Net Beans, Dreamweaver i e a e
i , e IDE (Integrated Development
Environment). c n ।
4.
eieieiei uuuu ( PHP Synt ax Tut or i al i n Bangl a)( PHP Synt ax Tut or i al i n Bangl a)( PHP Synt ax Tut or i al i n Bangl a)( PHP Synt ax Tut or i al i n Bangl a)
: яoяoяoяo
ei я a i i extension .php .html ei execute
।
* ei e p a <?php h e ?> h ।
* e ei Scripting Block(<?php e ?> e e b ) k n
।
*p instruction(code line) k d ।
o e e ( / ) e
<?php
echo"This is my first php page";
?>
e я mypage.php , htdocs browse save in e я e
b uя e http://localhost/mypage.php e en u ।
6. ei e u я s n echo o print.
ei nnnn: h ei e e execute
e , a m e n e
i n i // # i n i /* e */ h
।
: a p , k ki <?php e ?>
echo "Hello World! ";
echo "Hello World! ";
echo "Hello World! ";
echo "Hello World! ";
echo "Hello World! ";
e k ।
<?php
echo "Hello World!";
echo "Hello World!";
?>
ei s я ,e p я ।
5.
ei uei uei uei u ( PHP Var i abl es Tut or i al i n Bangl a)( PHP Var i abl es Tut or i al i n Bangl a)( PHP Var i abl es Tut or i al i n Bangl a)( PHP Var i abl es Tut or i al i n Bangl a)
: яoяoяoяo
c e t (Container) a e kk String “Hello
Bangladesh” a e integer value 100. e e e ( e e
declare ) я , (value)
7. ei “$” ei h a i я ।
* case sensitive. $a_number and $A_number , ei e ।
* m k ei
$variable_name = Value;
u i -
1.<?php
2.$hello = "Hello World!";
3.$a_number = 4;
4.$anotherNumber = 8;
5.?>
* ei e “Loosely Typed” я i declare e i ( ) u l o
ei я i n ।
d :
1.a i letter or “_”(under score) ।
2. alpha-numeric characters o underscores. a-z, A-Z, 0-9, or _ . ।
3. s e a “___”underscore ($my_string) a
ak ($myString) ।
6.
ei sT uei sT uei sT uei sT u ( PHP St r i ng Tut or i al i n Bangl a)( PHP St r i ng Tut or i al i n Bangl a)( PHP St r i ng Tut or i al i n Bangl a)( PHP St r i ng Tut or i al i n Bangl a)
: яoяoяoяo
ei s e k o । ei Career e ei s e t i e
।
s e e s e a e store
e i s ,e store echo ।
1.<?php
2.$my_string = "o merciful make me bold and brave!";
3.echo " o merciful make me bold and brave!";
4.echo $my_string;
5.?>
u u p s $my_string d s echo ,
store i e я i s e p i
e store ।
c e u k b uя u ।
8. e k Double quotes d s e Single quotes d s e i ,
o apostrophes ।
1.<?php
2.$my_string = ‘o merciful make me bold and brave!’;
3.echo ‘o merciful make me bold and brave!’;
4.echo $my_string;
5.?>
s e single quotes e -
echo ‘PHP it’s neat’
e double quotes e single quotes e i।
ei d e p g я e k t , n ei e
o i s quotation i heredoc,e
s e -
1.<?php
2.$my_string = <<<TEST
3.He will be succeeded here
4.and here after!
5.TEST;
6.echo $my_string;
7.?>
e s я a i -
*<<< identifier heredoc TEST ।
* o e e k ।
*e яi e i ,(indent) i ।
u <br>( i b я ) s e ।
9. 7.
ei a uei a uei a uei a u ( PHP Oper at or s)( PHP Oper at or s)( PHP Oper at or s)( PHP Oper at or s)
: яoяoяoяo
a - manipulate 3 a
1.Unary – e (operand) я ।
2.Binary- ।
3.Ternary- 3 ।
e Operator a d -Arithmetic, Assignment, Comparison
Operator etc.
a i aa i aa i aa i a ( ASSI GNMENT OPERAT( ASSI GNMENT OPERAT( ASSI GNMENT OPERAT( ASSI GNMENT OPERATOR)OR)OR)OR)
e aaaa e a e ।
$my_var = 4;
$another_var = $my_var;
e $my_var o $another_var u i 4.
Operator English Example
+ Addition 2+4
- Subtraction 6-2
* Multiplication 5*3
/ Division 15/3
% Modulus 43%10
10. 01.<?php
02.$addition = 2 + 4;
03.$subtraction = 6 - 2;
04.$multiplication = 5 * 3;
05.$division = 15 / 3;
06.$modulus = 5 % 2;
07.echo "Perform addition: 2 + 4 = ".$addition."<br />";
08.echo "Perform subtraction: 6 - 2 = ".$subtraction."<br />";
09.echo "Perform multiplication: 5 * 3 = ".$multiplication."<br />";
10.echo "Perform division: 15 / 3 = ".$division."<br />";
11.echo "Perform modulus: 5 % 2 = " . $modulus ?>
e -
aaaa ( COMPARI SON OPERATOR( COMPARI SON OPERATOR( COMPARI SON OPERATOR( COMPARI SON OPERATOR))))
ei Operator e relationship ei Operator n statement e
statement true false.
e Comparison Operator -
$x=4 o $y=5
Operator English Example Result
== Equal to $x=$y False
!= Not equal to $x!=$y True
< Less than $x<$y True
11. > Greater than $x>$y False
<= Less than equal to $x<=$y True
>= Greater than equal to $x>=$y False
sT asT asT asT a ( STRI NG OPERATOR)( STRI NG OPERATOR)( STRI NG OPERATOR)( STRI NG OPERATOR)
e i o -“”, ‘’
ARI THMETI CARI THMETI CARI THMETI CARI THMETI C eeee ASSI GNMENT OPERATORASSI GNMENT OPERATORASSI GNMENT OPERATORASSI GNMENT OPERATOR e COMBI NATI ONe COMBI NATI ONe COMBI NATI ONe COMBI NATI ON
Programming e e я c e , k t 1 i
$counter=$counter+1;
k e
$counter+=1;
Pre/Post-Increment eeee Pre/Post-Decrement:
u e ad ,e 1
$x++ $x += 1; a $x = $x + 1 e ।
k t “-” a ।
8.
ei sei sei sei s ( PHP Condi t i onal St at ement )( PHP Condi t i onal St at ement )( PHP Condi t i onal St at ement )( PHP Condi t i onal St at ement )
: яoяoяoяo
u action я n s n o i e e feature
i u i 12 “Good Morning” u 5
“Good evening” ei e o я o a n я Conditional
statement e ,condition e u t ei s k я i ।
ei Conditional statement -
*if statement
*if…else statement
*if…elseif…else statement
*Switch statement
* I F STATEMENT* I F STATEMENT* I F STATEMENT* I F STATEMENT
12. if statement execute condition true u u
Have a nice day Saturday ।
1.<?php
2.$d=date("D");
3.if ($d=="Sat")
4.echo "Have a nice Day";
5.?>
* I F* I F* I F* I F…ELSE STATEMENTELSE STATEMENTELSE STATEMENTELSE STATEMENT
c o e , , i e i if…else statement
e u e a s i e e ei ।
1.<?php
2.$d=date("D");
3.if ($d=="Sat") echo "Have a nice Day";
4.else
5.echo “Today is not saturday”;
6.?>
condition true a Saturday u
Have a nice day Today is not Saturday.
* I F* I F* I F* I F…ELSEI FELSEI FELSEI FELSEI F…ELSE STATEMENTELSE STATEMENTELSE STATEMENTELSE STATEMENT
ei statement d e e b execute ।
view source
print?
01.<html>
02.<body>
03.<?php
04.if ($number>=60)
05.echo "First Division";
06.elseif ($number>=45 and $number<60)
07.echo “Second Division”;
08.elseif($number>=33 and $number<45)
09.echo "Third Division";
10.else
11.echo “Failed”;
12.?>
13.</body>
14.</html>
9.
13. ei uei uei uei u ( PHP Loop Tut or i al i n Bangl a)( PHP Loop Tut or i al i n Bangl a)( PHP Loop Tut or i al i n Bangl a)( PHP Loop Tut or i al i n Bangl a)
: яoяoяoяo
e я i e i 50 i e e i 100
я i p g e я c e n i ei t я i i
e ।
c e e statement e b execute k я
।
4 -
While Loop
Do…while Loop
For Loop
Foreach Loop
10.
eieieiei WhileWhileWhileWhile
: яoяoяoяo
e condition true while e b execute ।
1.while (condition)
2.{
3.code to be executed;
4.}
condition false b e b condition
,true execute condition e e i :
01.<html>
02.<body>
03.<?php
04.$i=1;
05.while($i<=5)
06.{
07.echo "The number is " . $i . "<br />";
08.$i++;
09.}
10.?>
11.</body>
12.</html>
p i=1. e while($i<=5) a k k I e 5 p 1
14. u e -
The number is 1
The number is 2
The number is 3
The number is 4
The number is 5
e I e 6 u ? i e while loop e i execute
।
DODODODO…WHI LE LOOPWHI LE LOOPWHI LE LOOPWHI LE LOOP
e while loop e i e k condition test , , while
e a k e execute i।
1.Do
2.{
3.Code to be executed
4.}
5.While(condition);
u o u e i u я n ।
01.<?php
02.$i=1;
03.do
04.{
05.$i++;
06.echo "The number is " . $i . "<br />";
07.}
08.while ($i<=5);
09.?>
n e i=6 i ?
This is line 6
This line is outside while loop.so it will not repeat.
p i e execute p execution e repeat
? n while loop e p i ei ।
11.
ei uei uei uei u ( PHP For Loop)( PHP For Loop)( PHP For Loop)( PHP For Loop)
: яoяoяoяo
15. ei e я e я while o , e ।
1.for (init; condition; increment)
2.{
3.code to be executed;
4.}
for loop statement b 3 expression k d k 1 assignment
statement(loop control variable),p t i e e execution 2 Boolean
expression p t i e e (evaluate) ,ei true t false
return t n 3 loop control variable e
u i=1 e e k I e 5 e I e 1 ।
1.<?php
2.for ($i=1; $i<=5; $i++)
3.{
4.echo "The number is " . $i . "<br />";
5.}
6.?>
Output
The number is 1
The number is 2
The number is 3
The number is 4
The number is 5
expression e e expression , d k Boolean
expression e default true ei u u 1-10 ।
foreach loop e array e i
12.
ei a uei a uei a uei a u ( PHP Ar r ay Tut or i al i n Bangl a)( PHP Ar r ay Tut or i al i n Bangl a)( PHP Ar r ay Tut or i al i n Bangl a)( PHP Ar r ay Tut or i al i n Bangl a)
: яoяoяoяo
e e single value e t(container). n a e value’ container t e a
u p u value -key index u ।
s e e single variable e store e
-
$city1= “Dhaka”
$city2= “Chittagong”
16. $city3= “Rajshahi”
$city4= “Sylet”
$city5= “Khulna”
$city6= “Barishal”
n e a e e e a d c u k (series of
element) u index 0 k a я c-
1.<?php
2.$city=array(“Dhaka”, “Chittagong”, “Rajshahi”, Sylet”, “Khulna”,
“Barishal”, “Barishal”);
3.?>
e variable e store ,p e e u e p u e index
array’ 1 u e index/key c 0 e Dhaka[0],Chittagong[1]… e
e u e index number u l u
1.<?php
2.Print “$city[3]”;
3.?>
i a ei l ,=> ei a c ei u
a starting index 2 e ।
1.<?php
2.$city=array(2=>“Dhaka”, “Chittagong”, “Rajshahi”, “Sylet”, “Khulna”,
“Barishal”, “Barishal”);
3.?>
ei a u index я ।
a aa aa aa a ( ASSOCI ATI VE ARRAY)( ASSOCI ATI VE ARRAY)( ASSOCI ATI VE ARRAY)( ASSOCI ATI VE ARRAY)
e k index/key i string o e i associative array :
1.<?php
2.$ages = array("adnan"=>32, "rezwan"=>30,"refat"=>34);
3.?>
l il il il i aaaa ( MULTI DI MENSI ONAL AR( MULTI DI MENSI ONAL AR( MULTI DI MENSI ONAL AR( MULTI DI MENSI ONAL ARRAY)RAY)RAY)RAY)
e e a p u e a ei a p u o e a e
e o।
1.<?php
2.
3.$continents=array("Asia"=>array("Bangladesh","India","Pakistan"),
4."Europe"=>array("England","France")"Africa"=>array("Kenya",
5."Libya","Somalia"));
6.
7.?>
aaaa
17. FOREACH LOOPFOREACH LOOPFOREACH LOOPFOREACH LOOP
e associative array e t foreach statement e :
1.<?php
2.$city=array(“Dhaka”, “Chittagong”, “Rajshahi”, “Sylet”, “Khulna”,
“Barishal”, “Barishal”);
3.foreach ($city as $value)
4.{
5.echo “$value.<br>”;
6.}
7.?>
Output
Dhaka
Chittagong
Rajshahi
Sylet
Khulna
Barishal
Barishal
13.
ei uei uei uei u ( PHP Funct i on)( PHP Funct i on)( PHP Funct i on)( PHP Funct i on)
: яoяoяoяo
e c e b e i b i c execution
e ei e k p 700 e o l i ei ।
e i e execute я я e ।
1.function functionName()
2.{
3.code to be executed;
4.}
: e i ।
ak _ , m ।
e simple
01.<?php
18. 02.function writeName()
03.{
04.echo "Md.Rejoanul Alam";
05.}
06.
07.echo "My name is ";
08.writeName();
09.?>
Output
My name is Md.Rejoanul Alam
o ,e e PHP variable e i e
b
01.<?php
02.function writeName($fname)
03.{
04.echo $fname . " Alam.<br />";
05.}
06.
07.echo "My name is ";
08.writeName("Rejoanul ");
09.echo "My Father's name is ";
10.writeName("Samad");
11.echo "My brother's name is ";
12.writeName("Anjirul");
13.?>
Output
My name is Rejoanul Alam.
My Father's name is Samad Alam.
My brother's name is Anjirul Alam.
u
01.<?php
02.function myGreeting($firstName, $lastName){
03.echo "Hello there ". $firstName ." ". $lastName."!<br />";
04.}
05.myGreeting("Jack", "Black");
06.myGreeting("Ahmed", "Zewail");
07.myGreeting("Julie", "Roberts");
08.myGreeting("Charles", "Schwab");
09.?>
output
Hello there Jack Black!
Hello there Ahmed Zewail!
Hello there Julie Roberts!
Hello there Charles Schwab!
19. e return return statement
view source
print?
01.<?php
02.function add($x,$y)
03.{
04.$total=$x+$y;
05.return $total;
06.}
07.
08.echo "1 + 16 = " . add(1,16);
09.?>
14.
ei uei uei uei u ( PHP For m)( PHP For m)( PHP For m)( PHP For m)
: яoяoяoяo
e k ei ’ e p e iuя ei ei я
e ei i e ei (iuя i ) -
$_GET e $_POST.e ei e e i l e ।
1.<form action="welcome.php" method="post">
2.Name: <input name="fname" />
3.Age: <input name="age" />
4.<input type="submit" />
5.</form>
iuя k ei i “welcome.php” e
я k method=POST ,Form e ei d
20. POST e GET.
welcome.php i e
1.Welcome <?php echo $_POST["fname"]; ?>!<br />
2.You are <?php echo $_POST["age"]; ?> years old.
e я rezwan e age 24,e k u e
Welcome rezwan!
You are 24 years old.
15.
eieieiei $_$_$_$_GETGETGETGET ( PHP $_GET Met hod)( PHP $_GET Met hod)( PHP $_GET Met hod)( PHP $_GET Met hod)
: яoяoяoяo
GET e b uя e p e i k
e c 250 character (e e b uя u URL e
)
1.<form action="welcome.php"method="get">
2.Name: <input name="fname" />
3.Age: <input name="age" />
4.<input />
5.</form>
iuя k b uя e
http://www.w3schools.com/welcome.php?fname=Peter&age=37
welcome.php i e $_GET Method g ।
1.Welcome <?php echo $_GET["fname"]; ?>.<br />
2.You are <?php echo $_GET["age"]; ?> years old!
16.
ei s uei s uei s uei s u ( PHP $_POST Met hod)( PHP $_POST Met hod)( PHP $_POST Met hod)( PHP $_POST Met hod)
: яoяoяoяo
ei d i u b uя e o p ।
e ic ( c 8Mb n )
<form action="welcome.php" method="post">
Name: <input name="fname" />
Age: <input name="age" />
<input />
21. </form>
e iuя k b uя e
http://www.w3schools.com/welcome.php
e $_POST Method d ।
Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old.
al GET Method e iuя password i k t POST Method ।
BBBB....a n eia n eia n eia n ei
1.1.1.1.
a n ei ua n ei ua n ei ua n ei u |||| ( Advanced PHP( Advanced PHP( Advanced PHP( Advanced PHP Tut or i al i n Bangl a)Tut or i al i n Bangl a)Tut or i al i n Bangl a)Tut or i al i n Bangl a)
: яoяoяoяo
webcoachbd.com e ei ei a n u - ei ,k , i , ,e
n i ।
2.
ei uei uei uei u ( PHP Dat e Funct i on Tut or i al i n Bangl a)( PHP Dat e Funct i on Tut or i al i n Bangl a)( PHP Dat e Funct i on Tut or i al i n Bangl a)( PHP Dat e Funct i on Tut or i al i n Bangl a)
: яoяoяoяo
eieieiei ( PHP DATE FUNCTI ON)( PHP DATE FUNCTI ON)( PHP DATE FUNCTI ON)( PHP DATE FUNCTI ON)
o я / i ei e date() d e
view source
print?
1.<?php
2.echo date("Y/m/d") . "<br />";
3.echo date("Y.m.d") . "<br />";
4.echo date("Y-m-d")
5.?>
Output
2009/05/11
2009.05.11
2009-05-11
22. e n ।
3.
eieieiei i k ui k ui k ui k u ( PHP I ncl ude Funct i on Tut or i al i n( PHP I ncl ude Funct i on Tut or i al i n( PHP I ncl ude Funct i on Tut or i al i n( PHP I ncl ude Funct i on Tut or i al i n
Bangl a)Bangl a)Bangl a)Bangl a)
: яoяoяoяo
i c i e k u i ei e e i a a ei i
include() ।
Require()- fatal error( ) e skp e k u n ।
Include()- e skp e k u
e a я e , , a o i
яi e e ei i ( , , i ) a я e
p я e ei include i
e я я i k я
u , “menu.php” e i aa
1.<a href="/default.php">Home</a>
2.<a href="/tutorials.php">Tutorials</a>
3.<a href="/references.php">References</a>
4.<a href="/examples.php">Examples</a>
5.<a href="/about.php">About Us</a>
6.<a href="/contact.php">Contact Us</a>
e e
view source
print?
01.<html>
02.<body>
03.<div>
04.<?php include("menu.php"); ?>
05.</div>
06.<h1>Welcome to my home page.</h1>
07.<p>Some text.</p>
08.</body>
09.</html>
4.
eieieiei ( PHP r equi r e Funct i on Tut or i al i n Bangl a)( PHP r equi r e Funct i on Tut or i al i n Bangl a)( PHP r equi r e Funct i on Tut or i al i n Bangl a)( PHP r equi r e Funct i on Tut or i al i n Bangl a)
: яoяoяoяo
require() include() e i t e u t e n ।
23. Include() e e я ।
01.<html>
02.<body>
03.
04.<?php
05.include("wrongFile.php");
06.echo "Hello World!";
07.?>
08.</body>
09.</html>
Error message:
Warning: include(wrongFile.php) [function.include
failed to open stream
No such file or directory in C:homewebsitetest.php on line
Warning: include() [function.include
Failed opening 'wrongFile.php' for inclusio
(include_path='.;C:php5pear')
in C:homewebsitetest.php on line
Hello World!
Notice that the echo statement is executed! This is because a Warning does not stop the script
execution.
require() Function eeee eeee яяяя
Now, let's run the same example with the require() function.
1.<html>
2.<body>
3.<?php
4.require("wrongFile.php");
5.echo "Hello World!";
6.?>
7.</body>
8.</html>
Error message:
Warning: require(wrongFile.php) [function.require
failed to open stream
No such file or directory in C:homewebsitetest.php on line
Fatal error: require() [function.require
Failed opening required 'wrongFile.php
(include_path='.;C:php5pear')
in C:homewebsitetest.php on line 5
echo statement e e k u i
24. 5.
ei iei iei iei i uuuu ( PHP Fi l e Funct i on Tut or i al i n( PHP Fi l e Funct i on Tut or i al i n( PHP Fi l e Funct i on Tut or i al i n( PHP Fi l e Funct i on Tut or i al i n
Bangl a)Bangl a)Bangl a)Bangl a)
: яoяoяoяo
fopen e ei i
1.<html>
2.<body>
3.<?php
4.$file=fopen("welcome.txt","r");
5.?>
6.</body>
7.</html>
fopen e b я e “welcome.txt”a ei i e d “r” e e
i a s ( ) e “r” i e read only ।
e
Modes Description
r Read only. Starts at the beginning of the file
r+ Read/Write. Starts at the beginning of the file
w
Write only. Opens and clears the contents of file; or creates a new file if it doesn
exist
w+
Read/Write. Opens and clears the contents of file; or creates a new file if
exist
a Append. Opens and writes to the end of the file or creates a new file if it doesn't exis
a+ Read/Append. Preserves file content by writing to the end of the file
x Write only. Creates a new file. Returns FALSE and an error if file already exists
x+ Read/Write. Creates a new file. Returns FALSE and an error if file already exists
i fopen() function e я
1.<html>
2.<body>
3.<?php
4.$file=fopen("welcome.txt","r") or exit("Unable to open file!");
5.?>
6.</body>
7.</html>
e i k яe i k яe i k яe i k я
25. fclose() function i n ।
1.<?php
2.$file = fopen("test.txt","r");
3.
4.//some code to be executed
5.
6.fclose($file);
7.?>
ENDENDENDEND---- OFOFOFOF---- FILEFILEFILEFILE
e i ।
if (feof($file)) echo "End of file";
e e я ।
e ie ie ie i LINE BY LINELINE BY LINELINE BY LINELINE BY LINE
fgets() function ei e e i ei i
i u e e e i n।
01.<?php
02.$file = fopen("welcome.txt", "r") or exit("Unable to open file!");
03.//Output a line of the file until the end is reached
04.while(!feof($file))
05.{
06.echo fgets($file). "<br />";
07.}
08.fclose($file);
09.?>
CHARACTER BY CHARACTCHARACTER BY CHARACTCHARACTER BY CHARACTCHARACTER BY CHARACTERERERER e ie ie ie i
fgetc() function e i e e ak ।
u i e e ak ।
view source
print?
1.<?php
2.$file=fopen("welcome.txt","r") or exit("Unable to open file!");
3.while (!feof($file))
4.{
5.echo fgetc($file);
6.}
7.fclose($file);
8.?>
26. 6.
ei i uei i uei i uei i u ( PHP Fi l e Upl oad Tut or i al i n( PHP Fi l e Upl oad Tut or i al i n( PHP Fi l e Upl oad Tut or i al i n( PHP Fi l e Upl oad Tut or i al i n
Bangl a)Bangl a)Bangl a)Bangl a)
: яoяoяoяo
ei iuя i
01.<html>
02.<body>
03.
04.<form action="upload_file.php" method="post"
05.enctype="multipart/form-data">
06.<label for="file">Filename:</label>
07.<input />
08.<br />
09.<input type="submit" name="Submit"value="Submit" />
10.</form>
11.</body>
12.</html>
e action="upload_file.php" e method="post" a k
s e upload_file.php i e upload_file.php e ।
Upload_file.php skp e
01.<?php
02.if ($_FILES["file"]["error"] > 0)
03.{
04.echo "Error: " . $_FILES["file"]["error"] . "<br />";
05.}
06.else
07.{
08.echo "Upload: " . $_FILES["file"]["name"] . "<br />";
09.echo "Type: " . $_FILES["file"]["type"] . "<br />";
10.echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
11.echo "Stored in: " . $_FILES["file"]["tmp_name"];
12.}
13.?>
global PHP $_FILES a k in mu i ।
• $_FILES["file"]["name"] – i
• $_FILES["file"]["type"] - i type
• $_FILES["file"]["size"] - i size
• $_FILES["file"]["tmp_name"] i temporary copy k ।
i c i e t я u i
20 i a i .jpeg,.jpg,.gif
i i ।
28. 24.move_uploaded_file($_FILES["file"]["tmp_name"],
25."upload/" . $_FILES["file"]["name"]);
26.echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
27.}
28.}
29.}
30.else
31.{
32.echo "Invalid file";
33.}
34.?>
skp i ei i , move_uploaded_file
l i ।
u u “upload” e l i ।
7.
ei k uei k uei k uei k u ( PHP Cooki e Tut or i al i n Bangl a)( PHP Cooki e Tut or i al i n Bangl a)( PHP Cooki e Tut or i al i n Bangl a)( PHP Cooki e Tut or i al i n Bangl a)
: яoяoяoяo
e я iuя k e e c e i iuя (e /я
)।ধরুন i i e a k i я i i i
iuя i c ,i я i iuя e я c,e i i k
i ei (iuя o i ) k ।
kkkk
setcookie() function e k ।
setcookie() function a i <html> e ।
setcookie(name, value, expiration);
namename:e k , ei k ।
value:e k k , k c username(string)e last visit(date)
expiration:e oi k ei (k k )
b uя s i k ।
u e k iuя o i visit i k
e e я iuя i i k
e 30 a e oi s iuя ignore 30 e
i ।
1.<?php
2.$expire=time()+60*60*24*30;
29. 3.setcookie("user", "rezwan",$expire);
4.?>
5.<html>
6......
k udk udk udk ud ((((RETRIEVERETRIEVERETRIEVERETRIEVE))))
k ei $_COOKIE variable k retrieve ।
1.<?php
2.if(isset($_COOKIE['lastVisit']))
3.$visit = $_COOKIE['lastVisit'];
4.else
5.echo "You've got some stale cookies!";
6.
7.echo "Your last visit was - ". $visit;
8.?>
ei isset e "lastVisit" k e o iuя ,
iuя visit ।
kkkk
k e k ।
view source
print?
1.<?php
2.// set the expiration date to one hour ago
3.setcookie("user", "", time()-3600);
4.?>
8.
ei uei uei uei u ( PHP Sessi on Tut or i al i n Bangl a)( PHP Sessi on Tut or i al i n Bangl a)( PHP Sessi on Tut or i al i n Bangl a)( PHP Sessi on Tut or i al i n Bangl a)
: яoяoяoяo
e p я , , n n e e mu
я , e n in e -o
e k ei ei ei iuя
k я ei as e iuя i s
ei p iuя я a unique id (UID) ।
ei iuя k ei session_start()
e <html> tag e ।
1.<?php session_start(); ?>
2.
3.<html>
4.<body>
30. 5.
6.</body>
7.</html>
ei iuя яs e ei e i ।
kkkk
k o ud u $_SESSION ।
01.<?php
02.session_start();
03.// store session data
04.$_SESSION['views']=1;
05.?>
06.<html>
07.<body>
08.
09.<?php
10.//retrieve session data
11.echo "Pageviews=".$_SESSION['views'];
12.?>
13.
14.</body>
15.</html>
u
Pageviews=1
u page view counter(page я ) я e я isset()
ei ‘views’ i ‘views’ variable
a counter ‘views’variable e e 1
।
01.<?php
02.session_start();
03.
04.if(isset($_SESSION['views']))
05.$_SESSION['views']=$_SESSION['views']+1;
06.else
07.$_SESSION['views']=1;
08.echo "Views=". $_SESSION['views'];
09.?>
eeee ( DESTROYI NG A SESSI O( DESTROYI NG A SESSI O( DESTROYI NG A SESSI O( DESTROYI NG A SESSI ON)N)N)N)
unset() or the session_destroy() function ]
unset() function e ।
1.<?php
2.unset($_SESSION['views']);
3.?>
31. e m session_destroy() function ।
1.<?php
2.session_destroy();
3.?>
session_destroy() reset e e ।
9.
ei e h uei e h uei e h uei e h u ( PHP Er r or Handl er Tut or i al i n( PHP Er r or Handl er Tut or i al i n( PHP Er r or Handl er Tut or i al i n( PHP Er r or Handl er Tut or i al i n
Bangl a)Bangl a)Bangl a)Bangl a)
: яoяoяoяo
ei skp o e p error handling e e t e
( ) p g e t я ।
ei u e e p d
"die()" statements
Custom errors and error triggers
Error reporting
""""DIEDIEDIEDIE()"()"()"()" ssss eeee hhhh
e e kk i ।
1.<?php
2.$file=fopen("welcome.txt","r");
3.?>
i a s i b uя p ।
Warning: fopen(welcome.txt) [function.fopen]: failed to open stream:
No such file or directory in C:webfoldertest.php on line 2
iuя u я k я я
01.<?php
02.if(!file_exists("welcome.txt"))
03.{
04.die("File not found");
05.}
06.else
07.{
08.$file=fopen("welcome.txt","r");
09.}
10.?>
e i ei я ।
File not found
32. ei u e n e e d e error skp n e d
a ।
s e hs e hs e hs e h
e e ei e call ei k (error level and
error message) e c (optionally: file, line-number, and the error context) ।
error_function(error_level,error_message,error_file,error_line,error_context)
Parameter Description
error_level iuя error report level a i e
value number m error report level ।
error_message iuя я error message ।
error_file c i u l ।
error_line c i u l ।
error_context c e a u l (Specifies an array) e ।
e ee ee ee e ( VALUE)( VALUE)( VALUE)( VALUE)
Value Constant Description
2 E_WARNING run-time errors. sk p Execution n
8 E_NOTICE Run-time notices.
256 E_USER_ERROR iuя t e E_ERROR e p g PHP
function trigger_error() ।
512 E_USER_WARNING Runtime warnings generated by a call totrigger_error( )
1024 E_USER_NOTICE Runtime warnings generated by a call totrigger_error( )
4096 E_RECOVERABLE_ERROR Catchable fatal error.
8191 E_ALL errors e warnings, level E_STRICT (E_STRICT
PHP 6.0
e E_ALL e a )
e ee ee ee e e h ee h ee h ee h e яnяnяnяn
1.function customError($errno, $errstr)
2.{
3.echo "<b>Error:</b> [$errno] $errstr<br />";
33. 4.echo "Ending Script";
5.die();
6.}
e e error handling e e e error level e я ei e я
u skp p ।
e he he he h
ei l e error handler li i c e я error handler
PHP u ei я error handler
set_error_handler("customError");
error handle я я i, i set_error_handler() e e
,2 error level e я ।
e e u
01.<?php
02.//error handler function
03.function customError($errno, $errstr)
04.{
05.echo "<b>Error:</b> [$errno] $errstr";
06.}
07.
08.//set error handler
09.set_error_handler("customError");
10.
11.//trigger error
12.echo($test);
13.?>
u u e
Error: [8] Undefined variable: test
TRIGGERTRIGGERTRIGGERTRIGGER
skp iuя i trigger u iuя /a i
trigger_error() function e ei u test 1 e error ।
1.<?php
2.$test=2;
3.if ($test>1)
4.{
5.trigger_error("Value must be 1 or below");
6.}
7.?>
u
Notice: Value must be 1 or below
in C:webfoldertest.php on line 6
e error sk p я trigger e error
34. level trigger ।
mmmm error eeee
• E_USER_ERROR
• E_USER_WARNING
• E_USER_NOTICE
u
test e 1 e e E_USER_WARNING error e e я
error handler ।
01.<?php
02.//error handler function
03.function customError($errno, $errstr)
04.{
05.echo "<b>Error:</b> [$errno] $errstr<br />";
06.echo "Ending Script";
07.die();
08.}
09.
10.//set error handler
11.set_error_handler("customError",E_USER_WARNING);
12.
13.//trigger error
14.$test=2;
15.if ($test>1)
16.{
17.trigger_error("Value must be 1 or below",E_USER_WARNING);
18.}
19.?>
u
Error: [512] Value must be 1 or below
Ending Script
eeee
PHP error_log() e li e ic error log( )
e я i o।
i i ei i ei i ei i e яяяя
<?php
//error handler function
function customError($errno, $errstr)
{
echo "<b>Error:</b> [$errno] $errstr<br />";
echo "Webmaster has been notified";
35. error_log("Error: [$errno] $errstr",1,
" someone@example.com","From: webmaster@example.com");
}
//set error handler
set_error_handler("customError",E_USER_WARNING);
//trigger error
$test=2;
if ($test>1)
{
trigger_error("Value must be 1 or below",E_USER_WARNING);
}
?>
u
Error: [512] Value must be 1 or below
Webmaster has been notified
ei e e i
Error: [512] Value must be 1 or below
10.
ei l uei l uei l uei l u ( PHP Fi l t er Tut or i al i n Bangl a)( PHP Fi l t er Tut or i al i n Bangl a)( PHP Fi l t er Tut or i al i n Bangl a)( PHP Fi l t er Tut or i al i n Bangl a)
: яoяoяoяo
a u iuя i ei l g (validate/acceptable) e
(filter) o e p e i t o e p i i u
o e p i i filter i
d я e t я n u -
• e i
• k
• o
•
•
e le le le l
filter -
• filter_var() – e l e filter ।
• filter_var_array() – e i n l e l ।
36. • filter_input – e i e l
• filter_input_array – e i e e i n l l ।
• u filter_var() function e validate
01.<?php
02.$int = 123;
03.
04.if(!filter_var($int, FILTER_VALIDATE_INT))
05.{
06.echo("Integer is not valid");
07.}
08.else
09.{
10.echo("Integer is valid");
11.}
12.?>
ei "FILTER_VALIDATE_INT" d $int l ,e u "Integer is valid"
123 e integer.
VALIDATINGVALIDATINGVALIDATINGVALIDATING eeee SANI TI ZI NGSANI TI ZI NGSANI TI ZI NGSANI TI ZI NG
l 2
VALI DATI NG FI LTERS:VALI DATI NG FI LTERS:VALI DATI NG FI LTERS:VALI DATI NG FI LTERS:
• user input validate
• ( URL E-Mail validating)
SANI TI ZI NG FI LTERS:SANI TI ZI NG FI LTERS:SANI TI ZI NG FI LTERS:SANI TI ZI NG FI LTERS:
• e s e ak a я ।
• s return ।
OPTIONSOPTIONSOPTIONSOPTIONS eeee FLAGSFLAGSFLAGSFLAGS
Option e Flag l a k filtering option n l n option e
flag u e validate filter_var() l e "min_range" o "max_range"
option ।
01.<?php
02.$var=300;
03.
04.$int_options = array(
05."options"=>array
06.(
07."min_range"=>0,
37. 08."max_range"=>256
09.)
10.);
11.
12.if(!filter_var($var, FILTER_VALIDATE_INT,$int_options))
13.{
14.echo("Integer is not valid");
15.}
16.else
17.{
18.echo("Integer is valid");
19.}
20.?>
u options a i associative array e “options’’ flag
e a o я e 300 n i e u
"Integer is not valid".
VALI DATE I NPUTVALI DATE I NPUTVALI DATE I NPUTVALI DATE I NPUT
p i я a st filter_input() function d
i l u
01.<?php
02.if(!filter_has_var(INPUT_GET, "email"))
03.{
04.echo("Input type does not exist");
05.}
06.else
07.{
08.if (!filter_input(INPUT_GET, "email", FILTER_VALIDATE_EMAIL))
09.{
10.echo "E-Mail is not valid";
11.}
12.else
13.{
14.echo "E-Mail is valid";
15.}
16.}
17.?>
:u u e i (i i ) "GET" method ।
1. i e "email" GET a st ।
2. i e a st e i i e ।
SANI TI ZE I NPUTSANI TI ZE I NPUTSANI TI ZE I NPUTSANI TI ZE I NPUT
p i я a st filter_input() function d
i sanitize u
01.<?php
02.if(!filter_has_var(INPUT_POST, "url"))
38. 03.{
04.echo("Input type does not exist");
05.}
06.else
07.{
08.$url = filter_input(INPUT_POST,
09."url", FILTER_SANITIZE_URL);
10.}
11.?>
:u u e i (url) "POST" method ।
1. i e "url" POST a st ।
2. i e a st sanitize(ap я ak ) e e $url variable e k
।
i e s "http://www.W3ååSchøøools.com/" $url variable sanitizing e
e ।
http://www.W3Schools.com/
e ie ie ie i llll
e e i l e e call e filter
filter_var_array the filter_input_array function
view source
print?
01.<?php
02.$filters = array
03.(
04."name" => array
05.(
06."filter"=>FILTER_SANITIZE_STRING
07.),
08."age" => array
09.(
10."filter"=>FILTER_VALIDATE_INT,
11."options"=>array
12.(
13."min_range"=>1,
14."max_range"=>120
15.)
16.),
17."email"=> FILTER_VALIDATE_EMAIL,
18.);
19.
20.$result = filter_input_array(INPUT_GET,$filters);
21.
22.if (!$result["age"])
23.{
24.echo("Age must be a number between 1 and 120.<br />");
39. 25.}
26.elseif(!$result["email"])
27.{
28.echo("E-Mail is not valid.<br />");
29.}
30.else
31.{
32.echo("User input is valid");
33.}
34.?>
11.
eieieiei iiii ( PHP Mai l Funct i on Tut or i al i n Bangl a)( PHP Mai l Funct i on Tut or i al i n Bangl a)( PHP Mai l Funct i on Tut or i al i n Bangl a)( PHP Mai l Funct i on Tut or i al i n Bangl a)
: яo
PHP mail() d o я i i ।
1.mail(to,subject,message,headers,parameters)
to я ।e i i i i ।
subject я ।e u l ।
message я ।e я । я i (n) h d e i 70 ak
headers c ।e d a k । :From,Cc,Bcc.
parameters c ।a k ।
: i я s i i i s e php.ini i i a
>> c? b o i- i s p i
i s i e i e k k ।
e u i e p u n s c n
i u я a
e я ei i u e k я i
(a someone@example.com ei i )
PHP MAI L FORMPHP MAI L FORMPHP MAI L FORMPHP MAI L FORM
<html>
40. <body>
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail( " someone@example.com", "Subject: $subject",
$message, "From: $email" );
echo "Thank you for using our mail form";
}
else
//if "email" is not filled out, display the form
{
echo "<form method='post' action='mailform.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>
</body>
</html>
::::
p i i e
HTML i o
i o
ei 3 logic e ।
e k я reload e i i e i
।
::::e d e ei a iuя ie d e ei a iuя ie d e ei a iuя ie d e ei a iuя i
e i i i я ।i i i я ue i i i я ।i i i я ue i i i я ।i i i я ue i i i я ।i i i я u form validationform validationform validationform validation.... PHPPHPPHPPHP
llll ((((FilterFilterFilterFilter)))) a ua ua ua u
41. CCCC.... ei oei oei oei o
1.1.1.1.
ei o uei o uei o uei o u |||| ( PHP Fr amewor k Tut or i( PHP Fr amewor k Tut or i( PHP Fr amewor k Tut or i( PHP Fr amewor k Tut or i al i nal i nal i nal i n
Bangl a)Bangl a)Bangl a)Bangl a)
: яoяoяoяo
• ei o (PHP Framework) c e basic Platform/structure( ) o a p
।
• d , like k ei s я n (like) ,p я
j e i e e e e p e u ।
• PHP Framework e p -p ,
k,d a p ।
• e e o я ,e o o a , я i
।
я ei o (PHP Framework) e e o i s яi e o i
e i a ।
ei o (PHP Framework) я
1.PHP( PHP Function, Variable etc)
2.Object Oriented Programming
3.MVC(Model View Controller)Structure
a ei o яn o , , , i i i яn e i i
я p яn e я -яn en p iя ei e я i p i o
o я u i i , i e i i (CodeIgniter PHP
Framework) e u ।
2.
a яk a p g e eia яk a p g e eia яk a p g e eia яk a p g e ei ( OOP & PHP Tut or i al i n Bangl a)( OOP & PHP Tut or i al i n Bangl a)( OOP & PHP Tut or i al i n Bangl a)( OOP & PHP Tut or i al i n Bangl a)
: яoяoяoяo
42. p u ap u ap u ap u a p gp gp gp g ---- POP ( PROCEDURE ORI ENPOP ( PROCEDURE ORI ENPOP ( PROCEDURE ORI ENPOP ( PROCEDURE ORI ENTED PROGRAMMI NG)TED PROGRAMMI NG)TED PROGRAMMI NG)TED PROGRAMMI NG)
u language FORTRAN(Formula Translation-e Statistician
)COBOL,C i s i p g Procedure
Oriented Programming(POP).PHP o e p g POP
(instruction/actions) ,ei mu я ei g s
e p g e a ,p a i e p g e e + ।
e p g n я n e e p g i
i POP a global data k n
e o ।
a яk a pa яk a pa яk a pa яk a p gggg ---- OOP( OBJECTOOP( OBJECTOOP( OBJECTOOP( OBJECT ORI ENTED PROGRAMMI NGORI ENTED PROGRAMMI NGORI ENTED PROGRAMMI NGORI ENTED PROGRAMMI NG))))
OOP a яk a n p g (Object Oriented Programming) ei k
e OOP critical element e s k p (free flow) n OOP
e e Objects ,e я ei a яk e / sk
/ d k m /(interact)
OOPOOPOOPOOP
*e k ( ei operate )
* p g Object k a e p g a Object
*e Object e e ,ei (Operate )
* i ei e ।
* d e Object Object e ।
*e p g e ।
OOP
• Objects
• Class
• Encapsulation
• Inheritence
• Polymorphism
• Message passing
a яka яka яka яk ( OBJECTS)( OBJECTS)( OBJECTS)( OBJECTS)
a яk e ,ei ( ) a яk c e
(a bundle) e n e k k e a яk e k , k
43. я a я ko , k a яk c ei a яk
a ( )।কিন্তু e a o ।
a яk a n ei e a яk e / / (bunch).e g
я ei a яk e t я e u e s n ( ei skp ), e c
e (bunch) (a яk ), s n e я , p (a яk) я я я
m s nt ।
k ei ( d -Procrdure Oriented way) e
(bunch) sk pi ।
kkkk ( CLASS)( CLASS)( CLASS)( CLASS)
ei a яk ei a яk e я e /e l
(blueprint/template/outline) e p (e a яk e я ) k ।
k c a я k я (blueprint).e k c a я k я e e l e
e k я , a e k e a яk m e
a яk a n ei ei e living,breathing a яk k e u t
living,breathing a яk c ei a яk ।
e se se se s ( ENCAPSULATI ON)( ENCAPSULATI ON)( ENCAPSULATI ON)( ENCAPSULATI ON)
e k (class) e e i e e k e k e k
i e o a i ei p t ei k
i i i ei e i ei e n
o p k (data hiding/information hiding)
i ni ni ni n ( I NHERI TANCE)( I NHERI TANCE)( I NHERI TANCE)( I NHERI TANCE)
OOP i n : (reusability) p a e k a k
k i sk p e k e k ei k a
k k k (super class/base class) k e
k /p k (subclass/derived class).extends ei o k e k ।
яяяя ( POLYMORPHI SM)( POLYMORPHI SM)( POLYMORPHI SM)( POLYMORPHI SM)
e a яk e я e i n я ei p k я ।
я a kя a kя a kя a k ( MESSAGE PASSI NG)( MESSAGE PASSI NG)( MESSAGE PASSI NG)( MESSAGE PASSI NG)
e OO Program e e a яk e e e a a e a яk
a яk e я ei p k i я a k ।
44. 3.
a яka яka яka яk aaaa eieieiei ( OOPHP Tut or i al i n Bangl a)( OOPHP Tut or i al i n Bangl a)( OOPHP Tut or i al i n Bangl a)( OOPHP Tut or i al i n Bangl a)
eeee u ।।।। e
ei 5 (PHP5) ei 5 m a яk a n e ei 4 m a яk
a n ei 5 a яk a n o e я , , o e p я
OOPHP ei , , n s n, i ।
u я e 23 a ( ) ।
---- ::::
pppp ei я rei я rei я rei я r
index.php
class_lib.php
a яk a n e i i i ei ‘includes’ ei
e я ei u я a яk a n class_lib.php i OOP
k я k c m p /k a яk e я a яk m ।
---- ::::
eeee ei kei kei kei k
ei sk p , , i a яk a n d
p i e k k я p i ‘class’ b e e k i c ।
1.<?php
2.class people{
3.
4.}
5.?>
45. ---- ::::
kkkk
k c a я k я b pn/ k e ei
‘property’
1.<?php
2.class people{
3.var name;
4.}
5.?>
: e k / (ei u var name;) e ‘properties’
---- ::::
kkkk ////
e k e ‘properties’ e k e
‘methods’ ( k e ei )e
k /methods i k /properties ।
<?php
class people{
var $name;
function set_name($new_name){
$this->name=$new_name;
}
function get_name(){
return $this->name;
}
}
?>
46. k properties e ।
---- ::::
gettergettergettergetter eeee settersettersettersetter
/ get_name() e set_name() ei я e
e k getter e setter a i property ।
<?php
class people{
var $name;
function set_name($new_name){
$this->name=$new_name;
}
function get_name(){
return $this->name;
}
}
?>
e k getter e setter property e ei p g
a яk я i t set_name() / e
a i e property/variable ‘name’
---- ::::
‘$t hi s$t hi s$t hi s$t hi s’
m i
$this->name=$new_name
$this e li ( a я ki e l i ) a яk a e e self-
referencing e properties e e e e k
।
function get_name() {
return $this->name;
}
47. e e e ei o e ei ei
ei i я ।
---- ::::
ei я ei kei я ei kei я ei kei я ei k
ei я ei k a яk a n p g e u d i k
e ei я ei я e ‘include’ ‘require’ ।
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//BN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UFT-8" />
<title>OOPHP in Webcoachbd</title>
<?php include("class_lib.php"); ?>
</head>
<body>
</body>
</html>
n e o k ,e ।
---- ::::
a яka яka яka яk
e k a яk p k instantiation.
<?php include("class_lib.php"); ?>
</head>
<body>
$rejoan = new people();
</body>
</html>
48. $rejoan people a яk e я n $rejoan ei people
a яk nt e я ।
---- ::::
newnewnewnew oooo
e k a яk ei new o p я ।
i c e k a a яk ei i я p a яk (s nt
st )
<?php include("class_lib.php"); ?>
</head>
<body>
$rejoan = new people();
$riad = new people;
</body>
</html>
a яk k quote a e
$rejoan= new 'people';
---- ::::
a яka яka яka яk propertiespropertiespropertiesproperties ((((setsetsetset)))) ।।।।
a яk people ,e properties (set)
(the setters) ।
e o a яk e 2 ($rejoan e $riad) e i k people e u t
ei n m a ei e 2 a яk
m ।
<?php include("class_lib.php"); ?>
</head>
<body>
<?php
49. $rejoan = new people();
$riad= new people;
$rejoan->set_name("Rejoanul Alam");
$riad->set_name("Anjirul Alam");
?>
</body>
</html>
---- ::::
a я k ea я k ea я k ea я k e
e getter a я k e e i setter
a я k ।
k e properties e e i a (->) h ।
<?php include("class_lib.php"); ?>
</head>
<body>
<?php
$rejoan = new people();
$riad = new people;
$rejoan->set_name("Rejoanul Alam");
$riad->set_name("Anjirul Alam");
echo "Rejoan's full name: " . $rejoan->get_name();
echo "Riad's full name: " . $riad->get_name();
?>
</body>
</html>
:ei a (->) h e a (=>) ei h n e ।
a n ei u a ।
:
e ei k я i
ei k u t e я a яk
a я k
50. a яk
-12:
a яka яka яka яk propertiespropertiespropertiesproperties e ee ee ee e ???? eeee
a я k properties e e , a (->) a
e u s :
$rejoan->name.
o e o e e e я d e
getter ।
<?php include("class_lib.php"); ?>
</head>
<body>
<?php
$rejoan = new people();
$riad = new people;
$stefan->set_name("Rejoanul Alam");
$riad->set_name("Anjirul Alam");
// directly accessing properties in a class is a no-no.
echo "Rejoan’s full name: " . $rejoan->name;
?>
</body>
</html>
---- ::::
sT ksT ksT ksT k
a я k e li s k e a я k properties e ।
:__construct() ei a __construct /
e k e a яk ।
‘construct’ n s (__) s k k e k
(e ) ei d ।
51. <?php
class people {
var $name;
function __construct($people_name) {
$this->name = $people_name;
}
function set_name($new_name) {
$this->name = $new_name;
}
function get_name() {
return $this->name;
}
}
?>
ei u k
functions=methods
variables=properties
-14:
constructconstructconstructconstruct e a яke a яke a яke a яk
e s k ,e people a яk $name property’
u :
$rejoan = new people("Rejoanul Alam");
e set_name() e sk p ।
<?php include("class_lib.php"); ?>
</head>
<body>
<?php
$rejoan = new people("Rejoanul Alam");
echo "Rejoan’s full Name: " . $rejoan->get_name();
?>
</body>
52. </html>
e e u a яk a n ei e li (mechanism)
ei ।
---- ::::
propertiespropertiespropertiesproperties e e e d ।e e e d ।e e e d ।e e e d ।
a яk a n p g e e e (encapsulation).e a я k s
(properties) e e d ।
k properties e e d я ‘access modifier’ 3 e -
1. public
2. private
3. protected
l public ।
<?php
class people {
var $name;
public $height;
protected $social_insurance;
private $pinn_number;
function __construct($people_name) {
$this->name = $people_name;
<i>} </i>
function set_name($new_name) {
$this->name = $new_name;
}
function get_name() {
return $this->name;
}
}
?>
: ‘var’ o properties (declare) e ‘public’ ।
53. -16:
propertiespropertiespropertiesproperties e e d ।ae e d ।ae e d ।ae e d ।a ----
e property private e i k e ।
property protected t e i k e p k (derived class/ei
k k p o k k properties e e ) ei k e
я e i k e p k k ।
public d i u sk p я e e ।
<?php include("class_lib.php"); ?>
</head>
<body>
<?php
$rejoan = new people("Rejoanul Alam");
echo "Rejoan's full name: " . $rejoan->get_name();
/*
$pinn_number private i ei e ,p g i
*/
echo "Tell me private stuff: " . $rejoan->$pinn_number;
?>
</body>
</html>
---- ::::
e de de de d
properties e o ei 3 e e nt ।
1. public
2. private
3. protected
e ?
ut : e e , k a ei p g ei
e t e p я k e a ei p g я e
i o ।
54. <?php
class people {
var $name;
public $height;
protected $social_insurance;
private $pinn_number;
function __construct($people_name) {
$this->name = $people_name;
}
private function get_pinn_number() {
return $this->$pinn_number;
}
}
?>
: get_pinn_number() e private i ei t k , k
sk p a o ei public ।
---- ::::
:::: ::::i ni ni ni n
a яk a n p g e i n (Inheritence) e d e k a
k /k k ।
e ?
ut :e d k : e k c
‘employee’ employee e people/person i e i e properties
।
e ?
ei a s i n e e i :
k n e d ei ।
1. sk p e i ।
2. : c i e a (a ) k n i e i
a ei ‘includes()’ e я ।
55. // 'extends' ei o i n
class employee extends people {
function __construct($employee_name) {
}
---- ::::
:::: ।a।a।a।a ----
employee k k people i employee k a people k
‘public’ properties, ei k (a ei k )।
// 'extends' ei o i n
class employee extends people {
function __construct($employee_name) {
$this->set_name($employee_name);
}
}
k employee k set_name() o ei employee k
(declare) i ei i people k ।
-20:
:::: ।a।a।a।a ----
employee a я k get_name() people k я e
e d u (e i / )
<title>OOPHP in Webcoachbd</title>
<?php include("class_lib.php"); ?>
</head>
<body>
<?php
// Using our PHP objects in our PHP pages.
$rejoan = new people("Rejoanul Alam");
echo "Rejoan's full name: " . $rejoan->get_name();
$riad = new employee("Anjirul Alam");
56. echo "Riad’s full name " . $riad->get_name();
?>
</body>
</html>
---- ::::
Over r i ddi ngOver r i ddi ngOver r i ddi ngOver r i ddi ng
( i n ) e k я e p я
।
u s set_name() people k n employee k ।
n people k set_name() Override employee k ei e i
।
<?php
class people {
// explicitly adding class properties are optional - but is good practice
var $name;
function __construct($people_name) {
$this->name = $people_name;
}
public function get_name() {
return $this->name;
}
//protected methods and properties restrict access to those elements.
protected function set_name($new_name) {
if (name != "Jimmy Two Guns") {
$this->name = strtoupper($new_name);
}
}
}
// 'extends' ei o i n
class employee extends people {
protected function set_name($new_name) {
if ($new_name == "Stefan Sucks") {
$this->name = $new_name;
}
}
57. function __construct($employee_name) {
$this->set_name($employee_name);
}
}
?>
k set_name() people k ( k ) n employee k
।
-22:
OverridingOverridingOverridingOverriding....aaaa ----
o k e , i k p k (e child k o
) override ।
u employee k set_name() override e e
people::set_name($new_name);
e parent k (People) set_name() e ।
<?php
class people {
// explicitly adding class properties are optional - but is good practice
var $name;
function __construct($people_name) {
$this->name = $people_name;
}
public function get_name() {
return $this->name;
}
//protected methods and properties restrict access to those elements.
protected function set_name($new_name) {
if (name != "Jimmy Two Guns") {
$this->name = strtoupper($new_name);
}
}
}
// 'extends' is the keyword that enables inheritance
class employee extends people {
protected function set_name($new_name) {
58. if ($new_name == "Stefan Sucks") {
$this->name = $new_name;
}
else if($new_name == "Anjirul Alam") {
people::set_name($new_name);
}
}
function __construct($employee_name) {
$this->set_name($employee_name);
}
}
?>
---- ::::
overridingoverridingoverridingoverriding aaaa ----
'people::set_name()' e ei i я people k set_name() я
।
d parent o k parent k ( k
parent k ) ।
<?php
class people {
// explicitly adding class properties are optional - but is good practice
var $name;
function __construct($people_name) {
$this->name = $people_name;
}
public function get_name() {
return $this->name;
}
//protected methods and properties restrict access to those elements.
protected function set_name($new_name) {
if (name != "Jimmy Two Guns") {
$this->name = strtoupper($new_name);
}
}
}
// 'extends' is the keyword that enables inheritance
59. class employee extends people {
protected function set_name($new_name) {
if ($new_name == "Stefan Sucks") {
$this->name = $new_name;
}
else if($new_name == "Anjirul Alam") {
parent::set_name($new_name);
}
}
function __construct($employee_name) {
$this->set_name($employee_name);
}
}
?>
::::
a яk a n p g e e e OOPHP e я
я a я e OOP k d я e e
, я a яk e n я
e 8/10 e a яk k я ।
OOPOOPOOPOOP e p ge p ge p ge p g
a яk a n p g o e d a я e ei
я , ei , , ++ i ।
o я a яk a n i e я e i
o s e p ( o ) o e p
(o ) i OOP e u a яk
a n ei i i e я ।
e e e i , ei p я k я p a s e я e я
n e s n p яk a яk nd
eя a яk p яk g k g -
Ø o я ।
Ø p a яk p яn я k k
Ø ei k e properties e
Ø a e a яk m (parent-child/base-derived)
4.
60. u T sT uu T sT uu T sT uu T sT u ( MVC St r uct ur e Tut or i al i n( MVC St r uct ur e Tut or i al i n( MVC St r uct ur e Tut or i al i n( MVC St r uct ur e Tut or i al i n
Bangl a)Bangl a)Bangl a)Bangl a)
: яoяoяoяo
u n s MVC Structure (e я i d ) ei e p
я
01.<?php
02.include "common-libs.php";
03.include "config.php";
04.mysql_connect($hostname, $username, $password);
05.mysql_select_db($database);
06.?>
07.<?php include "header.php"; ?>
08.<h1>Home Page</h1>
09.<?php
10.$sql = "SELECT * FROM news";
11.$result = mysql_query($sql);
12.?>
13.<table>
14.<?php
15.while ($row = mysql_fetch_assoc($result)) {
16.?>
17.<tr>
18.<td><?php echo $row['date_created']; ?></td>
19.<td><?php echo $row['title']; ?></td>
20.</tr>
21.<?php
22.}
23.?>
24.</table>
25.<?php include "footer.php"; ?>
e ei m i a a m u n
я i ei e ei MVC Structure 3 n я
e i e я ei 3
(Model)
u (View)
n (Controller)
( MODEL) :( MODEL) :( MODEL) :( MODEL) :
i i e e p ,ei e p a t
(a я ) d i , , i
a a s p яn ei я я я (business logic)
uuuu ( VI EW) :( VI EW) :( VI EW) :( VI EW) :
61. e s d iuя e я a e e o я ei e e
я i i e e я e a o я , , e e я i ।
TTTT ( CONTROLLER) :( CONTROLLER) :( CONTROLLER) :( CONTROLLER) :
n s d e u e я e a a e u
я ei я e ।
i i o MVC a u n s e t я a e e
।
5.
i i ui i ui i ui i u e i se i se i se i s ( CodeI gni t er Downl oad & I nst al l( CodeI gni t er Downl oad & I nst al l( CodeI gni t er Downl oad & I nst al l( CodeI gni t er Downl oad & I nst al l
Tut or i al i n Bangl a)Tut or i al i n Bangl a)Tut or i al i n Bangl a)Tut or i al i n Bangl a)
: яoяoяoяo
p http://codeigniter.com/downloads/e i i o u , e .zip format e
e я e o , я c i e c
htdocs folder,e ei F:Program Filesxampphtdocs. e C Drive e C
62. drive e F i F c ei C:Program Filesxampphtdocs. e e
u (e я ) l a s l CodeIgniter.
e i i l e system>>application>> config>>config.php i m k e
।
view source
print?
01.|-------------------------------------------------------------------------
-
02.| Base Site URL
03.|-------------------------------------------------------------------------
-
04.
05.
06.$config['base_url'] = "http://localhost/CodeIgniter/";
07.
08.
09.
10.
11.|-------------------------------------------------------------------------
-
12.| Index File
13.|-------------------------------------------------------------------------
-
14.
15.
16.$config['index_page'] = "index.php";
17.
18.
19.
20.
21.|-------------------------------------------------------------------------
-
22.| Default Language
23.|-------------------------------------------------------------------------
-
24.
25.
26.$config['language'] = "english";
27.
28.
29.
30.
31.|-------------------------------------------------------------------------
-
32.| Default Character Set
33.|-------------------------------------------------------------------------
-
34.
35.
64. 80.|-------------------------------------------------------------------------
-
81.
82.
83.$config['compress_output'] = TRUE;
84.
85.
86.
87.
88.|-------------------------------------------------------------------------
-
89.| Rewrite PHP Short Tags
90.|-------------------------------------------------------------------------
-
91.
92.
93.$config['rewrite_short_tags'] = FALSE;
6.
i ii ii ii i ( CodeI gni t er Conf i gur e Tut or i al i n( CodeI gni t er Conf i gur e Tut or i al i n( CodeI gni t er Conf i gur e Tut or i al i n( CodeI gni t er Conf i gur e Tut or i al i n
Bangl a)Bangl a)Bangl a)Bangl a)
: яoяoяoяo
e “config.php” i o database.php e i e e
।
01.$active_group = "default";
02.$active_record = TRUE;
03.
04.
05.$db['default']['hostname'] = "localhost";
06.$db['default']['username'] = "root";
07.$db['default']['password'] = "mypassword";
08.$db['default']['database'] = "mydatabase";
09.$db['default']['dbdriver'] = "mysql";
10.$db['default']['dbprefix'] = "";
11.$db['default']['pconnect'] = TRUE;
12.$db['default']['db_debug'] = TRUE;
13.$db['default']['cache_on'] = FALSE;
14.$db['default']['cachedir'] = "";
15.$db['default']['char_set'] = "utf8";
16.$db['default']['dbcollat'] = "utf8_general_ci";
e address bar e http://localhost/CodeIgniter/ en a i s ।
65. 7.
i i e p e pi i e p e pi i e p e pi i e p e p ( Cr eat i ng Fi r st( Cr eat i ng Fi r st( Cr eat i ng Fi r st( Cr eat i ng Fi r st Appl i cat i on wi t hAppl i cat i on wi t hAppl i cat i on wi t hAppl i cat i on wi t h
CodeI gni t er )CodeI gni t er )CodeI gni t er )CodeI gni t er )
: яoяoяoяo
c ei u OOP e OOPHP e u e e
a яk a n p g e i i e a u o
, p ।
i i MVC Structure e t ,e o e p я
ei d я я ( a ),e p я ( n a )e я я ( u a
) i e e p e e p c ei e p
n e u e e я i i e o я i।
F:Program FilesxampphtdocsCodeIgnitersystemapplicationcontrollers ei e
helloworld.php i (F e я C ) ei i e ++ e
e class e
01.<?php
02.class HelloWorld extends Controller{
03.function HelloWorld(){
04.// load controller parent
05.parent::Controller();
66. 06.}
07.function index(){
08.$data['title']='My first application created with Code Igniter';
09.$data['message']='Hello world!';
10.// load 'helloworld' view
11.$this->load->view('helloworld',$data);
12.}
13.}
14.?>
: n a e k e c k /p k / k k 'Controller'
ei 'Controller' k i i i e c k / n k ei n
k 'Controller' extends o k 'HellowWorld' p
(derived).
e parent::Controller() e function index() d ei c n k (Controller e) o
e index() ( ) p $data (a ) e d u
p ei n i m p 'helloworld.php'।কোডইগনাইটারে loader e k
, n e k i ei loader k a i l e i i ei
loader k u i я e
$this->load->view('helloworld',$data);
e u i e e pass b uя u i e
F:Program FilesxampphtdocsCodeIgnitersystemapplicationviews ei helloworld.php
e i i
1.<html>
2.<head>
3.<title><?php echo $title;?></title>
4.</head>
5.<body>
6.<h1><?php echo $message?></h1>
7.</body>
8.</html>
e Address bar e e en ।
http://localhost/CodeIgniter/index.php/helloworld
: Controller e Views folder e k welcome.php e welcome_message.php i
++ e a ।