samedi 4 décembre 2021

Create index.php that executes different statements if user inputs different folder in url

On my server i have everything redirected to index.php I have to My index.php works as user inputs url

http://ip:80/index.php
then it executes php script as follows

'$input = trim($_SERVER["REQUEST_URI"], "/")

if(){statement}else{statement}'

I want to edit that index file so it executes 2 different if statements 
For example if user inputs this url  http://ip:80/server1/index.php
then it executes statement 1

`if(){statement 1}
if(){statement 2}
else{statement}`

if user inputs url as http://ip:80/server2/index.php then it executes statement2

`if(){statement 1}
if(){statement 2}
else{statement}'

Aucun commentaire:

Enregistrer un commentaire