PHP - Moved: Geolocation In Safari
This topic has been moved to Other.
http://www.phpfreaks.com/forums/index.php?topic=318586.0 Similar TutorialsThis topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=319471.0 i found the following code he https://stackoverflow.com/questions/409999/getting-the-location-from-an-ip-address <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script> contry_code = google.loader.ClientLocation.address.country_code city = google.loader.ClientLocation.address.city region = google.loader.ClientLocation.address.region </script> will this work to get location info? Edited October 15, 2019 by ajetrumpetThis topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=317486.0 IP2Location PHP module supports IPv6 queries now.
<?php require_once('IP2Location.php'); // Standard lookup with no cache $loc = new IP2Location('databases/DB24.BIN'); /* Cache whole database into system memory and share among other scripts & websites WARNING: Please make sure your system have sufficient RAM to enable this feature */ //$loc = new IP2Location('databases/DB24.BIN', IP2Location::SHARED_MEMORY); /* Cache the database into memory to accelerate lookup speed WARNING: Please make sure your system have sufficient RAM to enable this feature */ //$loc = new IP2Location(ROOT . 'databases/DB24.BIN', IP2Location::MEMORY_CACHE); $ip = $_SERVER['REMOTE_ADDR']; $record = $loc->lookup($ip, IP2Location::ALL); echo 'IP Address: ' . $record->ipAddress . '<br />'; echo 'IP Number: ' . $record->ipNumber . '<br />'; echo 'ISO Country Code: ' . $record->countryCode . '<br />'; echo 'Country Name: ' . $record->countryName . '<br />'; echo 'Region Name: ' . $record->regionName . '<br />'; echo 'City Name: ' . $record->cityName . '<br />'; echo 'Latitude: ' . $record->latitude . '<br />'; echo 'Longitude: ' . $record->longitude . '<br />'; echo 'ZIP Code: ' . $record->zipCode . '<br />'; echo 'Time Zone: ' . $record->timeZone . '<br />'; echo 'ISP Name: ' . $record->isp . '<br />'; echo 'Domain Name: ' . $record->domainName . '<br />'; echo 'Net Speed: ' . $record->netSpeed . '<br />'; echo 'IDD Code: ' . $record->iddCode . '<br />'; echo 'Area Code: ' . $record->areaCode . '<br />'; echo 'Weather Station Code: ' . $record->weatherStationCode . '<br />'; echo 'Weather Station Name: ' . $record->weatherStationName . '<br />'; echo 'MCC: ' . $record->mcc . '<br />'; echo 'MNC: ' . $record->mnc . '<br />'; echo 'Mobile Carrier Name: ' . $record->mobileCarrierName . '<br />'; echo 'Elevation: ' . $record->elevation . '<br />'; echo 'Usage Type: ' . $record->usageType . '<br />'; ?> Chrome is the browser I use, I have it set up so that the script detects safari and chrome as separate entities. When I browse to it, it shows: You are using Windows XP with a Chrome Web Browserwith a Safari Web Browser now I know stristr() is a case-insensitive version of strstr(), which will find the first form of a word in a string. The problem is that when I use it, the rest of the script doesn't work... it goes to the part as if nothing is there, and shows the text on the bottom. I can't figure out why. Can someone help me, is there a chrome/safari level of priority or am I just missing something? Code: [Select] <?php //Booleans to set OS and Browser to False. $os = false; $browser = false; //Booleans for Web Browser & OS Functions. $xp = xp(); $vista = vista(); $win7 = win7(); $ubuntu = ubuntu(); $chrome = chrome(); $safari = safari(); $firefox = firefox(); $ie9 = ie9(); $ie8 = ie8(); //Operating Systems function xp(){return(preg_match("/Windows NT 5.1/", $_SERVER['HTTP_USER_AGENT']));} function vista(){return(preg_match("/Windows NT 6.0/", $_SERVER['HTTP_USER_AGENT']));} function win7(){return(preg_match("/Windows NT 6.1/", $_SERVER['HTTP_USER_AGENT']));} function ubuntu(){return(preg_match("/Ubuntu/", $_SERVER['HTTP_USER_AGENT']));} //Web Browsers function chrome(){return(preg_match("/Chrome/", $_SERVER['HTTP_USER_AGENT']));} function safari(){return(preg_match("/Safari/", $_SERVER['HTTP_USER_AGENT']));} function firefox(){return(preg_match("/Firefox/", $_SERVER['HTTP_USER_AGENT']));} function ie9(){return(preg_match("/MSIE 9.0/", $_SERVER['HTTP_USER_AGENT']));} function ie8(){return(preg_match("/MSIE 8.0/", $_SERVER['HTTP_USER_AGENT']));} // If you have one of the valid Operating System. if($ubuntu){echo 'You are using Ubuntu Operating System ';} if($xp){echo 'You are using Windows XP ';} if($vista){echo 'You are using Windows Vista Operating System ';} if($win7){echo 'You are using Windows 7 Operating System ';} // If you have one of the valid Web Browser. if($chrome){echo 'with a Chrome Web Browser';} if($firefox){echo 'with an Firefox Web Browser';} if($safari){echo 'with a Safari Web Browser';} if($ie8){echo 'with an Internet Explorer 8 Web Browser';} if($ie9){echo 'with an Internet Explorer 9 Web Browser';} //If OS or Browser not found in list. if ($ubuntu || $xp || $vista || $win7) $os = true; if($firefox || $chrome || $safari || $ie9 || $ie8) $browser = true; if(!$browser || !$os){ echo'<strong>'; echo '<br />' . $_SERVER['HTTP_USER_AGENT'] . '<br /><br />Administrator someone in your work force is using an unsupported browser or OS, please email this information to the developer of the NCMR software you are using. It will allow your browser/OS combination to be used correctly. Sorry for the inconvenience.</strong> <br /><br />Please copy and paste the text above and send it to your web administrator. It will explain everything he/she needs to do.<br />';} ?> Hi,
I am testing the below JS code in various browsers and it works just fine on my Windows laptop running Firefox but INOP on IE (same laptop) and also from my Mack which runs Firefox and Safari. I'm on the latest versions of all browsers - can someone advise what would prevent the JS function from opening the new page in those browsers mentioned?
Note: I am not blocking JS nor popups - this just a test to see how the function works but now I'm curious as to what's really happening... thx!
Here's the code:
<!doctype html> <html> <head> <meta charset="utf-8"> <!DOCTYPE html> <html> <head> <script type="text/javascript"> function process() { window.open('http://www.w3schools.com/js/', '_blank'); self.blur(); } </script> </head> <body onUnload="process();"> <p> </p> <p>Close the browser or enter another URL in window and press enter.</p> <p>In doing either of those actions, you should be redirected to http://www.w3schools.com/js</p> </body> </html> </head> <body> </body> </html> Can anyone figure out why this works in IE and Firefox but not Safari? Any help would be great. Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Concept Builders</title> <link href="_css/main.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="_css/megamenu.css" type="text/css" media="screen" /> <script src="_scripts/pagebuilder.js" type="text/javascript"></script> <script src="_scripts/jquery-1.7.1.min.js" type="text/javascript"></script> <script src="_scripts/jquery.nivo.slider.pack.js" type="text/javascript"></script> <script src="_scripts/jquery.easing.1.3.js" type="text/javascript"></script> <script src="js/megamenu.js" type="text/javascript"></script> <?php include 'dbconfig.php'; include 'dbopen.php'; $plan=$_GET["plan"]; $sql = "SELECT * FROM homes WHERE plan_id= '".$plan."'"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $price=$row['price']; $sqft=$row['sqft']; $beds=$row['bedrooms']; $baths=$row['baths']; $amenities=$row['amenity_1'].", ".$row['amenity_2']; } setlocale(LC_MONETARY, 'en_US'); $price=money_format('%(#6.0n', $price); $plan_details= "<table> <tr> <td width='182' class='propDetailsHeadings'>Price:</td> <td width='75'>".$price."</td> </tr> <tr> <td class='propDetailsHeadings'>SQ Feet:</td> <td>".$sqft."</td> </tr> <tr> <td class='propDetailsHeadings'>Amenities:</td> <td></td> </tr> <tr> <td>".$amenities."</td> <td></td> </tr> </table>";?> <script language="javascript" type="text/javascript"> function loadPage() { var ajaxDisplay = document.getElementById("plan_details"); ajaxDisplay.innerHTML = <?PHP echo $plan_details;?>; } </script> </head> <body onload="loadPage()"> When I insert this code into a page on my website, it displays correctly in IE9, but not in Safari or Firefox. Any suggestions appreciated. Code: Code: [Select] <?php include("opendatabase.php"); ?> <div id="tables"> <?php echo "<table width=680 border=1>\n"; echo "<th>Owner</th>"; echo "<th>Team</th>"; echo "<th>1</th>"; echo "<th>2</th>"; echo "<th>3</th>"; echo "<th>4</th>"; echo "<th>5</th>"; echo "<th>6</th>"; echo "<th>7</th>"; echo "<th>8</th>"; echo "<th>9</th>"; echo "<th>10</th>"; echo "<th>11</th>"; echo "<th>12</th>"; echo "<th>13</th>"; echo "<th>14</th>"; echo "<th>15</th>"; echo "<th>16</th>"; echo "<th>17</th>"; echo "<th>Total</th>"; $result = mysql_query( " SELECT team_id, team_name, owner, total_pts FROM teams ORDER BY total_pts DESC" ); while ($row = mysql_fetch_array($result)) { $i = $row['team_id']; echo "<tr>\n", "</td><td align=center >", $row['owner'], "</td><td align=center >", $row['team_name']; $result1 = mysql_query( " SELECT bye, owner_pts FROM schedule WHERE team = $i"); $num_rows = mysql_num_rows($result1); while ($row1 = mysql_fetch_array($result1)) { if (empty($row1['bye'])) { echo "</td><td align=center >", $row1['owner_pts'], "</tr>\n"; } else { echo "</td><td align=center >","--","</tr>\n"; } } while ($num_rows<=16) { echo "</td><td>","","</tr>"; $num_rows++; } echo "</td><td align=center >",$row['total_pts'],"</tr>"; } echo ' <tr><td height="10"></td></tr> '; echo "</table>\n\n"; mysql_close($con); ?> The page: http://www.beat-the-spread.net/seasontotals.php Thanks for any help! I have some PHP/HTML code being used in a WordPress site. The PHP outside of WordPress works in any browser. When I open it in Chrome in WP, it runs no problem. Within WP in Safari(unsupported plug in error pops up but I have deactivated all plugins) and Firefox, nothing shows up. This is the page: https://searchsoftball.com/search/
I can reproduce the problem in Chrome making one change but I do not know how to fix it. <?php $result = $con->query($sql); while($row = $result->fetch_assoc()){ ?> <tr> <td><?php echo $row['School'];?></td> <td><?php echo $row['City'];?></td> <td><?php echo $row['State'];?></td> <td><?php echo $row['Conference'];?></td> <td><?php echo $row['Division'];?></td> <td><?php echo '<a href="'.$row['Main'].'"target ="_blank">Main</a>';?></td> <td><?php echo '<a href="'.$row['Softball'].'"target ="_blank">Softball</a>';?></td> <td><?php echo '<a href="'.$row['Camp'].'"target ="_blank">Camp</a>';?></td> </tr> <?php <--- remove this
} <— and this I can provide the full code if needed. Thanks in advance I am using the following css
.content { min-height: 850px; color: #CCC; padding-right: 320px; background-image:url(../images/wheelie.png); background-repeat: no-repeat; background-position: right bottom; }however the background image only shows in the desktop version of safari, I have checked firefox and chrome and mobile safari. I can't see why. I tried both of these articles, I have a windows 8.1 tablet and both of the different "codes" worked but I tried my friend's iPhone and the camera viewport is just a black square or doesn't show at all... the problem seems to be that the pop up where you push "allow" or "deny" doesn't show up at all, this makes me think the trigger isn't "triggered".
These are the sites
I'm using HTML5 and Javascript, didn't do much modifcation yet, I just needed the basic web cam access, cropping, saving functions at the moment.
http://davidwalsh.name/browser-camera
http://mycodingtrick...ipt/webcam-api/
Please help: I'm trying to figure out what is going on with a custom made PHP contact form on my company's multiple websites. Check it out he www.TacticalSolar.com This custom form was made by a former employee and USUALLY works great. Validation, spam checking, database connection, etc. But I've discovered a bug. The form does not always actually send the data to us when it says it does! This problem almost always happens in Internet Explorer and Safari browsers. But sometimes that data shows up. This does not effect Firefox or Chrome. I've been looking everywhere, but no idea what is causing this. Thoughts? Ideas? I'm no PHP coder so even obvious places to look are welcome. I am just setting up a db to catch user info on my site. After some testing all is working except that when I use Safari, my log wrongly shows that I am using Firefox. I have been scanning the web for a solution but all workarounds I have found seem to be very out of date. Can anyone help with this? here is the code I am using: Code: [Select] //logs user info to db $browser = $_SERVER['HTTP_USER_AGENT']; $time = $_SERVER['REQUEST_TIME']; $refer = $_SERVER['HTTP_REFERER']; $page = $_SERVER['PHP_SELF']; $pageQuery = $_SERVER['QUERY_STRING']; $ip = $_SERVER['REMOTE_ADDR']; My php and MySQL scripting works perfectly, but when someone enters data into the php form, using an iPad with Safari browser, all number entries are inserted into the database table incorrectly. It is still a number entry but the number differs substantially from the original input. Note: All other entries, where the individual selects something from a drop-down list and date selecter works perfectly from the same form. Please help me here, since at least 70% of my employees use iPads, thus I need to find a cure for this problem ASAP. Thanks in advance for any help offered. JayDude As mention in my title, I am using wordpress, bought a theme and the support team is not able to assist me without the FTP access.
URL: http://www.icv.solutions/swagger
Mobile: Android 4.4.2
Chrome: version 39.0.2171.93
Safari: star safari version 1.1
I am not able to scroll only on the above browser, other browser like firefox and default internet explorer on mobile have no such issue.
In fact the older version of chrome have no such issue too,
If anyone could give me a hint where might the problem lies at or any help at all, would be great.
I have been struggling with this for awhile now.
Thanks and happy holiday!
This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=319595.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=334099.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=318277.0 |