I do the registration in my android application, and I need to access the php file on the hosting, but I do not know how to find out the url to this file.

  • one
    Do you have access to this hosting? domain know which is tied to this hosting? - Mikhail Rebrov

2 answers 2

<?php echo 'ΠΏΡƒΡ‚ΡŒ ΠΎΡ‚ ΠΊΠΎΡ€Π½Π΅Π²ΠΎΠΉ ΠΏΠ°ΠΏΠΊΠΈ: '.$_SERVER['DOCUMENT_ROOT'].'<br>'; echo 'ΠŸΠΎΠ»Π½Ρ‹ΠΉ ΠΏΡƒΡ‚ΡŒ ΠΊ скрипту ΠΈ Π΅Π³ΠΎ имя: '.$_SERVER['SCRIPT_FILENAME'].'<br>'; echo 'Имя скрипта: '.$_SERVER['SCRIPT_NAME']; ?> 
  • It seems __FILE__ solves the problem. - And
  • As far as I remember, FILE and '$ _SERVER [' DOCUMENT_ROOT ']' are the same - AseTry
  • @AseTry - no, of course, these are different things .. DOCUMENT_ROOT - path to the root directory of the server - Arsen
  • Well, I abandoned PhP for quite a while so I do not remember. :)] - AseTry

In this php file, paste this code <?php echo __FILE__; ?> <?php echo __FILE__; ?> after running the php file in it will show the full path.

  • @merey nabi I recommend reading about routing requests. How to correctly associate addresses with queries, etc., try to avoid open queries. And it is desirable to make a single entry point index.php and send all requests for index.php , with the desired route. - And