I know now that i can use echo $url->parameter('user'); but it prints in all the pages , not content.
I need to use this variables by editing posts with several variables inside the post, how can i do it ?


Use JavaScript. You can find several tutorials with a search for "get url parameters javascript".altomarketing wrote: Sat Jul 10, 2021 4:32 am I need to use this variables by editing posts with several variables inside the post, how can i do it ? :
Code: Select all
<script language="javascript" type="text/javascript">
$.urlParameters = function(params) {
var results = new RegExp("[?&]" + params + "=([^&#]*)").exec(
window.location.href
);
return results ? decodeURI(results[1]) : null;
};
document.write("variable uno is ", $.urlParameters("variable1"));
document.write(", ", $.urlParameters("variable2"));
</script>
</p>I tested this three > https://www.codegrepper.com/code-exampl ... ing+jquery
Code: Select all
<script>
url = window.location.href;
str = url.indexOf("user");
name = url.slice(str+5);
document.write(name);
</script>
Code: Select all
<script>
url = window.location.href;
dato1 = url.split( 'user=' )[1];
dato2 = dato1.split( '&' )[0];
document.write(dato2);
</script>