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? Quote Link to comment 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; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.