-
Posts
208 -
Joined
-
Last visited
About ki
- Birthday 06/30/1990
Profile Information
-
Gender
Male
-
Location
Florida
ki's Achievements
Regular Member (3/5)
0
Reputation
-
I don't need anything returned, just sent to the server. There is a session_start(), I didn't include it in the code I posted.
-
Mind you, I've altered and butchered my code several times trying to find why it's not sending anything even though it says it does. geo.html navigator.geolocation.getCurrentPosition(GetLocation); function GetLocation(location) { var usr_lat = location.coords.latitude; var usr_long = location.coords.longitude; $.ajax({ url: 'local_settings.php', type: 'POST', data: { user_lat : usr_lat, user_long : usr_long }, success: function(data) { alert("success! user_lat:" + data); } }); } local_settings.php if (isset($_POST['user_lat']) && isset($_POST['user_long'])) { $_SESSION['user_lat'] = $_POST['user_lat']; $_SESSION['user_long'] = $_POST['user_long']; }
-
I already have the method for getting the coordinates. I just need help with the formula I explained above.
-
I'm trying to pull results from a database based on where the user is located based upon the variables $usr_lat & $usr_lng, and search for by a radius of x amount of miles/km (need to make it optional). I can't seem to find exactly what I'm looking for on google so I thought I'd asked here. Any help would be appreciated.
-
I fixed it. I ended up putting the code in the body, like this: <body<?php if($_SESSION['upload'] == 1) { print(" onload=\"javascript: upload();\""); $_SESSION['upload'] = 0; } else { } ?>> thanks for all the help guys
-
So when I view source on the targeted upload.php page form the browser, the header redirects it to the index.php where it's displaying the <script> code which is calling the upload script I require but when I load the page it doesn't call. So my script is working, there is a javascript problem I guess? I don't know what the hell to do.
-
nope, that didn't work. the code shows up only if I print() twice, the session I don't think is the problem.
-
Okay here I'll show you most of the code there is: upload.php <?php include("index_cross_session.inc.php"); if (!$_POST['image-upload-post']) { $_SESSION['upload'] = 1; header("Location: index.php"); die; } ?> index_cross_session.php <?php session_start(); if (!$_SESSION['id']) { $_SESSION['id'] = hash(crc32,uniqid()); session_write_close(); } ?> index_header.php <?php include("index_cross_session.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link media="screen" rel="stylesheet" href="tragical.css" /> <link media="screen" rel="stylesheet" href="colorbox.css" /> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <script src="jquery.colorbox-min.js" type="text/javascript"></script> <script src="tragical.js" type="text/javascript"></script> <?php if($_SESSION['upload'] == 1) { //print("<div style=\"display:none;\">LOL</div>"); print("<script type=\"text/javascript\">upload();</script>\n"); $_SESSION['upload'] = 0; } else { } ?>
-
I did the die and yes I have verified the post. I mean the page isn't calling the Javascript function. I've stumbled upon something while checking to see if it was maybe the session and it appears it isn't. I added another print function displaying some random string of text and it works. And I just changed the code around to where there's a inclusion of a php file which holds the session info. <?php if($_SESSION['upload'] == 1) { print("<div style=\"display:none;\">test</div>"); print("<script type=\"text/javascript\">upload();</script>"); $_SESSION['upload'] = 0; } else { } ?> That's the code that works. I don't know why it works with a print that's actually displaying text and not the other. I would just say this is working but I'm pretty anal about that.
-
I have nothing else after the header at this point, it's honestly just the code shown that's in that file. As for the POST, it is valid and it is working. I want anyone who hasn't tried posting anything that goes to that direct URL to go to the main page and display the Popup!
-
I have a problem with one of my codes. It works in google chrome but not in safari which I don't understand since it's mostly a server side script. What I'm doing is creating a session and on the page where it's redirecting it's suppose to create a script to call a javascript function which works in Chrome. I don't understand what the problem is at all since I see it work in Chrome but not Safari. This is the redirect script: <?php if (!$_POST['image-upload-post']) { $_SESSION['upload'] = 1; header("Location: index.php"); } ?> This is the script on the page it's going to: if($_SESSION['upload']==1) { print("<script type=\"text/javascript\">upload();</script>"); $_SESSION['upload'] = 0; } else { }
-
I have a code code right now which works but I want it to form to the height of the text, with mine I cant edit it unless I make specific values which some content will be dynamic and cant be determined. here's my code: <div id="div-overlay" onclick="javascript: closePopup();"></div> <div id="div-popup"></div> div#div-overlay { position: absolute; top: 0; left:0; width: 100%; height: 100%; background: #000; display: none; opacity: .5; filter: alpha(opacity=40); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; } div#div-popup { position: absolute; top: 50%; left: 50%; margin-left: -200px; margin-top: -200px; width: 400px; height: 400px; display: none; background: #FFFFFF; padding: 20px; -moz-border-radius: 7px; -webkit-border-radius: 7px; } wat do?
-
I kind of like this but I want it kind of like 4qR31~ Something like that, just an example though. I think I would have to use a session though. How would I go about doing this one? Someone could potentially edit that cookie and edit their ID appearing as someone else though.
-
I mean, I'm trying to use their unique name for posting, I just dont know which method to approach this at.
-
I'm not asking for any code really. I need a way to create a unique UserID per $_SESSION or by md5 hashing their IP address and only using the first 6 or 7 characters. Does anyone have any ideas into this? I'm not requiring a login for my specific project, but do want individuals posting to recognize each other within some time period or sense.