LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   render a graphic in another webpage with options (https://www.linuxquestions.org/questions/programming-9/render-a-graphic-in-another-webpage-with-options-643881/)

PB0711 05-21-2008 04:41 PM

render a graphic in another webpage with options
 
Dear all,

I would like to be able to pass two variables to a webpage (php) that will be embedded in another webpage. This page has 4 options which can be given to the page.
Idealy I would like something where the user clicks on the form button and the embedded page reloads and shows the new image. However, I'll also go with a submit button (what I currently am working on). However doing it this way I run into the problem that when I click submit my first parameter isn't called back up for the page.

How can I get the 1st variable recalled up. ie
index.php?idNum=1023&paramA=0
but when I hit submit I get
index.php?paramA=40
even thou I have (well I thought I did) coded for the 1st parameter to be there (the idnum). I used $_REQUEST and $SERVER['QUESRY']

Any pages or even code that someone can point me to for either the nicer auto reloading of the embedded page or the submit button way would be great.

Thanks

nc3b 05-22-2008 01:13 AM

Try with an iframe and a bit of javascript. Here is the main script

PHP Code:

//js functions
<script>
function 
call_iframe()
{
    
document.getElementById("iframe_id").src="script2.php?param1=val1&param2=val1" //etc
}
</script>

<iframe name="iframe_name" id="iframe_id" src=""></iframe> 

script2.php

PHP Code:

<?
    
echo($_GET["param1"]);
?>

Of course you can also employ some ajax tricks but this also seems to do the job:)

PB0711 06-04-2008 07:43 PM

thank you. I havn't got to implementing it yet so I might come back and ask but as always google is my friend :D


All times are GMT -5. The time now is 09:32 AM.