Anti-Frame Busting code? [duplicate] - php

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
My frame is redirecting page !! How to stop it ?
Is there any code like that ?
Please help..Thanks

If you mean a code that detects if it's in a frame, and if so, change the target location?
if (parent.frames.length > 0) parent.location.href = location.href;

Related

Getting second last parameter from querystring with PHP [duplicate]

This question already has answers here:
Getting parts of a URL (Regex)
(30 answers)
Closed 3 years ago.
I have a URL like so:
http://example.com/var1/var2
What I'd like to is get VAR 1 from the querystring. I've tried using a regex but I'm not really very familiar with them. Is there an easier way?
Another approach
<?php
$e = explode("/",parse_url("http://example.com/a/b")["path"])[1];
// $e now is "a"

replace particular value from url [duplicate]

This question already has answers here:
PHP, Delete parts of a URL variable [duplicate]
(3 answers)
Closed 4 years ago.
I want to replace '/50' with URL.my URL is
http://localhost/CI/admin/pcustomer/cprofile/50?customer=18267&mobile=&nearby=
I want url as
http://localhost/CI/admin/pcustomer/cprofile?customer=18267&mobile=&nearby=
From that little info in your question, this seems to be the simplest way to achieve "I want to replace '/50' with URL"
$url = str_replace('/50', '', 'http://localhost/CI/admin/pcustomer/cprofile/50?customer=18267&mobile=&nearby=');

Find Windows devices using Javascript? [duplicate]

This question already has answers here:
What is the list of possible values for navigator.platform as of today? [closed]
(3 answers)
Closed 5 years ago.
How to find Windowow devices using Javascript or jquery
use 'navigator.platform' to check what platform you are using.
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/platform
function isWindows() {
return navigator.platform.indexOf('Win') > -1
}
// Maybe Try this on android deveices
function isAndroid() {
return navigator.platform.indexOf('android') > -1
}

Append a text in the end of the url php [duplicate]

This question already has answers here:
Reference - What does this error mean in PHP?
(38 answers)
Closed 5 years ago.
i need to add a text in the end of the url while user click on a button.
for example :
www.example.com/people/xyz
when the user click the button, it should go to
www.example.com/people/xyz/edit
i did a search, & built code, but it didn't work, here it's :
$editlink = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
echo 'EDIT'
Please Help me to solve it
Correct your code as follows:
<?php
$editlink = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
?>
EDIT

How to get a URL query next to the "#!" prefix? [duplicate]

This question already has answers here:
Get fragment (value after hash '#') from a URL [closed]
(10 answers)
Closed 7 years ago.
I'm trying to get the URL query next the "#!" prefix, for example:
https://mega.co.nz/#!123abc
<?php
$query=$_GET["#!"]; //the example
?>
$query: 123abc.
It is possible to read the query using PHP or .htaccess file? How i can get started?
Thanks for reading and for any help! :)
Try this,
Let your URL:
https://mega.co.nz?query=123abc
Then you can get value as below :
<?php
$query=$_GET["query"]; //the example
?>

Categories