LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-21-2008, 04:41 PM   #1
PB0711
Member
 
Registered: Aug 2004
Location: London, UK
Distribution: Ubuntu 10.10, ubuntu 11.04, suse 9.2, OSX
Posts: 259

Rep: Reputation: 30
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
 
Old 05-22-2008, 01:13 AM   #2
nc3b
Member
 
Registered: Aug 2005
Posts: 330

Rep: Reputation: 32
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

Last edited by nc3b; 05-22-2008 at 01:14 AM.
 
Old 06-04-2008, 07:43 PM   #3
PB0711
Member
 
Registered: Aug 2004
Location: London, UK
Distribution: Ubuntu 10.10, ubuntu 11.04, suse 9.2, OSX
Posts: 259

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphic Driver: How to set up Livna graphic support? Chuong Linux - Software 11 08-20-2006 01:15 AM
Webpage does not render correctly in Konqueror. Maritime Linux - Newbie 6 05-19-2006 07:17 PM
fix CSS HTML built webpage to render in IE titanium_geek Programming 5 01-30-2006 05:33 PM
Mozilla Won't Render Aram Linux - General 0 02-04-2002 11:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration