I am new to php and server side processing.
I have a domain "www.example.co.in". And one more addon domain "www.example.com". I created a new folder "www.example.com" in the root folder (public_html) to raise the cpanel "www.example.co.in".
public_html-> www.example.com
Now I wrote an api in php fetch_data.php that looks like this:
<?php if(isset($_POST['test'])){
Now, if I put this file inside www.example.com ie public_html-> www.example.com → fetch_data.php
isset($_POST['test'])
returns false.
And if I put the same file in the root folder i.e. public_html-> fetch_data.php
I can get the data.
Note. I use the same input.
URL: http://www.example.com/fetch_data.php <- isset not working
URL: http://www.example.co.in/fetch_data.php <- isset working
I am testing the above apis using the REST Easy extension for Firefox. Rest Easy by nathan-osman
Actual path of my cpanel:
Home / www.example.co.in / public_html /
And the addon domain:
Home / www.example.co.in / public_html / www.example.com /
source share