GsT Posted December 9, 2009 Share Posted December 9, 2009 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 More sharing options...
Goldeneye Posted December 9, 2009 Share Posted December 9, 2009 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; ?> Link to comment https://forums.phpfreaks.com/topic/184512-open-a-link-automatically-with-php/#findComment-974050 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.