All Discussions Tagged 'email' - Build2024-03-28T10:11:15Zhttps://build.ning.com/forum/topic/listForTag?tag=email&feed=yes&xn_auth=noGetting logged in members Display Name or Email address via PHP APItag:build.ning.com,2011-07-28:6308082:Topic:74062011-07-28T00:02:51.212ZAlex Seymourhttps://build.ning.com/profile/AlexSeymour
<p>Hi,</p>
<p>I have managed to get the current logged in members email address, but think I have made it overly complicated. This is what I have done, my question is, is there a more efficient way to do it?</p>
<p> </p>
<p>In my ning network, I have added a text box and inside this, put the following HTML:</p>
<p><span style="font-family: courier new,courier; color: #0000ff;"><iframe id="testIframe" horizontalscrolling="no" allowtransparency="allowtransparency" style="border: none; width:…</span></p>
<p>Hi,</p>
<p>I have managed to get the current logged in members email address, but think I have made it overly complicated. This is what I have done, my question is, is there a more efficient way to do it?</p>
<p> </p>
<p>In my ning network, I have added a text box and inside this, put the following HTML:</p>
<p><span style="font-family: courier new,courier; color: #0000ff;"><iframe id="testIframe" horizontalscrolling="no" allowtransparency="allowtransparency" style="border: none; width: 500px; overflow-x: hidden;" name="testIframe" frameborder="0"></iframe></span></p>
<p><br/><span style="font-family: courier new,courier; color: #0000ff;"><script language="JavaScript" type="text/javascript">// <![CDATA[</span><br/><span style="font-family: courier new,courier; color: #0000ff;"> var author = ning.CurrentProfile.id;</span><br/><span style="font-family: courier new,courier; color: #0000ff;"> document.getElementById("testIframe").src = "http://xxx.com/test.php?author="+author;</span><br/><span style="font-family: courier new,courier; color: #0000ff;">// ]]></script></span></p>
<p> </p>
<p>Now in the file test.php I have:</p>
<p> </p>
<p><span style="font-family: courier new,courier; color: #0000ff;"><?php</span><br/><span style="font-family: courier new,courier; color: #0000ff;">require_once('ning-api-php/NingApi.php');</span><br/><br/><span style="font-family: courier new,courier; color: #0000ff;">//Get HTTP vars</span><br/><span style="font-family: courier new,courier; color: #0000ff;">$author = trim($_GET['author']);</span><br/><br/><span style="font-family: courier new,courier; color: #0000ff;">$args = array(</span><br/><span style="font-family: courier new,courier; color: #0000ff;"> "author" => $author</span><br/><span style="font-family: courier new,courier; color: #0000ff;">);</span><br/><br/><span style="font-family: courier new,courier; color: #0000ff;">$result = NingApi::instance()->user->fetch($args );</span><br/><br/><span style="font-family: courier new,courier; color: #0000ff;">print_r($result);</span><br/><span style="font-family: courier new,courier; color: #0000ff;">?></span></p>
<p> </p>
<p>This then gives me access to the logged in members email address, which I will then use to pull out of SalesForce some relevant data for that member and display it.</p>
<p>It works, but can I do this better?</p>