PHP - Find My Nearest Store Application
Similar TutorialsHow do I find the nearest div of dynamically added html?
Hi, I'm working on a project which was going pretty well until I discovered the application doesn't actually know where it is installed. So far when I want to include the config file I just use $_SERVER['DOCUMENT_ROOT'].'/config.php';() Which works fine if the application is installed in the root directory. But how do I get the folder the application is installed in? e.g. Document Root Folder: C:\Web\ Actually Application Folder: C:\Web\MyApp\ How do I get the \MyApp dynamically? I can't just use './' all the time because I have files accessed by AJAX stored in other folders. Thanks in advance. I have a payment button for PayPal which securely stores the amount, but when the payment is made how do i know if it was paid or not so i can get the page to store this in the mysql database? Hi, I need a small help. Here is my situation. I am using a MVC application (e.g. Joomla or Drupal) which has a .htaccess redirect rule that all requests are passed through index.php file. That's normal and this is my main application. Now I installed another application within the application folder structure. What I want do do here is to allow opening the third party application URLs after one logged into my main application. Can anybody provide me some pointers to do the same? Please let me know if you need any further information on this. Any solution irrespective of framework will work. Thanks! Anupam I need to take a time and convert so it is rounded up or down to the nearest 0 or 5. Code: [Select] function roundMe ($time, $upDown) { if($upDown==1) { //round up } else { //round down } return $x; } echo roundMe("16:22", 1); // returns 16:25 echo roundMe("16:22", 0); // returns 16:20 echo roundMe("16:25", 1); // returns 16:25 echo roundMe("16:59", 1); // returns 17:00 echo roundMe("16:59", 0); // returns 16:55 So I just started working with php (not programming) a couple days ago. In this formula, I need to round something down to the nearest 5 OR 0. Whatever comes first. Any thoughts on how i might do this? Here's what I have so far. <?php $magicLevel = $_POST['magicLevel']; $playerLevel = $_POST['playerLevel']; $rune = $_POST['rune']; //gets the value "lmm" $maxDamage = 0; switch($rune) { case "lmm": $maxDamage = ($playerLevel*0.2)+($magicLevel*0.81)+4; break; } echo $maxDamage; ?> What I need to round down is this part: ($playerLevel*0.2) Thanks in advance! How can I order this query of zip codes within the radius by nearest? /** * Get Zipcode By Radius * @param string $zip US zip code * @param ing $radius Radius in miles * @return array List of nearby zipcodes */ protected function get_zipcodes_by_radius ( $zip, $radius ) { $sql = 'SELECT distinct(zip) FROM zip_codes WHERE (3958*3.1415926*sqrt((latitude-'.$zip->latitude.')*(latitude-'.$zip->latitude.') + cos(latitude/57.29578)*cos('.$zip->latitude.'/57.29578)*(longitude-'.$zip->longitude.')*(longitude-'.$zip->longitude.'))/180) <= '.$radius.';'; $zip_codes = array(); if ( $result = $this->db->query( $sql ) ) { while( $row = $result->fetch_object() ) { array_push( $zip_codes, $row->zip ); } $result->close(); } return $zip_codes; }
hello, if i have the following, how would i display it? Code: [Select] function minutes_round ($hour = "$signintime", $minutes = '5', $format = "H:i") { $seconds = strtotime($hour); $rounded = round($seconds / ($minutes * 60)) * ($minutes * 60); return date($format, $rounded); } Hello, I have a variable called $Price, We are getting it through Mysql Database using While loop. We getting the data from database in ordered by ID. Now then i have requirement to store that data into Low to High form ... Like we are receiving $price lke unordered form .. 50 14 35 25 00 145 52 Here i just want to store it in Low to high form like 00, 14,25,35 ... and so on .. Please suggest me the appropriate code. While($myrow=mysql_fetch_array($result, MYSQL_ASSOC)) { some codes return value $price. // want to store in array } $array($price) // here want to store in Low to high with key value. There are ten list or bookmarks from Prof. Horner's Bible-Reading System found (http://www.facebook.com/group.php?gid=46416541831) each having set number of books from the Bible. One is to read ten chapters a day, one chapter from each of the bookmarks. Type in what day you are on and the program will show you on each of the lists as to what chapter you are suppose to be on. Also want to show statistics that will display how many times the Bible has been read with a break down of all 66 books of the Bible. Started a git respo http://github.com/Kutakizukari/Prof-Horners-Bible-Reading-System Bookmark list as follows: //List 1 $Matthew = 28; $Mark = 16; $Luke = 24; $John = 21; //List 2 $Genesis = 50; $Exodus = 40; $Levitieus = 27; $Numbers = 36; $Deuteronomy = 34; //List 3 $Romans = 16; $I_Corinthians = 16; $II_Corinthians = 13; $Galatians = 6; $Ephesians = 6; $Philipians = 4; $Colossians = 4; $Hebrews = 13; //List 4 $I_Thessalonians = 5; $II_Thessalonians = 3; $I_Timothy = 6; $II_Timothy = 4; $Titus = 3; $Philemon = 1; $James = 5; $I_Peter = 5 ; $II_Peter = 3 ; $I_John = 5; $II_John = 1; $III_John = 1; $Jude = 1; $Revelation = 22; //List 5 $Job = 42; $Ecclesiastes = 12; $Songs_of_Solomon = 8; //List 6 $Psalms = 150; //List 7 $Proverbs = 31; //List 8 $Joshua = 24; $Judges = 21; $Ruth = 4; $I_Samuel = 31; $II_Samuel = 24; $I_Kings = 22; $II_Kings = 25; $I_Chronicles = 29; $II_Chronicles = 36; $Ezra = 10; $Nehemiah = 13; $Esther = 10; //List 9 $Isaiah = 66; $Jeremiah = 52; $Lamentations = 5; $Ezekiel = 48; $Daniel = 12; $Hosea = 14; $Joel = 3; $Amos = 9; $Obadiah = 1; $Jonah = 4; $Micah = 7; $Nahum = 3; $Habakkuk = 3; $Zephaniah = 3; $Haggai = 2; $Zechariah = 14; $Malachi = 4; so on day 1 it should readout Matthew Chapter 1 Genesis Chapter 1 Romans Chapter 1 I Thessalonians Chapter 1 Job Chapter 1 Psalms Chapter 1 Proverbs Chapter 1 Joshua Chapter 1 Isaiah Chapter 1 Acts Chapter 1 on the second day it should all say Chapter two but Matthew reaches day 28 it should move on to Mark Chapter 1 and so on and so on and with each bookmark list. I am urgently looking for a junior PHP web application developer with a portfolio of your code experience, no commercial experience will be considered to.
Please contact me to find out more!
Exciting opportunity for someone wanting to get a foot in the door in the world of IT!!
Hi all, this is my first time on this forum! I have a background with HTML and CSS but have recently started a Masters in Computer Science hoping to come out of it with the tools to get a job with PHP development. Our first assignment has somewhat 'thrown me in the deep end' as we have to construct a search engine that indexes the words of a number of documents and rank them using the TF*IDF algorithm along with the log rule associated with Information retrieval. I am completely new to PHP so the past week has been something of a crash course - This is the code I have so far: Code: [Select] <?php $filename = 'airlines.txt'; $fp = fopen( $filename, 'r' ); $file_contents = fread( $fp, filesize( $filename ) ); fclose( $fp ); //$new_contents = ereg_replace("[^A-Za-z0-9]", "", $file_contents); /*$file_contents = trim($file_contents); $file_contents = preg_replace('/\h+/', ' ', $file_contents); $file_contents = preg_replace('/\v{3,}/', PHP_EOL.PHP_EOL, $file_contents); */ $pat[0] = "/^\s+/"; $pat[1] = "/\s{2,}/"; $pat[2] = "/\s+\$/"; $rep[0] = ""; $rep[1] = " "; $rep[2] = ""; $new_contents = preg_replace("/[^A-Za-z0-9\s\s+]/","",$file_contents); $new_contents = preg_replace($pat,$rep,$new_contents); //preg_replace('~\s{2,}~', ' ', $text); $commonWords = array('a','able','about','above'........and another few hundreds cut out of this not to hurt your eyes!); $lines = explode ( "\n", $new_contents); $lines2 = implode (" ", $lines); $words = explode ( " ", $lines2 ); $useful_words = array_diff( $words, $commonWords ); /*for($i = 0; $i < count($lines); $i++) { echo "Piece $i = $lines[$i] <br />"; }*/ for($i = 0; $i < count($useful_words); $i++) { echo "Words $i = $useful_words[$i] <br />"; } //$arr=array("blah1","blah2","blah3"); file_put_contents("demo2.txt",implode(" ",$useful_words)); //$file_c = file_get_contents("demo.txt"); //$colms = explode(",",trim($file_c)); //print_r($colms); //echo $lines[2]; ?> I've got to the stage where that strips out most of the stop words when the final array is printed, but they have been replaced with spaces or something that I have not come acoss because as you may see I had a bit of trouble originally stripping the punctuation marks. I'm hoping someone can point me in the direction as to how to organise the words I have left after the stripping of stop words which are of no use during the search. I need to store those words into another array and index them which says how many times they appear in that document. I've come across the function array array_count_values ( array $input ) on the manual but I'm not sure about the best way to use it. I've attached the files I've used if that helps. Any help would be greatly appreciated! i got this application more then 10 years, all this years nothing happend, untill prev week, someone to lazzy to filled all the info required, but after submitting the form, their uncomplete info just being printed on the database. Which mean the required field code didnt work 2 all, all this year,.. what a dissapointment. Can someone take a look at my scripts and fixed please [attachment deleted by admin] I am building program to manage payment/monthly payments. I've ran into an issue that I haven't been able to overcome and need some help. I've been lurking for a while and decided it was time to ask you guys...Here's the issue: I have a table 'payments' that contains scheduled payments that looks like: id clientid paymentduedate balance expected pending 367 112233 4/16/2011 1030.00 257.50 Y 368 112233 5/16/2011 1030.00 257.50 Y 369 112233 6/16/2011 1030.00 257.50 Y 370 112233 7/16/2011 1030.00 257.50 Y What I need to do that I haven't figured out is to adjust the expected amount according to the payment, update the status to N (not pending) without affecting the later expected payments. For example: they make a payment of $257.50, applies that to row 367, sets the status to N, but leaves the other status' to Y (for obvious reasons). the make a payment of $250.00, leaving the balance at $7.50, so lets add $7.50 to row 368, mark 367 status to N the make a payment of $300.00, leaving the expected balance at $0.00 for row 367, but adjust the balance for row 368 to $215.00 Any ideas? Thanks Hi, I need to develop a module called chat with doctor. User can able to chat with the doctor for that he has to pay some amount to website. Say example user got purchase the Package worth : 2$ =>5min. After 5 min chat will be closed , timer should be shown while chatting. How can we do this? Hey all I have an error in my Facebook application and I'm not sure what's wrong (New to PHP). The error output is: Code: [Select] Warning: array_rand() [function.array-rand]: Second argument has to be between 1 and the number of elements in the array in /home/app/view.php on line 15 And the PHP lines are as follows: $friends = $facebook->api('/me/friends'); print_r(array_rand($friends, 3)); Would it be possible to create a passive socket server using php, for a client-server php app, that runs as some sort of daemon? I understand that you probably can't understand much of what I mean, but I hope you understand enough to help me in some way. PHP APPLICATION - > APPLICATION SERVER - > DATABASE(S) Explanation: Each instance of the PHP application would connect to the "Application Server" and use it to fetch information and perform some commands. Could this be done using sockets ? Simple examples would help Thank You! hello guys I need little help bro, I want to make application in which i want this look, I am from a company where we have over 12 companies license and all are those is renew after every year. so i want to make a application which will inform us 1 month before expireing their license. Mean if any company license is expire on 12 June, our application give us notification on 12 May. Could you please help me how can I do this? Thanks and regards |