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: 49

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

Larry Matthews replied to Monica Diaz's discussion 'Ning 3.0 CSS and HTML Reference' in the group The Sandbox
".xg_module_activity or .dy-content-thumb-link img are there a ning 3.0 equals, im confused?"
39 minutes ago
Alessandro Sporleder replied to Rosario T.'s discussion 'Proteger contenido en la red' in the group Ning Networks en español
"Este post puede ayudar, pero necesita ajustar para…"
41 minutes ago

NC for Hire
Bernard Lama replied to Alexander's discussion 'Text Ticker in Ning Bar'
"Not a problem...tool icon is not visible to members and visitors...log in with different id (member…"
58 minutes ago
Corey replied to Richard Mckeever's discussion 'Billing for a Sandbox evaluation version of Ning3?' in the group The Sandbox
"Hi Richard, The sandbox plan gives you a free 6 month trial, so you should not receive any charges…"
1 hour ago
Alexander replied to Alexander's discussion 'Text Ticker in Ning Bar'
"Yes that works, except it appears to the left of the Network Tools/Design icons. Can it be moved…"
1 hour ago
Phil McCluskey replied to Radialistas Brasileiros's discussion 'How we will deal with 301 redirects and to fix 404 errors on NING 3.0?'
"Hi SP, Can you give me a little more info on the scenario you're looking at?"
1 hour ago

NC for Hire
Bernard Lama replied to Alexander's discussion 'Text Ticker in Ning Bar'
"Give this a try in custom code <script type="text/javascript">if (typeof(x$) !=…"
1 hour ago
CocteauBoy replied to John Bizley's discussion 'Show Your Ning 3.0 Sites'
"I mean no insult to anyone here, but I can't tell if it's the new (and old) Ning…"
1 hour ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service