php----url redirection - php

now, i have an input textfield in a form, which used to filled in the url's name. eg:(google).
i want to get when i put the mouse key hover on the google. the url display on the tool bar is my site's internal address. eg:(http://example.com/... ) then click the google. it will go to the google site.
the input textfield is used to fill in some url's name.

You can't control mouseover/hover effects from PHP. That's a client-side thing. For that you'd need Javascript. Check out onMouseOver and the various tooltip modules in jQuery/MooTools. As well, you won't be able to control the URL being displayed in the address bar (that's forbidden by standard browser security measures), and you MAY be able to control what shows up in the status bar, but that's a user-configurable setting (and I personally keep that locked down).

Related

How to get links from website, not seen in view source

I am still beginner, I searched in Google but I didnt found what I want,
I have a website http://www.example.com/index.php
On the main page, there is selectio form:
e.g. one selects first country in first field, the the city in the second field then click the button to show the data.
I didnt find these urls of these data links in view-source, and when changing input from selection fields, the address still the same in browser.
How to get these links to these data, I expected in view-source as extension in website url so e.g. php?=city A etc...
Any help and what are these data protection?
Edit
that is part from view-source
/if (todo==9) window.open ('loadajax.php?ekey='+document.getElementById('embid').value+'&todo='+todo+'&mkey='+mkey+'&kkey='+kkey); $.post("loadajax.php", {todo:todo,ekey:document.getElementById('embid').value,mkey:mkey,kkey:kkey},function(result){ // alert (result); $('#'+id).html(result); }); }
You can make use of one of the below two:
Install fidder. This is a free and open source tool that provides you all the network traffic and the links that are navigated.
Your browsers debugger tool should help you. If you are using chrome or IE, click F12 that brings you developer tools. Switch to the network tab to see all the links you are navigating to in an application.

Some additional characters appended after the URL

My client website created using php code.
However, when I click on any link on any web page, the url bar append some characters as below "VzFqJRV95E4". It is different from another computer and different browsers showing different characters.
I copy the website to my localhost also display different characters.
http://localhost/newbridge/Frequently-Asked-Questions.php#.VzFqJRV95E4
Screenshot from chrome
How can I remove the codes? I think it is session tracking. It's so annoying and I think I should remove it to protect user privacy.
I got the answer from rocky!
https://drupal.stackexchange.com/questions/37467/strange-characters-after-url-uafabbty-ie
The URL is actually generated by AddThis plugin's Address Bar Sharing Analytics.
Info can refer to this URL http://www.addthis.com/academy/what-is-address-bar-sharing-analytics/
How it Works
Address bar share tracking works by appending a special tag to your URL once your page has loaded. Your URLs will start to look like this:
http://example.com/blog#AHb4gs1hwck
In this case, “#AHb4gs1hwck” is a semi-random value which identifies each page view. When a user clicks on an URL like this we’ll know that they were the recipient of an address bar share and we’ll count a share and a click for your site. This tag contains the time that the page was viewed by the sharer so we can properly attribute the share. If that recipient subsequently shares your page to someone else, we’ll be able to measure it separately as a “reshare”, taking into account the various generations of your viral sharing.
Note: these types of tags (called URL fragments) will not affect your SEO because they are discarded by search engines during web crawling.

Is there a way to pull a 404 URL from the address bar and autopopulate a form field?

I'm encountering an issue where a user lands on a 404 page and then clicks a button to submit the 404 error they encountered. From there, they fill out a jotform (server config preventing simple form implementation from Wordpress or auxiliary plugins.)
The next step we'd like to take is to autopopulate the URL form field with the 404 error URL they encountered. Just some background info, we're operating the site through wordpress on a Windows box.
Is this possible? Seems unlikely, but I thought I'd ask and see what other developers might recommend.
(I'm aware of webmaster, analytics, and backend tracking of 404s. This was a specific setup requested for direct input from the user.)
[First time here, btw. Sorry in advance if I've broken any rules.]
In most cases, you can access the URL of the currently requested page via a PHP superglobal - $_SERVER["REQUEST_URI"].
This won't always be available to you, and there may be a Wordpress helper to get it without accessing the superglobal directly - but this should get you started.
Javascript is another simple option - window.location.href or similar will normally give you whatever is in the address bar.

What is the use of # in url

I realized that many of web app use # in their app's URL.
For example, Google Analytics.
This address is in the URL bar when I am viewing the visitor's language page:
https://www.google.com/analytics/web/?hl=en#report/visitors-language/a33185827w60383872p61754588/
This address is in the address bar when I am viewing the visitors' geolocation page:
https://www.google.com/analytics/web/?hl=en#report/visitors-geo/a33185827w60383872p61754588/
I think that this is the Google Analytics web app passing #report/visitors-language and #report/vistiors-geo.
I know that Google analytics is using an <iframe>. It seems that only the main content box is changing when displaying content.
Is # used because of the <iframe> functionality?
There are several answers but none cover the backend part.
Here is a URL, one from your own example:
www.google.com/analytics/web/?hl=en#report/visitors-language/a33185827w60383872p61754588/
You can think about the post-hash (including the hash #) part as a client-side request.
The web server will never know what was entered after the hash sign. It is the browser pointing to a specific ID on the page.
For basic web pages, if you have this HTML: <a name="main">welcome</a>
on a web page at www.example.com/welcome, going to www.example.com/welcome#main will scroll your browser viewport to the welcome text in the <a> HTML tag.
The web server will not know whether #main was in the URL or not.
Values in the URL after a question mark are called URL parameters, e.g. www.example.com/?foo=bar. The web server can deliver different content based on those values.
However, there is a technology developed by Google called AJAX (Asynchronous JavaScript and XML) that makes use of the # part in the URL to deliver different content without a page load. It's not using an <iframe>.
Using JavaScript, you can trigger a change in the URL's post-hash part and make a request to the server to get a specific part of the page, for example for the URL www.example.com/welcome#main2 Even if an element named #main2 does not exist, you can show one using JavaScript.
A hashbang is #!. It is used to make search engine indexing easier by indicating that this part is a dynamic web page.
This is the "hash" in the url.
Many browsers support hash change event in javascript.
as per my knowledge the hash change is the revolution in the ajax callbacks.
as such when the user interacts with the any link with a hash then on the hash change the event is fired and you can apply any thing with the javascript.
one more thing is that hash change is supported by the browser history.
see below URL
SEO and the use of !# in a url
or Read it
'#! is called a "hashbang" and they are the root of all that is evil in web development.'
Basically, weak web developers decided to use #anchor names as a kludgy hack to get "web 2.0" things to work on their page, then complained to google that their page rank suffered. Google made a work around to their kludge by enabling the hashbang.
Weak web developers took this work around as gospel. Don't use it. It is a crutch.
Web development that depends on hashbangs is web-development done wrong.
This article is far more well worded than I could ever be, and deals with the Gawker media fiasco from their migration to a (failed) hashbang centric website. It tells you WHAT is happening and why it's bad.
http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs
Correct me if I'm wrong, the hashtag in that URL would be used as an anchor to scroll the page to an element with an id. For example, I send you to the url http://example.com/sample#example, and the page would scroll (just display) at the element (I'm using a div as an arbitrary example, it could be anything).
Ajax and hash mark in the url mostly used for quick action.
If you have a part in your site that can be visible only by fire event (mostly click) - it would be hard to share it. With hash mark in the url you can (by javascript) make the browser think that you did the required action and it will display the relevant part.
Normally the '#' is using in url will find the particular id which is next to '#' in that particular page. By using this we can view the particular content at middle of the page also.

Avoiding cross site scripting

AM a newbie in php, i have seen some web applications that have only index.php showing on the browsers address path, when you put the mouse pointer, you would see that the links show with together with the variables required for the next page. However when you click on the link, the address bar would still show index.php. If one enters the variables directly on the address bar, then it takes you back to the home page.
How is this done?
A common way to do this is using AJAX or JQuery, allowing you to place content from other pages within an element of your mainpage, not causing a browser page refresh, while still having the same page in the url.
Using firebug extension of firefox, on the network tab, you can inspect what is send and how to the server.
This can be done with some success by checking the HTTP Referer header.
Here is a link of how to do it
Beautiful way to remove GET-variables with PHP also checke using htaccess

Categories