SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot mudda's Avatar
    Join Date
    Jul 2005
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    posting variable to another page ...

    What I was looking to do was open a new window with the current variables attached. I'm trying to make a 'printable' page without all the buttons on it, but am not sure about how to send the variables over. Is there an easy way to do this? Probably thru a session right? I've never really worked with sessions, so if this is the way, could someone explain it alittle to me?

  2. #2
    SitePoint Evangelist klik's Avatar
    Join Date
    Jan 2005
    Location
    Scotland, UK
    Posts
    547
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Either via $_GET or $_SESSION

  3. #3
    SitePoint Zealot mudda's Avatar
    Join Date
    Jul 2005
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would have to $_GET for all the variable on the initial page correct? And what would I have to put on the initial page to send the variables over?

  4. #4
    SitePoint Zealot mudda's Avatar
    Join Date
    Jul 2005
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I figured it out. I only had to call over the values I did in the first place. And I sent them over via URL. Here is the code I used ...

    Code:
    <a href='printable.php?chosen=".$row['groupname']."&amp;db=".$dbselect."&amp;column=groupname'>".$row['groupname']."</a>

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2005
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not PHP per se... but you should also look at creating printable versions via CSS. It's trivially easy.

    <link type="text/css" rel="stylesheet" href="print_sheet.css" media="print" />

    Then in print_sheet.css
    #menu {
    display:none;
    }

    Take a look at http://www.w3schools.com/css/default.asp


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •