I am manually storing the below line in mysql database using php myadmin.
<div>IP address : '<?php echo $_SERVER['REMOTE_ADDR']?>'</div>
It gets updated as I have confirmed it is in database.
My php page fetches this from database and updates the html.
The output that I get is –
IP address :
I am not an expert in php. Also I cannot write <?php echo $_SERVER[‘REMOTE_ADDR’]?> directly into my php page. Please help and tell me where is wrong.
When you fetch the text from the DB and output it to the client, it will just be WRITTEN, not EXECUTED – so
will never be replaced by the real IP adsress.
A solution would be to store
in your DB, later fetch it and
to your client.