Introduction to PHP and MySQL

Introduction To PHP And MySQL-ppt Download

  • Date:08 Dec 2020
  • Views:11
  • Downloads:0
  • Size:193.50 KB

Share Presentation : Introduction To PHP And MySQL

Download and Preview : Introduction To PHP And MySQL

Report CopyRight/DMCA Form For : Introduction To PHP And MySQL


Transcription:

Introduction to PHP andPostgreSQLCSC 436 Fall 2008Slides based on PHP manual Getting Started fromhttp www php net tut php.
PHP OverviewIntroductionInstallationPostgreSQL with PHPExtended example.
IntroductionPHP recursive acronym for PHP HypertextPreprocessor widely used Open Source general purpose scripting especially suited for Web development.
can be embedded into HTML title Example title php echo Hi I m a PHP script See this example here What can PHP do .
Server side scripting most traditional and main target field need three things to make this work PHP parser CGI or server module webserver with connected PHP installation.
web browserCommand line scripting PHP script to run it without any server or browser need the PHP parser to use it this wayWriting client side GUI applications.
not the best language to write windowing applications use PHP GTK to write such programsWhat do I need Your first PHP enabled pageSomething Useful.
Dealing with FormsWhat s next What do I need Assume that your server has support for PHPactivated and that all files ending in php are.
handled by PHPCreate your php files and put them in yourweb directory and the server will magicallyparse them for youNo need to compile anything.
Develop locally install a web server such as Apache install PHP install a database as well such as PostgreSQL First PHP enabled page.
Create a file named hello phpPut it in your web servers directory title PHP Test title php echo p Hello World p Use your browser to access the file.
Something usefulcheck what sort of browser the person viewing the page is check the user agent string that the browser sends as part of itsHTTP request stored in a variable.
always start with a dollar sign in PHP SERVER HTTP USER AGENT SERVER is a special reserved PHP variable that contains all webserver information title PHP Test title .
php echo SERVER HTTP USER AGENT html see this file VariablesVariables represented by a dollar sign followedby the name of the variable.
name is case sensitive name starts with a letter or underscore followed byany number of letters numbers or underscores type is assigned by value var Bob .
Var Joe echo var Var outputs Bob Joe x abc type can change if value changes 4site not yet invalid starts with a number 4site not yet valid starts with an underscore.
created by the array language takes a certain number of comma separated key value pairs arr array foo bar 12 true echo arr foo bar.
echo arr 12 1 see it here Arrays cont php Create a simple array array array 1 2 3 4 5 .
print r array Now delete every item but leave the array itself intact foreach array as i value unset array i print r array .
Append an item note that the new key is 5 instead of 0 as you might expect array 6 print r array Re index .
array array values array array 7 print r array see result here Dealing with forms.
HTML Forms GET and POST form is submitted to a PHP script information from that form isautomatically made available to the forms php.
form action foo php method POST Name input type text name username br Email input type text name email br input type submit name submit value Submit me .
Forms foo php php Available since PHP 4 1 0print POST username print REQUEST username import request variables p p .
print p username Available since PHP 3 As of PHP 5 0 0 these long predefined variables can be disabled with the register long arrays directive print HTTP POST VARS username .
Available if the PHP directive register globals on As of PHP 4 2 0 the default value of register globals off Using relying on this method is not preferred print username see result here .
Another forms exampleinfo form php form action show answers php method POST Your name input type text name name Your age input type text name age .
input type submit show answers php php echo POST name You are php echo POST age years old see results here .
InstallationPHP is installed on the Linuxservers in the CSC departmentYou can install it on your ownmachine if you want.
Refer to the PHP manual forinstructions on installationhttp www php net manual en ins... PosgreSQL with PHPAssume the following database table and data .
CREATE TABLE employees id tinyint 4 DEFAULT 0 NOT NULL AUTO INCREMENT first varchar 20 last varchar 20 address varchar 255 .
position varchar 50 PRIMARY KEY id UNIQUE id id INSERT INTO employees VALUES 1 Bob Smith 128 Here St Cityname .
Marketing Manager INSERT INTO employees VALUES 2 John Roberts 45 There St Townville Telephonist INSERT INTO employees VALUES.
3 Brad Johnson 1 34 Nowhere Blvd Snowston Doorman PostgreSQL Example db pg connect dbname sam user sam password iam or die Couldn t Connect pg last error db .
query SELECT FROM employees result pg query db query die Error in query query pg last error db rows pg num rows result if rows 0 .
for i 0 i rows i my row pg fetch array result i PGSQL ASSOC printf First Name s my row first printf Last Name s my row last printf Address s my row address .
printf Position s my row position printf n pg close db Extended Example ToyToy Catalog as described in class.
Assume database tables createdAssume data inserted into dataStart with html form pageTitle: Introduction to PHP and MySQL Author: Lisa Dipippo Last modified by: Lisa DiPippo Created Date: 10/21/2003 8:11:01 PM Document presentation format

Related Presentations

PHP and MySQL

Title: PHP and MySQL Author: Fred R. McClurg, [email protected] Last modified by: McClurg, Fred R Created Date: 1/1/1601 12:00:00 AM Document presentation format

11 Views0 Downloads

PHP MYSQL And IIS

Arial Wingdings Default Design Slide 1 Plan of talk Introduction Definitions Slide 5 Slide 6 Major Components Web Based Application Application examples Advantages On-line Exam Advantages Online Exam Tools required Slide 14 Slide 15 Advantages of Open Source Slide 17 Examples Slide 19 Slide 20 Example: SPEC Slide 22 Conclusion Thank you

9 Views0 Downloads

Secure PHP and MySQL LISUG

Disclaimer. This presentation does NOT cover risks involved with websites that accept financial payments. Recommendation: Integrate PayPal’s (or similar) shopping cart and payment services into your website to avoid having sensitive (and regulated) customer financial data on your website

4 Views0 Downloads

Databases MySQL and PHP

17 Databases, MySQL, and PHP Mapping in the Cloud Peterson The Social Network The first thing we're gonna need is a lot of pictures. Unfortunately, Harvard doesn't keep a public centralized facebook so I'm going to have to get all the images from the individual houses that people are in.

3 Views0 Downloads

Implementation of an interactive database interface utilizing HTML5 PHP and MySQL in support of water quality assessments in the Northeastern North Carolina Pasquotank Watershed

PHP. MySQL. XML. JavaScript. PHP. INTRODUCTION: PHP, or PHP Hypertext Preprocessor, is an open source scripting language that is tailored for use in website development and can be included within HTML. It is similar to asking the server a math question and receiving the answer in return without the server revealing how the answer was reached.

6 Views0 Downloads

Presentaci n PHP amp MySQL

(cont.) Fortalezas de MySQL Fortalezas de MySQL (cont.) Decisiones a tomar cuando se va a construir un e-commerce site Estadísticas sobre servidores Web marzo 2008 Estadísticas sobre servidores Web marzo 2008 (cont.) Ejemplo sencillo de cómo utilizar XHTML y PHP - 1 Ejemplo sencillo de cómo utilizar XHTML y PHP - 2 Forma creada por el ...

13 Views0 Downloads

Desarrollo de sitios web con PHP y MySQL

con PHP y MySQL Tema 4: Acceso a bases de datos MySQL en PHP José Mariano González Romano [email protected]

7 Views0 Downloads

PHP MySQL

PHP - MySQL Pemrograman Berorientasi Platform (IN315B) Ramos Somya, S.Kom., M.Cs. Pengenalan PHPMyAdmin Create database Isikan dengan nama database yang ingin anda create Create database Create tabel Buat tabel baru dengan Nama: biodata Field: 3 Set field name & atribute Isikan field, jenis dan ukuran sesuai gambar Klik simpan Pengisian data pada tabel Klik sisipkan, isikan nama dan alamat ...

6 Views0 Downloads

Apache PHP MySQL

Apache. PHP. MySQL. 介紹與安裝設定. NIT101115 戴琬諭. NIT101112 林佳保

6 Views0 Downloads

PHP MYSQL

Tổngquanvề MySQL. MySQL là một trong những hệ cơ sở dữ liệu quan hệ phổ biến đang được sử dụng trên Web.Nó có sẵn miễn phí và dễ cài đặt. Ưu. điểm. của. MySQL database server. Dễ sử dụng, mạnh mẽ, nhanh chóng, an toàn và có thể mở rộng.

4 Views0 Downloads

PHP MySQL Tricks Techniques

Lecture Series – PHP & MySQL for RPG Programmers. Certifications. IBM Power – i Sales Specialist. IBM Power – iTechnical Support. IBM Power – AIX & LINUX Sales Specialist. Vision Solutions – MIMIX Sales. Questions. 631-738-0500 x119, office. 516-458-3080, cell

6 Views0 Downloads

PHP V MySQL

PHP VI Adatbázisok, MySQL phpMyAdmin phpMyAdmin - Adatbázisok phpMyAdmin - Tábák phpMyAdmin - Táblák Hozzuk létre a ‘Persons’ táblát, 2 mezővel: id (bigint, not null, auto_increment, primary) name (varchar 255, not null, unique) phpMyAdmin - Táblák Hozzuk létre a ‘Currency’ táblát! create table currency ( id bigint not null auto_increment, name varchar(255) not null ...

11 Views0 Downloads