Saturday, June 9, 2012

ITC280 Update 10


What I learned in Week 10 of the ITC280 Class:

1) Here is how we create a session variable in PHP

if(!isset($_SESSION)){session_start();}


$sCustomerID = trim($row['CustomerID']); //Grab the Customer's unique ID, from a database


$_SESSION["sCustomerID"] = $sCustomerID; //Enter variable into session variable


2) We can clear a session by calling:
session_destroy();


3) To clear the data before destroying a session; insert an empty array:
$_SESSION = array();//copy empty array in case of failure!


4) We can silence notices and warnings by placing this code on our file
error_reporting(E_ERROR | E_PARSE); //only major problems

5) We can check the contents of the session and if the session is not set, we can send the user to a login page

if(!isset($_SESSION)){session_start();}
if(!isset($_SESSION['sCustomerID']))
{ //no session var
     myRedirect("login.php?msg=5"); //send user back to login page, as session has timed out
}

6) To find and upload setting, view the PHP info command results and search for the string via the browser. For example;

upload_max_filesize


7) To be able to upload a file, we need to use the enctype attribute in our form.

<form action="upload_test.php" method="post" enctype="multipart/form-data">


8) We use the file attribute of the input element to allow a file upload.
Please select an image to test upload: <input type="file" name="image" />

NOTES:
Seriously, did I finished the final project? My teacher said that this assignment served as the last part of my final project. I really don't know why. I haven't made a project before, but let's face it. I should accept the fact that my teacher said I already finished my final project. As I recall, my teacher said that Assignments 8 to 12 served as part of the final project. Really? If I said yes, then it is. That means I done it. Question is, should I come to class on Monday and Wednesday? I should remember that next week is the last week of the Spring 2012 semester.

Never mind, I'll find out by myself.

That is all.

2 comments:

Bill said...

Leopaul,

Yes, once you are done with A12 you are done with the requirements of the final project.

Our project was to build a dynamic website that featured a list/view application that pages database records. The list/view is the foundation for many websites, particularly sales & inventory oriented sites in which the list/view provide access to inventory items. Once the inventory item is visible, you can build a link to allow a user to be able to purchase the item, for example with a link to PayPal (which we'll cover as well in a optional piece).

Our clients are now able to login to an administrative area and upload images to represent inventory items and create thumbnails during upload.

An additional piece (which is also not a required piece) is to add RTE (rich text editing) to editable areas on web site pages, allowing our clients to manage text and images on their pages. This is the primary goal of Content Management Systems (CMS) which we'll add on Monday.

So, to answer the question, are you done? Both yes and no are correct. Yes you are done with your final obligations for ITC280 with A12, however we go (optionally) further. There is also an additional class, ITC281, in which we go much further in depth to the files with which we have been working.

Let me know if this helps!

Bill

leopauldelr said...

Thank you very much