<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged ipaddress</title>
<link>https://www.question2answer.org/qa/tag/ipaddress</link>
<description>Powered by Question2Answer</description>
<item>
<title>Why is createip null? Why is $_SERVER['REMOTE_ADDR'] empty?</title>
<link>https://www.question2answer.org/qa/51184/why-is-createip-null-why-is-%24_server-remote_addr-empty</link>
<description>

&lt;p&gt;I am still wondering when createip is null.&lt;/p&gt;

&lt;p&gt;function qa_remote_ip_address() is obviously creating the IP address by:&lt;/p&gt;

&lt;p&gt;return @$_SERVER['REMOTE_ADDR'];&lt;/p&gt;

&lt;p&gt;I think the function should be expanded by:&lt;/p&gt;

&lt;pre&gt;public function getRemoteIPAddress() {
    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
        return $_SERVER['HTTP_CLIENT_IP'];

    } else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { 
        return $_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    return $_SERVER['REMOTE_ADDR'];
}

From http://stackoverflow.com/a/19311275/1066234

To get the IP in all cases.


PS: Just stumbled over https://github.com/q2a/question2answer/pull/240 but there is no solution.

Basically: Why is the IP null?


*** Gosh, can you just add the &quot;source&quot; button to the ckeditor so we can edit/clean the html. Cannot get rid of this formatting here.
&lt;/pre&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/51184/why-is-createip-null-why-is-%24_server-remote_addr-empty</guid>
<pubDate>Wed, 06 Apr 2016 06:45:22 +0000</pubDate>
</item>
</channel>
</rss>