The document provides an overview of site management and sending/receiving data between web pages using PHP. It discusses dynamic page decisions using PHP or ASP, accessing and interpreting PHP pages using WAMPS locally, creating and saving PHP script files, alternative PHP delimiters, PHP syntax, embedding PHP statements in HTML, using comments in PHP scripts, PHP variables, arithmetic operators, strings, and common string functions.
This document provides an introduction and overview of PHP. It states that PHP is a server-side scripting language commonly used for web development. It can be embedded into HTML and is free, efficient and compatible with many platforms and servers. The document then covers basic PHP syntax, variables, data types, operators, conditional statements and loops. It provides examples to illustrate key PHP concepts and functions.
PHP and MySQL are open-source technologies commonly used together for building dynamic web applications. PHP is a server-side scripting language designed to integrate with MySQL databases. Key features include using PHP scripts embedded in HTML, variables to store and manipulate data, functions to reuse code, and MySQL functions to connect to databases and execute queries.
The document provides an overview of PHP (Hypertext Preprocessor), a popular server-side scripting language. It discusses key PHP concepts like variables, data types, operators, forms, and functions. Some key points covered include:
- PHP code is embedded within <?php ?> tags and can output and interact with HTML
- PHP supports common variable types like integers, floats, strings, and arrays
- Operators allow performing tasks like math operations and comparisons on variables
- Forms allow user input and are submitted via GET or POST methods to PHP scripts
- Functions help organize and reuse code when called within a PHP program
The document discusses PHP and MySQL for building web applications. It begins with an introduction to PHP, explaining that PHP is a widely used server-side scripting language suited for web development. It then covers PHP fundamentals like syntax, variables, data types, operators, and control structures. The document also discusses how to connect to and query MySQL databases from PHP. It provides an example of building a simple user registration and login application with PHP and MySQL to store and retrieve user data from a database table.
This chapter discusses working with text and numbers in PHP. It covers defining and manipulating strings, including validating, formatting, and changing case. Functions for selecting, replacing, and exploding parts of strings are described. Working with numbers, math operators, variables, and number formatting functions are also summarized. Key string functions include substr(), str_replace(), printf(), and number functions include rand(), round(), pow(), and abs().
PHP is a server-side scripting language commonly used for web development. It allows files containing text, HTML, and PHP scripts to be processed on the server and returned to the browser as plain HTML. PHP can generate dynamic page content, interact with databases, send and receive cookies, and more. Some key features of PHP include that it is free, open source, runs on most server environments, and can be easily learned. The document provides examples of basic PHP syntax, variables, data types, operators, and conditional statements.
The document provides a tutorial on PHP programming. It discusses what PHP is, how to install PHP, basic PHP syntax like variables and data types, and how to use PHP with HTML. It also covers PHP programming concepts like strings, operators, conditional statements, arrays, and more. The tutorial aims to teach the fundamentals of PHP to help readers get started with learning PHP.
PHP is a server-side scripting language commonly used for web development. It allows creation of dynamic content and applications. Some key things PHP can do include building shopping carts, content management systems, forums, and other web applications. PHP code is processed on the server and the results are sent to the user's browser. Variables, arrays, and other data types can store and manipulate information. Control structures like if/else statements and loops allow conditional execution of code. Functions allow reusable blocks of code to be defined. Sessions allow storing of data across multiple pages for a user.
This document provides an overview of PHP and MySQL for web development. It describes what PHP and MySQL are, basic PHP syntax like variables and control structures, working with forms, and how to include files across pages using includes and requires.
PHP Basics provides an overview of PHP syntax and variables. It explains how to define and assign variables, use data types like strings and arrays, and perform basic operations. Key points covered include using comments, semicolons, variable naming rules, operators, and the difference between echo and print statements. Constants and predefined variables are also summarized.
This document provides instructions for Lab 4 of an information systems design course. The lab aims to build experience with fundamental PHP functions related to arrays, strings, and regular expressions. Students will modify PHP code snippets to work with multi-dimensional arrays, define and call functions, and perform string operations like searching and replacing text. The lab consists of 4 steps involving PHP code to demonstrate various PHP features and concepts.
The document provides an overview of PHP concepts including variables, data types, functions, and more. It discusses PHP syntax like tags and comments. Key points covered include:
- PHP is a scripting language widely used for web development and is free to use
- Variables store and manipulate data in PHP and have no predefined type
- PHP has several data types including integers, doubles, strings, arrays, and objects
- Functions define reusable blocks of code and can accept parameters
- echo and print output content, with echo being marginally faster
This document provides an overview of PHP, including what PHP is, how PHP scripts work, embedding PHP in web pages, variables, operators, control structures, arrays, functions, and forms. Some key points covered include:
- PHP is a server-side scripting language commonly used for web development. PHP code is embedded within HTML and executed on the server to produce dynamic web page content.
- PHP scripts typically have a .php file extension and use <?php ?> tags. Code within the tags is executed by the server and the results are returned to the browser.
- Variables, constants, operators, and control structures like if/else statements allow PHP to dynamically output content. Arrays and multid
This document provides an introduction to basic PHP syntax. It discusses how PHP code is processed on the server before a page is sent to the browser. The key elements of PHP code are described, including variables, data types, operators, comments, and embedding PHP within HTML. Specific functions like strlen(), strpos(), and substr() are also overviewed.
The document discusses PHP, a popular scripting language used to enhance web pages. It explains that PHP allows users to create dynamic elements like login pages, forums, and galleries. It also discusses that PHP is server-sided, meaning code is executed on the web server and results sent to the user's browser. Finally, it provides an overview of what is needed to get started with PHP, including downloading Wampserver to set up a local testing server on Windows computers.
This document provides an introduction to PHP, including an overview of server-side scripting, the basic PHP syntax, variables, operators, control structures like conditional statements and loops, and how PHP code is processed. It explains what PHP is, how it is widely used for building dynamic websites, and the basic components needed to develop PHP applications including a web server, PHP, and a database.
- PHP is an open source scripting language used for web development that was created in 1995 and has evolved through several versions. It combines elements of Perl, C, and Java and allows embedding code in HTML.
- The document outlines the history and evolution of PHP, its core features like script tags, data types, functions, and portability between Linux and Windows. It also provides tips on debugging, tools, and resources for learning more about PHP and the upcoming PHP 5 release.
PHP and MySQL are open-source languages that allow for the creation of dynamic web pages; PHP is a server-side scripting language that is often used with MySQL to access and manipulate databases. The document provides an overview of PHP and how it can be used to connect to MySQL databases, retrieve and display data, handle forms, and write scripts with variables, functions, and control structures.
This document provides an introduction and overview of PHP, including what PHP is, what is needed to use it, basic syntax, variables, data types, operators, control structures like if/else and loops, functions, and includes/requires. Key points covered include PHP being a server-side scripting language, basic syntax using <?php ?> tags, common variable types and scoping, operators for arithmetic, comparison and logic, and common control structures for conditional execution and repetition.
PHP is a server-side scripting language designed for web development, but also used as a general-purpose programming language. Most of the websites are using PHP in their dynamic content
PHP is a server-side scripting language commonly used for web development. It allows developers to write scripts that can output dynamic web page content, collect form data, store and retrieve data in databases, and send emails. PHP scripts can be embedded within HTML pages or outputted directly. Key PHP features include variables, conditional statements, loops, functions, and arrays which allow complex tasks to be broken down into simple steps. PHP scripts can connect to databases like MySQL to dynamically display, insert, and update data in databases.
PHP is a server-side scripting language commonly used for web development. It allows developers to write scripts that can output dynamic web page content, collect form data, store and retrieve data in databases, and send emails. PHP scripts can be embedded within HTML pages and run on the server. Some key features include variables, conditional statements, loops, functions, and arrays which allow for powerful programming capabilities. PHP scripts can connect to databases like MySQL to dynamically display, insert, and update data in databases.
The document discusses various control structures in PHP including if/else statements, loops (while, do/while, for, foreach), and jumping in and out of PHP mode. It provides examples of how to use each control structure and also discusses adding comments to PHP scripts.
This document provides an overview of basic PHP concepts including:
- PHP syntax with opening and closing tags <?php ?>
- Language constructs like echo and print for outputting strings
- Variables, data types, operators, and functions
- Conditional statements like if/else and switch statements
- Looping with while, do/while, and for loops
- Arrays for storing multiple values
- Form handling with $_GET and $_POST superglobals
- Connecting to databases using MySQLi or PDO extensions
The document covers PHP fundamentals and is intended as an introduction for learning the language. It explains core PHP concepts through examples and explanations in a step-by-step manner over 47 sections
This document provides an overview of PHP, its uses, installation, configuration, and basic concepts. It discusses that PHP is a widely used programming language for building dynamic websites. It can be installed along with Apache and MySQL on a server. The document also covers PHP variables, data types, flow control, functions, and how to work with strings and numbers.
This document provides instructions for Lab 4 of an information systems design course. The lab aims to build experience with fundamental PHP functions related to arrays, strings, and regular expressions. Students will modify PHP code snippets to work with multi-dimensional arrays, define and call functions, and perform string operations like searching and replacing text. The lab consists of 4 steps involving PHP code to demonstrate various language features like joining strings, defining functions, and using regular expressions.
Introduction of PHP with all the basic codes and tags. Explanation of all the confusing keywords. PHP forms are also explained along with operators and datatypes.
PHP is a server-side scripting language commonly used for web development. It allows creation of dynamic content and applications. Some key things PHP can do include building shopping carts, content management systems, forums, and other web applications. PHP code is processed on the server and the results are sent to the user's browser. Variables, arrays, and other data types can store and manipulate information. Control structures like if/else statements and loops allow conditional execution of code. Functions allow reusable blocks of code to be defined. Sessions allow storing of data across multiple pages for a user.
This document provides an overview of PHP and MySQL for web development. It describes what PHP and MySQL are, basic PHP syntax like variables and control structures, working with forms, and how to include files across pages using includes and requires.
PHP Basics provides an overview of PHP syntax and variables. It explains how to define and assign variables, use data types like strings and arrays, and perform basic operations. Key points covered include using comments, semicolons, variable naming rules, operators, and the difference between echo and print statements. Constants and predefined variables are also summarized.
This document provides instructions for Lab 4 of an information systems design course. The lab aims to build experience with fundamental PHP functions related to arrays, strings, and regular expressions. Students will modify PHP code snippets to work with multi-dimensional arrays, define and call functions, and perform string operations like searching and replacing text. The lab consists of 4 steps involving PHP code to demonstrate various PHP features and concepts.
The document provides an overview of PHP concepts including variables, data types, functions, and more. It discusses PHP syntax like tags and comments. Key points covered include:
- PHP is a scripting language widely used for web development and is free to use
- Variables store and manipulate data in PHP and have no predefined type
- PHP has several data types including integers, doubles, strings, arrays, and objects
- Functions define reusable blocks of code and can accept parameters
- echo and print output content, with echo being marginally faster
This document provides an overview of PHP, including what PHP is, how PHP scripts work, embedding PHP in web pages, variables, operators, control structures, arrays, functions, and forms. Some key points covered include:
- PHP is a server-side scripting language commonly used for web development. PHP code is embedded within HTML and executed on the server to produce dynamic web page content.
- PHP scripts typically have a .php file extension and use <?php ?> tags. Code within the tags is executed by the server and the results are returned to the browser.
- Variables, constants, operators, and control structures like if/else statements allow PHP to dynamically output content. Arrays and multid
This document provides an introduction to basic PHP syntax. It discusses how PHP code is processed on the server before a page is sent to the browser. The key elements of PHP code are described, including variables, data types, operators, comments, and embedding PHP within HTML. Specific functions like strlen(), strpos(), and substr() are also overviewed.
The document discusses PHP, a popular scripting language used to enhance web pages. It explains that PHP allows users to create dynamic elements like login pages, forums, and galleries. It also discusses that PHP is server-sided, meaning code is executed on the web server and results sent to the user's browser. Finally, it provides an overview of what is needed to get started with PHP, including downloading Wampserver to set up a local testing server on Windows computers.
This document provides an introduction to PHP, including an overview of server-side scripting, the basic PHP syntax, variables, operators, control structures like conditional statements and loops, and how PHP code is processed. It explains what PHP is, how it is widely used for building dynamic websites, and the basic components needed to develop PHP applications including a web server, PHP, and a database.
- PHP is an open source scripting language used for web development that was created in 1995 and has evolved through several versions. It combines elements of Perl, C, and Java and allows embedding code in HTML.
- The document outlines the history and evolution of PHP, its core features like script tags, data types, functions, and portability between Linux and Windows. It also provides tips on debugging, tools, and resources for learning more about PHP and the upcoming PHP 5 release.
PHP and MySQL are open-source languages that allow for the creation of dynamic web pages; PHP is a server-side scripting language that is often used with MySQL to access and manipulate databases. The document provides an overview of PHP and how it can be used to connect to MySQL databases, retrieve and display data, handle forms, and write scripts with variables, functions, and control structures.
This document provides an introduction and overview of PHP, including what PHP is, what is needed to use it, basic syntax, variables, data types, operators, control structures like if/else and loops, functions, and includes/requires. Key points covered include PHP being a server-side scripting language, basic syntax using <?php ?> tags, common variable types and scoping, operators for arithmetic, comparison and logic, and common control structures for conditional execution and repetition.
PHP is a server-side scripting language designed for web development, but also used as a general-purpose programming language. Most of the websites are using PHP in their dynamic content
PHP is a server-side scripting language commonly used for web development. It allows developers to write scripts that can output dynamic web page content, collect form data, store and retrieve data in databases, and send emails. PHP scripts can be embedded within HTML pages or outputted directly. Key PHP features include variables, conditional statements, loops, functions, and arrays which allow complex tasks to be broken down into simple steps. PHP scripts can connect to databases like MySQL to dynamically display, insert, and update data in databases.
PHP is a server-side scripting language commonly used for web development. It allows developers to write scripts that can output dynamic web page content, collect form data, store and retrieve data in databases, and send emails. PHP scripts can be embedded within HTML pages and run on the server. Some key features include variables, conditional statements, loops, functions, and arrays which allow for powerful programming capabilities. PHP scripts can connect to databases like MySQL to dynamically display, insert, and update data in databases.
The document discusses various control structures in PHP including if/else statements, loops (while, do/while, for, foreach), and jumping in and out of PHP mode. It provides examples of how to use each control structure and also discusses adding comments to PHP scripts.
This document provides an overview of basic PHP concepts including:
- PHP syntax with opening and closing tags <?php ?>
- Language constructs like echo and print for outputting strings
- Variables, data types, operators, and functions
- Conditional statements like if/else and switch statements
- Looping with while, do/while, and for loops
- Arrays for storing multiple values
- Form handling with $_GET and $_POST superglobals
- Connecting to databases using MySQLi or PDO extensions
The document covers PHP fundamentals and is intended as an introduction for learning the language. It explains core PHP concepts through examples and explanations in a step-by-step manner over 47 sections
This document provides an overview of PHP, its uses, installation, configuration, and basic concepts. It discusses that PHP is a widely used programming language for building dynamic websites. It can be installed along with Apache and MySQL on a server. The document also covers PHP variables, data types, flow control, functions, and how to work with strings and numbers.
This document provides instructions for Lab 4 of an information systems design course. The lab aims to build experience with fundamental PHP functions related to arrays, strings, and regular expressions. Students will modify PHP code snippets to work with multi-dimensional arrays, define and call functions, and perform string operations like searching and replacing text. The lab consists of 4 steps involving PHP code to demonstrate various language features like joining strings, defining functions, and using regular expressions.
Introduction of PHP with all the basic codes and tags. Explanation of all the confusing keywords. PHP forms are also explained along with operators and datatypes.
PHP is a server-side scripting language used for web development. It allows developers to add dynamic content to websites. PHP code is embedded within HTML and executed on the server. Common PHP features include variables, loops, conditional statements, forms, and arrays. Form data can be collected using the $_GET superglobal for GET requests and $_POST for POST requests. PHP arrays can store multiple values and are useful for storing and looping through form data.
PHP is a server-side scripting language commonly used for web development. It allows developers to write scripts that can output dynamic web page content, collect form data, store and retrieve data in databases, and send emails. PHP scripts can be embedded within HTML pages or outputted directly. Key PHP features include variables, conditional statements, loops, functions, and arrays which allow complex tasks to be broken down into simple steps. PHP scripts can connect to databases like MySQL to dynamically display, insert, and update data in databases.
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Muhamad Al Imran
This document provides an introduction to PHP, including an overview of server-side scripting, how PHP code is processed, basic PHP syntax, variables, operators, control structures like conditional statements and loops, and other key PHP concepts. It explains what PHP is, how it is used to create dynamic web content, and some of the basic building blocks needed to get started with PHP programming.
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Muhamad Al Imran
This document provides an introduction to PHP, including an overview of server-side scripting, how PHP code is processed, basic PHP syntax, variables, operators, control structures like conditional statements and loops, and other key PHP concepts. It explains what PHP is, how it is used to create dynamic web content, and some of the basic building blocks needed to get started with PHP programming.
Open Source Package Php Mysql 1228203701094763 9isadorta
PHP and MySQL are open-source technologies commonly used together for building dynamic web applications. PHP is a server-side scripting language designed to integrate with MySQL databases. Key features include using PHP scripts embedded in HTML, variables to store and manipulate data, functions to reuse code, and MySQL functions to connect to databases and execute queries.
The document provides an overview of PHP including:
- PHP is an open source scripting language used for web development. PHP scripts are executed on the server and return HTML to browsers.
- PHP files can contain text, HTML, CSS, JavaScript and PHP code. Common file extensions are .php.
- PHP supports variables, arrays, strings and loops. Arrays can be numeric, associative or multidimensional.
- Functions like include() and require() allow including content from one PHP file into another.
- Control structures like while and do-while loops execute code blocks repeatedly based on conditions.
This document provides a list of 55 common PHP interview questions and their answers. Some key questions covered include: what PHP is and its uses, how to include files, the differences between include and require, how to declare arrays, use echo and print, create MySQL connections and queries, set and retrieve cookies and sessions, and common PHP functions like count(), in_array(), explode(), and trim(). The questions range from basic to more advanced topics and are meant to help candidates prepare for PHP interviews.
PHP: Why PHP and MySQL? Server-side scripting, PHP syntax and variables, comments, types, control structures, branching, looping, termination, functions, passing information with PHP, GET, POST, formatting form variables, superglobal arrays, strings and string functions, regular expressions, arrays, number handling, basic PHP errors/problems
PHP is a server-side scripting language used for web development that allows developers to add dynamic content to websites. It is compatible across platforms and browsers. PHP code is embedded within HTML and executed on the server to generate output that can include HTML, images, and other multimedia. Common PHP features include variables, operators, functions, and file and database access.
PHP is a server-side scripting language used for web development that allows developers to add dynamic content to websites. It is compatible across platforms and browsers. PHP code is embedded within HTML and executed on the server to produce dynamic web pages. Variables, strings, arrays, and other data types can be manipulated to add interactivity and retrieve data from databases on the server-side.
PHP is a server-side scripting language used for web development that allows developers to add dynamic content to websites. It is compatible across platforms and browsers. PHP code is embedded within HTML and executed on the server, with the output sent to the user's browser. Variables, strings, arrays, and other data types can be manipulated to add logic and interact with databases for dynamic content. Files can be created, opened, read from, written to, and closed using PHP functions to manage files and data on the server.
PHP is a server-side scripting language commonly used for web development. It allows developers to add dynamic content and functionality to websites. PHP code is executed on the server and the results are sent to the browser. This document provides an introduction to key PHP concepts like variables, operators, functions, forms, and GET/POST requests.
PHP is a scripting language used for web development that allows developers to write dynamically generated web pages quickly. Key points about PHP include:
- PHP code must be contained within <?php ?> tags or <? ?> shorthand tags
- Files containing PHP code must have a .php extension
- Variables, operators, functions, and other PHP elements allow dynamic content and programming logic
- Functions can take parameters and return values
- Files and sessions allow sharing data across pages
The document provides an introduction to PHP, including:
- PHP is a scripting language originally designed for web pages and runs on most operating systems.
- PHP syntax is quite easy if familiar with C-type languages, and it is designed to output to browsers but can also create CLI apps.
- Variables, constants, naming conventions, data types, and basic control structures like if/else, while loops and foreach loops are discussed.
- Combining PHP with XHTML is covered, recommending using functions and an object-oriented approach.
- User input via forms is mentioned, linking to a resource on processing forms with PHP.
PHP is a server-side scripting language used to build dynamic web applications. It allows developers to add interactivity to websites. Some key points:
- PHP scripts are executed on the server-side and allow generation of dynamic web page content.
- It supports many databases and is compatible with popular web servers like Apache and IIS.
- Basic PHP syntax involves opening and closing <?php ?> tags to embed PHP code in HTML documents.
- Variables, conditional statements, loops and functions allow building complex scripts.
- PHP can retrieve and process form data submitted from HTML forms.
Raish Khanji GTU 8th sem Internship Report.pdfRaishKhanji
This report details the practical experiences gained during an internship at Indo German Tool
Room, Ahmedabad. The internship provided hands-on training in various manufacturing technologies, encompassing both conventional and advanced techniques. Significant emphasis was placed on machining processes, including operation and fundamental
understanding of lathe and milling machines. Furthermore, the internship incorporated
modern welding technology, notably through the application of an Augmented Reality (AR)
simulator, offering a safe and effective environment for skill development. Exposure to
industrial automation was achieved through practical exercises in Programmable Logic Controllers (PLCs) using Siemens TIA software and direct operation of industrial robots
utilizing teach pendants. The principles and practical aspects of Computer Numerical Control
(CNC) technology were also explored. Complementing these manufacturing processes, the
internship included extensive application of SolidWorks software for design and modeling tasks. This comprehensive practical training has provided a foundational understanding of
key aspects of modern manufacturing and design, enhancing the technical proficiency and readiness for future engineering endeavors.
Concept of Problem Solving, Introduction to Algorithms, Characteristics of Algorithms, Introduction to Data Structure, Data Structure Classification (Linear and Non-linear, Static and Dynamic, Persistent and Ephemeral data structures), Time complexity and Space complexity, Asymptotic Notation - The Big-O, Omega and Theta notation, Algorithmic upper bounds, lower bounds, Best, Worst and Average case analysis of an Algorithm, Abstract Data Types (ADT)
☁️ GDG Cloud Munich: Build With AI Workshop - Introduction to Vertex AI! ☁️
Join us for an exciting #BuildWithAi workshop on the 28th of April, 2025 at the Google Office in Munich!
Dive into the world of AI with our "Introduction to Vertex AI" session, presented by Google Cloud expert Randy Gupta.
Passenger car unit (PCU) of a vehicle type depends on vehicular characteristics, stream characteristics, roadway characteristics, environmental factors, climate conditions and control conditions. Keeping in view various factors affecting PCU, a model was developed taking a volume to capacity ratio and percentage share of particular vehicle type as independent parameters. A microscopic traffic simulation model VISSIM has been used in present study for generating traffic flow data which some time very difficult to obtain from field survey. A comparison study was carried out with the purpose of verifying when the adaptive neuro-fuzzy inference system (ANFIS), artificial neural network (ANN) and multiple linear regression (MLR) models are appropriate for prediction of PCUs of different vehicle types. From the results observed that ANFIS model estimates were closer to the corresponding simulated PCU values compared to MLR and ANN models. It is concluded that the ANFIS model showed greater potential in predicting PCUs from v/c ratio and proportional share for all type of vehicles whereas MLR and ANN models did not perform well.
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...Infopitaara
A Boiler Feed Pump (BFP) is a critical component in thermal power plants. It supplies high-pressure water (feedwater) to the boiler, ensuring continuous steam generation.
⚙️ How a Boiler Feed Pump Works
Water Collection:
Feedwater is collected from the deaerator or feedwater tank.
Pressurization:
The pump increases water pressure using multiple impellers/stages in centrifugal types.
Discharge to Boiler:
Pressurized water is then supplied to the boiler drum or economizer section, depending on design.
🌀 Types of Boiler Feed Pumps
Centrifugal Pumps (most common):
Multistage for higher pressure.
Used in large thermal power stations.
Positive Displacement Pumps (less common):
For smaller or specific applications.
Precise flow control but less efficient for large volumes.
🛠️ Key Operations and Controls
Recirculation Line: Protects the pump from overheating at low flow.
Throttle Valve: Regulates flow based on boiler demand.
Control System: Often automated via DCS/PLC for variable load conditions.
Sealing & Cooling Systems: Prevent leakage and maintain pump health.
⚠️ Common BFP Issues
Cavitation due to low NPSH (Net Positive Suction Head).
Seal or bearing failure.
Overheating from improper flow or recirculation.
π0.5: a Vision-Language-Action Model with Open-World GeneralizationNABLAS株式会社
今回の資料「Transfusion / π0 / π0.5」は、画像・言語・アクションを統合するロボット基盤モデルについて紹介しています。
拡散×自己回帰を融合したTransformerをベースに、π0.5ではオープンワールドでの推論・計画も可能に。
This presentation introduces robot foundation models that integrate vision, language, and action.
Built on a Transformer combining diffusion and autoregression, π0.5 enables reasoning and planning in open-world settings.
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfMohamedAbdelkader115
Glad to be one of only 14 members inside Kuwait to hold this credential.
Please check the members inside kuwait from this link:
https://www.rics.org/networking/find-a-member.html?firstname=&lastname=&town=&country=Kuwait&member_grade=(AssocRICS)&expert_witness=&accrediation=&page=1
The Fluke 925 is a vane anemometer, a handheld device designed to measure wind speed, air flow (volume), and temperature. It features a separate sensor and display unit, allowing greater flexibility and ease of use in tight or hard-to-reach spaces. The Fluke 925 is particularly suitable for HVAC (heating, ventilation, and air conditioning) maintenance in both residential and commercial buildings, offering a durable and cost-effective solution for routine airflow diagnostics.
We introduce the Gaussian process (GP) modeling module developed within the UQLab software framework. The novel design of the GP-module aims at providing seamless integration of GP modeling into any uncertainty quantification workflow, as well as a standalone surrogate modeling tool. We first briefly present the key mathematical tools on the basis of GP modeling (a.k.a. Kriging), as well as the associated theoretical and computational framework. We then provide an extensive overview of the available features of the software and demonstrate its flexibility and user-friendliness. Finally, we showcase the usage and the performance of the software on several applications borrowed from different fields of engineering. These include a basic surrogate of a well-known analytical benchmark function; a hierarchical Kriging example applied to wind turbine aero-servo-elastic simulations and a more complex geotechnical example that requires a non-stationary, user-defined correlation function. The GP-module, like the rest of the scientific code that is shipped with UQLab, is open source (BSD license).
The role of the lexical analyzer
Specification of tokens
Finite state machines
From a regular expressions to an NFA
Convert NFA to DFA
Transforming grammars and regular expressions
Transforming automata to grammars
Language for specifying lexical analyzers
introduction to machine learining for beginersJoydebSheet
Ad
Learn php with PSK
1. Learn
PHP
with
PSK
Learn PHP with Prabhjot Singh Kainth.
Prabhjot Singh Kainth is currently pursuing B.E in CSE from Thapar
University Patiala.
H Hostel Thapar University Patiala.
2. PRABHJOT SINGH KAINTH 2
ABOUT THE BOOK
This book is being written by Prabhjot Singh Kainth, currently pursuing
B.E in Computer Science from Thapar University Patiala.
He has written many other books on various languages.
This book is purely his own work, no code have been copied from any
other book/source.
This books doesn`t go in much details of PHP.It will only provide you
information necessary to start developing web pages.
This books comes with a zip file attached which contains some
examples.
Hope you will enjoy his small effort.
You can contact him through following ways:
Email:[email protected]
Facebook:www.facebook.com/prab409069
Mobile: +919814181928
3. PRABHJOT SINGH KAINTH 3
Php stands for Hypertext preprocessor.
It is a server side scripting language (which means all the actions performed by the
script will be processed by server not the client).
Php is basically used to create dynamic websites (websites which return dynamic
data for example: facebook, google, youtube etc.).
You can find various definition and advantages of PHP in lots of books.
What are the data types involved in php?
There are integer, character, string, Boolean and float data type.
There is no such reserved keyword for data type (for ex: we have int for integer,
float for float data type in c/c++).
So how do we differentiate data types?
All data types are stored as variable in php with a $ sign.
Example will make things clear for you ($prab is the name of the variable you can
use anything instead of prab)
$prab=10; //makes it integer type
$prab=”Prabhjot”; //makes it string type
$prab=10.0; //makes it float type
$prab=true; //makes it Boolean type
// is used for comments.
How to print data in php?
You can use print but echo is more often used.
For example:
echo “Prabhjot”;
4. PRABHJOT SINGH KAINTH 4
How to write php scripts?
All php script starts with <?php and ends with ?> as show below.
<?php
//your code
?>
Writing your first php script?
<?php
echo “My name is Prabhjot singh”;
?>
Result:
My name is Prabhjot singh
Now working more with variables:
$a=10;
$b=20;
echo “a”; //will print a not the value of a which is 10.
echo “$a”; // this will print 10 not a.
or simply type echo $a;
“ ” is used to print strings but php takes anything as variable if it starts with $
sign.
A simple program to add 2 numbers:
<?php
$a=10;
$b=20;
$c=$a+$b; //note if you simply use a+b it will return an error (discussed later why)
echo “$c”; or echo $c;
?>
How to concatenate strings with variables (suppose you want to print: Addition of
a and b is 30.how to do this)
For this we have a concatenation operator “.”, dot operator is used to
concatenate strings.
5. PRABHJOT SINGH KAINTH 5
In above example:
echo “Addition of a and b is”. $c ;
// will print: Addition of a and b is 30
You can even concatenate two strings using this operator.
Moving onto loops and decisions:
The syntax remains the same as we have in c/c++ only difference comes is $ sign
for variables. For example:
For loop:
for($i=0;$i<=10;$i++)
{
echo $i;
}
Switch statements:
switch($i)
{
case 1:
echo “one”;
break;
default:
echo “wrong choice”;
break;
}
6. PRABHJOT SINGH KAINTH 6
Moving onto Arrays
There are two types of array in php:
1. Indexed: Simple arrays as we have in c/c++.
2. Associative: This type of array is also referred to as a hash or map. With
associative arrays, each element is referenced by a string index.
You will get to know the difference between them later.
Arrays can be declared in following ways in php:
$arr=array(“apple”,”orange”,”mango”); //indexed array
$arr=array(“name”=>”Prabhjot”,”rollno”=>101203073,”branch”=>”Computer”);
//associative array
How to access elements of array?
echo $arr[0]; // will print apple in case of indexed array
echo $arr[“name”]; // will print Prabhjot .
You can also add items to an array:
$arr[3]=”grapes”;
$arr[0]=”banana”; // note it will replace apple
If you want to print an array whole in once (all the elements without loop),you can
use print_r() function:
For example: print_r($arr); // it will print apple orange mango.
You can use html tags within Php also,this process is known as fusion.
For example:
echo “Prabhjot”.’<br>’.”singh”;
This will print Prabhjot and singh in next line as breakline tag is being used.
echo "prabhjot".'<b>'."singh".'</b>';
This will print Prabhjot and singh in bold letters.
Please note html tags are used with single quote.
7. PRABHJOT SINGH KAINTH 7
Some more functions related to Strings and Arrays
printf() and sprintf() functions:
As we use in c,we can use printf in the same way.
For ex: printf(“Answer is %d”,$i); //where i is an integer type.
You can also specify the precision of a floating point number as we do in c.
For ex: printf(“%0.4f”,123.45678) will result in 123.4567
Now if we want to store result and not to print it,sprint() is used.
$psk=sprintf(file_get_contents(“psk.txt”));
How to count elements of an Array?
Using count function.Suppose name of our array is arr.
$ctr=count($arr);
echo $ctr;
For each loop in array:
$arr= array( “cricket”, “football”, “Tennis”, “Hockey” );
foreach ( $arr as $val )
{
echo $val . “ < br/ > ”;
}
Where $val can be name of any variable.This will print all the elements of array.
Multi dimension array are also there but it is not necessary for web
development right now.
You can sort,merge and push-pop an array by following functions:
sort($arr); //sorting in ascending order for indexed array.
rsort($arr); //sorting in descending order for indexed array.
asort($arr); //sorting in ascending order for associative array.
arsort($arr); //sorting in descending order for associative array.
array_push($arr,”badminton”); // to insert an element at the end of the array.
array_pop($arr); // will pop an item from the end of the array.
array_merge($arr1,$arr2); // will merge two arrays named arr1 and arr2.
8. PRABHJOT SINGH KAINTH 8
RUNNING A PHP PAGE
Before moving on further,we first have to learn how to run php pages.
Since php is a server side scripting language therefore we need a server to run php.
After writing your php script in notepad/any other software you need to save it
with .php extension.For ex: psk.php
But if you will open this directly as you do in case of html pages,nothing will be
processed.
So to process a php page we need servers like apache,IIS etc.
But it’s complicated to configure these servers for an amateur,therefore we will
use a software known as wamp or xampp.
You just need to install any of them.
After installing (I am assuming that you installed xampp),open xampp and you will
see some window like this.
Now click on start corresponding to Apache and MySQL also. That`s it you have
successfully started an Apache server.
9. PRABHJOT SINGH KAINTH 9
Now go to C:xampphtdocs
Place your php files in htdocs folder.As shown below.
Now go to your web browser let’s say google chrome and then type on address bar
localhost and hit enter.You will see your files listed,click on your file and it will be
processed.
Screenshot will make things more clear for you.
10. PRABHJOT SINGH KAINTH 10
Now you have learnt how to run php pages,we will now learn how to work with
html pages in php.
Before moving on please install Adobe Dreamviewer(it’s an application to
write html,php,javascripts).
11. PRABHJOT SINGH KAINTH 11
WORKING WITH HTML FORMS AND PHP
Assuming you have learnt concepts of form in html classes,if not refer to my html
book(Learn Html with PSK).
Let`s suppose you want to create a simple page which gets username and
password from user,if username is Prabhjot and password is 1234 welcome
text is displayed.
Now send.html page:
<html>
<body>
<form action=”receive.php” method=”POST”>
Username:<input type=”text” name=”user”>
<br>
Password:<input type=”password” name=”pass”>
<input type=”submit” value=”login”>
</form>
</body>
</html>
receive.php is the name of the file which contains your php code and
method=”POST” means that username and password will be send to the server via
post method. You can also use GET method instead of POST,but POST is
preferred(you can see the difference between them after this tutorial).
Now receive.php :
<?php
$use=$_POST[‘user’];
$pas=$_POST[‘pass’];
if($use==”Prabhjot” && $pass=1234)
{
echo “welcome user”;
}
else
{
echo “login failed”;
}
?>
12. PRABHJOT SINGH KAINTH 12
Understanding the php code written above.
$use and $pas are the names of the variables (it could be anything you want).
$_POST: it’s a syntax you have to use this when catching values from different
pages.
$_POST[‘user’]: ‘user’ is the name of the input field in our send.html page.
You can also use $_GET[‘user’] if you have used method=”GET” in send.html page.
Now save both of these files into your c:xampphtdocs folder.
Run send.html page and then see the results.
DIFFERENCE BETWEN POST AND GET METHOD
• The GET method sends the encoded user information appended to the
page request. The page and the encoded information are separated by the
? character as follows:
• http://www.psk.com?user=prabhjot&pass=1234
• The GET method is the defualt method to pass information from browser
to web server and it produces a long string that appears in your browser's
address bare. Never use the GET method if you have password or other
sensitive information to pass to the server. The GET method has size
limtations,only 1024 characters can be in a request string.
• A generally more reliable method of passing information to a backend
program is the POST method.
• This packages the information in exactly the same way as GET methods,
but instead of sending it as a text string after a ? in the URL it sends it as a
separate message.
• This message comes to the backend program in the form of the standard
input which you can parse and use for your processing.
• No characters limitations.
• Provides more security than GET method.
13. PRABHJOT SINGH KAINTH 13
How to upload a file in html form using PHP
First of all we need two files upload.html and uploaded.php(names can be any)
Upload.html
<html>
<body>
<form action=”uploaded.php” method=”POST” enctype=”multipart/form-data”>
Upload file<input type=”file” name=”psk”>
<input type=”submit” value=”upload”>
</form>
</body>
</html>
What is enctype=”multipart/form-data”?
This attribute ensures that the form data is encoded as mulitpart MIME data, the
same format that is used for encoding file attachments in email messages , which
is required for uploading binary data such as files.
Uploaded.php
<?php
$filename=$_FILES[‘psk’][‘name’];
move_uploaded_file($_FILES['psk']['tmp_name'],”uploads/psk”);
echo “file”.$filename.”uploaded successfully”;
?>
Understanding the code:
$filename is a variable which is used to store the name of the file.
$FILES[‘psk’][‘name’] is used because we have name of the input field as psk in
upload.html page and ‘name’ is used because we have used name attribute(if we
have used id attribute then $FILES[‘psk’][‘id’]).
How to redirect to another page in PHP?
You can use header .For ex:
header(‘location:www.google.com’);
14. PRABHJOT SINGH KAINTH 14
WORKING WITH QUERY STRINGS IN PHP
Suppose I want to pass an information from one page to another,this is done by
query string as you might be knowing.
send.php:
<?php
$user=”Prabhjot”;
header(‘location:receive.php?username=$user’);
?>
url will be something like this receive.php?username=Prabhjot
receive.php:
<?php
$username=$_GET[‘username’];
?>
$_GET[‘username’] is used because we have used username as the name attribute
in the url(see above).
Query strings are always caught by GET/REQUEST method not POST method.
15. PRABHJOT SINGH KAINTH 15
WORKING WITH COOKIES IN PHP
How to create a cookie?
By using following:
setcookie(name,value,expires,path,domain,secure,HttpOnly);
name:name of the cookie
value:value of the cookie if any
expires:the time after which the cookie should get expire
path: The path that the browser should send the cookie back to.
domain: By default, a browser only sends a cookie back to the exact computer that
sent it.But if you want any other computer to receive a cookie back.
Secure:This ensures that the cookie will only be sent if there is a secure
connections that is https connection
HttpOnly:Cookies will only be used by browser which makes request via HTTP
For example:
setcookie(“psk”,0,time()+60*60*2,”/data”,”www.psk.com”,false,true);
Please note time is in milliseconds.
How to access cookies?
It`s very simple.
echo $_COOKIE[“psk”];
If you want to display welcome message only if cookie psk is running.
<?php
$cook=$_COOKIE[“psk”];
if($cook)
{
echo “welcome user”.$cook;
}
?>
16. PRABHJOT SINGH KAINTH 16
WORKING WITH SESSIONS IN PHP
How to create a session?
By using session_start();
How to write and read sessions?
$_SESSION[‘name of the session’]=value of the session; // writing session
echo $_SESSION[‘name of the session’]; // reading session
For example:
<?php
session_start();
$_SESSION[‘psk’]=”Prabhjot”;
echo $_SESSION[‘psk’];
?>
How to destroy a session?
By using session_destroy();
For example:
If session psk is Prabhjot redirect to www.google.com, if it is prakhar redirect to
www.facebook.com.
<?php
session_start();
$sess=$_SESSION[‘psk’];
if(sess==”Prabhjot”)
{
header(‘location:www.google.com’);
}
if(sess==”prakhar”)
{
header(‘location:www.facebook.com’);
}
?>
17. PRABHJOT SINGH KAINTH 17
WORKING WITH FILES AND DIRECTORIES IN PHP
file_exists(“c:/psk.txt”); // this will return true if the file exists else false.
filesize(“/home/psk.txt”); // will return the size of the file.
How to get the name of the file?
$filename=basename(“/home/psk.txt”);
How to open files in php?
$handle=fopen(“path of the file”,”permission”);
$handle is a resource data type that is associated with file open.
Permission means the rights on the file whether we have open that file for
reading or writing purpose.
For ex:
$handle=fopen(“/home/psk.txt”,”r”); //means psk.txt is opened only for reading
purpose.
$handle=fopen(“/home/psk.txt”,”w”); //means psk.txt is opened only for writing
purpose.
If we use a then it means file is opened only for appending purpose.
How to close files in php?
fclose($handle);
How to read and write from file in php?
By following functions:
fread() — Reads a string of characters from a file
fwrite() — Writes a string of characters to a file
fgetc() — Reads a single character at a time
feof() — Checks to see if the end of the file has been reached
fgets() — Reads a single line at a time
file() — Reads an entire file into an array
Examples on next page.
18. PRABHJOT SINGH KAINTH 18
$handle=fopen(“psk.txt”,”r”);
$ans=fread($handle,5); // this will read only first 5 characters of the file
$handle=fopen(“psk.txt”,”w”);
fwrite($handle,”Prabhjot”); // this will write Prabhjot at the end of the file.
fwrite($handle,”Prabhjot”,5); // this will write only first 5 characters of Prabhjot at
the end of the file.
How to change permissions of file in php?
By using chmod(path of the file,permission);
For ex: chmod(“/home/psk.txt”,0166);
0166 is basically UNIX based permission granting technique you can learn this
from google.
How to copy,rename or delete files in php?
copy(source,destination);
Ex:copy(“/home/psk.txt”,”/download/ps.txt”);
rename(oldname,newname);
Ex:rename(“/home/psk.txt”,”/home/prab.txt”);
unlink() function is used to delete files in php.
Ex:unlink(“/home/psk.txt”);
WORKING WITH DIRECTORIES
Same as file are opened or close,only difference instead of fopen or fclose use
opendir or closedir.
For ex: $handle=opendir(“/home/download”);
closedir($handle);
$file=readdir($handle); // will read contents of the directory.
How to create or delete directory?
mkdir(“/home/download/psk”); //will create psk folder
rmdir(“/home/download/psk”); //will remove psk folder
19. PRABHJOT SINGH KAINTH 19
WORKING WITH MYSQL IN PHP
This is the most important topic of this book.
Before starting we must first set up a MYSQL server to handle sql queries.
Remember when we were setting up Apache server,we clicked on MYSQL start if
not then go back to xampp control panel and click on start corresponding to
MySQL.
After doing this step go to your browser and type localhost/phpmyadmin and a
window something like this will open.
Now from left hand side click on new to create a new database(Assuming the
name of the database is psk).
Then click on psk database from the list and then create a table named as
details.
Then create two columns one username and another password with varchar
datatype.( I am assuming that you know some basic concepts of sql if not
then refer to my book Learn simple MySQL with psk)
Screenshots will help you don`t worry.
21. PRABHJOT SINGH KAINTH 21
After setting up the server our next task is to link php with Mysql.
For this in our php code we need to include following things.
<?php
$con=mysql_connect('servername','username','password');
mysql_select_db('databasename',$con);
?>
$con is the name of the variable (you can use any of your choice).
mysql_connect is a syntax use to connect to Mysql.
servername is the name of the server,in our case localhost.
Username is the username for accessing the server by default it is root
Password: by default empty.
Mysql_select_db is use to select database.
So this is how our connection will look like:
$con=mysql_connect(‘localhost’,’root’,’’);
mysql_select_db(‘psk’,$con);
WORKING WITH QUERIES(Please note name of our table is details)
SELECT QUERY:
mysql_query(“select * from details”,$con);
It`s better to store this in a variable(usually $data is used but you can use any) as
data which is returned by select query come in form of an array.
$data= mysql_query(“select * from details”,$con);
Take another variable to fetch data in array form usually $row is used.
$row=mysql_fetch_array($data);
Now to print data:
echo $row[‘name of the column’];
for ex:we have 2 columns in our details table,namely username and password
echo $row[‘username’]; //will only print first entry in the table not all values.
22. PRABHJOT SINGH KAINTH 22
So how to print all data returned by select query?
Simply use a loop as we do in c/c++.
For example:
while($row=mysql_fetch_array($data)
{
echo $row[‘username’];
}
INSERT QUERY:
mysql_query(“insert into `details` (`username`,`password`)
values(‘prab40’,’1234’)”,$con);
UPDATE QUERY:
mysql_query(“update `details` set `username`=‘prab40’ `password`=’1234’
”,$con);
Please note: ` ` is different from ‘ ‘
DELETE QUERY:
mysql_query(“delete from `details` where `username`=’prab40’ “,$con);
Next page will show you how to create a login page and check if username exists
in the database or not,if username and password are correct then create a
session named id of username and then redirect to home.html page else return
login details wrong.
24. PRABHJOT SINGH KAINTH 24
Now if suppose you have 50 pages in your website which uses sql
connection,every time you have to write connection code but we can reduce
our job by creating a separate file which only have connection code and then
include that in every page.
For example:
lib.php
<?php
$con=mysql_connect(‘localhost’,’root’,’’);
mysql_select_db(‘psk’,$con);
?>
Now to use this page in another page,we have to use include function as we
have in c/c++ but with some changes.
For example in login.php I have to use lib.php
Login.php
<?php
include(‘lib.php’);
?>
25. PRABHJOT SINGH KAINTH 25
SOME MORE FUNCTIONS, ATTRIBUTES AND THINGS
RELATED TO PHP
How to print current date and time?
$dat=getdate();
echo $dat[“mday”].$dat[“month”].$dat[“year”];
echo $dat[“hours”].$dat[“minutes”];
How to get IP address of your website visitor?
echo “Your IP address is: “ . $_SERVER[“REMOTE_ADDR”];
How to create a random number/text?
$psk=rand(1,10);
echo $psk.$psk.$psk; //will generate a 3 digit number(concatenate more if you
want more digits)
$psk='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$text= $psk[rand(0,25)].$psk[rand(0,25)]; //will generate text of 2 characters.
How to mail in php?
mail(“destination address”,”subject”,”message”);
example:mail(“[email protected]”,”application”,”hi”);
26. PRABHJOT SINGH KAINTH 26
WORKING ON SECURITY IN PHP
First of all we will learn how to protect our website from vulnerability and then
encryption and decryption also.Since our password,username,session id or any
other sensitive data must be protected from unauthorized access therefore we
will implementing some methods to protect our website from getting hacked.
When we were creating session in above lessons,we were giving session value as
username.If someone somehow knows your username he can easily get access to
your website.
So to remove such vulnerabilities we should use some random session id
using random function.
For example:
$sess=rand(10,10000);
$_SESSION[‘login’]=$sess;
Always have validations on input fields,never allow any script to be as input.
For example: In an input field someone input something as:
<script>alert(“Website Hacked by Me”);</script>
You can make use of regular expression in javascript to remove such inputs from
being getting processed.This attack is well known as XSS attacks.
Some ways to remove XSS attacks:
Data Validation:To validate data
For example:to validate a phone number in php
if(preg_match(‘/^((1-)?d{3}-)d{3}-d{4}$/’,$phone))
{
echo $phone.”is correct”;
}
27. PRABHJOT SINGH KAINTH 27
Data Sanitization:To remove unwanted data
For example:If your input field should have only text nothing else then:
$ans=strip_tags($_POST[‘name’]);
Output escaping:To prevent browser from applying any unintended meaning to
any special sequence of characters that may be found.
For example:
echo “You queried for”. Htmlspecialchars($_GET[‘nm’]);
Now to prevent SQL injection attacks:
SQL injection attacks can be prevented by using prepared statements.
What are prepared statements?
Prepared Statements do not combine variables with SQL strings,so it is not
possible for an attacker to modify the SQL query.
They combine the variables with compiled statement which means that SQL
query and variables are sent separately.
For example:
$user=$_GET[‘username’];
if($stmt=$mysqli->prepare(“select password from user where username=?”))
{
$stmt->bind_param(“s”,$user);
$stmt->execute();
$stmt->bind_result($password);
$stmt->fetch();
echo $password;
}
28. PRABHJOT SINGH KAINTH 28
SOME ENCRYTION AND DECRYPTION TECHNIQUES
MD5 hash:Message Digest Hash
md5() function is used to calculate md5 hash of string.
Syntax:md5(string,raw);
String:your text.
Raw:specifies hex or binary output form(true for binary and false for hex)
For example:
$psk=”Prabhjot”;
echo md5($psk);
SHA1:Secured Hash Algorithm
sha1() function is used to calculate sha hash of string.
Syntax:sha1(string,raw);
String:your text.
Raw:specifies hex or binary output form(true for binary and false for hex)
For example:
$psk=”Prabhjot”;
echo sha1($psk);
29. PRABHJOT SINGH KAINTH 29
EXAMPLE TO ADD ENCRYPTION AND DECRYPTION(source php website)
<?php
# --- ENCRYPTION ---
# the key should be random binary, use scrypt, bcrypt or PBKDF2 to
# convert a string into a key
# key is specified using hexadecimal
$key = pack('H*',
"bcb04b7e103a0cd8b54763051cef08bc55abe029fdebae5e1d417e2ffb2a00a3")
;
# show key size use either 16, 24 or 32 byte keys for AES-128, 192
# and 256 respectively
$key_size = strlen($key);
echo "Key size: " . $key_size . "n";
$plaintext = "This string was AES-256 / CBC / ZeroBytePadding encrypted.";
# create a random IV to use with CBC encoding
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128,
MCRYPT_MODE_CBC);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
# creates a cipher text compatible with AES (Rijndael block size = 128)
# to keep the text confidential
# only suitable for encoded input that never ends with value 00h
# (because of default zero padding)
$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key,
$plaintext, MCRYPT_MODE_CBC, $iv);
# prepend the IV for it to be available for decryption
$ciphertext = $iv . $ciphertext;
# encode the resulting cipher text so it can be represented by a string
$ciphertext_base64 = base64_encode($ciphertext);
echo $ciphertext_base64 . "n";
# Resulting cipher text has no integrity or authenticity added
# and is not protected against padding oracle attacks.
30. PRABHJOT SINGH KAINTH 30
# --- DECRYPTION ---
$ciphertext_dec = base64_decode($ciphertext_base64);
# retrieves the IV, iv_size should be created using mcrypt_get_iv_size()
$iv_dec = substr($ciphertext_dec, 0, $iv_size);
# retrieves the cipher text (everything except the $iv_size in the front)
$ciphertext_dec = substr($ciphertext_dec, $iv_size);
# may remove 00h valued characters from end of plain text
$plaintext_dec = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key,
$ciphertext_dec, MCRYPT_MODE_CBC, $iv_dec);
echo $plaintext_dec . "n";
?>
32. PRABHJOT SINGH KAINTH 32
TEXT TO SPEECH CONVERSION USING GOOGLE TRANSLATE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"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=utf-8" />
<title>Text to speech APi</title>
<?php
if($_POST){
$text=substr($_POST['ps'],0,100);
$text=urlencode($text);
$file='psk';
$file=$file.".mp3";
$mp3=file_get_contents("http://translate.google.com/translate_tts?tl=en&q=$te
xt");
file_put_contents($file,$mp3);
}
?>
</head>
<body>
<form action="" method="post">
Enter your text here
<input type="text" name="ps" /><br />
<input type="submit" name="submit" />
<br />
</form>
<br />
<?php if($_POST)
{?>
<audio controls="controls" autoplay="autoplay">
<source src="<?php echo $file;?>" type="audio/mp3" />
</audio>
<?php } ?>
</body>
</html>
33. PRABHJOT SINGH KAINTH 33
ATTACHED ZIP INCLUDES FOLLOWING THINGS
• Webkiosk(Student Information Management website of Thapar
university created by Prabhjot Singh Kainth)
• FaceMash(FaceMash website which was originally created by
Mark Zuckerberg to rate people)
• CAPTCHA implementation in php by Prabhjot Singh Kainth
• Online T-shirt ordering system
• A love calculator website(please note it may be funny but do have
a look on the algorithm used)
• Text to Speech Conversion using google translation by Prabhjot
Singh Kainth
• A facebook home page look like which changes according to your
device size by Prabhjot Singh Kainth
• Music website which plays songs according to the selected mood
by Prabhjot Singh Kainth
*by Prabhjot Singh Kainth means this is original work by him rest
means he has edited the code of some other person.