0
I’m trying to recover the value of url
for $_GET
with php, I am absolutely sure it is impossible not to give refresh, something else as I would pass the title of each page also?
php
<?php
if (isset($_GET['url'])) :
$url = addslashes($_GET['url']);
$sepURL = explode('/', $url);
print_r($sepURL);
endif;
if (isset($_GET[$sepURL[0]])) :
$lobby = $sepURL[0];
endif;
if (isset($lobby)) :
require_once('lobby.php');
else :
require_once('private.php');
endif;
?>
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ chat.php?url=$1
links
<li><a href="#" onclick="history.pushState('teste','Bem vindo','https://localhost/chat'); return false;">Geral</a></li>
<li><a href="#" onclick="history.pushState('teste','Amanda Caroline','https://localhost/chat/amanda-caroline'); return false;">Amanda Caroline</a></li>
he’s passing the right links, I’m just not getting their value back, someone has some idea?
You need to make an ajax call to the server
– Costamilam
the more I pass on the ajax date?
– goio
I think nothing, since the data you need are in the url
– Costamilam
man doesn’t have an example for a look?
– goio
Sopt is full of them just search, have with all kinds of library, framework or with pure JS
– Costamilam
Sorry my ignorance, but what is it?
– goio
What is that? "Sopt" stands for STackTheverflow in portugues
– Costamilam
Let’s go continue this discussion in chat.
– goio