Jump to content

Open a link automatically with PHP...


GsT

Recommended Posts

Hi,

 

How do you open a link automatically with PHP?

 

Here is my specific problem. I have a simple PHP login form with password security. When the user logs in succesfully I would like the script to open a link automatically. All this because I am using a the LightWindow (http://www.stickmanlabs.com/lightwindow/#howtouse) Javascript to open a PDF-file, and this script is activated by clicking a link.

 

Any ideas how to get the link to open without actually having to click on it manually so to speak?

Link to comment
https://forums.phpfreaks.com/topic/184512-open-a-link-automatically-with-php/
Share on other sites

With PHP? You wouldn't really automatically open a link. Instead, you'd have use the header function to redirect to the PDF file.

 

Example:

<?php
if(/*USER IS LOGGED IN*/){
    $pdf_file_path = '/path/to/pdf/file';
    header('Location: '.$pdf_file_path) and exit;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.