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 Paul Crane's discussion '3.0 customizing content' in the group The Sandbox
"In 3.0  you set the privacy for each individual page - not just network wide; so I can have…"
4 minutes ago
Kos replied to Kos's discussion '3.0 My Thoughts From A Non-Coder (edited 5/19/13)' in the group The Sandbox
"Edit to add: text editor not responsive vertically or horizontally on Samsung SIII"
24 minutes ago
Kos replied to Kos's discussion '3.0 My Thoughts From A Non-Coder (edited 5/19/13)' in the group The Sandbox
"Edited to add iPhone 5 view and a little housekeeping."
51 minutes ago
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…"
1 hour 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…"
2 hours 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

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service