GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 05-Mar-2004, 21:32
JUNK KED JUNK KED is offline
Awaiting Email Confirmation
 
Join Date: Oct 2003
Location: uk&ireland
Posts: 85
JUNK KED will become famous soon enough

passing variables out of an iframe by url


Hi guys,

I am fairly new to php. I am developing a ringtone reseller site. The ringtones,games and graphics are provided by another site.
Calls to the database are passed by URL to a php file on the server.
(eg http;//yadayadayada.com/returnval.php?x=1&y=2)

This part is working fine.
However I decided to use iframes. Passing variables to files that display in the iframes can be done using relative addresses.
But when trying to pass variables by relative address out of the iframe it will not work. I can do this only by using absolute Urls (eg ......).

I think it has to do with the parent page but I am not sure.

This is not really a problem but as I am developing in a different site I will have to change the absolute URLs when I move.

Does any body know the correct way to pass variables with a relative path from an iframe.

The development folder is viewable if you want to laugh at my layout.
I may change my mind about the use of iframes or try to make my own mysql database.
Feel free to pop in and watch the pages develop. I dont have browser checking this is just to test the php, the css is broken on MOZILLA.
Dont worry I will fix this in the future.

www.cashformulas.com

as you can see the index is a static html page.

junk ked
  #2  
Old 06-Mar-2004, 23:43
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
I have passed variables via iframes and never had a problem before, maybe a snippet of code where this fails will help.
  #3  
Old 07-Mar-2004, 20:21
JUNK KED JUNK KED is offline
Awaiting Email Confirmation
 
Join Date: Oct 2003
Location: uk&ireland
Posts: 85
JUNK KED will become famous soon enough
Quote:
Originally Posted by JdS
I have passed variables via iframes and never had a problem before, maybe a snippet of code where this fails will help.

Hi there,

I use this to pass variables to the frame

<a href="#" onClick="content.location='display.php?CID=892&TID =2'">

I use this to pass to an included file on my own server

include "http://www.cashformulas.com/tunaphptemplate/showgroups.php?CID=$CID&TID=$TID" ; (this works)

I tried

include "showgroups.php?CID=$CID&TID=$TID" ;

and

include ('showgroups.php?CID=$CID&TID=$TID') ;

niether format works inside a frame but both work outside the frame!

I also checked
include ('showgroups.php') ;
include "showgroups.php" ;

both opened showgroups from inside the frame.It just wont work with variables!

By the way the book that I am studying "luke welling & laura thompson, php and mysql web development" uses the bracket single quote (' as their prefered method. Which is the proper way? the double quote " was used by the reseller in all their examples.

Looking at this problem for the third time I think it is probably a javascript DOM foible of iframes.

Any suggestions. Do not go out of your way , like I said it is not a real problem and once I have tested all the php and deployed the first version, I will start work on importing the database.

Now THAT will be fun!!

Thanks for the interest

Junk Ked
  #4  
Old 08-Mar-2004, 05:55
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Looks like you've figured it out? The sample page looks all okay now... in any case I STILL had problems understanding the second explanation of the issue, to be honest.
  #5  
Old 10-Mar-2004, 08:52
cs2 cs2 is offline
Member
 
Join Date: May 2003
Location: California
Posts: 107
cs2 will become famous soon enough
Quote:
Originally Posted by JUNK KED
PHP Code:

include ('showgroups.php');
include "showgroups.php"; 



[...]

By the way the book that I am studying "luke welling & laura thompson, php and mysql web development" uses the bracket single quote (' as their prefered method. Which is the proper way?
"Include" is a language construct, not a true function, so either way is correct re brackets or not. As for quotes (single vs. double), the normal parsing rules apply -- if there are no interpreted statements (e.g., constants or variables), use single quote for a slight speed boost (tells the parser to ignore what is inside the quotes, and treat it as a literal).
__________________
The Whole Internet, LLC
Visit our Homepage, -or-
use our online CSS Editor
  #6  
Old 31-Jul-2007, 10:33
neon neon is offline
New Member
 
Join Date: Jul 2007
Posts: 1
neon is on a distinguished road

Re: passing variables out of an iframe by url


I'm facing a similar but slightly different challenge. We use a Content Management System (CMS) which is .asp based but had to develope a PHP/MySQL interface for a calendar of events due to the limitations of the CMS software. The PHP application was pretty easy and straight-forward to develope, but when it came time to place it in the CMS our options where limited to the use of "iframes".

Here is the challenge: We have a homepage interface placed in an iframe which is dynamically place on that page via the CMS, and we have a more full version of the calendar on a separate CMS generated page within another iframe. It is quite easy to have results display in the same iframe on the same CMS generated page, the challenge is to get a dynamically generated page within a dynamically generated iframe have a dynamically generated link have results display on another iframe on another dynamically create page.

How do I get the .asp dynamic link with asp variables to open the correct search results in another asp pages iframe based on PHP?
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem putting variables cumulatively into a string, warny_maelstrom C Programming Language 3 05-Feb-2004 10:29
Not finding POST variables shrdlu Apache Web Server Forum 2 22-Jan-2004 19:50
Apache on Windows XP and passing variables Jos Elkink Apache Web Server Forum 4 21-Nov-2003 03:21
C++ variables question pcxgamer C++ Forum 2 19-Sep-2003 04:01
PHP variables nniehoff MySQL / PHP Forum 7 26-Jul-2002 07:25

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:17.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.