PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 27th, 2009, 08:49 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,149 hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 8 h 53 m 20 sec
Reputation Power: 3178
PHP-General - $_GET using an iframe

Alright, so I'm wondering if I'm doing something wrong or if this is not possible...

Basically I have a left nav folder tree broken down into states, counties, and cities. When a user clicks on a county, I want the right column of the site to have rotating images displayed. For the right column, I have created an iframe.

For each of the tree items, they are all linked as such:
Code:
<a href="#?county=$county" onclick="return false;">County</a>

(Without the onclick="return false;" the folder tree breaks on refresh.) I have also tried without onclick="return false"

For the iframe, I have the following code:
Code:
$county = $_GET['county'];
print $county;


This displays nothing... but if I change the link to:
Code:
<a href="getcounty.php?county=$county">County</a>

It works properly.

I have a Javascript script that will rotate images and that part works.. but I need it to only rotate images for the particular county.

Any input would be appreciated... If you need further information, let me know.

Thanks.

Reply With Quote
  #2  
Old June 27th, 2009, 09:02 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Dec 2004
Posts: 3,227 E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 17 h 39 m 4 sec
Reputation Power: 2061
Nothing following an # sign in a URL is sent to the server, in order to send the variable to the server you will need to remove that.

Your description isn't that clear to me. What exactly needs to happen when you click on a link? Does it need to call a Javascript function? Does it need to change the address of the iframe?
Comments on this post
hiker agrees: Thanks.

Reply With Quote
  #3  
Old June 27th, 2009, 09:30 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,149 hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 8 h 53 m 20 sec
Reputation Power: 3178
Thanks for the reply

Quote:
Originally Posted by E-Oreo
Nothing following an # sign in a URL is sent to the server, in order to send the variable to the server you will need to remove that.

Unfortunate... but good to know.

Quote:
Your description isn't that clear to me. What exactly needs to happen when you click on a link? Does it need to call a Javascript function? Does it need to change the address of the iframe?

In the folder tree on the left, a user can click a state, county, or city. When they click one, the menu drops down. I am wanting to somehow pass the information to an iframe of what they currently clicked on. For example, if a user clicks on Alachua, I want Alachua passed over to the iframe. The iframe is where I have rotating banners displayed. However, I only want banners displayed for the county that has been clicked on. Because of this limitation, I need to somehow pass the county name over which is why I was trying with #?county=$county ...

I don't want the entire page reloaded by linking to itself because then the folder tree will collapse entirely again. So trying to find another way of passing the variable.

Whether a function is called, the address is changed, etc, doesn't really matter... as long as I can somehow get the county name over to the iframe.

Thanks...

Reply With Quote
  #4  
Old June 27th, 2009, 10:49 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Dec 2004
Posts: 3,227 E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 17 h 39 m 4 sec
Reputation Power: 2061
Try setting the A tag HREF attribute to the URL you want to load in the IFRAME, then use the TARGET attribute of the A tag to cause the URL to be loaded in the IFRAME.

Reply With Quote
  #5  
Old June 27th, 2009, 10:58 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,149 hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 8 h 53 m 20 sec
Reputation Power: 3178
Quote:
Originally Posted by E-Oreo
Try setting the A tag HREF attribute to the URL you want to load in the IFRAME, then use the TARGET attribute of the A tag to cause the URL to be loaded in the IFRAME.


I had considered that, but target is depracated, so was trying to stay away from that if possible...

Reply With Quote
  #6  
Old June 27th, 2009, 11:11 PM
ctardi ctardi is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Dec 2006
Location: Midnight Train Going Anywhere
Posts: 1,065 ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 42575 Folding Title: Beginner FolderFolding Points: 42575 Folding Title: Beginner FolderFolding Points: 42575 Folding Title: Beginner Folder
Time spent in forums: 2 Weeks 2 Days 19 h 11 m 14 sec
Reputation Power: 1280
Send a message via MSN to ctardi Send a message via Skype to ctardi
Facebook
Quote:
Originally Posted by hiker
I had considered that, but target is depracated, so was trying to stay away from that if possible...


What if instead of an iframe, you used ajax to pull in a page with the javascript for the rotating banner?
Comments on this post
Onslaught agrees!
hiker agrees: Thanks.

Reply With Quote
  #7  
Old June 27th, 2009, 11:26 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,149 hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 8 h 53 m 20 sec
Reputation Power: 3178
Quote:
Originally Posted by ctardi
What if instead of an iframe, you used ajax to pull in a page with the javascript for the rotating banner?


That would be awesome.... um.. how do I do that?

I don't have to use an iframe... only using one because I thought it would be easy... (for me). I was wrong.

My knowledge is limited in most programming areas... If you could point me in the right direction, that would be great!

I'm doing this site for a friend and well... seem to have gotten myself in way over my head here... but I've learned quite a bit because of this site as well, so I'm not too upset.

Thanks...

Reply With Quote
  #8  
Old June 27th, 2009, 11:34 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,161 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 5 Days 21 h 37 m 35 sec
Reputation Power: 766
Probably the simplest thing would to be to use jQuery's ajax library if your not that comfortable with ajax.

But basically, when you handle the click for expanding the tree, also call a seperate javascript function that makes your ajax request and loads a div in place of your iframe.

i.e.
javascript Code:
Original - javascript Code
  1.  
  2. <script type="text/javascript">
  3. function updateBannerAdd(county) {
  4.     $.ajax({
  5.         type: "POST",
  6.         url: "yourbannerloader.php",
  7.         data: "county="+county,
  8.         success: function(msg) {
  9.              $('#bannerDiv').html(msg);
  10.         }
  11.     });
  12. }
  13. </script>

Of course this is oversimplified, but you get the idea I think. You have a div with an id of bannerDiv and calling updateBannerAdd(county) would return the new html to place in that div for the new county.

Reply With Quote
  #9  
Old June 27th, 2009, 11:54 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Dec 2004
Posts: 3,227 E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 16th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 17 h 39 m 4 sec
Reputation Power: 2061
Quote:
I had considered that, but target is depracated, so was trying to stay away from that if possible...

You could also change the src attribute of the iframe using Javascript in the onclick event for the A tag. You're more likely to run into compatibility issues with that though than with target.

If your iframe currently has Javascript in it you will need to do a bit of re-arranging to make it work over AJAX. When you load data into the page using AJAX, any Javascript code that might be contained within the data is not executed as if it were loaded in an iframe.

Reply With Quote
  #10  
Old June 28th, 2009, 11:18 AM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,149 hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 8 h 53 m 20 sec
Reputation Power: 3178
Quote:
Originally Posted by Onslaught
Probably the simplest thing would to be to use jQuery's ajax library if your not that comfortable with ajax.

But basically, when you handle the click for expanding the tree, also call a seperate javascript function that makes your ajax request and loads a div in place of your iframe.

i.e.
javascript Code:
Original - javascript Code
  1.  
  2. <script type="text/javascript">
  3. function updateBannerAdd(county) {
  4.     $.ajax({
  5.         type: "POST",
  6.         url: "yourbannerloader.php",
  7.         data: "county="+county,
  8.         success: function(msg) {
  9.              $('#bannerDiv').html(msg);
  10.         }
  11.     });
  12. }
  13. </script>

Of course this is oversimplified, but you get the idea I think. You have a div with an id of bannerDiv and calling updateBannerAdd(county) would return the new html to place in that div for the new county.


Alright... so I seem to be doing something wrong.. or just missing something somewhere...

I added the function above, have the link calling the function, created a div, and created the banner.php page to display the county, but nothing is being displayed...

This is what I have taken the above function to mean... it takes $county and sends it via POST to yourbannerloader.php. From within yourbannerloader.php, I have tried pulling the post info via:
$county = $_POST['county'];

Then I tried displaying $county... and nothing is being displayed.

Can you please help clarify... Thanks.

Reply With Quote
  #11  
Old June 28th, 2009, 05:48 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,161 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 5 Days 21 h 37 m 35 sec
Reputation Power: 766
simple things first, the above example is using jQuery, so you would need to have that library loaded before the call to the function. Got this step? Just making sure.

Your synopsis of the function is correct, when called it should invoke an ajax request to yourbannerloader.php with the country argument being sent via post.

Reply With Quote
  #12  
Old June 30th, 2009, 10:26 AM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,149 hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 8 h 53 m 20 sec
Reputation Power: 3178
Quote:
Originally Posted by Onslaught
simple things first, the above example is using jQuery, so you would need to have that library loaded before the call to the function. Got this step? Just making sure.

Your synopsis of the function is correct, when called it should invoke an ajax request to yourbannerloader.php with the country argument being sent via post.


Since the folder tree is using jQuery, I already have the library loaded... don't I? (Yes, you can talk to me like I'm a beginner).

Reply With Quote
  #13  
Old June 30th, 2009, 10:46 AM
simshaun's Avatar
simshaun simshaun is offline
$x=104;echo chr($x++),chr($x);
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2008
Location: North Carolina
Posts: 1,658 simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)simshaun User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 18142 Folding Title: Novice Folder
Time spent in forums: 2 Weeks 4 Days 2 h 18 m 38 sec
Reputation Power: 1384
Yes you should have the library loaded already.

Can you post your full code?

Reply With Quote
  #14  
Old June 30th, 2009, 12:03 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,149 hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)hiker User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 8 h 53 m 20 sec
Reputation Power: 3178
This is what populates the folder tree (left nav):
Code:
if (mysql_num_rows($result) != '0') {
  while($row = mysql_fetch_array($result)) {
	  $string5= $row['string'];
	  $state3 = $row['state'];
	  $county3 = $row['county'];
	  $city3 = $row['city'];
		$item3 = $row['item_name'];
		if ($state2 != $state3) {
			if ($i != 1) {
		    $treeview .= "</ul></li></ul></li></ul></li>";			
		  }
		  $i++;
			$treeview .= "<li class=\"expandable\"><div class=\"hitarea expandable-hitarea\"><a href=\"#\" style=\"margin-left:20px;\"onclick=\"return false;\">".$state3."</a></div><br />";
			$state2 = $state3;
			$j = 1;
		}
	  if ($county2 != $county3) {
			if ($j != 1) {
		    $treeview .= "</ul></li></ul></li></ul>";			
		  }
		  $j++;
		  $treeview .= "<ul style=\"display:none;\">";
		  $treeview .= "<li class=\"expandable\"><div class=\"hitarea expandable-hitarea\"><a href=\"#\" style=\"margin-left:20px;\" onclick=\"updateBannerAdd(county); return false;\">".$county3."</a></div><br />";
		  $county2 = $county3;
		}
		if ($city2 != $city3) {
      $treeview .= "<ul style=\"display:none;\">";
		  $treeview .= "<li class=\"expandable\"><div class=\"hitarea expandable-hitarea\"><a href=\"#\" style=\"margin-left:20px;\" onclick=\"return false;\">".$city3."</a></div><br />";
			$city2 = $city3;
      $treeview .= "<ul style=\"display:none;\">";		
		}
		if ($item3) {
//		  $treeview .= "<li><a href=\"index.php\">".$item3."</a></li><br />";
		  $treeview .= "<li>".$item3."</li>";
			$item2 = $item3;
		}
	} 
}
$treeview .= "</ul></li></ul></li></ul></li></ul>";


All the javascript links and such:
Code:
  <link rel="stylesheet" href="./jquery.treeview.css" />
  <link rel="stylesheet" href="./red-treeview.css" />
	<link rel="stylesheet" href="screen.css" />
  <link rel="stylesheet" href="um.css" type="text/css" />
	
	<script src="./jquery.js" type="text/javascript"></script>
	<script src="./jquery.cookie.js" type="text/javascript"></script>
	<script src="./jquery.treeview.js" type="text/javascript"></script>
	
	<script type="text/javascript">
		$(function() {
			$("#tree").treeview({
				collapsed: true,
				animated: "medium",
				control:"#sidetreecontrol",
				prerendered: true,
				persist: "location"
			});
		})
		
	</script>

<script type="text/javascript">
function updateBannerAdd(county) {
    $.ajax({
        type: "POST",
        url: "banner.php",
        data: "county="+county,
        success: function(msg) {
             $('#bannerDiv').html(msg);
        }
    });
}
</script> 


The div:
Code:
<div id="bannerDiv"></div>


Banner.php
Code:
<?php
print $county;
?>


I've also tried banner.php with $county = $_POST['county'];

If you need the code from any of the .js or .css files, just let me know.

Thanks.

Reply With Quote
  #15  
Old June 30th, 2009, 12:07 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,161 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 5 Days 21 h 37 m 35 sec
Reputation Power: 766
php Code:
Original - php Code
  1. onclick=\"updateBannerAdd(county); return false;\">".$county3."
should probably be
PHP Code:
 onclick="updateBannerAdd('".$county3."'); return false;\">".$county3.


You have to pass the specific county value to the javascript function, in your current incarnation, county is not set.
Comments on this post
simshaun agrees: beat me to it

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - $_GET using an iframe


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
Stay green...Green IT