Skip to content

Instantly share code, notes, and snippets.

@johnsiwicki
Last active March 22, 2018 13:21
Show Gist options
  • Select an option

  • Save johnsiwicki/e417c311ab8b964aa64d2f7183cc902a to your computer and use it in GitHub Desktop.

Select an option

Save johnsiwicki/e417c311ab8b964aa64d2f7183cc902a to your computer and use it in GitHub Desktop.
$data = array(
'firstname' => $_POST['form_logger_First_Name'],
'lastname' => $_POST['form_logger_Last_Name'],
'phone1' => $_POST['form_logger_Phone'],
'email1' => $_POST['form_logger_Email_Address'],
'streetaddress' => $_POST['form_logger_Street'],
'city' => $_POST['form_logger_City'],
'state' => $_POST['form_logger_State'],
'zip' => $_POST['form_logger_Zip_Code'],
'source' => ' $_POST['new-dropdown']',
'sourcetype' => ''
);
$serialize = http_build_query($data);
$request = curl_init('https://truguardconstruction.secure.force.com/services/apexrest/i360/eLead');
curl_setopt($request, CURLOPT_POST, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $serialize);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($request);
curl_close($request);
// get all of the nav links in a array
const navLinks = document.querySelectorAll('#top-nav-list li a');
//loop through all the links
for (i = 0; i < navLinks.length; i++) {
if (navLinks[i].href == 'https://www.visionairewindows.com/about-us/financing.html') {
//add class to the parent LI
navLinks[i].parentNode.classList.add('has-dropdown');
// dropdown code
$(navLinks[i]).after('<ul class="dropdown m-menu short" style="display: none;"><li class="title back js-generated"><h5><a href="javascript:void(0)">Back</a></h5></li><li class="parent-link hide-for-medium-up"><a class="parent-link js-generated" href="https://www.visionairewindows.com/about-us.html"><span>About Us</span></a></li><li><div class="row"><div class="columns"><ul class="m-menu-ul short"><li><a href="https://www.visionairewindows.com/about-us.html">About Us</a><ul></ul></li></ul></div></div></li></ul>');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment