PHP - Gps Coordinates And Float Issue Length,value
im trying to update a GPS table
for example: UPDATE markers SET lat = '38.40907441955112' AND lng = '14.943452775478363' WHERE ApID = '35911' i tried with float 20,18 it isnt updatng correctly Similar TutorialsI know the default length of a tiny int is less than an int, but if I put in the same length for both, are they essentially the same type? Hi, i want to have a map of the us in which in my game people can control and it turns there colour using co ordinates, i know how to get the coordinates from below but i dont know how to set the borders for each country or save the info into a table ie where controlledby texas player1 washington none and if it's controlled by the player then changed the colour of the square to there colour ie red? i hope this makes sense and someone can point me in the right direction Code: [Select] <? $foo_x=$_POST['foo_x']; $foo_y=$_POST['foo_y']; echo "X=$foo_x, Y=$foo_y "; ?> <form action='' method=post> <input type="image" alt=' Finding coordinates of an image' src="map.jpg" name="foo" style=cursor:crosshair;/> </form> I've created a topic before about making this game in php and mysql, which would be on a -250x250 grid but would only display 11x11, displaying your character in the center/middle of the table and being able to click the surrounding squares to change coordinates. I thought I'd realized how to make one of these map explore games but I've really got no ideas for some bits, so if anyone has any general hints or any tutorials for learning how to make something like this it would be greatly appreciated. Thanks in advance people Hello, Id like to know how to extract bold coordinates from this url (PHP). I have never done that kind of stuff before. Important: Not just this specific url, but all urls with different coordinates every time. http://maps.google.com/maps?q=46.055603,14.507732&num=1&t=m&z=12 Thanks in advance. Hi, I am working on a project that involves mobile (android) and the application being designed connects to the database within PHPMYADMIN storing some table data entries. The language on the app being used is Flutter / DART and I do apologize, I am not familar at all with this language and my collegue has been writing his mobile code in this. I am the one who is going in and writing the PHP code that tells the data from the mobile app to be stored in a table. Hopefully this makes sense to you all still... Now... as shown below a diagram of how we have this app kicking and talking.
Thank for whom all can assist with this, but this is really the last piece of the puzzle then the app is finally done.
php output code: <!DOCTYPE html> <html> <head> <title>Test</title> <style> table { border-collapse: collapse; width: 100%; color: #588c7e; font-family: monospace; font-size: 25px; text-align: left; } th { background-color: #588c7e; color: white; } tr:nth-child(even) {background-color: #f2f2f2} </style> </head> <body> <table> <tr> <th>Id</th> <th>First Name</th> <th>Last Name</th> <th>Image</th> </tr> <?php $conn = mysqli_connect("localhost", "****", "****", "pmapp"); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT id, first_name, last_name FROM pmvisit"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "<tr><td>" . $row["id"]. "</td><td>" . $row["first_name"] . "</td><td>" . $row["last_name"]. "</td></tr>"; } echo "</table>"; } else { echo "0 results"; } $conn->close(); ?> </table> </body> </html> Edited February 16, 2020 by Barand obscuring pwd Hi all! I hope that you are all having a great time with PHP. Well I am too. Problem: I want all users who register to a mock site to have a unique, yet random ID. This ID is used to give the user virtual coordinates. So what I thought was to give the users a 'coordinate' like x=123, y=123 . i.e. (123,123) One of my goals is to calculate the virtual distance between two users. I figured out the real-world solution to this problem (I hope that it is correct!). It is as follows: Code: [Select] User 1: (123,123), User 2: (111,111). Distance: (((123-111)^2)+((123-111)^2)))^1/2 Now to my problem... Is it possible for me to arrange a list of user-records for each user in order of the 'closest' (shortest distance) users to those farthest? Without having my databases ruined with too much entries, that is... My other problem is as to how to make the 'coordinates' unique to each user. All I know about that is about assigning random numbers for each, and this is not that efficient. If you think that my entire approach to the situation is bonkers , do let me know. I thank you for any help in advance! Regards, Thauwa Hi there, I am building a custom configuration program, where i want people to choose various items, e.g. 1. Size of a table, colour, how many drawers, other features. I want to store all my options in mysql tables. At the end of the process I want to somehow get mysql to get line co-ordinates from a table and dynamically draw a plan view and elevation view of the table showing the options that the customer has chosen. I was wondering if anyone has ever been able to do this. I'm not sure how to start, or if php is capable of doing this. any ideas would be great. I need a map which locates all the stores addresses(Less than 10). Those address must be retreived from the database. But the database don't contain any lat or long field. Therefore geocoding an address into their corresponding lat and long coordinates must be done and appropriate markers must be placed.
The code which I have at the moment is as follows:-
<?php require_once '../model/stores.php'; $obj=new Stores(); $result=$obj->getStores(); $new_array = array(); while($row=mysql_fetch_assoc($result)){ $new_array[] = $row['stores_address']; } $add_js = json_encode( $new_array ); ?> <html> <head> <style> #map_canvas { width: 500px; height: 500px; } </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> <script> $(document).ready(function () { var map; var elevator; var myOptions = { zoom: 1, center: new google.maps.LatLng(0, 0), mapTypeId: 'terrain' }; map = new google.maps.Map($('#map_canvas')[0], myOptions); //var addresses = ['Norway', 'Africa', 'Asia','North America','South America']; var addresses = <?php echo $add_js ?>;; for (var x = 0; x < addresses.length; x++) { $.getJSON('http://maps.googleapis.com/maps/api/geocode/json? address=' +addresses[x]+'&sensor=false', null, function (data) { var p = data.results[0].geometry.location var latlng = new google.maps.LatLng(p.lat, p.lng); new google.maps.Marker({ position: latlng, map: map }); }); } }); </script> </head> <body> <div id="map_canvas"></div> </body> </html>I have looked on various forums and other web resources but no use as none of them worked out for me...Hope any genius would help me to solve the problem. Edited by Naseem, 15 August 2014 - 12:25 AM. Hi all,
The output of the following line of code where user is Jack1234
$user = filter_input(INPUT_POST, 'user', FILTER_SANITIZE_STRING);using var_dump is string 'Jack1234' (length=8)I would like to know if there is someway we can use/retrieve the length value of the string that is displayed in the output or verify the string length against it. Thanks. Is 40 characters long enough for an E-mail field? Debbie Howdy, I have a page on my site that displays events I have uploaded. Below is the code that displays the event title. I want to know if there is a simple way to limit the characters of the title that a view will see. For example, limiting the title to 10 characters. So, if I had an event titled "My awesome new event". You would see "My awesome..." Hope this makes sense. I'm not sure if you will need to see more of the code to help me, thank you! <a href ="event-description.php?eid=<?php echo $data->EventId?>"<span class="events-title"><?php echo $data->EventTitle ?> I've got an enormous page for a pretty complex process. I just posted some changes, and it stopped functioning. Through multiple tests, I determined there was no problem with the code; it was just becomes too large at a certain point. I've read about changing settings in the php.ini file, but I'm not exactly sure what to change or what to bump it up to to allow for this huge page. Here are some current settings that I'm guessing control this problem: Code: [Select] max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) ; Maximum size of POST data that PHP will accept. post_max_size = 8M ; Maximum allowed size for uploaded files. upload_max_filesize = 2M Does anyone have any insight into what to change or what settings might allow for a larger page? Not sure which one of these settings controls my problem. Thanks, as always, for any help. Hello everyone, I've searched these forums for a while now trying to resolve a problem that I have with my sessions timing out before I would like them to, but I've only gotten confused about it. I've read about changing some settings or adding code in my php.ini file but I have no idea what I'm doing when it comes to that. I'm starting the session simply by having session_start(); at the top of each of my pages. I'm including a copy of my entire php.ini file here so that you can see what I have already. Can someone please help me to figure out what I would need to do to make my sessions last at least 8 hours? Thanks in advance. Here's my php.ini file: Code: [Select] register_globals = off allow_url_fopen = off expose_php = Off max_input_time = 60 variables_order = "EGPCS" extension_dir = ./ upload_tmp_dir = /tmp precision = 12 SMTP = relay-hosting.secureserver.net url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" ; Only uncomment zend optimizer lines if your application requires Zend Optimizer support ;[Zend] ;zend_optimizer.optimization_level=15 ;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3 ;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3 ;zend_extension=/usr/local/Zend/lib/Optimizer-3.3.3/ZendExtensionManager.so ;zend_extension_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3/ZendExtensionManager_TS.so ; -- Be very careful to not to disable a function which might be needed! ; -- Uncomment the following lines to increase the security of your PHP site. ;disable_functions = "highlight_file,ini_alter,ini_restore,openlog,passthru, ; phpinfo, exec, system, dl, fsockopen, set_time_limit, ; popen, proc_open, proc_nice,shell_exec,show_source,symlink" Hey there, need some help badly. I'm trying to get the size of the BLOB data in mysql. Did a search and there are like no tutorial on this. Only relevant info was from this page, at the far bottom, it just wrote this (below code). But the writer did not explain how to use it. SELECT OCTET_LENGTH(content) FROM BloBTest WHERE filename='myimage.png' I just give it a trial an error, wrote this, but did not work. $LENGTH = mysql_query("SELECT OCTET_LENGTH(blobdata) FROM thedatabase WHERE id = 'selected_id'"); echo $LENGTH; Please help.... For PHP 7.4, what is the recommended session length that I should be using to have the best security? In DEV< in my php.ini file, session.sid_length = 26 According to the comments above that, it sounds like you can go up to 256. Is it fair to assume that larger is more secure? Also, if I set it to a larger size like 256, is tehre any risk of breaking things on my (VPS) web server running WHM/cPanel? $file = 'includes/views.txt'; $f = fopen($file, 'w+'); $views = fread($f, filesize($file)); fwrite($f, $views+1); fclose($f); The contents of views.txt is: Code: [Select] 1 Why is it returning it needs to be greater than 0?...The file isn't empty. Hi all, Yesterday I moved a web application from a normal cookie session to a use_trans_sid session because some users' browser didn't accept cookies. This works great, but the session used to last for 45 minutes (set with session.gc_maxlifetime), but after the change the session times out faster. (How) can I set the session length if I use use_trans_sid? Thanks, Base PS: PHP version 5.2.13-1 |