I been searching for a similar question, but I cannot find someone who has the same problem as me.
I'm using XAMPP V3.2.2. I can get access to my local web from my Android phone with Chrome (which is connected to the same network as my laptop), just by typing my laptop IPV4 address and then /index.php/controller/id
(because I´m using Codeigniter framework). So the URL in Chrome of my Android phone is something like:
192.168.xx.xx/index.php/principal/index
At this point I can access to the principal and admin webpages (background image is loaded and also Bootstrap and CSS) This is how it looks . But here is where some problems begin to appear.
One of them is that the images in the main webpage are not loaded. As I say, the background image load without any problem, but the images of the gallery are not loaded.
Another problem appears when I try to use some functions in the admins webpage like "Delete a photo" or "Upload an image". When y press the submit button of, for example the "Upload an image" form (here is the html):
<form action="http://localhost/index.php/principal/subir_foto" enctype="multipart/form-data" method="post" accept-charset="utf-8">
<label class='control-label'>Seleccionar:</label>
<input id="img" required="true" type='file' name='imagen'/>
<div class='input-group'>
<label class='control-label'>Descripción:</label>
<input type='text' name='alt' placeholder='Descripción'>
</div>
<div class='input-group'>
<input type='submit' name='agregar' value="Agregar">
</div>
</form>
I put the code just to illustrate, it works fine in my laptop, I can upload photos, delete them, create new categories and so on. But as I was saying before, when I try to do those things in my phone and press the submit button, the browser show me this page -> Error page
So, I hope someone has the same problem and could give my a solution.
Thanks
Well I finally solve the problem...
In the Codeigniter Config.php file, I change:
from
$config['base_url'] = 'http://localhost/';
to
$localIP = getHostByName(getHostName());
$config['base_url'] = 'http://'.$localIP.'/';
So now I´m giving to CodeIgniter the Server IP dynamically, and now mobile devices can search images from the server IP and not from themselves like with "localhost" before.