formatter

Hello all,

i was working for a client when i needed a solution to this issue; i crawled the whole web but nothing satisfactory came up.

Later i came with this piece of code that works really good and i have tested it in several browsers and its ok.

<html>

////////////////////////////////////////////////////////////////////
 // PERFECT                                                       //
 // -------                                                       //
 // Javascript Code That Initiates a Download with Redirect       //
 // File: feedback.php                                            //
 // Version: 1.0 (Nov 10, 2017)                                   //
 // Description: This Piece of code Initates a File Download      //
 // and at the same time redirect                                 //
 // to a specified page.                                          //
 // Instructions: Go to "http://www.john.ng".                     //
 // License: Public Domain Software                               //
 //                                                               //
 // John's Tech Hub * https://john.ng * John Onyejegbu            //
 //////////////////////////////////////////////////////////////////

<script>
 setTimeout(function() {
 var redirectWindow = window.open('http://filedownload.com/file.pdf', '_blank'); //downloa
 redirectWindow.location;
 window.location.href = 'https://page-to-be-redirected-to.com';// Redirect
 }, 1000); //set redirect time
 </script>

</html>

This piece of code also works within php with an echo function.

Enjoy!!!

Comments

comments

SHARE
Previous articleFormBook Form Grabber Malware
Next articleSeandovi Defensive Cyber Security Training
John Onyejegbu

John Loves to code!!! He loves engaging in challenging tasks, identifying problems in our society and using technology to solve those problems!!!
I am a strong software developer with an extensive background in all part of the software development lifecycle. My unique career has given me Experience in not only development, but project management, database design and management, software testing, quality assurance, and disaster recovery planning.