I am a student and I was stuck with the task of coding a .php database structure for my group with out any knowlage besides some books, I have read php for the world wide web, php for dummies, and mysql/php database applications, and I am trying to figure out how to code a php document that will look into my database file with zipcodes in it, and will, after doing some inhouse math, send you to mapquest to show a map based off of a user inputted zipcode (this is for a chain of diners) what it will do is take the inputted zipcode, and based off the database, will do the math to figure out what is closer and then send you to mapquest.
Thanks
Dino
.php to mapquest
Moderator: General Moderators
what I dont understand
[<?php
$Mlink = "";
;
$zip = trim($zip);
$Mlink = "http://www.mapquest.com/maps/map.adp?ad ... =us&zoom=5";
return $Mlink;
}
?>
is what I have (I found it online and been playing around with it)
, I have tired using html to have it link after putting in a zipcode, but nothing happens.
$Mlink = "";
;
$zip = trim($zip);
$Mlink = "http://www.mapquest.com/maps/map.adp?ad ... =us&zoom=5";
return $Mlink;
}
?>
is what I have (I found it online and been playing around with it)
, I have tired using html to have it link after putting in a zipcode, but nothing happens.
Here is what I have so far
I am sorry to be taking up your time mate, but here is what I have so far...
[<form>
<h1> Zip Code</h1>
<form name= "zip" id"zip"
method="zip" action="zips.php">
<p>Please insert your Zip Code <br />
<textarea name="Zips" cols "10"
rows="0"id= "$zip"></textarea>
</p>
$Mlink = "";
;
$zip = trim($zip);
$Mlink = "http://www.mapquest.com/maps/map.adp?address=$zip";
return $Mlink;
}
</form>
]
[<form>
<h1> Zip Code</h1>
<form name= "zip" id"zip"
method="zip" action="zips.php">
<p>Please insert your Zip Code <br />
<textarea name="Zips" cols "10"
rows="0"id= "$zip"></textarea>
</p>
$Mlink = "";
;
$zip = trim($zip);
$Mlink = "http://www.mapquest.com/maps/map.adp?address=$zip";
return $Mlink;
}
</form>
]
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
the basic html should look this (zips.php):
Code: Select all
<?php
if(!isset($_GETї'zip']) || !is_numeric($_GETї'zip']))
{
echo <<<STOP
<form method="get" action="zips.php">
<input type="text" name="zip" maxlength="5" />
<input type="submit" value="Find Closest Store" />
</form>
STOP;
exit;
}
// do your distance calculations in here
// assume $zip is the location chosen from the calculation
$Mlink = 'http://www.mapquest.com/maps/map.adp?address=' . $zip;
echo 'Closest found: <a href="' . $Mlink . '">' . $zip . '</a>';Life saver
Thank you so much man, you have no Idea how much you have helped me,
dino
dino