auto save the link from the browser

Posted on 2012-08-17
Last Modified: 2012-08-20
i have  a report that prints each month to the screen automatically ,
can the link be saved automatically then it will be putting on the body of the email to be send  to the customer...
Question by:asaidi
    LVL 107

    Accepted Solution

    The current link address (URL) is usually available in these two variables:


    I say "usually" because not every PHP installation is the same.  You should try echoing those out to the browser output stream to see if they contain what you expect.  If you've got the information you need in there, you can depend on these variables.  You may also find interesting information in $_SERVER['HTTP_REFERER'] but in my experience this is less dependable because individuals can access scripts directly (perhaps from bookmarks) and when the access is direct, the HTTP_REFERER may be blank.
    LVL 29

    Expert Comment

    by:Olaf Doschke
    It's unclear what you want.

    There are many kinds of reports you could do with or without PHP into Word, PDF, Excel, etc. besides of course simply outputting a html page.

    And what link do you want to save where? into what? Into favorites of the browser? Into the report itself?

    How is email involved at all? Is the report automatically mailed? Or is that the step missing?

    Bye, Olaf.

    Author Comment

    Hi Olaf
    normally this report will be send automatically by  email to the customer..
    i thought we could not do an automatic send then i want to save the result from the browser to my c:
    then write an email script and put the link saved into body of email ,then the customer can only click on the link and he get the result..then if he wants to print it he can do..
    LVL 107

    Expert Comment

    by:Ray Paseur
    I think you can send the URL of a page or create a link to the page using the variables shown above.  Install and run this script to check the values:

    <?php phpinfo();

    Open in new window

    LVL 29

    Expert Comment

    by:Olaf Doschke
    Well, do you have control about the php script at all?

    If the link you have creates a page your customers want to see and print, and you have control over that php script and can change it, you can instead send the output of the script as an html mail to a customer.

    If you the script isn't yours, but the link is displaying the page for anyone, not depending on login or cookies, simply send the link over for a customer to go there and print it.

    But to get the page yourself and save it to mail it would be an overhead in any situation, won't it?

    Bye, Olaf.

    Featured Post

    Course: HTML5 for Beginning Beginners

    Are you looking for an efficient introduction to HTML5? Have you tried other HTML5 courses and found them too complex? Do you need just the basics of HTML5 to use with Wordpress or other content management system? If you said yes to any of these questions, this course is for you.

    Join & Write a Comment

    Suggested Solutions

    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    Introduction HyperText Transfer Protocol ( or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now