I have a PHP page inside an iFrame on a page I have created on my network. I would like to pass information from the member profile (unique ID and name) to my page. Any ideas how I can do this?

Views: 47

Reply to This

Replies to This Discussion

Hi Saville,

I think you'll need some javascript in your page that constructs the iFrame for you, and builds the scr attribute based on the ning.CurrentProfile.fullname variables etc.

Thanks Phil. Can you give me an example of the Javascript I would need to, let's say, display the users fullname. Once I have this I think I can go from there.

Hi Saville,

If you view source on a page when you're signed in, you'll see we create a javascript object called ning.CurrentProfile that has a few different variables in it. ning.CurrentProfile.fullName will give you the name of the currently signed in user. If it's null, then that's a signed out pageview, and you should not generate your iFrame or do something else.

Thanks,
Phil

Thanks Phil. I will take a look and see if I can get this sorted.

Here's a very simple example:

<script type="text/javascript">

alert(ning.CurrentProfile.fullName);

alert(ning.CurrentProfile.photoUrl);

</script>

RSS

Latest Activity

Kos replied to SweetPotato's discussion 'Simple, Responsive Slider for Ning 3.0'
"Oye it's back again.  smh  SP would you take a look for me purdy puhleeease and see…"
39 minutes ago
Kos replied to Kos's discussion 'What's The Best Width When Designing A Header in 3.0?' in the group The Sandbox
"I ended up just designing/uploading a logo and moving my tabs up to the right side.  No CSS…"
1 hour ago
Kos replied to Joao Fernandes's discussion 'Easy Slider For Ning 2.0'
"Slideful works in 2.0 as well.  Free, very easy and versatile as well. On occasion I…"
1 hour ago
Kos replied to Allison Leahy's discussion 'Facebook App Updates'
"Allison thank you for posting this.  That July update reminder was becoming annoying and I…"
1 hour ago
Peter Matthews replied to Peter Matthews's discussion 'Will I be able to merge my 2.0 site with a 3.0 site that I am building now?'
"Dear Phil & Susie, thanks for the replies. It might be good for us to think of different ways…"
2 hours ago
Fire-Tech replied to soaringeagle's discussion '3.0 feature request'
"+1"
9 hours ago
Allison Leahy replied to soaringeagle's discussion '3.0 feature request'
"Thanks. I'll make sure this is filed as a feature improvement for 3.0."
11 hours ago
Kos replied to SweetPotato's discussion 'Simple, Responsive Slider for Ning 3.0'
"Ha!  Nevermind.  Suddenly it's back to normal again.  Gremlins in the hardware,…"
11 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service