Jump to content

ki

Members
  • Posts

    208
  • Joined

  • Last visited

Everything posted by ki

  1. 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.
  2. 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']; }
  3. I already have the method for getting the coordinates. I just need help with the formula I explained above.
  4. 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.
  5. 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
  6. 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.
  7. nope, that didn't work. the code shows up only if I print() twice, the session I don't think is the problem.
  8. 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 { } ?>
  9. 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.
  10. 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!
  11. 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 { }
  12. ki

    Displaying A Popup

    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?
  13. 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.
  14. I mean, I'm trying to use their unique name for posting, I just dont know which method to approach this at.
  15. 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.
  16. Like 6 years ago I had made a forum software for me and my buddies to post on. It had worked all great until my friend had posted a character that skewed my whole database, unintentionly, he knew nothing about computers. But I really haven't dabbed in PHP since 2008, I'm just now getting back into it again. I need to know how I can make data from an input to be put into an MySQL database and not screw up my code. So something along the lines that make the code safe and not exploitable. Also any third party scripts on captcha would be great!
  17. How do you make it so that the div positioned moves with the page as you scroll down?
  18. Not at all, I'm trying to get todays history script for each specific day.
  19. I've been looking for one all over the internet and have yet to find one to my exact specifications. I don't even know how I would attempt to make said script since I don't have a database of my own with that type of information stored on it. I basically want to use History.com's This Day In History feed on my website, but I don't like their RSS feed considering it's a giant paragraph of a single article. I'm just looking to post a few random dates and some information like this for example: 1986 > blah blah blah 1990 > blah blah blah 2010 > blah blah blah Any help would be greatly appreciated brethren.
  20. ki

    Web font

    What would you guys suggest as a pretty good font to use on a website? What do you guys normally use for your web projects? I'm looking for a new look, trying to dip my fingers into each bit of style there is sort to speak.
  21. ki

    question

    Is it possible to send a fax through php? and if so does anyone have any good tutorials? or any at all.
  22. ki

    div

    your have to z-index them both? because I tried only one z-index
  23. try this: http://www.dhtmlgoodies.com/index.html?page=dragDrop
  24. ki

    div

    Im trying to float a div over a div, ive tried different methods trying this yet non seem to work here is the code im trying to make the div float over: <style> div#subjects { margin-bottom: 5px; display: block; } div#msgbody { float: left; display: block; width: 100%; } div.CB { float: left; width: 50px; } div.FR { float: left; width: 100px; } div.SB { float: left; } div.MR { float: left; display: block; width: 100%; font-size: 14px; } </style> <div class="MH">Message(s)</div> <div id="subjects"> <div class="MR"><div class="CB"><input type="checkbox" name="mail[]"></div><div class="FR"><a href="">name</a></div><div class="SB"><a href="javascript:message('')">subject</a></div></div> </div> and this is the div I want floated: <div id="msgbody"> </div> its not going to be moved but its going to popup in the center of a holder div (non of the above divs) that displays a message with AJAX. any help is appreciated
  25. ki

    iphone?

    Does anyone know how to tell if your using an iPhone to view a site yet?, cause I wanna make a totally different site then
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.