How to get IP address?
Question by user362064
Possible Duplicate:
How can I get the client’s IP address in a PHP webservice?
I want to get IP address of user who view the page. How can ?
Possible Duplicate:
How can I get the client’s IP address in a PHP webservice?
I want to get IP address of user who view the page. How can ?
I have 2 Tables in phpmyadmin that need joining
tracklisting
is my one and catelogue
is the other, and are saved as innodb
They both have a column CAT.NO
and would like it to be joined on this column. In catelogue it is the primary and in tracklisting it’s indexed
catelogue
is my parent and tracklisting
would be the child as it doesn’t have info for every record in catelogue. I believe this would be correct unless I’m wrong
How do I do this so that when I query on a column in tracklisting
it only brings up the matches for ‘catelogue’ because I want to know what album it’s on and not my entire 60000+ catelogue
Can this be done with phpmyadmin’s interface or is this a sql statement
Many thanks
EDIT:
This was the code that worked
SELECT *
FROM tracklisting
INNER JOIN catelogue ON catelogue.`CAT NO.` = tracklisting.`TRACKLISTING CAT NO.`
WHERE tracklisting.`ARTIST` LIKE 'placebo'
Thanks to everyone that helped out
I dont know if this can be done with the interface, but with sql
SELECT *
FROM
tracklisting t
INNER JOIN catelouge c on c.catno=t.catno
WHERE t.id = 1
i’m trying to create a flow layout and i’m having some trouble using float:left property in css.
I have one parent container which has 100% width and 100% height. It contains three containers:
The header, the menu container, and the content container.
The menu is a vertical menu,not a horizontal menu. It comes below the header and then the content container floats left on the menu container.
Now the problem is i want to make it flowlayout. When i reduce the resolution,the floating content container comes below the menu container. I want the content to float with a flowlayout without coming below the menu container.Please provide a solution to this.
Thanks!
Here is the link to the code.
The problem is the min-width
you have for #menu-cont
The layout you are trying to have is very hard to maintain.
Is it possible to send a parameter (eg. a get variable) with getJSON to a php file, and if so how to do it?
The code below doesn’t work, but hopefully it shows what I try to accomplish.
var url = "http://www.address.com/"
$.getJSON('http://anotheraddress.com/messages.php?url=+escape(url))', function(data) {
// code here
});
$.getJSON accepts another parameter for data:
var url = "http://www.address.com/"
$.getJSON('http://anotheraddress.com/messages.php', { url: escape(url) }, function(data) {
// code here
});
Your jquery might look something like this
$.getJSON("messages.php",
{
data1: value1,
data2: value2,
url: escape(url)
},
function(data) {
alert(data.yourval);
});
The only thing you should remember while using getJSON is that, the php page message.php
should return JSON string as a response. SO you have do something like this at the end of the file.
echo json_encode($responseArray);
// Remember not to echo or output anything or the JQuery will not execute
I tried a simple ajax aplication using jquery, where i had my php file in an separate folder in my root and it is working.
Is there any other way to use ajax in a zend framework?
There are some ways you can do it
Use ZendX_JQuery. They have helper called ajax_link, with which you can use make ajax call directly from a link.
Embed a js file, in your file and use ajax there. Use something like:
$this -> headLink() -> appendScript(‘path/to/your/script’);
You might have to import the JQuery file like this, if you have not enabled this, using the ZendX_JQuery helper.
Directly feed script content like <script>...</script>
like you would raw html
However, JQuery helper might take a bit to fully understand. If you are already familier with JQuery, and know how to use it properly. Go with option number 2.
๐
I have this css:
.disable {
properties
}
.comment_action:hover {
properties
}
I have this jQuery:
//comment button index disable
$("#mydiv").toggle(function() {
$(this).find(".comment_action").addClass('disable');
},
function(){
$(this).find(".comment_action").removeClass('disable');
});
The problem for me is that when I doing click the .comment_action:hover is not disappear or removed. I want that If I doing click on the class .comment_action:hover dissapear and if I doing click again the .comment_action:hover appear.
You would need an !important
added to properties you want to override in the :hover
psuedo-selector…
Because :hover
takes precedence, even if .disabled
is applied.
Also your javascript should be calling find with .comment_action
instead of comment_action
See working example: http://jsfiddle.net/TN4rh/11/
i am working on a e-commerce website, i want to monitor how many pages a users visited in a particular session. there are only registered users of the site.
can any one tell me how to record the URL of the user of a particular session,
i am using php and mysql
There are more than one way to do this. Here is one quick walkthrough:
Create a table with two fields (‘session_id’, ‘url’);
Whenever the site loads, read the sessionid using session_id()
, and use this value to store the url of the page in a table for every pages the people visit.
Once a page loads, read the URL, through $_SERVER['REQUEST_URI'];
and then use it the value of session_id()
and store the records.
After you implement this simple technique. you can see how many people see the pages, using a simple query
SELECT count(*) FROM <YOURSESSIONTABLE> GROUP BY `<session_id_field>`
P.S. This is one of the basic example, and should be changed to fit your requirements
$(document).ready(function() {
$('#tabs > ul').tabs('select', 1);
$('#tabs').tabs({
selected: 1
});
$("#tabs").tabs({
disabled: [0, 2, 3]
});
return false;
});
To move to another tab, CSS style is not followed. How do I deselect the current tab?
Use the following to select a different tab or move to another tab.
$( "#tabs" ).tabs( "option", "selected", 2 );
However, to deselect the current tab, you have to select another tab, that’s the only way the tabs work. If you want to clear the style of current selected tabs then use
$("#tabs .ui-tabs-selected").removeClass("ui-state-active").removeClass("ui-tabs-selected");});
I have an xml file, inside views folder and I want read it, before I load the view.
for example
views
default/
info.xml
How to do this?
Very Simple. Load the file using this
$xmlData = $this -> load -> file("application/views/default/info.xml", true);
Now use the data, where needed.
I’ve tried Audio / embed / Object, but fail at all of them.
play wave file is ok, but cannot play stream.
<audio><source src="sample.wav" /></audio>
OK
<audio><source src="http://mydomain/stream" /></audio>
fail
<object data="sample.wav"></object>
OK
<object data="http://mydomain/stream"></object>
fail
jPlayer also cannot work!
I found a clue:
If when I play it in firefox before, then safari works. It seems firefox download it so the safari can play it in quicktime’s cache.
code:
<embed src="http://10.224.91.28:8080/cas/auth.do?cmd=getaudiobycaptchaid&id=Q71UNBGRFOI00A8NDNBV76BTNE&clientid=9e1f73ca9d0ff1e07ca87f7660d1b911" height="45" width="170" type="audio/x-wav"/>
You should use html5audioplayer. It slags a bit, but works in the end….