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

    Join Date
    Nov 2001
    Location
    Chicago
    Posts
    81
    Rep Power
    14

    passing php variables in a javascript OpenWindow script


    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
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    2
    Rep Power
    0
    Hy,

    I don't know if I misunderstood you, but for me, the answer is quite simple.

    You get $fname by url,
    now you create a jsfunction in the head:

    function somefunction(var) {
    window.open(); /* whatever you want "var" to change */
    }

    call the function in the body with:

    onClick="somefunction(<? echo $fname; ?>);"

    I hope it was helpful.

    Regards

    Stefan

IMN logo majestic logo threadwatch logo seochat tools logo