Skip to main content

Posts

Showing posts from October, 2019

Redirect In contact form 7

add_action( 'wp_footer' , 'redirect_cf7' ); function redirect_cf7() { ?> < script type = "text/javascript" > document.addEventListener( 'wpcf7mailsent' , function ( event ) { if ( '1377' == event.detail.contactFormId ) { // Sends sumissions on form 947 to the first thank you page location = 'https://www.panelesyceldassolares.com/regreso' ; } else { // Sends submissions on all unaccounted for forms to the third thank you page location = 'https://www.panelesyceldassolares.com/regreso-2/' ; } }, false ); </ script > <?php }

Extract file.zip is in the same directory as the executing script.

<?php // assuming file.zip is in the same directory as the executing script. $file = 'Tmpfile.zip'; // get the absolute path to $file $path = pathinfo(realpath($file), PATHINFO_DIRNAME); $zip = new ZipArchive; $res = $zip->open($file); if ($res === TRUE) {   // extract it to the path we determined above   $zip->extractTo($path);   $zip->close();   echo "WOOT! $file extracted to $path"; } else {   echo "Doh! I couldn't open $file"; } ?>