- I need to make sure you guys are in the smooth progress on your shopping cart
- form -> php
- form -> post & get -> php
- form -> ajax / jQuery post or get -> php
- Then we'll be looking into checkout process : payment & shipping, paypal sandbox.
- MVC, maybe?
- CMS, maybe?
- Overall Quiz on what we've learned this 2 months
- Feedback, Q&A
Search This Blog
Sunday, July 29, 2012
Day 36 - 40 : Project Finishing & Assessment
This would be your final week. You should be on your final steps on your project. A few things will be on this week's list:
Sunday, July 22, 2012
PayPal Web Service
- Web Services are application interfaces made available via the World Wide Web; in oo terms, it can be seen as a class that exposes its public methods via the web.
- You may continue with the paypal web service when your e-commerce project on the final stage. Which mean the stage of getting the user to submit payment.
- Getting start with Paypal sandbox
- getting start with paypal api
- Paypal X integration
- download NVP sample code
- Integration Wizard - Express Checkout
- getting started with Express Checkout
Day 31 - 35 : Shopping Cart
Day 31 - 35
- [txtbk Chapter 28] Building a Shopping Cart
- Php MySQL Shopping Cart Tutorial <= self exploration
- This final 2 weeks would be more time spending on your project; you may voice out any question or if you wish any topics to have further explanation.
- For those that haven't start anything on the project, or want to try something other that e-commerce, you may suggest to me what you have on mind, orget some idea from here:
- Mail editing and sending system(with PHP)Project description : Please create a system to send email asynchronously about 100,000. you may consider PEAR or other frameworkThe system also needs to be able to edit the HTML mail.
- Tourist SiteA site similar to http://www.visitmaine.com/structure and functionality of http://www.visitmaine.com/Graphic Design similar to http://www.colombia.travel/en/Using latest versions of PHP and Joomla.Bilingual skeleton for English and (Chinese/Arab/Malay/Tamil/Spanish). Leave frame for third language in future.Easy to mantain for Website Manager.Easy to customize content and images for staff writers.SEO friendly.Crossbrowser compatibility. IExplorer, Firefox, Chrome, Safari
- To-Do Task List Cloud OfferingDescription: build a To-Do task list service offered through the cloud.We'd like service providers to provide effort and cost estimates for providing design and development services for this service.High level functional requirements include:1. Sign in via Facebook2. Create a task3. Create a note4. Create a “group” of tasks5. Assign other individuals to a group6. Assign other individual to a task7. Change the status of a task8. Select a due date for a task9. Create dependencies between tasksSimilar websites that we like are the following. Functionality will be similar to these:http://www.rememberthemilk.com
Saturday, July 14, 2012
Day 26 - 30 : Accessing MySQL db from the Web with PHP, Authentication
Day 26: [txtbk Chapter 11] connect and process database access: select, insert
- $db = new mysqli(...);
- check bd connection error? mysqli_connect_errno()
- connection ok, $db->real_escape_string()
- $db->query(); ex: $result = $db->query()
- if the query "SELECT", $result->num_rows;
- if "UPDATE / INSERT", $db->affected_rows;
- make a loop to retrieve data from db [for / while] 0 to num_rows-1
- $row = $result->fetch_assoc();
- get the db data ex: $row['id'], $row['name']
- $result->free();
- $db->close();
Day 27:
- update
- encryption, date & time Function in MySQL
- prevent SQL injection : preparedStatement
- bind_param variables -i, d, s, b
- $db = new mysqli(...);
- check bd connection error? mysqli_connect_errno()
- ex: $query = "select name from books where isbn=?"; //value replace to ? in query
- $db->prepare(); ex: $stmt = $db->prepare($query);
- $stmt->bind_param('s', $isbn); //if 1 ? then, parameter type 's' refer to its type, and the $isbn refer to the value of the ?
- if the query "SELECT", $stmt->bind_result($name);
- $stmt->execute();
- if the query "SELECT", $stmt->store_result();
- if the query "SELECT", $stmt->num_rows;
- if "UPDATE / INSERT", $stmt->affected_rows;
- make a loop to retrieve data from db using while : $stmt->fetch()
- get the db data ex: $name // as what the parameter we keep for bind_result
- $stmt->free_result();
- $stmt->close();
- $db->close();
Day 28:
- [txtbk Chapter 17] Implement Authentication with PHP & MySQL
- [txtbk Chapter 23] Using Session Control
Day 29:
- [txtbk Chapter 27] Building User Authentication and Personalization
- ispell dictionary ->select English -> download collection of word
lists for spell-checking
download Ispell English Word Lists .zip
- [txtbk Chapter 34] Web 2.0 Applications with Ajax
- step to change chapter 27 codes to be ajax :--
- insert new_ss.css and new_ajax.js to project chapter27
- amend function display_add_bm_form() in output_fns.php
- amend do_html_header() in output_fns.php
- link external js and css
- modify add_bms.php
- remove --- do_html_header('Adding bookmarks');
- remove --- display_user_menu();
- remove --- do_html_footer();
- remove --- check_valid_user();
- remove --- try block and exception handling to something make sense in ajax environment
- add else(s)
- modify url_fns.php
- in function add_bm() : throw change to echo(s); add else; remove --- return true;
Day 30:
- [txtbk Chapter 28] Building a Shopping Cart
Friday, July 13, 2012
MySQL Quiz
- create a database "MyDatabase"
- create a table "MyTable", with 4 fields[id, name, password,dateCreated]
- delete data from "MyTable" which have name begin with 'A'
- insert 3 rows of data with this information:
- name:Ali, Johan, Frankie; password: ali123, johan123, frankie123
- update data from "MyTable", change the name to "Ali Adam", "Johan Harry", "Frankie Tom"
- empty the table / delete all data from "MyTable"
- Sort "MyTable" in descending order according to "name" field
- add a new field "age" to "MyTable"
- remove "MyTable" from "MyDatabase"
- u have 2 tables user(id, name, password), and activity(id, userid, activityName)
join these 2 table and show the data of user's name and his activity.
Friday, July 6, 2012
Day 21 - 25: MySQL
Day 21: Relational Database Concepts
- Database intro
- Tables, Columns, Rows, Values, Keys, Schemas
- Relationship: 1-1, 1-many, many-many
- database diagram, database dictionary
- database fundamentals
- mySQL monitor : c:\xampp\mysql\bin -> mysql.exe -u root [-p]
- create database, drop
- php connect to mySQL DB
- mySQL Administration DCL: create user, grant ... to, revoke ... from, privileges
- Storage Engines/Table Type : myisam, innodb
- Data Types :
- numeric - tinyint(bool), int
- float - float(m,d, double)
- date & time: date, time, datetime, timestamp
- string: char(fix length char), varchar; text, blob[binary large object:example-image]
- DDL: create, alter, drop table
Day 22-23:
- DML: insert, update, delete
- DQL: select ... where
- indexing
- keyword:
- null, not null, auto_increment, unsigned(int)
- distinct, order by asc|desc, limit
- operator:
- =, >, <, >=, <=, !=,
- is null, is not null, between, in, not in, like("%"), not like, regexp
- join type: union, inner join, left join
- grouping & aggregating
- group by... having
- avg(), count(), min(), max(), sum()
- subqueries: any, in , some, all
Day 24-25:
- mySQL functions
- mySQL tips
- foreign keys(pg315) in innoDB: references tablename(colname)
- stored Procedure & Cursors
Thursday, July 5, 2012
Day 19 : Quickform2 tutorial
// Load the main class
require_once 'HTML/QuickForm2.php';
// Instantiate the HTML_QuickForm2 object
$form = new HTML_QuickForm2('tutorial');
// Set defaults for the form elements
$form->addDataSource(new HTML_QuickForm2_DataSource_Array(array(
'name' => 'Joe User',
'Gender' => '1',
'status' =>'1'
)));
// Add some elements to the form
$fieldset = $form->addElement('fieldset')->setLabel('QuickForm2 tutorial example');
$name = $fieldset->addElement('text', 'name', array('size' => 50, 'maxlength' => 255))
->setLabel('Your name:');
$email = $fieldset->addElement('text', 'email', array('size' => 50, 'maxlength' => 255))
->setLabel('Your Email:');
$gender1= $fieldset->addElement('radio', 'gender[]', array('value' => 1),
array('content' => 'male', 'label' => 'male'));
$gender2= $fieldset->addElement('radio', 'gender[]', array('value' => 2),
array('content' => 'female', 'label' => 'female'));
$options = array('KL','Melaka','Sabah', 'Srwk');
$location= $fieldset->addElement('select', 'location', array('multiple' => 'multiple', 'size' => 4),
array('options' => $options, 'label' => 'Multiple select Location:'));
$status1= $fieldset->addElement('checkbox', 'status[]', array('value' => 1),
array('content' => 'single'));
$status2= $fieldset->addElement('checkbox', 'status[]', array('value' => 2),
array('content' => 'married'));
$fieldset->addElement('submit', null, array('value' => 'Send!'));
// Define filters and validation rules
$name->addFilter('trim');
$name->addRule('required', 'Please enter your name');
$email->addFilter('trim');
$email->addRule('required', 'Please enter your email');
$email->addRule('regex', 'valid email address please','/^(\w+[\-\.])*\w+@(\w+\.)+[A-Za-z]+$/');
// Try to validate a form
if ($form->validate()) {
echo '<h1>Hello, ' . htmlspecialchars($name->getValue()) . '!</h1>';
//echo "<br/>".$email->getValue()."<br/>";
//var_dump($form->getValue());
//echo "<br/>".$form->getValue('name')."<br/>";
//echo "<br/>".$form['status']->getValue()."<br/>";
$post = $form->getValue();
//var_dump($post);
//var_dump($location->getValue();
var_dump($post['status']);
exit;
}
// Output the form
echo $form;
Wednesday, July 4, 2012
Subscribe to:
Posts (Atom)