<?php echo $_SESSION['product']; ?>
<?php echo $_SESSION['product']; ?>
<?php $_SESSION['product']; ?>
$.ajax({
type: 'POST',
url: "scripts/processForm1.php",
cache: false,
datatype: "html",
success: function(data){
…
}
});
$.ajax({
type: 'POST',
url: "[[snippet-name]]",
cache: false,
datatype: "html",
success: function(data){
…
}
});
<?php
session_start();
require_once 'database_connection.php';
require_once 'clean_up.php';
// Determine if the username is available or not,
// and returns a JSON { "valid": true } or { "valid": false }
$isAvailable = false;
// Get the username from request
$zip = mr_clean($_POST['zip']);
$query = "SELECT * FROM zipcodes WHERE zipcode = ".$zip.";";
$result = mysql_query($query);
if ($result) {
$num_rows = mysql_num_rows($result);
if($num_rows == 1){
$location = mysql_fetch_array( $result );
$city = $location['city'];
$_SESSION['city']= $city;
$_SESSION['location']= $location['city'].', '.$location['state'];
$isAvailable = true;
}
}
echo json_encode(array(
'valid' => $isAvailable,
));
?>
<div class="col-md-12">
<h1>Here are some <?php echo $_SESSION['product']; ?> Insurance Quotes in <?php echo $_SESSION['city']; ?> </h1>
<h4 id="continue-form">Continue the form below or call (800) 555-5555 to speak to an agent instantly!</h4>
</div>
session_start();
include $modx->getOption(base_path) . 'scripts/' . $include . '.php';
[[!includeScript? &include=`processForm1`]]
$.ajax({
type: 'POST',
url: "[[~99]]",
cache: false,
datatype: "html",
success: function(data){
…
}
});
return $_SESSION[$var];
<div class="col-md-12">
<h1>Here are some [[!getSessionVar? &var=`product`]] Insurance Quotes in [[!getSessionVar? &var=`city`]] </h1>
<h4 id="continue-form">Continue the form below or call (800) 555-5555 to speak to an agent instantly!</h4>
</div>