$v) { $form[$k] = trim($v); } } $form["model"] = mysql_real_escape_string($_REQUEST["model"]); if ($form["model"] == "" || $form["model"] == "NULL") { $form["model"] = "arw"; } # $query = "select countryname from essl_country.country order by countryname asc"; $query = "select countryname from wrfweb.wrf_country order by countryname asc"; # $result = mysql_query($query); $result = $mysqli->query($query); $country_options = "\n"; $citizenship_options = "\n"; # while ($row = mysql_fetch_row($result)) { while ($row = $result->fetch_array()) { $c = ucwords(strtolower($row[0])); if ($form["country"] == $c) { $selected = " SELECTED"; } else { $selected = ""; } $country_options .= "\n"; $c = ucwords(strtolower($row[0])); if ($form["citizenship"] == $c) { $selected = " SELECTED"; } else { $selected = ""; } $citizenship_options .= "\n"; } $affiliation_types = array("US Universities", "US Government / State Agencies", "US Private Companies", "US Non-Profit", "Non-US Universities", "Non-US Governmental / Provincial Agencies", "Non-US Private Companies", "Non-US Non-Profit"); #$intended_usages = array("Numerical Weather Prediction", # "Idealized Simulations", # "Coupled Models", # "Regional Climate", # "Data Assimilation", # "Atmospheric Chemistry / Transport / Air Pollution", # "Military Purposes", # "Teaching", # "Non Meteorological Applications", # "Other"); $intended_usages = array('WRFDA', 'WRFPLUS', 'MADIS2LITTLER', 'Numerical Weather Prediction', 'Idealized Simulations', 'Coupled Models', 'Regional Climate', 'Data Assimilation', 'Atmospheric Chemistry / Transport / Air Pollution', 'Military Purpose', 'Teaching', 'Non Meteorological Applications', 'Other'); ?> WRF Data Assimilation System Download: New User Registration
 

 

Overview

WRFDA

WRFPLUS

Test data

FSO

MADIS2LITTLER

Tools

Free Input Data

 

 

 

WRFDA Source Code Download: New User Registration

"; print_r($values); exit; if (is_array($values)) { foreach ($values as $key => $value) { $values[$key] = db_escape($value, $quotes); } } else if ($values === null) { $values = 'NULL'; } else if (is_bool($values)) { $values = $values ? 1 : 0; } else if (!is_numeric($values)) { $values = mysqli_real_escape_string($mysqli, $values); if ($quotes) { $values = '"' . $values . '"'; } } return $values; } function required($name) { global $form_errors; if ($form_errors["$name"] != "") { return " required"; } else { return ""; } } function check_form($form) { if ($form["firstname"] == "") { $errors["firstname"] = "First Name"; } if ($form["lastname"] == "") { $errors["lastname"] = "Last Name"; } if ($form["email"] == "") { $errors["email"] = "E-Mail Address"; } if ($form["affiliation"] == "") { $errors["affiliation"] = "Affilication (Company Name)"; } if ($form["affiliation_type"] == "") { $errors["affiliation_type"] = "Affilication Type"; } if ($form["city"] == "") { $errors["city"] = "City"; } if ($form["country"] == "") { $errors["country"] = "Country Where You Work"; } if ($form["citizenship"] == "") { $errors["citizenship"] = "Country of Citizenship"; } if ($form["intended_usage"] == "") { $errors["intended_usage"] = "Intended WRF Software Usage"; } // if ($form["model"] == "") { // $errors["model"] = "Download Preference"; // } if ($form["intended_usage"] == "Other" && $form["intended_usage_other"] == "") { $errors["intended_usage"] = "\"Other\" Intended Usage"; } return $errors; } $form["submit"] = $_POST["submit"]; if ($form["submitted"]) { $form_errors = check_form($form); } if ($form_errors) { print "

Please fill out the following required fields:

\n"; print "
    \n"; foreach ($form_errors as $form_error) { print "
  • $form_error
  • \n"; } print "
\n"; $form["submit"] = ""; } if ($form["submit"] == "") { ?>

All fields below are required. Information collected here is for internal use only.

First Name

">

Last Name

">

E-Mail Address

">
> Subscribe to WRF-News mailing list?

Affiliation (Company Name)

">

Affiliation Type

City

">

Country Where You Work

Country of Citizenship

Intended WRF Software Usage

Please specify other usage:
">

">
$query"; # $result = mysql_query($query); $result = $mysqli->query($query); # if (mysql_num_rows($result) > 0) { if ($result->num_rows > 0) { # $row = mysql_fetch_row($result); $row = $result->fetch_row(); $user_id = $row[0]; $query = <<query($query); } else { $query = <<query($query); # $user_id = mysql_insert_id(); $user_id = $mysqli->insert_id; } if ($user_id) { print '

User registration successful!

'; if ($form["subscribe"] == "on") { # $to = "akiyama@ucar.edu"; $to = "wrf-news-subscribe@ucar.edu"; $subject = "subscribe " . $form["email"]; $body = $subject; $headers = "From: " . $form["email"] . "\r\n" . "X-Mailer: php"; if (mail($to, $subject, $body, $headers)) { print '

A request to subscribe to WRF-News has been sent.

'; print '

Please check your inbox for subscription confirmation instructions.

'; } else { # print "$to
$subject
$body
$headers"; print '

A request to subscribe to WRF-News was not successfully.

'; print '

Please visit this WRF-News subscription page to manually subscribe.

'; } } if ($form["model"] == "arw") { $goto_url = "http://www2.mmm.ucar.edu/wrf/users/download/get_sources.html"; # $goto_url = "http://www2.mmm.ucar.edu/wrf/users/download/get_source2.htm"; } elseif ($form["model"] == "nmm") { $goto_url = "http://www.dtcenter.org/wrf-nmm/users/downloads/index.php?email=" . $form["email"]; } else { $goto_url = ""; } print '

Please click here to proceed to the download page.

'; } else { print '

User registration unsuccessful.

'; print '

Please click here to try again.

'; } } ?>