Re: [PHP-DB] screen resolution!

2006-02-06 Thread JeRRy
Yes I know this but there is no script that can re-write webpages on the fly 
for certain resolutions?
   
  Instead of re-doing each page for each res.?  
   
  With the technology these days I thought someone would of created something 
like this, so you create a website than you put it through a program that 
re-does the HTML for the resolutions you set and bingo the results are spat out 
and you add it to the site and use a little script to redirect depending on 
their set resolution.
   
  Jerry

PHP Superman <[EMAIL PROTECTED]> wrote:
  Or you can have a page which detects resolution by javascript and redirects 
to another PHP page with the resolution data

  On 2/4/06, Bastien Koert <[EMAIL PROTECTED]> wrote:   
As the other poster mentioned you need JS to detect the screen widththe
usual approach is to use js to detect the screen res and the include the 
appropriate CSS file to match the screen res.

Bastien


>From: JeRRy <[EMAIL PROTECTED]>
>To: php-db@lists.php.net 
>Subject: [PHP-DB] screen resolution!
>Date: Sun, 5 Feb 2006 02:44:19 +1100 (EST)
>
>Hi,
>
>   I have written a website in PHP using MYSQL.  But I have come accross an
>un-common problem.  Normally when I create a website it's done on a desktop 
>PC.  But this time for the first time I did it on laptop meaning the screen
>resolution is different.
>
>   Is there any sort of script/code I can use to create another section of
>my site in a desired screen resolution without me having to do it all 
>manually?
>
>   I know of many scripts online that I can DETERMINE visitors screen
>resolutions and recommend the correct one but don't know one that will
>adjust the website to suit that visitors screen resolution.  Am aware of 
>scripts that redirect to another web page but that requires you to write
>the website again to cater for that.
>
>   Is there a quicker way/solution?
>
>   Thanks!
>
>   J 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now! 


[PHP-DB] Creative Commons CA, MX, and UK postal code databases?

2006-02-06 Thread Matty Sarro
Hey all!
I'm working on expanding the functionality of one of my first web apps (it
simply searches by radius from a zip code). Currently I've been using
creative commons databases for the US (released under the Share & Share
Alike license here http://civicspacelabs.org/home/zipcodedb).

I'm having almost no luck finding similar databases for Canada, Mexico, and
the UK. Has anyone else had this trouble? I'm trying to keep my costs down
to a minimum, so purchasing the databases seems like a rather steep
investment just to learn. Any ideas?
-Matty


Re: [PHP-DB] First web app, ever, so please bear with me

2006-02-06 Thread Julien Bonastre

This is my kind of gear...


You've hit my nail, right ontop of my head...



I have made some feature similar to this for Australia..


I am using a federal government operated index of every registered 
landmark, train station, suburb, river, etc that stores the geographical 
position [latitude and longtitude]


And I use this in conjuction with an equation of Approximate Episoidal 
Distance to calculate to a fairly high degree of accuracy [200m to 
500km] the distance between to given points.




To figure out the items between said centre location and given radius 
though requires a bit of calculation.



simply because in order to determine which 'elements' fall within given 
range you have to compute live the distance between requested location 
and each element stored in db.



Somewhat painful therefore it is wise to somehow use other filters as 
well to choose what type of business/ etc



I know this sounds somewhat inefficient, and therefore the only other 
way to simplify this is either to cache queries so any future queries 
that match the same source and range will save the processing and just 
display this results


Again though depending on your business rollover these results may 
expire quickly and it isn't all that likely that given the timeframe you 
might set that another person might run the same range and source query 
anytime soon



Therefore if you could conjure up sone form of indexing system to 
categorise quickly locations against a given reference point perhaps?


For example break down locations in terms of "blocks" or something and 
then you can just perform this operation on any business that falls 
inside the block of the requested source location and adjacent blocks 
etc etc..




I have attached a library i wrote for my geolocate system on a site I am 
currently developing.. Its a start point to the implementation



Of course you'd have to find where you can source a fairly up to date 
extensive postcode/zipcode/suburb database that links to geographical 
points to do this.




Enjoy.. and Good luck!


p.s. As a side note, I am not aware fully of American systems, and I do 
believe there are already in place some fairly comprehensive systems to 
do zipcode/locational distance calculations. Alot easier than I had to 
do in Aus.




---oOo--- Allowing users to execute CGI scripts in any directory should 
only be considered if: ... a.. You have no users, and nobody ever visits 
your server. ... Extracted Quote: Security Tips - Apache HTTP 
Server ---oOo--- --oOo---oOo-- Julien Bonastre 
[The_RadiX] The-Spectrum Network CEO ABN: 64 235 749 494 
[EMAIL PROTECTED] 
www.the-spectrum.org --oOo---oOo-- 
- Original Message - 
From: "Matty Sarro" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, February 05, 2006 8:17 PM
Subject: [PHP-DB] First web app, ever, so please bear with me


Greetings all! I am finally taken the plunge and started trying to 
develop a

web application. I've got a fair amount of web design experience with
straight up HTML, I've written a few scripts with perl, and I'm slightly
familiar with SQL. This is to give you some background... I'm by no 
means

experienced so please bear with me.

Currently I'm using a forum to gather business reviews from subscribers 
to a
website. Once a substantial number have been gathered, I want to use 
them to

populate a database that can be appended to by users.

The actual application (once data has been migrated) will have two uses:
first, users should be able to search by geographic area for businesses
based on zip code, town name, business name, distance from a given 
zipcode,

etc. If a certain field isn't filled in, it should be assumed to be a
wildcard (for instance, if a user would enter no business name, or town
name, but they do enter 10 mile radius from 90210, then all businesses
within 10 miles of 90210 that have reviews will be displayed).

I'd like to use a similar form to allow users to submit reviews for new
businesses.

Most of this may seem pretty simple, but like I said, I've never worked 
with
PHP before, or SQL, let alone both. And whats worse, I've got no idea 
how to
do anything with the geographical code (the X mile radius from zip code 
Y
thing). So, where would be a fair place to get started (besides the 
obvious

php.net)?

I hope this wasn't too vague - thanks again guys! Also, this is my first
post, so please be gentle :)






No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 
4/02/2006
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 4/02/2006

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] screen resolution!

2006-02-06 Thread Micah Stevens

Yes, there is. It's called HTML.

You might think me daft, but HTML was actually created to allow the page to 
adapt to screen size. The oldest technology on the block is actually the 
thing to use in this situation, otherwise you're just creating extra work for 
yourself. 

A simple example:

 - This works great, looks great, until you have a 
640x480 screen. Instead, try this:

  (this scales according to screen size)

or

 (this scales according to content size + screen size)

It really sounds like this is a problem with your web page design, not php or 
Javascript. 

However, you could indeed do as others suggested and create multiple pages.. 
That really sounds like more work than it's worth though. 

-Micah 

On Monday 06 February 2006 1:38 am, JeRRy wrote:
> Yes I know this but there is no script that can re-write webpages on the
> fly for certain resolutions?
>
>   Instead of re-doing each page for each res.?
>
>   With the technology these days I thought someone would of created
> something like this, so you create a website than you put it through a
> program that re-does the HTML for the resolutions you set and bingo the
> results are spat out and you add it to the site and use a little script to
> redirect depending on their set resolution.
>
>   Jerry
>
> PHP Superman <[EMAIL PROTECTED]> wrote:
>   Or you can have a page which detects resolution by javascript and
> redirects to another PHP page with the resolution data
>
>   On 2/4/06, Bastien Koert <[EMAIL PROTECTED]> wrote:
> As the other poster mentioned you need JS to detect the screen widththe
> usual approach is to use js to detect the screen res and the include the
> appropriate CSS file to match the screen res.
>
> Bastien
>
> >From: JeRRy <[EMAIL PROTECTED]>
> >To: php-db@lists.php.net
> >Subject: [PHP-DB] screen resolution!
> >Date: Sun, 5 Feb 2006 02:44:19 +1100 (EST)
> >
> >Hi,
> >
> >   I have written a website in PHP using MYSQL.  But I have come accross
> > an un-common problem.  Normally when I create a website it's done on a
> > desktop PC.  But this time for the first time I did it on laptop meaning
> > the screen resolution is different.
> >
> >   Is there any sort of script/code I can use to create another section of
> >my site in a desired screen resolution without me having to do it all
> >manually?
> >
> >   I know of many scripts online that I can DETERMINE visitors screen
> >resolutions and recommend the correct one but don't know one that will
> >adjust the website to suit that visitors screen resolution.  Am aware of
> >scripts that redirect to another web page but that requires you to write
> >the website again to cater for that.
> >
> >   Is there a quicker way/solution?
> >
> >   Thanks!
> >
> >   J
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] screen resolution!

2006-02-06 Thread Luis Morales
Well,

you can do use auto resize if you use 0% over height and width table's
html tags.

eg.


  put your table content ---


Regards,

Luis Morales 

On Mon, 2006-02-06 at 09:28 -0800, Micah Stevens wrote:
> Yes, there is. It's called HTML.
> 
> You might think me daft, but HTML was actually created to allow the page to 
> adapt to screen size. The oldest technology on the block is actually the 
> thing to use in this situation, otherwise you're just creating extra work for 
> yourself. 
> 
> A simple example:
> 
>  - This works great, looks great, until you have a 
> 640x480 screen. Instead, try this:
> 
>   (this scales according to screen size)
> 
> or
> 
>  (this scales according to content size + screen size)
> 
> It really sounds like this is a problem with your web page design, not php or 
> Javascript. 
> 
> However, you could indeed do as others suggested and create multiple pages.. 
> That really sounds like more work than it's worth though. 
> 
> -Micah 
> 
> On Monday 06 February 2006 1:38 am, JeRRy wrote:
> > Yes I know this but there is no script that can re-write webpages on the
> > fly for certain resolutions?
> >
> >   Instead of re-doing each page for each res.?
> >
> >   With the technology these days I thought someone would of created
> > something like this, so you create a website than you put it through a
> > program that re-does the HTML for the resolutions you set and bingo the
> > results are spat out and you add it to the site and use a little script to
> > redirect depending on their set resolution.
> >
> >   Jerry
> >
> > PHP Superman <[EMAIL PROTECTED]> wrote:
> >   Or you can have a page which detects resolution by javascript and
> > redirects to another PHP page with the resolution data
> >
> >   On 2/4/06, Bastien Koert <[EMAIL PROTECTED]> wrote:
> > As the other poster mentioned you need JS to detect the screen widththe
> > usual approach is to use js to detect the screen res and the include the
> > appropriate CSS file to match the screen res.
> >
> > Bastien
> >
> > >From: JeRRy <[EMAIL PROTECTED]>
> > >To: php-db@lists.php.net
> > >Subject: [PHP-DB] screen resolution!
> > >Date: Sun, 5 Feb 2006 02:44:19 +1100 (EST)
> > >
> > >Hi,
> > >
> > >   I have written a website in PHP using MYSQL.  But I have come accross
> > > an un-common problem.  Normally when I create a website it's done on a
> > > desktop PC.  But this time for the first time I did it on laptop meaning
> > > the screen resolution is different.
> > >
> > >   Is there any sort of script/code I can use to create another section of
> > >my site in a desired screen resolution without me having to do it all
> > >manually?
> > >
> > >   I know of many scripts online that I can DETERMINE visitors screen
> > >resolutions and recommend the correct one but don't know one that will
> > >adjust the website to suit that visitors screen resolution.  Am aware of
> > >scripts that redirect to another web page but that requires you to write
> > >the website again to cater for that.
> > >
> > >   Is there a quicker way/solution?
> > >
> > >   Thanks!
> > >
> > >   J
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
-
Luis Morales 
Consultor de Tecnologia
Cel: +(58)416-4242091
-
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarĂ¡s haciendo lo imposible"
-

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] php/sendmail help!

2006-02-06 Thread JeRRy
Hi, I have a form, form results are PUSHED to another page and processed.  
Files below. (in plain-tet)
   
  Now this is what I want to do:
   
  1) Make all fields required input, but if easy to configure I want to have 
rules for each textarea.  For instance an email address must contain a '@' 
symbol.  Must be at leat 5 character longs and must be in a form of an email 
address.  So if I type [EMAIL PROTECTED] it would produce an error, 
highlighting the error area or display a message at the top of the page.  
Postcode should contain 4 numbers and numbers only, etc.  The only field that 
can be left blank will be the message area.  How do I achieve this? (message 
regarding this below)
   
  2) I want to add to the form a UNIQUE ID generater.  I will add a new hidden 
form field for this.  I need a script called by PHP to generate it.  Would 
include both letters and numbers and be atleast 8 CHARS long.
   
  As for 1) I have tried some javascript but it failed, since I PUSH all field 
responses to another page.  When i add it the submit button fails and does not 
push the results through.  But it produces the error fine, but form is not 
PUSHED on.  So it seems it's lost because of the javascript.  So i took it out 
completely.  I think there is a way in PHP to call errors for forms?  But 
anways, here are the files below.  Please help, I am on a tight schedule here 
if anyone can assist me.
   
  file one looks like this: (form.php)
   
  
  
  


  
  
  Pre Order Form!
  
 

First Name: 
Last Name:
Company:
Unit/House #:
Street Name:
Suburb/Town:
Post Code/Zip:
Phone #:
Email Address: 
Country:AUSTRALIANEW 
ZEALANDFIJIUNITED 
KINGDOMGERMANYSWEDENCANADA-AFGHANISTANALBANIAALGERIAAMERICAN
 
SAMOAANDORRAANGOLAANGUILLAANTARCTICAANTIGUA
 AND 
BARBUDAARGENTINAARMENIAARUBAAUSTRIAAZERBAIJANBAHAMASBAHRAINBANGLADESHBARBADOSBELARUSBELGIUMBELIZEBENINBERMUDABHUTANBOLIVIABOSNIA
 AND HERZEGOWINABOTSWANABOUVET 
ISLANDBRAZILBRITISH INDIAN OCEAN TERRITORYBRUNEI 
DARUSSALAMBULGARIABURKINA
 FASOBURUNDICAMBODIACAMEROONCANADACAPE 
VERDECAYMAN ISLANDSCENTRAL AFRICAN 
REPUBLICCHADCHILECHINACHRISTMAS 
ISLANDCOCOS (KEELING) 
ISLANDSCOLOMBIACOMOROSCONGOCOOK 
ISLANDSCOSTA RICACOTE D'IVOIRECROATIA (local name: 
Hrvatska)CUBACYPRUSCZECH 
REPUBLICDENMARKDJIBOUTIDOMINICADOMINICAN 
REPUBLICEAST TIMORECUADOREGYPTEL 
SALVADOREQUATORIAL 
GUINEAERITREAESTONIAETHIOPIAFALKLAND ISLANDS 
(MALVINAS)FAROE 
ISLANDSFIJIFINLANDFRANCEFRANCE, 
METROPOLITANFRENCH GUIANAFRENCH POLYNESIAFRENCH
 
OTHERGABONGAMBIAGEORGIAGERMANYGHANAGIBRALTARGREECEGREENLANDGRENADAGUADELOUPEGUAMGUATEMALAGUINEAGUINEA-BISSAUGUYANAHAITIHEARD
 AND MC DONALD ISLANDSHONDURASHONG 
KONGHUNGARYICELANDINDIAINDONESIAIRAN 
(ISLAMIC REPUBLIC 
OF)IRAQIRELANDISRAELITALYJAMAICAJAPANJORDANKAZAKHSTANKENYAKIRIBATIKOREAKUWAITKYRGYZSTANLATVIALEBANONLESOTHOLIBERIALIBYAN
 ARAB JAMAHIRIYALIECHTENSTEINLITHUANIALOCATION NOT 
REPORTEDLUXEMBOURGMACAUMACEDONIAMADAGASCARMALAWIMALAYSIAMALDIVESMALIMALTAMARSHALL
 
ISLANDSMARTINIQUEMAURITANIAMAURITIUSMAYOTTEMEXICOMICRONESIAMOLDOVA,
 REPUBLIC 
OFMONACOMONGOLIAMONTSERRATMOROCCOMOZAMBIQUEMYANMARNAMIBIANAURUNEPALNETHERLANDSNETHERLANDS
 ANTILLESNEW CALEDONIANEW 
ZEALANDNICARAGUANIGERNIGERIANIUENORFOLK 
ISLANDNORTHERN MARIANA ISLANDSNORWAYNot 
AvailableOMANPAKISTANPALAUPANAMAPAPUA 
NEW 
GUINEAPARAGUAYPERUPHILIPPINESPITCAIRNPOLANDPORTUGALPUERTO
 RICOQATARREUNIONROMANIARUSSIAN 
FEDERATIONRWANDASAINT KITTS AND NEVISSAINT 
LUCIASAINT VINCENTSAMOASAN MARINOSAO TOME AND 
PRINCIPESAUDI ARABIASENEGALSEYCHELLESSIERRA
 LEONESINGAPORESLOVAKIA (Slovak 
Republic)SLOVENIASOLOMON ISLANDSSOMALIASOUTH 
AFRICASOUTH GEORGIA SPAINSRI LANKAST. 
HELENAST. PIERRE AND 
MIQUELONSUDANSURINAMESWAZILANDSWEDENSWITZERLANDSYRIAN
 ARAB REPUBLICTAIWAN, PROVINCE OF 
CHINATAJIKISTANTANZANIA, UNITED REPUBLIC 
OFTHAILANDTOGOTOKELAUTONGATRINIDAD AND 
TOBAGOTUNISIATURKEYTURKMENISTANTURKS AND CAICOS 
ISLANDSTUVALUUGANDAUKRAINEUNITED ARAB 
EMIRATESUNITED KINGDOMUNITED STATESUNITED STATES 
MINORUNKNOWN 
LOCATIONURUGUAYUZBEKISTANVANUATUVATICAN CITY 
STATE (HOLY SEE)VENEZUELAVIET NAMVIRGIN ISLANDS 
(BRITISH)VIRGIN ISLANDS (U.S.)WALLIS AND FUTUNA 
ISLANDSWESTERN
 
SAHARAYEMENZAMBIAZIMBABWEMessage:
 



 

  

 



  





   
  
--end--
   
  here is file 2: resultsubmit.php
   
  
  
  


  
  
  Please wait... Your request is being 
processed...!"; 
} 
else{ 
echo "Internal Error:  Your input was 
unprocessed.Contact $from"; 
} 
} 
?> 

  
  

  

   
  --end--
   
   
  FYI I have changed some email settings and configuration files for security 
reasons.  But as you can see results are pushed to the second file than emailed 
off, no need for a database or anything.  So you should be able to test very 
easily.
   
  If anyone can help with suggestions or even do the code it would be mostly 
appreciated, can pay since it's urgent.
   
  Thanks for your time!
   
  J


RE: [PHP-DB] php/sendmail help!

2006-02-06 Thread Bastien Koert


You are in serious need of some regex here...google email regex and you will 
have enough results to get you what you want.


Postal Code (assume 2 letters 4 dgits in that order

 if (ereg("^[A-Z]{2}{0-9]{4}$",$_POST['postal'])){
   ...

As for pasting it back to the form, I would suggest you have the form as a 
function and the processing code as a function, then you can pass the post 
arrays back and forth and pass the error handling along with it


Bastien


From: JeRRy <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] php/sendmail help!
Date: Tue, 7 Feb 2006 13:22:53 +1100 (EST)

Hi, I have a form, form results are PUSHED to another page and processed.  
Files below. (in plain-tet)


  Now this is what I want to do:

  1) Make all fields required input, but if easy to configure I want to 
have rules for each textarea.  For instance an email address must contain a 
'@' symbol.  Must be at leat 5 character longs and must be in a form of an 
email address.  So if I type [EMAIL PROTECTED] it would produce an error, highlighting 
the error area or display a message at the top of the page.  Postcode 
should contain 4 numbers and numbers only, etc.  The only field that can be 
left blank will be the message area.  How do I achieve this? (message 
regarding this below)


  2) I want to add to the form a UNIQUE ID generater.  I will add a new 
hidden form field for this.  I need a script called by PHP to generate it.  
Would include both letters and numbers and be atleast 8 CHARS long.


  As for 1) I have tried some javascript but it failed, since I PUSH all 
field responses to another page.  When i add it the submit button fails and 
does not push the results through.  But it produces the error fine, but 
form is not PUSHED on.  So it seems it's lost because of the javascript.  
So i took it out completely.  I think there is a way in PHP to call errors 
for forms?  But anways, here are the files below.  Please help, I am on a 
tight schedule here if anyone can assist me.


  file one looks like this: (form.php)

  
  
  


  
  
  Pre Order Form!
  BORDER="0">



First Name: MAXLENGTH="20">
Last Name:MAXLENGTH="25">
Company:MAXLENGTH="25">
Unit/House #:MAXLENGTH="6">
Street Name:MAXLENGTH="25">
Suburb/Town:MAXLENGTH="25">
Post Code/Zip:MAXLENGTH="25">
Phone #:MAXLENGTH="25">
Email Address:MAXLENGTH="25"> 
Country:SIZE="1">AUSTRALIANEW 
ZEALANDFIJIUNITED 
KINGDOMGERMANYSWEDENCANADA-AFGHANISTANALBANIAALGERIAAMERICAN 
SAMOAANDORRAANGOLAANGUILLAANTARCTICAANTIGUA 
AND 
BARBUDAARGENTINAARMENIAARUBAAUSTRIAAZERBAIJANBAHAMASBAHRAINBANGLADESHBARBADOSBELARUSBELGIUMBELIZEBENINBERMUDABHUTANBOLIVIABOSNIA 
AND HERZEGOWINABOTSWANABOUVET 
ISLANDBRAZILBRITISH INDIAN OCEAN TERRITORYBRUNEI 
DARUSSALAMBULGARIABURKINA
 
FASOBURUNDICAMBODIACAMEROONCANADACAPE 
VERDECAYMAN ISLANDSCENTRAL AFRICAN 
REPUBLICCHADCHILECHINACHRISTMAS 
ISLANDCOCOS (KEELING) 
ISLANDSCOLOMBIACOMOROSCONGOCOOK 
ISLANDSCOSTA RICACOTE D'IVOIRECROATIA (local name: 
Hrvatska)CUBACYPRUSCZECH 
REPUBLICDENMARKDJIBOUTIDOMINICADOMINICAN 
REPUBLICEAST TIMORECUADOREGYPTEL 
SALVADOREQUATORIAL 
GUINEAERITREAESTONIAETHIOPIAFALKLAND 
ISLANDS (MALVINAS)FAROE 
ISLANDSFIJIFINLANDFRANCEFRANCE, 
METROPOLITANFRENCH GUIANAFRENCH POLYNESIAFRENCH
 
OTHERGABONGAMBIAGEORGIAGERMANYGHANAGIBRALTARGREECEGREENLANDGRENADAGUADELOUPEGUAMGUATEMALAGUINEAGUINEA-BISSAUGUYANAHAITIHEARD 
AND MC DONALD ISLANDSHONDURASHONG 
KONGHUNGARYICELANDINDIAINDONESIAIRAN 
(ISLAMIC REPUBLIC 
OF)IRAQIRELANDISRAELITALYJAMAICAJAPANJORDANKAZAKHSTANKENYAKIRIBATIKOREAKUWAITKYRGYZSTANLATVIALEBANONLESOTHOLIBERIALIBYAN 
ARAB JAMAHIRIYALIECHTENSTEINLITHUANIALOCATION NOT 
REPORTEDLUXEMBOURGMACAUMACEDONIAMADAGASCARMALAWIMALAYSIAMALDIVESMALIMALTAMARSHALL
 
ISLANDSMARTINIQUEMAURITANIAMAURITIUSMAYOTTEMEXICOMICRONESIAMOLDOVA, 
REPUBLIC 
OFMONACOMONGOLIAMONTSERRATMOROCCOMOZAMBIQUEMYANMARNAMIBIANAURUNEPALNETHERLANDSNETHERLANDS 
ANTILLESNEW CALEDONIANEW 
ZEALANDNICARAGUANIGERNIGERIANIUENORFOLK 
ISLANDNORTHERN MARIANA ISLANDSNORWAYNot 
AvailableOMANPAKISTANPALAUPANAMAPAPUA 
NEW 
GUINEAPARAGUAYPERUPHILIPPINESPITCAIRNPOLANDPORTUGALPUERTO 
RICOQATARREUNIONROMANIARUSSIAN 
FEDERATIONRWANDASAINT KITTS AND NEVISSAINT 
LUCIASAINT VINCENTSAMOASAN MARINOSAO TOME 
AND PRINCIPESAUDI 
ARABIASENEGALSEYCHELLESSIERRA
 LEONESINGAPORESLOVAKIA (Slovak 
Republic)SLOVENIASOLOMON 
ISLANDSSOMALIASOUTH AFRICASOUTH GEORGIA 
SPAINSRI LANKAST. HELENAST. PIERRE AND 
MIQUELONSUDANSURINAMESWAZILANDSWEDENSWITZERLANDSYRIAN 
ARAB REPUBLICTAIWAN, PROVINCE OF 
CHINATAJIKISTANTANZANIA, UNITED REPUBLIC 
OFTHAILANDTOGOTOKELAUTONGATRINIDAD 
AND TOBAGOTUNISIATURKEYTURKMENISTANTURKS 
AND CAICOS ISLANDSTUVALUUGANDAUKRAINEUNITED 
ARAB EMIRATESUNITED KINGDOMUNITED STATESUNITED 
STATES MINORUNKNOWN 
LOCATIONURUGUAYUZBEKISTANVANUATUVATICAN 
CITY STATE (HOLY SEE)VENEZUELAVIET NAMVIRGIN 
ISLANDS (BRITISH)VIRGIN ISLANDS (U.S.)WALLIS AND FUTUNA 
ISLANDSWESTERN
 
SAHARAYEMENZAMBIAZIMBABWEMessage: 







  





  







--end--

[PHP-DB] Strange rawlist behaviour

2006-02-06 Thread Chris Payne
Hi there everyone,
 
Can anyone see a problem with the below code?  It scans an FTP directory and
adds the LAST item in that directory to the database (Being the latest item
added) - however, if the directory only has 1 file in it it WON'T add
anything, the system returns that the directory is empty and it's very
frustrating.
 
chris
 
   $conn_id = ftp_connect($ftp_server2);
   $login_result = ftp_login($conn_id, $ftp_user_name2, $ftp_user_pass2);
 
// check connection
if ((!$conn_id) || (!$login_result)) {
   die("FTP connection has failed !");
};
 
// Initiate passive mode
if (ftp_pasv($conn_id, true))
{ echo ""; }
else { echo "Could not initiated passive mode"; }
 
// try to change the directory to somedir
if (ftp_chdir($conn_id, "$newdir2")) {
//   echo "Current directory is now: " . ftp_pwd($conn_id) . "\n";
 
// get the file list for /
$array = ftp_rawlist($conn_id, "-t");
 
$newdata = $contents[0];
 
   for ( $i = 1; $i < count($array); $i++ ) {
 
   $current = $array[$i];
   $structure[$i]['name']  = substr($current, 55, strlen($current) - 0);
 
$newdatab = $structure[$i][name];
 
   }};
 
   // close the connection
ftp_close($conn_id);
 
};