Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143
This is the forum to discuss the Wrox book Beginning PHP 6, Apache, MySQL 6 Web Development by Timothy Boronczyk, Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz; ISBN: 9780470391143
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old March 16th, 2012, 04:16 PM
Authorized User
Points: 54, Level: 1
Points: 54, Level: 1 Points: 54, Level: 1 Points: 54, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Posts: 13
Thanks: 2
Thanked 0 Times in 0 Posts
Default

thank @useless

u were right
the debug mode is fine

but as i remove the debug mode line

Code:
// enable debug mode?
$debug = true;

/*
session_start();

$db= mysql_connect('localhost', 'bp6am', 'bp6ampass')
if( !$db )
{
    die ('Unable to connect. Check your connection parameters.');
}

// make sure our databse is the active one
if( !mysql_select_db('namelist', $db) )
{
    die('Error Selecting db: ' . mysql_error($db));
}
*/

*********************************************
if( $debug & (isset($_POST['submit']) && ($_POST['submit'] == 'Register')) )
{
    echo '<pre>';
    print_r($_POST);
    echo '</pre>';
    
    unset($_POST['submit']);
}

and replacing with the simple code
Code:
session_start();
$db = mysql_connect('localhost', 'bp6am', 'bp6ampass') or
	die ('Unable to connect. Check your parameters.');
mysql_select_db('namelist', $db) or die (mysql_error($db));

i'm getting an error in your SQL syntax

Code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2
do i need any correction ?
Reply With Quote
  #12 (permalink)  
Old March 16th, 2012, 04:28 PM
Authorized User
Points: 54, Level: 1
Points: 54, Level: 1 Points: 54, Level: 1 Points: 54, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Posts: 13
Thanks: 2
Thanked 0 Times in 0 Posts
Default

thank @useless

u were right
the debug mode is fine

but as i remove the debug mode line

Code:
// enable debug mode?
$debug = true;

/*
session_start();

$db= mysql_connect('localhost', 'bp6am', 'bp6ampass')
if( !$db )
{
    die ('Unable to connect. Check your connection parameters.');
}

// make sure our databse is the active one
if( !mysql_select_db('namelist', $db) )
{
    die('Error Selecting db: ' . mysql_error($db));
}
*/

*********************************************
if( $debug & (isset($_POST['submit']) && ($_POST['submit'] == 'Register')) )
{
    echo '<pre>';
    print_r($_POST);
    echo '</pre>';
    
    unset($_POST['submit']);
}
and replacing with the simple code

Code:
session_start();
$db = mysql_connect('localhost', 'bp6am', 'bp6ampass') or
	die ('Unable to connect. Check your parameters.');
mysql_select_db('namelist', $db) or die (mysql_error($db));
i'm getting an error in your SQL syntax


You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2


do i need any correction ?
Reply With Quote
  #13 (permalink)  
Old March 24th, 2012, 07:00 AM
Friend of Wrox
Points: 651, Level: 9
Points: 651, Level: 9 Points: 651, Level: 9 Points: 651, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Location: North East UK
Posts: 125
Thanks: 0
Thanked 24 Times in 24 Posts
Default

Code:
<?php

/* commented due to not running db server
session_start();

$db= mysql_connect('localhost', 'bp6am', 'bp6ampass');
if( !$db )
{
    die ('Unable to connect. Check your connection parameters.');
}

// make sure our databse is the active one
if( !mysql_select_db('namelist', $db) )
{
    die('Error Selecting db: ' . mysql_error($db));
}
*/

/* Enable debug mode?
* to disable debug mode simply set debug to false ....
*/
$debug = true;


/* get the country list
* passing nothing returns the country list with the country as the value
* passing 'iso' returns the list with the iso country code as the value
*/
$country_list = get_country_list();
$gender_list = array('male', 'female');
$month_list = get_month_list('short');
 
if( $debug & (isset($_POST['submit']) && ($_POST['submit'] == 'Register')) )
{
    echo '<pre>';
    print_r($_POST);
    echo '</pre>';
    
    // unset submit so the db code is not ran
    unset($_POST['submit']);
}
    
// obtain user supplied values
$username = (isset($_POST['username'])) ? trim($_POST['username']) : '';
$password = (isset($_POST['password'])) ? $_POST['password'] : '';
$first_name = (isset($_POST['first_name'])) ? trim($_POST['first_name']) : '';
$last_name = (isset($_POST['last_name'])) ? trim($_POST['last_name']) : '';
$email = (isset($_POST['email'])) ? trim($_POST['email']) : '';

$country = (isset($_POST['country']) && !empty($_POST['country'])) ? $_POST['country'] : '';
$gender = (isset($_POST['gender']) && !empty($_POST['gender'])) ? $_POST['gender'] : '';

$dob = (isset($_POST['dob']) && is_array($_POST['dob']) && (sizeof($_POST['dob']) == 3)) ? $_POST['dob'] : array();

// check size of the dob array and if zero elements then populate with dummy ones
// stops the undefined offset error when the page is first loaded
if( !sizeof($dob) )
{
	$dob[] = '';
	$dob[] = '';
	$dob[] = '';
}
	
if (isset($_POST['submit']) && $_POST['submit'] == 'Register')
{
    $errors = array();
    
    // make sure manditory fields have been entered
    if (empty($username))
    {
        $errors[] = 'Username cannot be blank.';
    }
        
    // check if username already is registered
    /* IMPORTANT
    * the username needs to be sanitised otherwise SQL injection could be a problem
    */
    $query = 'SELECT username FROM palgo_user WHERE username = "' . $username . '"';
    $result = mysql_query($query, $db) or die (mysql_error());
    if (mysql_num_rows($result) > 0)
    {
        $errors[] = 'Username: <em>' . $username . '</em> is already registered.';
        $username = '';
    }
        
    // check if email already is registered
    /* IMPORTANT
    * the email address needs to be sanitised otherwise SQL injection could be a problem
    */
    $query = 'SELECT email FROM palgo_info WHERE email = "' . $email . '"';
    $result = mysql_query($query, $db) or die (mysql_error());
    if (mysql_num_rows($result) > 0)
    {
        $errors[] = 'Email Address: <em>' . $email . '</em> is already in use by a registered user.';
        $email = '';
    }
    mysql_free_result($result);
    
    if (empty($password))
    {
        $errors[] = 'Password cannot be blank.';
    }
    if (empty($first_name))
    {
        $errors[] = 'First name cannot be blank.';        
    }
    if (empty($last_name))
    {
        $errors[] = 'Last name cannot be blank.';
    }
    if (empty($email))
    {
        $errors[] = 'Email address cannot be blank.';
    }

    if (count($errors) > 0)
    {
        echo '<p><strong style="color:#FF000;">Unable to process your registration.</strong></p>';
        echo '<p>Please fix the following:</p>';
        echo '<ul>';
        foreach ($errors as $error)
        {
            echo '<li>' . $error . '</li>';
        }
        echo '</ul>';
    }
    else
    {
        // No errors so enter the information into the database.

        $query = 'INSERT INTO palgo_user (username, password)
                    VALUES ("' . mysql_real_escape_string($username, $db) . '", PASSWORD("' . mysql_real_escape_string($password, $db) . '"))';    
        $result = mysql_query($query, $db) or die(mysql_error());

        $user_id = mysql_insert_id($db);

        $query = 'INSERT INTO palgo_info (user_id, first_name, last_name, email, country, gender, d_o_b)
                    VALUES (' . $user_id . ', ' .
                            '"' . mysql_real_escape_string($first_name, $db) . '", ' .
                            '"' . mysql_real_escape_string($last_name, $db) . '", ' .
                            '"' . mysql_real_escape_string($email, $db) . '", ' .
                            '"' . mysql_real_escape_string($country, $db)  . '")';
                            '"' . mysql_real_escape_string($gender, $db)  . '")';
                            '"' . mysql_real_escape_string(join(', ', $dob), $db)  . '")';
        $result = mysql_query($query, $db) or die(mysql_error());

        $_SESSION['logged'] = 1;
        $_SESSION['username'] = $username;

        header('Refresh: 5; URL=login.php');                        

		exit;
    }
}

?>        

<html>
<head>
<title>Registration</title>
<style type="text/css">
.tableline {
	margin: 0 auto;
	border: 1px solid #009;
}
th {
	margin: 2px;
	padding: 2px;
	background-color: #009;
	color: #fff;
	font-family: Tahoma, Verdana, Helvetica;
	font-size: 16px;
	font-weight: bold;
	text-transform: uppercase;
}
.button-row {
	padding: 8px;
	border-top: 1px solid #009;
	text-align: center;
}
input {
	border: #0080c0 1px solid;
}

input:focus {
	border: #0f0 1px solid;
}
</style>
</head>

<body>
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    <table width="450" cellspacing="3" cellpadding="2" border="0" class="tableline">
    <tr>
    	<th colspan="2">Registration</th>
    </tr>
    <tr>
        <td align="right">First Name:&nbsp;</td>
        <td><input type="text" name="first_name" maxlength="20" size="20"value="<?php echo $first_name; ?>" /></td>
    </tr>
    <tr>
        <td align="right">Last Name:&nbsp;</td>
        <td><input type="text" name="last_name" maxlength="20" size="20"  value="<?php echo $last_name; ?>"/></td>
    </tr>
    <tr>
        <td align="right">User Name:&nbsp;</td>
        <td><input type="text" name="username" maxlength="20" size="20"  value="<?php echo $username; ?>"/></td>
    </tr>
    <tr>
        <td align="right">Email:&nbsp;</td>
        <td><input type="text" name="email" maxlength="20" size="20"  value="<?php echo $email; ?>"/></td>
    </tr>
    <tr>
        <td align="right">Password:&nbsp;</td>
        <td><input type="password" name="password" maxlength="20"  value="<?php echo $password; ?>"/></td>
    </tr>
    <tr>
        <td align="right">Country:&nbsp;</td>
        <td>
            <select name="country" id="country" >
                <option value="">-- Select Country --</option>
                <?php
                $option = '';
                foreach($country_list as $value)
                {
                    $selected = ( ($value == $country) ? ' selected="selected"' : '');
                    $option .= '<option value="' . $value . '"' . $selected . '>' . $value . '</option>' . "\n";
                }
                
                echo $option;
                ?>
            </select>
        </td>
    </tr>
    <tr>
        <td align="right">Gender:&nbsp;</td>
        <td>
            <select name="gender" id="gender">
                <option value="">Select</option>
                <?php
                $option = '';
                foreach($gender_list as $value)
                {
                    $selected = ( ($value == $gender) ? ' selected="selected"' : '');
                    $option .= '<option value="' . $value . '"' . $selected . '>' .ucfirst($value) . '</option>' . "\n";
                }
                
                echo $option;
                ?>
            </select>
        </td>
    </tr>
    <tr>
        <td align="right">Date of birth:&nbsp;</td>
        <td>
            <select name="dob[]" id="dob" >
                <option value="">Month</option>
                <?php
                $option = '';
                foreach($month_list as $key => $value)
                {
                    $selected = ( ($key == $dob[0]) ? ' selected="selected"' : '');
                    $option .= '<option value="' . $key . '"' . $selected . '>' .$value . '</option>' . "\n";
                }
                
                echo $option;
                ?>
            </select>

            <select name="dob[]" id="dob" >
                <option value="">Day</option>
                <?php
                $option = '';
                $range = range(1,31);
                foreach($range as $value)
                {
                    $selected = ( ($value == $dob[1]) ? ' selected="selected"' : '');
                    $option .= '<option value="' . $value . '"' . $selected . '>' .$value . '</option>' . "\n";
                }
                
                echo $option;
                ?>
            </select>

            <select name="dob[]" id="dob" >
                <option value="">Year</option>
                <?php
                $option = '';
                $range = range(2000, 1950);
                foreach($range as $value)
                {
                    $selected = ( ($value == $dob[2]) ? ' selected="selected"' : '');
                    $option .= '<option value="' . $value . '"' . $selected . '>' .$value . '</option>' . "\n";
                }
                
                echo $option;
                ?>
            </select>
        </td>
    </tr>
    <tr>
        <td colspan="2" class="button-row"><input type="submit" name="submit" value="Register" />&nbsp;&nbsp;&nbsp;<input type="reset" value="Reset" /></td>
    </tr>
    </table>
    </form>

</body>
</html>

<?php

function get_month_list($type = '')
{
	$type = strtolower($type);
	
	switch( $type )
	{
		case 'short':
			$month_list = array(	'Jan'	=> 'January',
									'Feb'	=> 'February',
									'Mar'	=> 'March',
									'Apr'	=> 'April',
									'May'	=> 'May',
									'Jun'	=> 'June',
									'Jul'	=> 'July',
									'Aug'	=> 'August',
									'Sep'	=> 'September',
									'Oct'	=> 'October',
									'Nov'	=> 'November',
									'Dec'	=> 'December');
		break;
		
		default:
			$month_list = array(	1	=> 'January',
									2	=> 'February',
									3	=> 'March',
									4	=> 'April',
									5	=> 'May',
									6	=> 'June',
									7	=> 'July',
									8	=> 'August',
									9	=> 'September',
									10	=> 'October',
									11	=> 'November',
									12	=> 'December');
		break;
	}
	
	return $month_list;
}

function get_country_list($type = '')
{
	$type = strtolower($type);
	
	switch( $type )
	{
		case 'iso':
			$country_list = array(
				'AF' => 'Afghanistan',
				'AX' => 'Åland Islands',
				'AL' => 'Albania',
				'DZ' => 'Algeria',
				'AS' => 'American Samoa',
				'AD' => 'Andorra',
				'AO' => 'Angola',
				'AI' => 'Anguilla',
				'AQ' => 'Antarctica',
				'AG' => 'Antigua and Barbuda',
				'AR' => 'Argentina',
				'AM' => 'Armenia',
				'AW' => 'Aruba',
				'AU' => 'Australia',
				'AT' => 'Austria',
				'AZ' => 'Azerbaijan',
				'BS' => 'Bahamas',
				'BH' => 'Bahrain',
				'BD' => 'Bangladesh',
				'BB' => 'Barbados',
				'BY' => 'Belarus',
				'BE' => 'Belgium',
				'BZ' => 'Belize',
				'BJ' => 'Benin',
				'BM' => 'Bermuda',
				'BT' => 'Bhutan',
				'BO' => 'Bolivia',
				'BA' => 'Bosnia and Herzegovina',
				'BW' => 'Botswana',
				'BV' => 'Bouvet Island',
				'BR' => 'Brazil',
				'IO' => 'British Indian Ocean Territory',
				'BN' => 'Brunei Darussalam',
				'BG' => 'Bulgaria',
				'BF' => 'Burkina Faso',
				'BI' => 'Burundi',
				'KH' => 'Cambodia',
				'CM' => 'Cameroon',
				'CA' => 'Canada',
				'CV' => 'Cape Verde',
				'KY' => 'Cayman Islands',
				'CF' => 'Central African Republic',
				'TD' => 'Chad',
				'CL' => 'Chile',
				'CN' => 'China',
				'CX' => 'Christmas Island',
				'CC' => 'Cocos (Keeling) Islands',
				'CO' => 'Colombia',
				'KM' => 'Comoros',
				'CG' => 'Congo',
				'CD' => 'Congo, The Democratic Republic of The',
				'CK' => 'Cook Islands',
				'CR' => 'Costa Rica',
				'CI' => "Cote D'ivoire",
				'HR' => 'Croatia',
				'CU' => 'Cuba',
				'CY' => 'Cyprus',
				'CZ' => 'Czech Republic',
				'DK' => 'Denmark',
				'DJ' => 'Djibouti',
				'DM' => 'Dominica',
				'DO' => 'Dominican Republic',
				'EC' => 'Ecuador',
				'EG' => 'Egypt',
				'SV' => 'El Salvador',
				'GQ' => 'Equatorial Guinea',
				'ER' => 'Eritrea',
				'EE' => 'Estonia',
				'ET' => 'Ethiopia',
				'FK' => 'Falkland Islands (Malvinas)',
				'FO' => 'Faroe Islands',
				'FJ' => 'Fiji',
				'FI' => 'Finland',
				'FR' => 'France',
				'GF' => 'French Guiana',
				'PF' => 'French Polynesia',
				'TF' => 'French Southern Territories',
				'GA' => 'Gabon',
				'GM' => 'Gambia',
				'GE' => 'Georgia',
				'DE' => 'Germany',
				'GH' => 'Ghana',
				'GI' => 'Gibraltar',
				'GR' => 'Greece',
				'GL' => 'Greenland',
				'GD' => 'Grenada',
				'GP' => 'Guadeloupe',
				'GU' => 'Guam',
				'GT' => 'Guatemala',
				'GG' => 'Guernsey',
				'GN' => 'Guinea',
				'GW' => 'Guinea-bissau',
				'GY' => 'Guyana',
				'HT' => 'Haiti',
				'HM' => 'Heard Island and Mcdonald Islands',
				'VA' => 'Holy See (Vatican City State)',
				'HN' => 'Honduras',
				'HK' => 'Hong Kong',
				'HU' => 'Hungary',
				'IS' => 'Iceland',
				'IN' => 'India',
				'ID' => 'Indonesia',
				'IR' => 'Iran, Islamic Republic of',
				'IQ' => 'Iraq',
				'IE' => 'Ireland',
				'IM' => 'Isle of Man',
				'IL' => 'Israel',
				'IT' => 'Italy',
				'JM' => 'Jamaica',
				'JP' => 'Japan',
				'JE' => 'Jersey',
				'JO' => 'Jordan',
				'KZ' => 'Kazakhstan',
				'KE' => 'Kenya',
				'KI' => 'Kiribati',
				'KP' => "Korea, Democratic People's Republic of",
				'KR' => 'Korea, Republic of',
				'KW' => 'Kuwait',
				'KG' => 'Kyrgyzstan',
				'LA' => "Lao People's Democratic Republic",
				'LV' => 'Latvia',
				'LB' => 'Lebanon',
				'LS' => 'Lesotho',
				'LR' => 'Liberia',
				'LY' => 'Libyan Arab Jamahiriya',
				'LI' => 'Liechtenstein',
				'LT' => 'Lithuania',
				'LU' => 'Luxembourg',
				'MO' => 'Macao',
				'MK' => 'Macedonia, The Former Yugoslav Republic of',
				'MG' => 'Madagascar',
				'MW' => 'Malawi',
				'MY' => 'Malaysia',
				'MV' => 'Maldives',
				'ML' => 'Mali',
				'MT' => 'Malta',
				'MH' => 'Marshall Islands',
				'MQ' => 'Martinique',
				'MR' => 'Mauritania',
				'MU' => 'Mauritius',
				'YT' => 'Mayotte',
				'MX' => 'Mexico',
				'FM' => 'Micronesia, Federated States of',
				'MD' => 'Moldova, Republic of',
				'MC' => 'Monaco',
				'MN' => 'Mongolia',
				'ME' => 'Montenegro',
				'MS' => 'Montserrat',
				'MA' => 'Morocco',
				'MZ' => 'Mozambique',
				'MM' => 'Myanmar',
				'NA' => 'Namibia',
				'NR' => 'Nauru',
				'NP' => 'Nepal',
				'NL' => 'Netherlands',
				'AN' => 'Netherlands Antilles',
				'NC' => 'New Caledonia',
				'NZ' => 'New Zealand',
				'NI' => 'Nicaragua',
				'NE' => 'Niger',
				'NG' => 'Nigeria',
				'NU' => 'Niue',
				'NF' => 'Norfolk Island',
				'MP' => 'Northern Mariana Islands',
				'NO' => 'Norway',
				'OM' => 'Oman',
				'PK' => 'Pakistan',
				'PW' => 'Palau',
				'PS' => 'Palestinian Territory, Occupied',
				'PA' => 'Panama',
				'PG' => 'Papua New Guinea',
				'PY' => 'Paraguay',
				'PE' => 'Peru',
				'PH' => 'Philippines',
				'PN' => 'Pitcairn',
				'PL' => 'Poland',
				'PT' => 'Portugal',
				'PR' => 'Puerto Rico',
				'QA' => 'Qatar',
				'RE' => 'Reunion',
				'RO' => 'Romania',
				'RU' => 'Russian Federation',
				'RW' => 'Rwanda',
				'SH' => 'Saint Helena',
				'KN' => 'Saint Kitts and Nevis',
				'LC' => 'Saint Lucia',
				'PM' => 'Saint Pierre and Miquelon',
				'VC' => 'Saint Vincent and The Grenadines',
				'WS' => 'Samoa',
				'SM' => 'San Marino',
				'ST' => 'Sao Tome and Principe',
				'SA' => 'Saudi Arabia',
				'SN' => 'Senegal',
				'RS' => 'Serbia',
				'SC' => 'Seychelles',
				'SL' => 'Sierra Leone',
				'SG' => 'Singapore',
				'SK' => 'Slovakia',
				'SI' => 'Slovenia',
				'SB' => 'Solomon Islands',
				'SO' => 'Somalia',
				'ZA' => 'South Africa',
				'GS' => 'South Georgia and The South Sandwich Islands',
				'ES' => 'Spain',
				'LK' => 'Sri Lanka',
				'SD' => 'Sudan',
				'SR' => 'Suriname',
				'SJ' => 'Svalbard and Jan Mayen',
				'SZ' => 'Swaziland',
				'SE' => 'Sweden',
				'CH' => 'Switzerland',
				'SY' => 'Syrian Arab Republic',
				'TW' => 'Taiwan, Province of China',
				'TJ' => 'Tajikistan',
				'TZ' => 'Tanzania, United Republic of',
				'TH' => 'Thailand',
				'TL' => 'Timor-leste',
				'TG' => 'Togo',
				'TK' => 'Tokelau',
				'TO' => 'Tonga',
				'TT' => 'Trinidad and Tobago',
				'TN' => 'Tunisia',
				'TR' => 'Turkey',
				'TM' => 'Turkmenistan',
				'TC' => 'Turks and Caicos Islands',
				'TV' => 'Tuvalu',
				'UG' => 'Uganda',
				'UA' => 'Ukraine',
				'AE' => 'United Arab Emirates',
				'GB' => 'United Kingdom',
				'US' => 'United States',
				'UM' => 'United States Minor Outlying Islands',
				'UY' => 'Uruguay',
				'UZ' => 'Uzbekistan',
				'VU' => 'Vanuatu',
				'VE' => 'Venezuela',
				'VN' => 'Viet Nam',
				'VG' => 'Virgin Islands, British',
				'VI' => 'Virgin Islands, U.S.',
				'WF' => 'Wallis and Futuna',
				'EH' => 'Western Sahara',
				'YE' => 'Yemen',
				'ZM' => 'Zambia',
				'ZW' => 'Zimbabwe'
				);
		break;
		
		default:	
			$country_list = array(
				'Afghanistan' => 'Afghanistan',
				'Aland Islands' => 'Aland Islands',
				'Albania' => 'Albania',
				'Algeria' => 'Algeria',
				'American Samoa' => 'American Samoa',
				'Andorra' => 'Andorra',
				'Angola' => 'Angola',
				'Anguilla' => 'Anguilla',
				'Antarctica' => 'Antarctica',
				'Antigua and Barbuda' => 'Antigua and Barbuda',
				'Argentina' => 'Argentina',
				'Armenia' => 'Armenia',
				'Aruba' => 'Aruba',
				'Australia' => 'Australia',
				'Austria' => 'Austria',
				'Azerbaijan' => 'Azerbaijan',
				'Bahamas' => 'Bahamas',
				'Bahrain' => 'Bahrain',
				'Bangladesh' => 'Bangladesh',
				'Barbados' => 'Barbados',
				'Belarus' => 'Belarus',
				'Belgium' => 'Belgium',
				'Belize' => 'Belize',
				'Benin' => 'Benin',
				'Bermuda' => 'Bermuda',
				'Bhutan' => 'Bhutan',
				'Bolivia' => 'Bolivia',
				'Bosnia and Herzegovina' => 'Bosnia and Herzegovina',
				'Botswana' => 'Botswana',
				'Bouvet Island' => 'Bouvet Island',
				'Brazil' => 'Brazil',
				'British Indian Ocean Territory' => 'British Indian Ocean Territory',
				'Brunei Darussalam' => 'Brunei Darussalam',
				'Bulgaria' => 'Bulgaria',
				'Burkina Faso' => 'Burkina Faso',
				'Burundi' => 'Burundi',
				'Cambodia' => 'Cambodia',
				'Cameroon' => 'Cameroon',
				'Canada' => 'Canada',
				'Cape Verde' => 'Cape Verde',
				'Cayman Islands' => 'Cayman Islands',
				'Central African Republic' => 'Central African Republic',
				'Chad' => 'Chad',
				'Chile' => 'Chile',
				'China' => 'China',
				'Christmas Island' => 'Christmas Island',
				'Cocos (Keeling) Islands' => 'Cocos (Keeling) Islands',
				'Colombia' => 'Colombia',
				'Comoros' => 'Comoros',
				'Congo' => 'Congo',
				'Congo, The Democratic Republic of The' => 'Congo, The Democratic Republic of The',
				'Cook Islands' => 'Cook Islands',
				'Costa Rica' => 'Costa Rica',
				"Cote D'ivoire" => "Cote D'ivoire",
				'Croatia' => 'Croatia',
				'Cuba' => 'Cuba',
				'Cyprus' => 'Cyprus',
				'Czech Republic' => 'Czech Republic',
				'Denmark' => 'Denmark',
				'Djibouti' => 'Djibouti',
				'Dominica' => 'Dominica',
				'Dominican Republic' => 'Dominican Republic',
				'Ecuador' => 'Ecuador',
				'Egypt' => 'Egypt',
				'El Salvador' => 'El Salvador',
				'Equatorial Guinea' => 'Equatorial Guinea',
				'Eritrea' => 'Eritrea',
				'Estonia' => 'Estonia',
				'Ethiopia' => 'Ethiopia',
				'Falkland Islands (Malvinas)' => 'Falkland Islands (Malvinas)',
				'Faroe Islands' => 'Faroe Islands',
				'Fiji' => 'Fiji',
				'Finland' => 'Finland',
				'France' => 'France',
				'French Guiana' => 'French Guiana',
				'French Polynesia' => 'French Polynesia',
				'French Southern Territories' => 'French Southern Territories',
				'Gabon' => 'Gabon',
				'Gambia' => 'Gambia',
				'Georgia' => 'Georgia',
				'Germany' => 'Germany',
				'Ghana' => 'Ghana',
				'Gibraltar' => 'Gibraltar',
				'Greece' => 'Greece',
				'Greenland' => 'Greenland',
				'Grenada' => 'Grenada',
				'Guadeloupe' => 'Guadeloupe',
				'Guam' => 'Guam',
				'Guatemala' => 'Guatemala',
				'Guernsey' => 'Guernsey',
				'Guinea' => 'Guinea',
				'Guinea-bissau' => 'Guinea-bissau',
				'Guyana' => 'Guyana',
				'Haiti' => 'Haiti',
				'Heard Island and Mcdonald Islands' => 'Heard Island and Mcdonald Islands',
				'Holy See (Vatican City State)' => 'Holy See (Vatican City State)',
				'Honduras' => 'Honduras',
				'Hong Kong' => 'Hong Kong',
				'Hungary' => 'Hungary',
				'Iceland' => 'Iceland',
				'India' => 'India',
				'Indonesia' => 'Indonesia',
				'Iran, Islamic Republic of' => 'Iran, Islamic Republic of',
				'Iraq' => 'Iraq',
				'Ireland' => 'Ireland',
				'Isle of Man' => 'Isle of Man',
				'Israel' => 'Israel',
				'Italy' => 'Italy',
				'Jamaica' => 'Jamaica',
				'Japan' => 'Japan',
				'Jersey' => 'Jersey',
				'Jordan' => 'Jordan',
				'Kazakhstan' => 'Kazakhstan',
				'Kenya' => 'Kenya',
				'Kiribati' => 'Kiribati',
				"Korea, Democratic People's Republic of" => "Korea, Democratic People's Republic of",
				'Korea, Republic of' => 'Korea, Republic of',
				'Kuwait' => 'Kuwait',
				'Kyrgyzstan' => 'Kyrgyzstan',
				"Lao People's Democratic Republic" => "Lao People's Democratic Republic",
				'Latvia' => 'Latvia',
				'Lebanon' => 'Lebanon',
				'Lesotho' => 'Lesotho',
				'Liberia' => 'Liberia',
				'Libyan Arab Jamahiriya' => 'Libyan Arab Jamahiriya',
				'Liechtenstein' => 'Liechtenstein',
				'Lithuania' => 'Lithuania',
				'Luxembourg' => 'Luxembourg',
				'Macao' => 'Macao',
				'Macedonia, The Former Yugoslav Republic of' => 'Macedonia, The Former Yugoslav Republic of',
				'Madagascar' => 'Madagascar',
				'Malawi' => 'Malawi',
				'Malaysia' => 'Malaysia',
				'Maldives' => 'Maldives',
				'Mali' => 'Mali',
				'Malta' => 'Malta',
				'Marshall Islands' => 'Marshall Islands',
				'Martinique' => 'Martinique',
				'Mauritania' => 'Mauritania',
				'Mauritius' => 'Mauritius',
				'Mayotte' => 'Mayotte',
				'Mexico' => 'Mexico',
				'Micronesia, Federated States of' => 'Micronesia, Federated States of',
				'Moldova, Republic of' => 'Moldova, Republic of',
				'Monaco' => 'Monaco',
				'Mongolia' => 'Mongolia',
				'Montenegro' => 'Montenegro',
				'Montserrat' => 'Montserrat',
				'Morocco' => 'Morocco',
				'Mozambique' => 'Mozambique',
				'Myanmar' => 'Myanmar',
				'Namibia' => 'Namibia',
				'Nauru' => 'Nauru',
				'Nepal' => 'Nepal',
				'Netherlands' => 'Netherlands',
				'Netherlands Antilles' => 'Netherlands Antilles',
				'New Caledonia' => 'New Caledonia',
				'New Zealand' => 'New Zealand',
				'Nicaragua' => 'Nicaragua',
				'Niger' => 'Niger',
				'Nigeria' => 'Nigeria',
				'Niue' => 'Niue',
				'Norfolk Island' => 'Norfolk Island',
				'Northern Mariana Islands' => 'Northern Mariana Islands',
				'Norway' => 'Norway',
				'Oman' => 'Oman',
				'Pakistan' => 'Pakistan',
				'Palau' => 'Palau',
				'Palestinian Territory, Occupied' => 'Palestinian Territory, Occupied',
				'Panama' => 'Panama',
				'Papua New Guinea' => 'Papua New Guinea',
				'Paraguay' => 'Paraguay',
				'Peru' => 'Peru',
				'Philippines' => 'Philippines',
				'Pitcairn' => 'Pitcairn',
				'Poland' => 'Poland',
				'Portugal' => 'Portugal',
				'Puerto Rico' => 'Puerto Rico',
				'Qatar' => 'Qatar',
				'Reunion' => 'Reunion',
				'Romania' => 'Romania',
				'Russian Federation' => 'Russian Federation',
				'Rwanda' => 'Rwanda',
				'Saint Helena' => 'Saint Helena',
				'Saint Kitts and Nevis' => 'Saint Kitts and Nevis',
				'Saint Lucia' => 'Saint Lucia',
				'Saint Pierre and Miquelon' => 'Saint Pierre and Miquelon',
				'Saint Vincent and The Grenadines' => 'Saint Vincent and The Grenadines',
				'Samoa' => 'Samoa',
				'San Marino' => 'San Marino',
				'Sao Tome and Principe' => 'Sao Tome and Principe',
				'Saudi Arabia' => 'Saudi Arabia',
				'Senegal' => 'Senegal',
				'Serbia' => 'Serbia',
				'Seychelles' => 'Seychelles',
				'Sierra Leone' => 'Sierra Leone',
				'Singapore' => 'Singapore',
				'Slovakia' => 'Slovakia',
				'Slovenia' => 'Slovenia',
				'Solomon Islands' => 'Solomon Islands',
				'Somalia' => 'Somalia',
				'South Africa' => 'South Africa',
				'South Georgia and The South Sandwich Islands' => 'South Georgia and The South Sandwich Islands',
				'Spain' => 'Spain',
				'Sri Lanka' => 'Sri Lanka',
				'Sudan' => 'Sudan',
				'Suriname' => 'Suriname',
				'Svalbard and Jan Mayen' => 'Svalbard and Jan Mayen',
				'Swaziland' => 'Swaziland',
				'Sweden' => 'Sweden',
				'Switzerland' => 'Switzerland',
				'Syrian Arab Republic' => 'Syrian Arab Republic',
				'Taiwan, Province of China' => 'Taiwan, Province of China',
				'Tajikistan' => 'Tajikistan',
				'Tanzania, United Republic of' => 'Tanzania, United Republic of',
				'Thailand' => 'Thailand',
				'Timor-leste' => 'Timor-leste',
				'Togo' => 'Togo',
				'Tokelau' => 'Tokelau',
				'Tonga' => 'Tonga',
				'Trinidad and Tobago' => 'Trinidad and Tobago',
				'Tunisia' => 'Tunisia',
				'Turkey' => 'Turkey',
				'Turkmenistan' => 'Turkmenistan',
				'Turks and Caicos Islands' => 'Turks and Caicos Islands',
				'Tuvalu' => 'Tuvalu',
				'Uganda' => 'Uganda',
				'Ukraine' => 'Ukraine',
				'United Arab Emirates' => 'United Arab Emirates',
				'United Kingdom' => 'United Kingdom',
				'United States' => 'United States',
				'United States Minor Outlying Islands' => 'United States Minor Outlying Islands',
				'Uruguay' => 'Uruguay',
				'Uzbekistan' => 'Uzbekistan',
				'Vanuatu' => 'Vanuatu',
				'Venezuela' => 'Venezuela',
				'Viet Nam' => 'Viet Nam',
				'Virgin Islands, British' => 'Virgin Islands, British',
				'Virgin Islands, U.S.' => 'Virgin Islands, U.S.',
				'Wallis and Futuna' => 'Wallis and Futuna',
				'Western Sahara' => 'Western Sahara',
				'Yemen' => 'Yemen',
				'Zambia' => 'Zambia',
				'Zimbabwe' => 'Zimbabwe'
				);
		break;
	}

	return $country_list;
}

?>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
Remove <select a value> option roy_mm Reporting Services 0 February 25th, 2007 02:26 AM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM
<STRONG> vs <B> and <EM> vs <I> anshul HTML Code Clinic 12 September 1st, 2004 05:22 PM



All times are GMT -4. The time now is 04:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.