#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    Chicago
    Posts
    81
    Rep Power
    13

    Question Passing PHP variables with javascript


    I am developing a page for a private school in which you can enroll online. After you enroll and the data goes to the database, you receive an email with a link to click on and it tells you to print the page you see. The link was made in the parsing form and sends all the variables back to the users email so when they click the link, all their info is on the signup sheet. However, there are three sheets that need to be printed and I want to improve upon my methods and put in a control panel with javascript. The URL i specify is something like this:

    https://web17.omnis.com/exceld/print_page.php?fname=$fname

    This control panel then has three form buttons with all the persons info in each form so when they click on one, it will bring the page with their info. The problem is this. (or at least i think it is this) Since the javascript is client side, it executes and the link looks just like above. Then the php executes but it doesnt pass the variables to the script to open a new window. So anyways, I cant pass the needed variables from the link in the users mailbox to the print_page.php page to the control_panel.php page. Any and all help is greatly appreciated. Thanks a lot,
    kevin
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    New Zealand
    Posts
    167
    Rep Power
    14
    Hi Kevin,

    I use javascript and php together frequently, so I think I see what you're getting at. Could you possibly post some code?

    Just off the top of my head tho:

    How is that url being generated, that's really the crunch thing. If the page is being written and the url is always: https://web17.omnis.com/exceld/print_page.php?fname=$fname and the only thing that changes is the value of $fname, can you use php to generate the url and echo it out on the page? That way, the url ends up as: https://web17.omnis.com/exceld/print_page.php?fname=Jen by the time it hits the client side or gets put into the email. Then you can click on it and it will create a variable $fname with the value 'Jen' on the page print_page.php.

    This might be totally off base, but if you post some code I'll try to be more helpful!

    Cheers,

    Jen

IMN logo majestic logo threadwatch logo seochat tools logo