Pixel-Picasso
03-25-2009, 07:10 PM
Hello -
I have been learning PHP for about a month now, and I am working on a large project that requires a lot of it. My project involves the Google Maps API and I have a database that populates my map with information collected from a form.
Each of the markers on my map are populated by the following javascript code:
var html = '<b>' + name + '</b> <br/>' + address + '<br />' + '<a href=\"/locations/' + state + '/' + city + '/' + name + '\">View Profile</a>';
As you can see a link is created in the marker using the state, city and name.
Now that I have determined a URL path, I need to actually create it. I need a way to go through the database and create a file and file path for each one, this will be a "Profile" page for each location.
I know how to use fopen to create a file, I just dont know how to use a variable $name for the file and I cant find a guide that explains how to determine the file path, which in my case would be location/$state/$city/ and then the actual file.
Any help would be greatly appreciated, it somewhat hard to explain the ultimate goal I envision so if you need more details I will certainly give them.
If you know of any guides anywhere that relate to this in some way that would work perfectly.
Thanks
I have been learning PHP for about a month now, and I am working on a large project that requires a lot of it. My project involves the Google Maps API and I have a database that populates my map with information collected from a form.
Each of the markers on my map are populated by the following javascript code:
var html = '<b>' + name + '</b> <br/>' + address + '<br />' + '<a href=\"/locations/' + state + '/' + city + '/' + name + '\">View Profile</a>';
As you can see a link is created in the marker using the state, city and name.
Now that I have determined a URL path, I need to actually create it. I need a way to go through the database and create a file and file path for each one, this will be a "Profile" page for each location.
I know how to use fopen to create a file, I just dont know how to use a variable $name for the file and I cant find a guide that explains how to determine the file path, which in my case would be location/$state/$city/ and then the actual file.
Any help would be greatly appreciated, it somewhat hard to explain the ultimate goal I envision so if you need more details I will certainly give them.
If you know of any guides anywhere that relate to this in some way that would work perfectly.
Thanks