I'm using $_SERVER['REMOTE_ADDR'] on 2 separate occassions in 2 php files. The user clicks a link to file a feedback ticket. One php file is created which fills information into an XML file. Later on, the final php file takes the user's IP and puts it into an email for the ticket.
For the email, $_SERVER['REMOTE_ADDR'] works perfectly, but trying to place $_SERVER['REMOTE_ADDR'] into a child in the XML file does not at all.
The tags in the XML file are all functional minus the ip one.
$ticket->addChild('ip', $_SERVER['REMOTE_ADDR']);
$ticket->addChild('ticketid', $ticketid);
$ticket->addChild('call', $post_body);
the ip tag returns nothing as a whole for the tag. If I replace $_SERVER['REMOTE_ADDR'] with just a generic "hello", it makes <ip> hello </ip>
. If I place $_SERVER['REMOTE_ADDR'] in it, there's no IP address and the <ip>
tags disappear completely.
Google and searches on stackoverflow haven't provided clarity.