Identifying HTTP_REFERER screen resolution of window outside div overlay - php

I have a form which is overlayed over the visitors current page using jQuery when the user clicks on a div in the bottom right of a web page. This overlay pulls up an iframe but I need to record the page the visitor clicked from to get to the overlay (essentially the HTTP_REFERER) along with the resolution of the window the user clicked from.
As of now I am attempting to grab this information after the form has been passed, my concern is that the information I will be provided with will not not be correct and will instead give me the window size of the overlay and since it's a separate iframe won't be able to grab the HTTP_REFERER. Are these assumptions correct?

Can you create a hidden field in the form?
If so you could then update this hidden field with the url of the page the user came from.
var current_url = window.location.pathname;
$('#myHiddenField').val(current_url);

You can get the parent window res with js: parent.document.body.clientHeight/Width

Related

Content of frame in wordpress should not be full page rather just the action

In wordpress, i need to create a frame from one page to another but the frame should not display the full page, but the action only, i.e., only the text boxes and labels, submit button
to add a record into the designated table.
I created a frame using the help of the available guidance in stackoverflow from the link below:
How to make a frame in WordPress?
Now, the frame shows the full page, i.e., the admin dashboard, all menus, etc.
In the src="", i have given the link to the page of add action. how to modify this to truncate the extra content?
You could use jQuery to hide the elements:
$(document).ready(function() {
$('iframe').contents().find('#header').hide();
});

Popup window with different contents

I have some buttons containing different contents and when the user clicks, a new window should popup with the content for the clicked button.
There should only be one popup window where the content should be altered, depending on which button the user has pressed.
I'm using PHP to generate HTML code but I can't find a way to do it as PHP is server side..
Don't want to use href in html, JS could work, although I'm not great at JS..
Here is a site that will auto-generate javascript code for a popup window that you can attach to your buttons

href target to a new website at some certain div id of that new website

is it possible to create a link that when clicked would open a new tab with a certain web page and slide down to a certain div id of that new page, such as comments, knowing div id
click here
without having any administrative role on that certain website.
Set the fragment identifier of the URL to the div's ID:
click here
It's not sliding down, but the browser will put the element in the view. The element must exist on page load though.
click here
?

Display a page's elements as selectable (HTML/PHP)

I am looking for a way to make all visible objects in a webpage selectable by a visitor.
For example, I take google's homepage as source, my php script already gets the homepage, and stores everything in an array.
Now I want to show the google homepage with every object (span, div, body, td etc...) selectable.
My visitor will select a few objects and then click submit (form post)
I do not know how to do this, even after searching dhtml and so ..
Thansk for your help
Mykeul
Parse the html page, if the actual element has an ID, just store, if not set an ID.
When you have all ID-s set a border for each element
Set an onClick, onMouseOver event handler
Handle clicking
Finally post the select element's id
Jquery would help you.

posting variables between windows in php

my title may not be clear. But basically what I want to do is:
There will be a link in my php form
<a href="somepage.php" target=_blank>Update</a>
when the user clicks on the link, a new browser window opens and allows him to select some options. There will be close button in that window. When he clicks on that 'close' button, there is a post form from where the parent window should get the selected value.
When I get that selected value from that child browser window, how I am going to refresh parent browser window to reflect what user has selected in child window?
Environment : PHP
Can anyone give me some idea?
As far as I know you can't refresh a parent window using PHP (or, more correctly, pure HTML). You will need a bit of Javascript in your onLoad event:
window.opener.location.reload(); // Refresh
- or -
window.opener.location.href = "targetpage.php"; // Redirect
You would be able to refresh a child window that was opened before from that page using a named target:
<a href="new_window.php" target="my_new_window_i'm_going_to_refresh">
(apostrphe for demonstration purposes only :)
repeated clicking on that link should refresh the child every time. It doesn't work the other way round, though.
In parent expect the refreshed values something like as:
parent.php?value=xxx
on popup, when user clicks close, you can always use window.opener.location = "parent.php?value=XXX" ... this will refresh the parent with the value selected.

Categories