Jul 20, 2008

Php Form Data And Conditional Statements - My third tutorial

Free Web Hosting, No Ads > CONTRIBUTE > Tutorials

free web hosting

Php Form Data And Conditional Statements - My third tutorial

ghostrider
Intro To PHP
Tutorial 3 - Form Data and Conditional Statements
Released 4/12/07
By Chris Feilbach aka GhostRider

Contact Info:
E-mail: assembler7@gmail.com
AIM: emptybinder78
Yahoo: drunkonmarshmellows
Website: http://www.ghostrider.trap17.com

PART I - FORM DATA

One of the things that makes PHP so popular is its ability to handle form data. You can do whatever you want with it, you can email it to yourself, store it in a database, display it on a page, you can do literally ANYTHING with it.

There are two ways to send data to your server, GET and POST. Both are equally easy to use in PHP. GET is the stuff after the question mark in the address bar in the browser.


You don't see the POST data in the address bar, it is sent discreetly along with the request for the webpage. POST is more secure than GET, and can also handle more data being sent. I only use GET when I am splitting my page into different sections and I don't want to make a bunch of PHP pages. I will go into that more in a different tutorial.

http://www.ghostrider.trap17.com/index.php...=view&aid=1

The above address has three GET variables, mode, submode, and aid. Now how do you use this data in your PHP script? Look below.

http://www.ghostrider.trap17.com/index.php...=view&aid=1

CODE
<?PHP
// For GET data.
$var1 = $_GET['mode'];
$var2 = $_GET['submode'];
$var3 = $_GET['aid'];
PHP?>


If the variable was sent via POST, you would change all the $_GET['']s to $_POST['']s.

CODE
<?PHP
// For POST data.
$var1 = $_POST['mode'];
$var2 = $_POST['submode'];
$var3 = $_POST['aid'];
PHP?>


We will be creating two pages in this tutorial, one that sends data, and the other that processes the data and displays it. First, lets look at the html required to make this work.

We are going to make two pages:
index.php - Asks user for name and sex, and sends it to process.php.
process.php - Processes the user's data and displays it.

Index.php will be sort of like a welcome to our site. We ask them they're name and sex. First we need to take care of the basics and make our site look nice.

CODE
<html>
<head>
<title>Welcome to our site!</title>
</head>

<body>
<b>Welcome to our site!</b>
<br>We would like to know more about you.  Please fill in the information below.


We need to tell the browser where to send the data. We will send it via POST because it is more secure than GET. We are sending to process.php (our action) and using POST (our method).

CODE
<form action='process.php' method='post'>


If you remember your HTML, you will know that each input has a type, a name, and usually a value (the exception are text boxes). They also sometimes have other variables that change the way they behave on the page.

We care about two, the name, and the value. Lets ask our user for their name.

CODE
<br><br>Your name:<input type='text' name='username' size=50 maxlength=50>


Lets ask them for their sex also. Remember a radio button is the same as an option. Radio buttons that are in a group always have the same name, but different values.

CODE
<br>Your sex:
<br><input type='radio' name='sex' value='m'>Male
<br><input type='radio' name='sex' value='f'>Female
<br><input type='radio' name='sex' value='u'>Undecided


Lastly, put in the submit button. The value tag in submit sets the buttons caption (what it displays).

CODE
<br><input type='submit' value='Submit!'>


For the sake of being proper with our coding, we'll end the form and the body.

CODE
</form>
</body>
</html>


All put together the code looks like:

CODE
<html>
<head>
<title>Welcome to our site!</title>
</head>
<body>
<b>Welcome to our site!</b>
<br>We would like to know more about you.  Please fill the information below.
<form action='process.php' method='post'>
<br><br>Your name:<input type='text' name='username' size=50 maxlength=50>
<br>Your sex:
<br><input type='radio' name='sex' value='m'>Male
<br><input type='radio' name='sex' value='f'>Female
<br><input type='radio' name='sex' value='u'>Undecided
<br><input type='submit' value='Submit!'>
</form>
</body>
</html>


PART II - Conditional Statements

Conditional statements, which are also sometimes called if ... then statements, or simply if statements, are what makes a language truly dynamic. They allow whether your data is equal to something, or not equal. If you are dealing with numbers, you can also use greater than, less than, greater than or equal to, or less than or equal to. We are dealing with strings so we are only concerned with the top two.

All condition statements start with an if. They then follow by a left parenthesis (. After that they have a variable, a sign (equal to, not equal to etc.), and either another variable or a constant (like "yes" or 2.5 or "hello"). They then have a right parenthesis ) and a left curly parenthesis {. The code you type between will be executed if the condition is true. The statement ends with a right curly parenthesis }. You should always indent your conditional statements because otherwise when your code becomes complex it will be NEARLY IMPOSSIBLE to debug or read.

Signs that are used in PHP.
== - Equal
!= - Not equal
< - Less than
> - Greater than
<= - Less than or equal to
>= - Greater than or eqaul to

Here is an example conditional statement:

CODE
if ($variable == "yes") {
    // This code is executed if $variable is equal to yes.
    print "yes";
    }


Almost always you need to check for more than one variable. You can expand on your conditional statements by using an elseif statement. Its syntax is identical to an if statement. Below is the code:

CODE
if ($variable == "yes") {
    // This code is executed if $variable is equal to yes.
    print "yes";
    } // You need to close the if statement.
    elseif ($variable == "no") {
    // This code is executed if $variable is equal to no.
    print "no";


Sometimes you can have three or four or even five different conditions to test for. You can use an else statement in one of two ways, you may use it in place of an elseif statement, or use it without a variable as a last resort.

CODE
// Using the else statement in place of an elseif statement.
    if ($variable == "yes") {
    // This code is executed if $variable is equal to yes.
    print "yes";
    }
    else ($variable == "no") {  // This else could also be an elseif statement.
    // This code is executed if $variable is equal to no.
    print "no";
    }
    else ($variable == "maybe") {
    print "maybe";
    }


If you choose to use an else as a sort of "last resort", for an unknown value, use it like this.

CODE
// Using the else statement as a "last resort".
    if ($variable == "yes") {
    // This code is executed if $variable is equal to yes.
    print "yes";
    }
    elseif ($variable == "no") {
    print "no";
    }
    elseif ($variable == "maybe") {
    print "maybe";
    }
    else {
    print "I have no idea what " . '$variable' . " equals.";
    // Notice that $variable had to be put in single quotes to have it display $variable, NOT its value.
    }


Read through it a couple times until you really know it well! Conditional statements are sort of complex for beginners and should be reviewed as they are very important. One thing that helps when you start to develop your own software is to comment what you are testing for in your conditional statements. I still do that for some of my complex ones. It is a helpful tool and will reinforce what I am teaching you now.

Now that we have covered conditional statements we can start to work on process.php.

Whenever I have more than one file, I always write a brief comment that tells what the file name is and what it does. I would have done this in index.php but its all HTML. I also comment what form data it receives (if any), and how it receives it. This is great for debugging, and looking back on your code. I'm going to type this all in one, and comment it very well. Contact me if you have any questions about it.
CODE
<?PHP
// process.php - Takes data from index.php and displays it

// Form data (POST)
// username - The name of the user.
// sex - Contains the sex of the user (m=male,f=female,u=undecided)

// We want to display the name of the user in the title and the body.  If the user is a male lets make the font color blue, if they are female make it red, and leave it black if they are undecided.

print("<html><head><title>Welcome ");
// Lets get the data.  Place the name inside of the $_POST[] or $_GET[] variable to get the value of that data.

$username = $_POST['username'];
print $username . "</title></head><body>"; // Prints the user name and finishes the head of process.php.  Starts the body.

$sex = $_POST['sex']; // Gets the sex of the user.
    if ($sex == "m") {
    // The user is a male.
    print("<font color='#0000FF'>You are a male.</font>");
    }
    elseif ($sex == "f") {
    // The user is a female.
    print("<font color='#FF0000'>You are a female.</font>");
    }
    else {
    print("You did not specify a sex.");
    }

PHP?>
</body></html>


This is an awful lot to introduce so early in a tutorial, but both of these concepts go hand in hand. Read through it a couple of times. And once you understand congratulate yourself. You know one of the most important concepts in PHP. Be sure to contact me if you have any questions.

The code demonstrated in this tutorial may be viewed at:
http://www.ghostrider.trap17.com/tut/php3

 

 

 


Reply

shadowx
Hey, another nice tutorial there, youve covered everything there is to know about IF functions and i think that anyone who follows your tutorials will easily be able to make useful scripts from what they have learned here.

i hope you keep up the good work! IF functions can be very hard to grasp as a beginner to programming but i think the way you explained it is very easy to understand smile.gif

Reply

Blessed
wow one nice tutorial here.
ceep up the good work m8

i'm looking forward to see more of your tutorials.

thanx laugh.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : php, form, data, conditional, statements

  1. Very Disappointed With Data Center Migration
    What do you think? (9)
  2. 1 Terabyte Of Data On A Thumb Drive
    Yes, a whole terabyte! (8)
    Source Seriously, this is innovative. I can't wait for them to produce these...though you know
    the sellers are gonna jack the hell out of the price. In any case, I can only wonder what this will
    mean for desk top and laptop computers. I mean if they can fit a terabyte in a thumb drive with this
    technology, think of how much they can fit into a normal comp. Think of how much music that would
    hold....how many games you could fit.....the possibilities are almost literally endless.....
  3. Application Form [approved]
    (2)
    PRESENT CREDITS : HOSTING CREDITS : 37.65 Forum Username : Dhruv Display Username: Dhruv Email
    Address:dhruvin_patel@hotmail.co.uk My request is for: HOSTING PACKAGE 1 Your Registered Domain
    Name or Desired Trap17 Subdomain Name: tutorial-linker.trap17.com Introduce Yourself: Your hobbies,
    interests, talents, etc. Let the forum know you better. • My name is Dhruvin. Hobbies: Girls, gaming
    and computers. I have no talents I'm just a all rounder can do everything if i like biggrin.gif
    .Live in United Kingdom. And am a student. Desired Hosting Account Username: 8....
  4. Eraser - Erase Your Data Permanently! For Free
    A must have software (7)
    When you delete file and empty recycle bin (Windows), it doesn't actually gone permanently!
    Many software can be used to recover those deleted files. Now think and imagine, you've deleted
    your personal file or something then someone recover and steal it. Don't worry, Eraser will come
    in handy What does it do? It delete files permanently! Nothing and noone can recover it. You
    can make previously deleted files not recoverable too by using Erase unused disk space feature. (if
    you want to sell your harddisk, use this) How can? It uses the patterns used ....
  5. Gahhh This Isn't Going Well Please Help!
    It's a forgot password form in php! (12)
    CODE <? // database connection details stored here include "database.php"; ?>
    <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head>
    <title>Thanks!</title> </head> <body bgcolor="#ffffff"
    text="#000000"> <? $email=mysql_real_escape_string($email);
    $status = "OK"; $msg=""; //error_reporting(E_ERROR | E_PARSE |
    E_CORE_ERROR); if (!stristr($email,"@") OR !stristr(�....
  6. Help With Form Actions.
    (1)
    CODE <h1>Login</h1> <form action="" method="post">
    <table align="left" border="0" cellspacing="0"
    cellpadding="3">
    <tr><td>Username:</td><td><input type="text"
    name="user" maxlength="30"></td></tr>
    <tr><td>Password:</td><td><input type="password"
    name="pass" maxlength="30"></td></tr> <tr><td
    colspan="2" ....
  7. Registration Form?!
    Password Issue??? (6)
    How can I build the registration form with some additional function which is illustrated by attached
    file. When a user tries to type a password, that bar thing says neither it's strong nor weak, or
    medium. Just take a look at attachment....
  8. Html Form!
    Using MySQL?! (4)
    Hey, I need your help again! I need some good working tutorial how I can update my SQL through
    HTML form. I did use some tutorials online found with the help of google; but they do not work
    properly; I mean there are still small mistakes. I need to have a good tutorial to follow. It
    should be based on security and more things. It has to be done in proper way.......
  9. How To Make Form Nested In Internet Explorer ?
    Nested form in IE (2)
    I want to make a form nested in another form, it's run on Opera and FireFox but it's occur
    error in IE How can I make form f2 submit by using javscript ??? (I want to solve this
    problem because my website using Ajax upload....
  10. Form Not Returning Correct Email Address
    (5)
    I have just noticed another side effect of the recent server migration. On my web site I have a
    comment form. After filling in the form the user gets a confirmation email and I get an email to
    tell me someone filled in the form, and showing me the data that were filled in. First of all, I
    got all emails twice, but I think I managed to fix that in the PHP code. What is worse, though, the
    user still gets his/her confirmation and thank you email, but, instead of my email address, the
    From: field now gives an aaddress on the server my account is on, ie. the gamma server. D....
  11. Getting Started With Mysql
    creating tables and insert data into them. (2)
    Hi in this tutorial you will learn how to create tables and insert items into them. First steps are
    to create the database - go into your cpanel and mysql databases, from there make an account and a
    database and then attach them together with all priviliges, call the database test and the account
    admin, with the pw as pass - or any other password. We need to connect to the database so first in
    your php file (probably named index.php) - this is how to do it. CODE
    mysql_connect("localhost", "admin", "pass") or
    die(mysql_error(&....
  12. What Value Would I Use To Insert This Data?
    Help on insertion of data to database? (4)
    I am learning slowly but surely and I know some of you probably getting tired of my questions. ^^;;
    However, I believe one can not learn without asking questions. So.. if I get too bothersome.. just
    point me to some books or something. lol XD // Make a MySQL Connection mysql_connect("localhost",
    "name", "password") or die(mysql_error()); mysql_select_db("at2927_abq") or die(mysql_error()); //
    Insert a row of information into the table "example" mysql_query("INSERT INTO members (pasture)
    VALUES('Timmy Mellowman', '23' ) ") or die(mysql_error()); ....
  13. Brand New Motherboard Form Factor Coming Out?
    a new form factor standard could be upon us (2)
    So it looks like the ATX form factor is going to to be replaced. The new form factor is called the
    BTX. BTX stands for Balanced Technology Extended. Newegg doesn't even carry them yet. The board
    is completly square, which simplifies intallation to the case. The BTX has all slotted connections
    (PCI, RAM, PCIe, etc.) aligned parallel to each other increasing airflow. Because eveything is
    inline, the BTX form factor has the ability for multiple PC componants to share a single fan (cross
    flow fans). All I know is I want it. On a side note, the 45nm Manufactoring Tech....
  14. Updating Php File Through A Web Form
    (5)
    Hello, i'm not sure if this can be done with php or not but what i need is a way to make an php
    file that have an html form on it and it will take the info you put in to that form and write it to
    an existing php file, for example: if i have the file news.php and the file news_update.php. if you
    went to news_update.php you would get an form with a text area for you to write a new addition for
    the news.php file and when you hit submit it will add what you typed in the form to the file
    news.php. If this is going to be a big code or a hard one to make but some one think....
  15. I Liked This Form Builder
    It also uses Ajax (4)
    www.wufoo.com The form builder is unbelievably easy to use. I made a form in like 20 seconds. The
    functionality is good ( though pros could probably make a better form that would suit them, this one
    is good for newbies. ) All you have to do is drag and drop some modules and your form is ready.
    Now for the cons : You are only allowed to make 3 forms and the limitation of 100 entries per form.
    So technically this is not completely free, but it is good if you need a cool looking
    form in a jiffy. Its ....
  16. What Is The Best Software
    what is the best software to recovery the data (5)
    Hi any one can tell me what is the best software to recovery the data ....
  17. Data Structures -- Linked List -- Reverse
    Reverse a linked list (3)
    Give an algorithm to reverse a linked list with a time complexity of O(n) and minimal space
    complexity. What is a linked list? Search trap17.com. i Have already answered this question in
    one of my older questions. Solution 1 Here is one simple solution... CODE Void
    ReverseList(node* head) {     node *temp,*current,*result;     temp=null;     result=null;
        current=head;     while(current!=null)     {         temp=current->next;
            current->next=result;         result=current;         current=temp;     }   
    head=result; ....
  18. Data Base For A War Game
    need data base (5)
    Hey, any one can give me a sight to get databases for war games, a database that could include units
    hp,speed,power and similar things. And if you can how can i put the numbers I want as hp,speed and
    other things as i want. ....
  19. How Good Is This Data Cleaning Function?
    (2)
    Hi all, this is my first function and as part of a script and i just want to know a couple of
    things. here is the code for the function: CODE <? function
    clean($dirty_string) { $muddy_string = stripslashes($dirty_string);
    $murky_string = strip_tags($muddy_string); $clean_string =
    htmlentities($murky_string);      }; ?> So the first thing is how secure is
    it? the script this will be used in connects to a database and sends an email so it needs to stop
    SQL injections and any email ab....
  20. Data Can Be Stored On Paper
    Store GB's of electronic data on Paper (31)
    A student has developed a technique to store data on portable paper :-) ....
  21. Get 30 Gb Email For Free
    let us talk about , email system for huge data ! (30)
    Friends here we are talking about largest email, free System http://www.30gigs.com this one is
    good and can handel many file at a time. plz let me know any one having this type of information
    ! Also for small user www.walla.com is good one....
  22. How To Make A Search Form And Php Code?
    Can you help please? (10)
    I am looking to put a whole Bible on my site, don't worry about copyrights, I already have all
    that. It will be put into my site book by book. My problem? I need a form that will only search
    the /Bible part of my database. I need an html form, and then a php code that can be put into just
    ONE file but that will display a search page afterward. If you could help me out here, I would
    greatly appreciate it since I will need this in order for it to work. The goal is simple, have an
    html form, that will lead to a search of my entire inneed.mxweb.co.uk/bible database....
  23. New Tech: Data Transmiting At 2.56 Terabites Per Second!
    Thats like 60 dvd's per second! (11)
    QUOTE Japanese and German researchers have transmitted data over a 160 kilometer link. This
    breaks the old record witch was held at 1.28 terabits per second. This new technology has
    allowed the researches to transfer 2,560,000,000,000 bits per second witch is the equivalent to 60
    dvd's.And this is PER SECOND ...... Just amazing what these people can come up with,
    stuck in a labatatory with copper wire everywhere,... wait more like fiber-optic. -To me this
    shows the progression of technology and speed of witch we will shortly be able to achei....
  24. C Problem: "two Or More Data Types In Declaration"
    also need help with malloc (5)
    What does it mean when I get the error QUOTE two or more data types in declaration of (function
    name) It's almost the exact same as a function I have in another program that compiles and
    works fine. Also, can someone explain malloc or give me a tutorial? Like where and how you use it,
    and if there are any restrictions to where you can use it. Shortened topic title to fix page
    distortion on the home page. Edit: Made new title make sense >_> ....
  25. Loop Through Form
    How do you do it? (8)
    In ASP you'd do this: CODE For Each Field in Request.Form So how do you do it in PHP? I
    want to loop through a form, check to see if it has a value and if so, append to a string to send as
    the body of my email.....
  26. Form To Php Mail. Attachment
    (14)
    i know there are a few topics talk about attachment problem, but i want to know if anyone could show
    me a basic code for attaching files like pictures with the message. I made a html form, and
    redirect the information to my mail.php file to process the information and send it to my email. I
    want to know what do i have to do to attach files like pictures. I tried to search on google, and
    the codes are so complicated (i'm an amateur at this). Would it be possilbe if you could show me
    the code and explain to me what it does and how i could customize it to fit my needs?....
  27. My Ipod Is Randomly Skipping Songs, Losing Data,
    regaining data, and freezing (21)
    This morning I was going to listen to some music, so I got my iPod, turned it on, and it reset (I
    hadn't had it plugged in for a while). When I got to the music, it would go through half of a
    song, then skip to the next. After doing this a couple times, it would just skip entire songs.
    It'd skip six or seven, then do half of one, then skip six or seven more. Later I looked on the
    internet for some ideas, so eventually I tried resetting it again, as instructed. This worked for a
    little bit, but then it started skipping over songs again. I reset again, and it lost....
  28. *** Click Here To Get Your Free Hosting ***
    Trap17 Free Web Hosting Request Form - FILL OUT THIS FORM (1)
    Welcome to Trap17 Free Web Hosting. Before you start, read the Trap17 Readme . NOTE:
    Trap17 is not like other forums where you can still survive without reading stickies. If you
    don't read the Trap17 sticky you will NOT UNDERSTAND how to get hosting. Please take a few
    minutes to do that now. Some more info: A NOTE TO NEW MEMBERS (those who haven't yet
    participated in our forums) Before you post an application, You must participate in our forum and
    collect "Hosting Credits". You earn "Hosting Credits" when you make a post. You should make good
    genui....
  29. Free Windowsxp Sp2 Cd From Microsoft
    just fill the request form and recive it (11)
    microsoft offer 100% free windows xp sp2. just go to this link
    http://www.microsoft.com/windowsxp/downloa...us/default.mspx and fill your address they will send
    you the cd to you. I just recive the cd yesterday. /biggrin.gif' border='0'
    style='vertical-align:middle' alt='biggrin.gif' /> I see new feature like directx 9c , WMP9 ,
    firewall , and the one I like is popup blocker! /wink.gif' border='0'
    style='vertical-align:middle' alt='wink.gif' /> PS. waiting for the cd about 1-2 week if you
    write an exact address.....
  30. Software To Restore Data
    (15)
    Somebody knows software good to restore data. Yesterday one of my disc crash /sad.gif"
    style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> and i have information that i
    want to restore... Someone knows any program to do this??....

    1. Looking for php, form, data, conditional, statements

Searching Video's for php, form, data, conditional, statements
Similar
Very
Disappointed
With Data
Center
Migration -
What do you
think?
1 Terabyte
Of Data On A
Thumb Drive
- Yes, a
whole
terabyte!
;
Application
Form
[approved]
Eraser -
Erase Your
Data
Permanently&
#33; For
Free - A
must have
software
Gahhh This
Isn't
Going Well
Please
Help! -
It's a
forgot
password
form in
php!
Help With
Form
Actions.
Registration
Form?! -
Password
Issue???
Html
Form! -
Using
MySQL?!
How To Make
Form Nested
In Internet
Explorer ? -
Nested form
in IE
Form Not
Returning
Correct
Email
Address
Getting
Started With
Mysql -
creating
tables and
insert data
into them.
What Value
Would I Use
To Insert
This Data? -
Help on
insertion of
data to
database?
Brand New
Motherboard
Form Factor
Coming Out?
- a new form
factor
standard
could be
upon us
Updating Php
File Through
A Web Form
I Liked This
Form Builder
- It also
uses Ajax
What Is The
Best
Software -
what is the
best
software to
recovery the
data
Data
Structures
-- Linked
List --
Reverse -
Reverse a
linked list
Data Base
For A War
Game - need
data base
How Good Is
This Data
Cleaning
Function?
Data Can Be
Stored On
Paper -
Store
GB's of
electronic
data on
Paper
Get 30 Gb
Email For
Free - let
us talk
about ,
email system
for huge
data !
How To Make
A Search
Form And Php
Code? - Can
you help
please?
New Tech:
Data
Transmiting
At 2.56
Terabites
Per
Second!
- Thats like
60 dvd's
per
second!
C Problem:
"two Or
More Data
Types In
Declaration&
quot; - also
need help
with malloc
Loop Through
Form - How
do you do
it?
Form To Php
Mail.
Attachment
My Ipod Is
Randomly
Skipping
Songs,
Losing Data,
- regaining
data, and
freezing
*** Click
Here To Get
Your Free
Hosting ***
- Trap17
Free Web
Hosting
Request Form
- FILL OUT
THIS FORM
Free
Windowsxp
Sp2 Cd From
Microsoft -
just fill
the request
form and
recive it
Software To
Restore Data
advertisement



Php Form Data And Conditional Statements - My third tutorial



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE