GEt data from url after # and insert in database?
Like : After auth from any web app, I get http://mywebsite.com/#acc=ANYCODES .. I need ANYCODES and want to save in database.
GEt data from url after # and insert in database?
Like : After auth from any web app, I get http://mywebsite.com/#acc=ANYCODES .. I need ANYCODES and want to save in database.
The hash in the URL doesn't even get to the server. There is no way you can access it from any programming language on the server side. However, you may use GET parameter and access its value on server side.
http://mywebsite.com/?acc=ANYCODES
$code = isset($_GET['acc']) ? $_GET['acc'] : ''; // if acc is set, get value
if( !empty($_GET['id']) && !empty($_GET['Regnumber'])){
get all data GET command
Next Use Insert Query to insert data in database
}
Explain your question more for properly understand, Only GET parameter access value on server side
Here is the code for you.
<?php
$url = "http://mywebsite.com/#acc=ANYCODES";
$acc = substr($url, strpos($url, "#") + 1);
echo $acc = substr($acc, 4);
?>
It will work only for http://mywebsite.com/#acc=ANYCODES this type of url if url contain anything after ANYCODES, we need to use another code for that.