Search Results

Search found 28 results on 2 pages for 'user296516'.

Page 1/2 | 1 2  | Next Page >

  • a php script to get lat/long from google maps using CellID

    - by user296516
    Hi guys, I have found this script that supposedly connects to google maps and gets lat/long coordinates, based on CID/LAC/MNC/MCC info. But I can't really make it work... where do I input CID/LAC/MNC/MCC ? <?php $data = "\x00\x0e". // Function Code? "\x00\x00\x00\x00\x00\x00\x00\x00". //Session ID? "\x00\x00". // Contry Code "\x00\x00". // Client descriptor "\x00\x00". // Version "\x1b". // Op Code? "\x00\x00\x00\x00". // MNC "\x00\x00\x00\x00". // MCC "\x00\x00\x00\x03". "\x00\x00". "\x00\x00\x00\x00". //CID "\x00\x00\x00\x00". //LAC "\x00\x00\x00\x00". //MNC "\x00\x00\x00\x00". //MCC "\xff\xff\xff\xff". // ?? "\x00\x00\x00\x00" // Rx Level? ; if ($_REQUEST["myl"] != "") { $temp = split(":", $_REQUEST["myl"]); $mcc = substr("00000000".dechex($temp[0]),-8); $mnc = substr("00000000".dechex($temp[1]),-8); $lac = substr("00000000".dechex($temp[2]),-8); $cid = substr("00000000".dechex($temp[3]),-8); } else { $mcc = substr("00000000".$_REQUEST["mcc"],-8); $mnc = substr("00000000".$_REQUEST["mnc"],-8); $lac = substr("00000000".$_REQUEST["lac"],-8); $cid = substr("00000000".$_REQUEST["cid"],-8); } $init_pos = strlen($data); $data[$init_pos - 38]= pack("H*",substr($mnc,0,2)); $data[$init_pos - 37]= pack("H*",substr($mnc,2,2)); $data[$init_pos - 36]= pack("H*",substr($mnc,4,2)); $data[$init_pos - 35]= pack("H*",substr($mnc,6,2)); $data[$init_pos - 34]= pack("H*",substr($mcc,0,2)); $data[$init_pos - 33]= pack("H*",substr($mcc,2,2)); $data[$init_pos - 32]= pack("H*",substr($mcc,4,2)); $data[$init_pos - 31]= pack("H*",substr($mcc,6,2)); $data[$init_pos - 24]= pack("H*",substr($cid,0,2)); $data[$init_pos - 23]= pack("H*",substr($cid,2,2)); $data[$init_pos - 22]= pack("H*",substr($cid,4,2)); $data[$init_pos - 21]= pack("H*",substr($cid,6,2)); $data[$init_pos - 20]= pack("H*",substr($lac,0,2)); $data[$init_pos - 19]= pack("H*",substr($lac,2,2)); $data[$init_pos - 18]= pack("H*",substr($lac,4,2)); $data[$init_pos - 17]= pack("H*",substr($lac,6,2)); $data[$init_pos - 16]= pack("H*",substr($mnc,0,2)); $data[$init_pos - 15]= pack("H*",substr($mnc,2,2)); $data[$init_pos - 14]= pack("H*",substr($mnc,4,2)); $data[$init_pos - 13]= pack("H*",substr($mnc,6,2)); $data[$init_pos - 12]= pack("H*",substr($mcc,0,2)); $data[$init_pos - 11]= pack("H*",substr($mcc,2,2)); $data[$init_pos - 10]= pack("H*",substr($mcc,4,2)); $data[$init_pos - 9]= pack("H*",substr($mcc,6,2)); if ((hexdec($cid) > 0xffff) && ($mcc != "00000000") && ($mnc != "00000000")) { $data[$init_pos - 27] = chr(5); } else { $data[$init_pos - 24]= chr(0); $data[$init_pos - 23]= chr(0); } $context = array ( 'http' => array ( 'method' => 'POST', 'header'=> "Content-type: application/binary\r\n" . "Content-Length: " . strlen($data) . "\r\n", 'content' => $data ) ); $xcontext = stream_context_create($context); $str=file_get_contents("http://www.google.com/glm/mmap",FALSE,$xcontext); if (strlen($str) > 10) { $lat_tmp = unpack("l",$str[10].$str[9].$str[8].$str[7]); $lat = $lat_tmp[1]/1000000; $lon_tmp = unpack("l",$str[14].$str[13].$str[12].$str[11]); $lon = $lon_tmp[1]/1000000; echo "Lat=$lat <br> Lon=$lon"; } else { echo "Not found!"; } ?> also I found this one http://code.google.com/intl/ru/apis/gears/geolocation_network_protocol.html , but it isn't php.

    Read the article

  • PHP won't echo out the $_POST ...

    - by user296516
    Hi guys, got a small problem, this code echo '<input name="textfield" type="text" id="textfield" value="Roger" />'; echo 'Hello, '.$_POST['textfield'].'<br>'; should echo out "Hello, Roger", as roger is the default value, yet it gives out only "Hello, " and nothing else. Any suggestions? Thanks!

    Read the article

  • Reverse geocoding with Google Maps API

    - by user296516
    I have found this code for reverse geocoding: var point = new GLatLng (lat[1],long[1]); var geocoder = new GClientGeocoder(); geocoder.getLocations (point, function(result) { alert (lat[1]+' '+long[1]+' '+result.address); }); But it pops the alert, saying that result.address is 'undefined'. Any ideas, what could be the problem?

    Read the article

  • please help turn a simple Python2 code to PHP

    - by user296516
    Hi guys, Sorry to bother again, but I really need help transforming this Python2 code into PHP. net, cid, lac = 25002, 9164, 4000 import urllib a = '000E00000000000000000000000000001B0000000000000000000000030000' b = hex(cid)[2:].zfill(8) + hex(lac)[2:].zfill(8) c = hex(divmod(net,100)[1])[2:].zfill(8) + hex(divmod(net,100)[0])[2:].zfill(8) string = (a + b + c + 'FFFFFFFF00000000').decode('hex') data = urllib.urlopen('http://www.google.com/glm/mmap',string) r = data.read().encode('hex') print float(int(r[14:22],16))/1000000, float(int(r[22:30],16))/1000000 Would be great if someone could help, thanks in advance!

    Read the article

  • Error querying database in PHP, MySQL

    - by user296516
    Hi guys, I have this code in PHP. It connects to the DB fine, but pops an error, when tryinto to insert the info. $dbc = mysqli_connect('localhost', 'root', 'marina', 'aliendatabase') or die('Error connecting to MySQL server.'); $query = "INSERT INTO aliens_abduction (name, email) VALUSE ('John', '[email protected]')"; $result = mysqli_query($dbc, $query) or die('Error querying database.'); mysqli_close($dbc); Here's a screenshot: http://img532.imageshack.us/img532/2930/63306356.jpg Thanks, R

    Read the article

  • problems with UTF-8 encoding in PHP

    - by user296516
    Hi guys, The characters I am getting from the URL, for example www.mydomain.com/?name=john , were fine, as longs as they were not in Russian. If they were are in Russian, I was getting '????'. So I added $name= iconv("cp1251","utf-8" ,$name); and now it works fine for Russian and English characters, but screws up other languages. :))) For example 'Janis' ( Latvian ) that worked fine before iconv, now turns into 'j??nis'. Any idea if there's some universal encoder that would work with both the Cyrillic languages and not screw up other languages?

    Read the article

  • Hosting a database?

    - by user296516
    Hi, I was kinda puzzled by seeing that most hosting plans do offer, say, 12.000 MB disk space and 60 MB Database space... what is the difference between this two and what do I do if I need like a few gigs for a database and only some tens of MB for the rest of the site?

    Read the article

  • Incorrect table name, php/mysql

    - by user296516
    Hi guys, I've got this code mysqli_query ( $userdatabase, 'CREATE TABLE `user_'.$emailreg.'` ( ID int NOT NULL AUTO_INCREMENT PRIMARY KEY, IP varchar(10), FLD1 varchar(20), FLD2 varchar(40), FLD3 varchar(25), FLD4 varchar(25), FLD5 varchar(25) )' ); echo ( mysqli_error ($userdatabase) ); that works fine on my localhost, but when I upload it to the server, it starts giving me a "Incorrect table name '[email protected]'" error. any idea? Thanks!

    Read the article

  • Google Maps, marker info window won't show up ?

    - by user296516
    Hi guys, I have written this code that loops through an array of lat/long coordinates and places a marker at each of the coordinate. Everything forks fine, exempt the info window won't appear once the marker is clicked. var ExpTowerIcon = new GIcon(); ExpTowerIcon.image = "tower.png"; ExpTowerIcon.iconSize = new GSize(75, 75); ExpTowerIcon.iconAnchor = new GPoint(37, 65); ExpTowerIcon.infoWindowAnchor = new GPoint(37, 20); var marker=new Array(); for ( i=0 ; i < lat.length ; i++ ) { var MarkerPoint = new GLatLng(lat[i],long[i]); marker[i] = new GMarker(MarkerPoint,{icon:ExpTowerIcon}) map.addOverlay( marker[i] ); GEvent.addListener( marker[i] , 'click', function() { marker[i].openInfoWindowHtml('Hello!') ; }); var polyline = new GPolyline([ new GLatLng(lat[i],long[i]) , new GLatLng(lat[i+1],long[i+1]) ], "#ff0000", 5); map.addOverlay(polyline); } Any ideas? Thanks!

    Read the article

  • getting a date array from a mysql database?

    - by user296516
    Hi guys, I have a database with date field is this format "2010.06.11. | 10:26 13" What is need is a php array that would hold all the different dates, .i.e. array[0] = "2010.06.09." array[1] = "2010.06.10." array[2] = "2010.06.11." Currently I am doing it by selecting the whole table, then looping through the result and adding the date substr to an array if it is not already there. But maybe there is a faster way? Thanks.

    Read the article

  • php, mySQL - how to create a table?

    - by user296516
    Hi guys, I have written a code that should check weather there is a table called imei.$addimei and, if not, create it... $userdatabase = mysqli_connect('localhost', 'root', 'marina', 'imei'); ... $result = mysqli_query($userdatabase, "SELECT * FROM imei".$addimei."" ); if ( !$result ) { echo('creating table...'); /// if no such table, make one! mysql_query ( $userdatabase, 'CREATE TABLE imei'.$addimei.'( ID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(ID), EVENT varchar(15), TIME varchar(25), FLD1 varchar(35), FLD2 varchar(35), IP varchar(25), )' ); } Yet the CREATE TABLE somehow doesn't seem to work. Warning: mysql_query() expects parameter 1 to be string, object given in C:\xampp\xampp\htdocs\mobi\mainmenu.php on line 564 Any idea's what wrong? Thanks!

    Read the article

  • Error querying database.

    - by user296516
    Hi, Once I have successfully connected to the database, i have a line that must insert values. mysqli_query($edb, "INSERT INTO elvis_table (name,email) VALUES ('$name','$email')" ) or die('Error querying database.'); It works fine on my computer ( xampp ), but once I upload it onto a server, it starts giving an error. Yes, I have a database with a corresponding table and fields on a server, it connects to the database fine, but gives an error on this line... Thanks!

    Read the article

  • can't add a custom marker to Google maps ( JS )

    - by user296516
    Hi, Was wondering, how do I add a custom marker to google maps, JavaScript, integrated into my site. This code adds a regular marker: var marker = new GMarker(center); map.addOverlay(marker); but where do I insert an image tag (say, "marker.png" ) for it to appear instead of the regular google marker? Thanks!

    Read the article

  • crazy things with PHP array...

    - by user296516
    Hi, A very strange thing, I have an array where element 7 is '[1000137d]', but when I try to compare it by using if ( $array[7] == '[1000137d]' ) it will return a negative. echo $array[7]; echo '<br>'; echo '[1000137d]'; echo '<br>'; echo md5($array[7]); echo '<br>'; echo md5('[1000137d]'); this code would echo out: [1000137d] [1000137d] ca9983334e720042e3a6cbb1dd6b7fd2 3b1c21e661bd7d38deda1f4a45eaa23b as you can see $array[7] is identical to [1000137d], yet their md5's differ. what do you think might be the problem? Thanks!

    Read the article

  • authentication in PHP ?

    - by user296516
    Hi guys, I need to make an authentication script in php. I have already made a login.php page, where the user can enter his unsername/password and it gets checked against a database. If the unsername/password are correct, the user should be forwarded to members.php page together with a $_SERVER['username'] variable. What is the command in PHP to go to another webpage, in this case members.php ? in pseudocode I see it like this: if ( unsername/password are OK ) { $_SERVER['username'] = $username; goto(members.php); } Thanks!

    Read the article

  • XAMPP mail not working with PHP mail() function.

    - by user296516
    Hi gusy, I just installed XAMPP, Apache is running, so is MySQL and Mercury. In Dreamweaver I created a php file with a mail($to,$subject,$msg,'From:'.$email); function, but when I ran the file from localhost it showed an error. After playing around with xampp control panel, turning mercury on and off, it's not showing any errors, yet is not send the email either... any ideas? the 'admin' button on the cp for mercury does nothing. Thanks! R

    Read the article

  • mysqli_query SELECT FROM WHERE [ partial match ] ?

    - by user296516
    Hi guys, I have a database that a time filed that is stored in this format "2010.06.04. | 18:53 01". What I need is to select rows that have a specific date, for example "2010.06.04." Right now I am doing it my first selecting all rows and then looping through them and adding ones with the specified date to a new array. Maybe there is an easier way to do it and I somehow can select it using mysqli_query? Thanks!

    Read the article

1 2  | Next Page >