1
I have the following code:
$ip = 'stream.radioturn.com.br';
$port = '8000';
I would like to change the same values with a variable in the url, for example:
app.php?ip=ipqualquer.com.br&port=2531
And so it would display the same code but with the values of the new url
how can I do this?
I’ll try that
– Paulo Sérgio Filho
It did not work: http://radioturn.com.br/live/app.php?ip=stream.radioturn.com.br&port=8000
– Paulo Sérgio Filho
I messed up, I fixed it right there
– LocalHost
I got it, thank you!
– Paulo Sérgio Filho
Is it possible to set a default value? in case I enter only in app.php? without the variable
– Paulo Sérgio Filho
Let me give you an example
– LocalHost
@Paulosérgiofilho, take a look :)
– LocalHost
It worked, thank you very much :)
– Paulo Sérgio Filho
Only one point to add, if PHP 7, you can use the ternary operator like this:
$ip = $_GET['ip'] ?? 'ip padrao';
– Leonardo