Home     Articles & Projects     Products & Web Services     Forum

Forum

PHP GeoLocation

Hi guys,
trying to work out the following
I have created a list of GeoLocations and I would like to create a simple system that tells me if a person is inside the area of the GeoLocation I have set for e.g.

If a person it in the area of
144.30'39.82/-38.16'22.00 by with of 144.31'12.99/-38.16'16.20
by
144.30'41.77/-38.16'37.09 by with of 144.31'12.74/-38.16'33.05

so if a person is in that area I want to show that info.

I have the script that collects the GeoLocation but not away to know if a person is in an area.

Amazon and MySQL Mashup

Hi David,

It's been a while, hope you are well?

I am creating a micro niche affiliate site and get some results from amazon and some from a mySQL database.

In order to display the results for a particular product according to price I have created arrays for both sets of results (amazon and mysql) and then will try to merge them together before sorting and displaying them.

I have got as far as creating the arrays but I am having difficulty in merging the results together. I think I need to create a multi-dimensional array for amazon results first?

This is what I have so far, could you please give me a nudge in the right direction!

<?php
// Amazon
require("includes/MagicParser.php");
$amazonItems = array();
function
myRecordHandler($item) {
    global
$amazonItems;
   
$amazonItems[] = $item;
  }

 
MagicParser_parse($awsUrl,"myRecordHandler","xml|ITEMLOOKUPRESPONSE/ITEMS/ITEM/OFFERS/OFFER/");

// mySQL
$retailerItems = array();
$sql = "SELECT * FROM `".DB_PREFIX."prices` WHERE prod_id='".$prodId."' ORDER BY price ASC";
//echo "<p>SQL:".$sql."</p>";
if (database_querySelect($sql,$rows)) {
    foreach(
$rows as $products) {
       
$retailerItems[] = $products;
    }
}

// Combine arrays
array_push($amazonItems,$retailerItems);
$finalarray = array_combine($amazonItems, $retailerItems);
print_r($finalarray);
?>

Thanks,
Simon

Just got a VPS server and want to know can i do the following

Hi guys, just got myself a VPS server, I need to find away with PHP to open and close a port on the firewall while the PHP script runs.
Is that possible?

Get the main body text from site/s

Hi just wondering, does anyone know how to tell PHP to get the text from a story.

I am sure as we all know a web developer can place text anywhere on the page, but I want to only get the area that has the most text.

Go back to start of PHP

Hi i have a hard question, SO thought I would ask it here.

Is there anyway to go back to the start of a PHP code, if the result is not accepted by an if statement?

Basic question

Hi David,

Forgive my Numptyness here, but Just trying to learn php basics

If I was trying to show one banner randomly each time my homepage was opened, would the following work at all? or am I miles off?

<?php
$image1
= "img src='http.wwww.mydomain/images/banner1.jpg'";
$image2 = "img src='http.wwww.mydomain/images/banner2.jpg'";
$image3 = "img src='http.wwww.mydomain/images/banner3.jpg'";

$randimages = array("$image1", "$image2", "$image3");

$splash = array_rand($randimages);

{

  echo
"$splash";

}
?>

Thanks for any help you can offer

Regards

Paul

Only show data from the last R

Hi I was wondering if anyone can help me, I need to be able to get information from my MYSQL database but only show the data that was added since the last status = R

for e.g.

ID   |  Amount | Status
1   |0.00      | R
2   |1.90      | 0
3   |1.40      | 0
4   |0.00      | R
5   |0.50      | 0

What I want it to show is 0.50

Need to add a OR in the Where but don't want to make it too long

Ok this is my issue, I have a row called status and in the example below, it is shown as a.status
The system has the numbers from 1 to 6 and I need to say only show ads that match if there status is 2 - 3 or 5

However I have tried everything I know of to get it to work from AND a.status LIKE "2%3%5" but that did not work I tried placing an OR in it, but saw it screwed the whole thing...

So I am kinda at a loss I know it has to be possible but just don't know how.

<?php
SELECT
c
.id as id,
c.catid as catid,
c.onoff as onoff,
c.cid as cid,
u.sid as sid,
u.onoff as sonoff,
m.uid as stationuid,
m.sid as stationid,
m.minprice as stationminprice,
m.maxprice as stationmaxprice,
a.id as advertisersid,
a.uid as advertisersuid,
a.status as status,
a.minprice as advertisersminprice,
a.maxprice as advertisersmaxprice,
a.audiofile as advertisersaudiofile,
AVG((m.maxprice)/(a.minprice)) as avg

FROM tbl_radio_ad_network_categories_onoff c
LEFT OUTER JOIN tbl_radio_ad_network_categories_onoff u ON u
.catid = c.catid
LEFT OUTER JOIN tbl_radio_ad_network_stations m ON u
.sid = m.sid
LEFT OUTER JOIN tbl_radio_ad_network_campaign a ON c
.cid = a.id AND a.minprice <> m.minprice AND a.maxprice <> m.maxprice

WHERE c
.cid NOT LIKE "0" AND u.sid NOT LIKE "0" AND c.onoff NOT LIKE "0" AND u.onoff NOT LIKE "0" AND a.status = "2" OR "3" AND u.sid = "4" AND c.cid NOT LIKE "27"
?>

How long was the page opened for

Hi I am wondering if your able to help, I need a PHP solution to finding out when the page was opened and closed. and the seconds between.

Thanks

PHP MYSQL - Time/count

Hi guys,
I am trying to figure out how to do the following

I want to get the last 3 entries in the database
get the time, then i need to find out if all 3 of them have been added in the last 3minutes.

If anyone can help that would be great.

Thanks

Syndicate content