Help.. php mysql javascript and frames

phuschnickensphuschnickens Beverly Hills, Michigan Member
edited April 2009 in Internet & Media
I'm using frames... even though i think they suck my needs make pretty good use of them i think. I'm using php and mysql. I'm carrying the input from a form on the previous php page via the $_POST variable. In the next php file (the one I'm struggling with), I set a javascript variable to equal the $_POST variable. My goal is to reference the javascript variable in "frame src="variable' + ' .pdf"> . I've run into a few different things, but think i'm close. For some reason the <skript></script> tags (and what's held within) totally kill the rest of the file. I get rid of that section of code and the frames magically reappear. Oh, and I have tried moving the script tags around... and making two separate script sections, etc.

Any help is greatly appreciated. Had to attach the php file in a txt file bc icrontic doesn't like to see it posted. Thanks!


org.php.txt

Comments

  • LincLinc Owner Detroit Icrontian
    edited April 2009
    This is all your PHP file needs to have:
    [html]
    <frameset rows="150px, 80%" frameborder = "0">
    <frame src="<?php echo $_POST; ?>.pdf">
    </frameset>
    [/html]

    Your error was that you simply stated the POST variable without actually echoing it into the document. If you look at your source after the page loads, it probably said that it was setting the Javascript variable to nothingness.

    In any case, you can deposit the PHP variable right into the page without needing to make it all complicated with Javascript.
  • phuschnickensphuschnickens Beverly Hills, Michigan Member
    edited April 2009
    i feel stupid (i'm constantly saying those three words in threads i start).

    so simple.

    thank you thank you.
Sign In or Register to comment.