[PHP-DB] php/sendmail help!

2006-02-09 Thread jusa_98
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)
   
  ? include(header.php);?
  table width=800 border=0
  tr
td width=270 valign=top? include(menu.php);?/td
td width=500 valign=center
  DIV ALIGN=JUSTIFY
  ? include(ads.php);?
  h1bPre Order Form!/h1/b
  TABLE  WIDTH=90% ALIGN=left CELLSPACING=1 CELLPADDING=4 BORDER=0
FORM ACTION=contact1.php METHOD=POST 
font face=arial
trtdFirst Name:/td tdINPUT TYPE=text NAME=firstname SIZE=25 
MAXLENGTH=20/td/trBRBtrtd
Last Name:/td/BtdINPUT TYPE=text NAME=lastname SIZE=25 
MAXLENGTH=25/td/trBtrtd
BtrtdCompany:/td/BtdINPUT TYPE=text NAME=company SIZE=25 
MAXLENGTH=25/td/trBRBtrtd
Unit/House #:/td/BtdINPUT TYPE=text NAME=address1 SIZE=25 
MAXLENGTH=6/td/trBRBtrtd
Street Name:/td/BtdINPUT TYPE=text NAME=address2 SIZE=25 
MAXLENGTH=25/td/trBRBtrtd
Suburb/Town:/td/BtdINPUT TYPE=text NAME=suburb SIZE=25 
MAXLENGTH=25/td/trBRBtrtd
Post Code/Zip:/td/BtdINPUT TYPE=text NAME=postcode SIZE=25 
MAXLENGTH=25/td/trBRBtrtd
Phone #:/td/BtdINPUT TYPE=text NAME=phone SIZE=25 
MAXLENGTH=25/td/trBRBtrtd
Email Address:/td/BtdINPUT TYPE=text NAME=emailaddress SIZE=25 
MAXLENGTH=25/td/trBRBtrtd/td/Btd 
/td/trBRBtrtdCountry:/td/BtdSELECT NAME=country 
SIZE=1OPTION SELECTEDAUSTRALIAOPTIONNEW 
ZEALANDOPTIONFIJIOPTIONUNITED 
KINGDOMOPTIONGERMANYOPTIONSWEDENOPTIONCANADAOPTION-OPTIONAFGHANISTANOPTIONALBANIAOPTIONALGERIAOPTIONAMERICAN
 
SAMOAOPTIONANDORRAOPTIONANGOLAOPTIONANGUILLAOPTIONANTARCTICAOPTIONANTIGUA
 AND 
BARBUDAOPTIONARGENTINAOPTIONARMENIAOPTIONARUBAOPTIONAUSTRIAOPTIONAZERBAIJANOPTIONBAHAMASOPTIONBAHRAINOPTIONBANGLADESHOPTIONBARBADOSOPTIONBELARUSOPTIONBELGIUMOPTIONBELIZEOPTIONBENINOPTIONBERMUDAOPTIONBHUTANOPTIONBOLIVIAOPTIONBOSNIA
 AND HERZEGOWINAOPTIONBOTSWANAOPTIONBOUVET 
ISLANDOPTIONBRAZILOPTIONBRITISH INDIAN OCEAN TERRITORYOPTIONBRUNEI 
DARUSSALAMOPTIONBULGARIAOPTIONBURKINA
 FASOOPTIONBURUNDIOPTIONCAMBODIAOPTIONCAMEROONOPTIONCANADAOPTIONCAPE 
VERDEOPTIONCAYMAN ISLANDSOPTIONCENTRAL AFRICAN 
REPUBLICOPTIONCHADOPTIONCHILEOPTIONCHINAOPTIONCHRISTMAS 
ISLANDOPTIONCOCOS (KEELING) 
ISLANDSOPTIONCOLOMBIAOPTIONCOMOROSOPTIONCONGOOPTIONCOOK 
ISLANDSOPTIONCOSTA RICAOPTIONCOTE D'IVOIREOPTIONCROATIA (local name: 
Hrvatska)OPTIONCUBAOPTIONCYPRUSOPTIONCZECH 
REPUBLICOPTIONDENMARKOPTIONDJIBOUTIOPTIONDOMINICAOPTIONDOMINICAN 
REPUBLICOPTIONEAST TIMOROPTIONECUADOROPTIONEGYPTOPTIONEL 
SALVADOROPTIONEQUATORIAL 
GUINEAOPTIONERITREAOPTIONESTONIAOPTIONETHIOPIAOPTIONFALKLAND ISLANDS 
(MALVINAS)OPTIONFAROE 
ISLANDSOPTIONFIJIOPTIONFINLANDOPTIONFRANCEOPTIONFRANCE, 
METROPOLITANOPTIONFRENCH GUIANAOPTIONFRENCH POLYNESIAOPTIONFRENCH
 
OTHEROPTIONGABONOPTIONGAMBIAOPTIONGEORGIAOPTIONGERMANYOPTIONGHANAOPTIONGIBRALTAROPTIONGREECEOPTIONGREENLANDOPTIONGRENADAOPTIONGUADELOUPEOPTIONGUAMOPTIONGUATEMALAOPTIONGUINEAOPTIONGUINEA-BISSAUOPTIONGUYANAOPTIONHAITIOPTIONHEARD
 AND MC DONALD ISLANDSOPTIONHONDURASOPTIONHONG 
KONGOPTIONHUNGARYOPTIONICELANDOPTIONINDIAOPTIONINDONESIAOPTIONIRAN 
(ISLAMIC REPUBLIC 
OF)OPTIONIRAQOPTIONIRELANDOPTIONISRAELOPTIONITALYOPTIONJAMAICAOPTIONJAPANOPTIONJORDANOPTIONKAZAKHSTANOPTIONKENYAOPTIONKIRIBATIOPTIONKOREAOPTIONKUWAITOPTIONKYRGYZSTANOPTIONLATVIAOPTIONLEBANONOPTIONLESOTHOOPTIONLIBERIAOPTIONLIBYAN
 ARAB JAMAHIRIYAOPTIONLIECHTENSTEINOPTIONLITHUANIAOPTIONLOCATION NOT 
REPORTEDOPTIONLUXEMBOURGOPTIONMACAUOPTIONMACEDONIAOPTIONMADAGASCAROPTIONMALAWIOPTIONMALAYSIAOPTIONMALDIVESOPTIONMALIOPTIONMALTAOPTIONMARSHALL
 
ISLANDSOPTIONMARTINIQUEOPTIONMAURITANIAOPTIONMAURITIUSOPTIONMAYOTTEOPTIONMEXICOOPTIONMICRONESIAOPTIONMOLDOVA,
 REPUBLIC 

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

2006-02-09 Thread bastien_k

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)

   ? include(header.php);?
   table width=800 border=0
   tr
 td width=270 valign=top? include(menu.php);?/td
 td width=500 valign=center
   DIV ALIGN=JUSTIFY
   ? include(ads.php);?
   h1bPre Order Form!/h1/b
   TABLE  WIDTH=90% ALIGN=left CELLSPACING=1 CELLPADDING=4 
BORDER=0
 FORM ACTION=contact1.php METHOD=POST
font face=arial
trtdFirst Name:/td tdINPUT TYPE=text NAME=firstname SIZE=25 
MAXLENGTH=20/td/trBRBtrtd
Last Name:/td/BtdINPUT TYPE=text NAME=lastname SIZE=25 
MAXLENGTH=25/td/trBtrtd
BtrtdCompany:/td/BtdINPUT TYPE=text NAME=company SIZE=25 
MAXLENGTH=25/td/trBRBtrtd
Unit/House #:/td/BtdINPUT TYPE=text NAME=address1 SIZE=25 
MAXLENGTH=6/td/trBRBtrtd
Street Name:/td/BtdINPUT TYPE=text NAME=address2 SIZE=25 
MAXLENGTH=25/td/trBRBtrtd
Suburb/Town:/td/BtdINPUT TYPE=text NAME=suburb SIZE=25 
MAXLENGTH=25/td/trBRBtrtd
Post Code/Zip:/td/BtdINPUT TYPE=text NAME=postcode SIZE=25 
MAXLENGTH=25/td/trBRBtrtd
Phone #:/td/BtdINPUT TYPE=text NAME=phone SIZE=25 
MAXLENGTH=25/td/trBRBtrtd
Email Address:/td/BtdINPUT TYPE=text NAME=emailaddress SIZE=25 
MAXLENGTH=25/td/trBRBtrtd/td/Btd 
/td/trBRBtrtdCountry:/td/BtdSELECT NAME=country 
SIZE=1OPTION SELECTEDAUSTRALIAOPTIONNEW 
ZEALANDOPTIONFIJIOPTIONUNITED 
KINGDOMOPTIONGERMANYOPTIONSWEDENOPTIONCANADAOPTION-OPTIONAFGHANISTANOPTIONALBANIAOPTIONALGERIAOPTIONAMERICAN
 
SAMOAOPTIONANDORRAOPTIONANGOLAOPTIONANGUILLAOPTIONANTARCTICAOPTIONANTIGUA
 
AND 
BARBUDAOPTIONARGENTINAOPTIONARMENIAOPTIONARUBAOPTIONAUSTRIAOPTIONAZERBAIJANOPTIONBAHAMASOPTIONBAHRAINOPTIONBANGLADESHOPTIONBARBADOSOPTIONBELARUSOPTIONBELGIUMOPTIONBELIZEOPTIONBENINOPTIONBERMUDAOPTIONBHUTANOPTIONBOLIVIAOPTIONBOSNIA
 
AND HERZEGOWINAOPTIONBOTSWANAOPTIONBOUVET 
ISLANDOPTIONBRAZILOPTIONBRITISH INDIAN OCEAN TERRITORYOPTIONBRUNEI 
DARUSSALAMOPTIONBULGARIAOPTIONBURKINA
  
FASOOPTIONBURUNDIOPTIONCAMBODIAOPTIONCAMEROONOPTIONCANADAOPTIONCAPE 
VERDEOPTIONCAYMAN ISLANDSOPTIONCENTRAL AFRICAN 
REPUBLICOPTIONCHADOPTIONCHILEOPTIONCHINAOPTIONCHRISTMAS 
ISLANDOPTIONCOCOS (KEELING) 
ISLANDSOPTIONCOLOMBIAOPTIONCOMOROSOPTIONCONGOOPTIONCOOK 
ISLANDSOPTIONCOSTA RICAOPTIONCOTE D'IVOIREOPTIONCROATIA (local name: 
Hrvatska)OPTIONCUBAOPTIONCYPRUSOPTIONCZECH 
REPUBLICOPTIONDENMARKOPTIONDJIBOUTIOPTIONDOMINICAOPTIONDOMINICAN 
REPUBLICOPTIONEAST TIMOROPTIONECUADOROPTIONEGYPTOPTIONEL 
SALVADOROPTIONEQUATORIAL 
GUINEAOPTIONERITREAOPTIONESTONIAOPTIONETHIOPIAOPTIONFALKLAND 
ISLANDS (MALVINAS)OPTIONFAROE 
ISLANDSOPTIONFIJIOPTIONFINLANDOPTIONFRANCEOPTIONFRANCE, 
METROPOLITANOPTIONFRENCH GUIANAOPTIONFRENCH POLYNESIAOPTIONFRENCH
  
OTHEROPTIONGABONOPTIONGAMBIAOPTIONGEORGIAOPTIONGERMANYOPTIONGHANAOPTIONGIBRALTAROPTIONGREECEOPTIONGREENLANDOPTIONGRENADAOPTIONGUADELOUPEOPTIONGUAMOPTIONGUATEMALAOPTIONGUINEAOPTIONGUINEA-BISSAUOPTIONGUYANAOPTIONHAITIOPTIONHEARD
 
AND MC DONALD ISLANDSOPTIONHONDURASOPTIONHONG 
KONGOPTIONHUNGARYOPTIONICELANDOPTIONINDIAOPTIONINDONESIAOPTIONIRAN 
(ISLAMIC REPUBLIC 

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

2006-02-09 Thread JeRRy
Thanks but I recieved this exact email the other day also.  Maybe servers 
playing up ;)
   
  J

[EMAIL PROTECTED] wrote:
  
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 
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:   [input] MAXLENGTH=20

Last Name:   [input] MAXLENGTH=25
Company:   [input] MAXLENGTH=25

Unit/House #:   [input] MAXLENGTH=6

Street Name:   [input] MAXLENGTH=25

Suburb/Town:   [input] MAXLENGTH=25

Post Code/Zip:   [input] MAXLENGTH=25

Phone #:   [input] MAXLENGTH=25

Email Address:   [input] MAXLENGTH=25
  

Country:  SIZE=1AUSTRALIANEW 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 

[PHP-DB] css

2006-02-09 Thread JeRRy
Hi everyone,
   
  I have created this website in PHP and mySQL at http://www.bps-testntag.com/ 
but have come accross an error I was not aware of before.
   
  Now I am using stylesheets and I have been surfing the net for about 90 
minutes and yet to find a solution, so thought I'd post here, could be basic 
but i can't find it online anywhere.  Get alot of forum refrences but no 
solution.
   
  Here is the code below before I continue:
   
  style type=text/css
  html {
background : url(images/background3.jpg); 
} 
body {
margin : 0; 
padding : 0 1px; 
border : 0; 
height : 100px; 
background : url(images/background3.jpg); 
} 
body {
font-family : arial, serif; 
font-size : 16px; 
} 
#page {
margin : 310px 0 50px 250px; 
display : block; 
width : 500px; 
border : 1 solid #000; 
background : url(images/background3.jpg); 
padding : 10px; 
} 
#page .right {
font-size : 30px; 
float : right; 
} 
#menu {
display : block; 
top : 110px; 
left : 20px; 
width : 130px; 
position : fixed; 
border : 0; 
padding : 10px; 
text-align : center; 
font-weight : bold; 
color : #fff; 
} 
* html #menu {
position : absolute; 
} 
#menu a:visited, #menu a {
display : block; 
width : 120px; 
height : 20px; 
margin : 0 auto; 
border-top : 0 solid #fff; 
border-bottom : 0 solid #000; 
text-align : center; 
text-decoration : none; 
line-height : 20px; 
color : #000; 
} 
#menu a:hover {
background : #aaa; 
color : #fff; 
} 
.clear {
clear : both; 
} 
p:first-letter {
font-size : 25px; 
color : #cc; 
} 
#fixpic {
display : block; 
width : 108px; 
height : 145px; 
position : fixed; 
bottom : 0; 
left : 0; 
} 
* html #fixpic {
position : absolute; 
} 
#adsie {
position : absolute; 
top : 10px; 
right : 30px; 
} 
/style

  Now I have been told NOT to use px but use % for meassurements because 
this is relient on resolution/screen_size.  
   
  HOWEVER what does 1px equal in %?
   
  Some have said 30px equals 3% and some say 30px equals 30%.  30px and 30% 
don't seem right, I changed my CSS for this and it pushes everything only 
slightly to the RIGHT.  But removes the menu altogether.
   
  Can anyone offer some help here?
   
  Also if a table is made like this:
   
  table width=300 height=400  Is that default % or px or what?  What is the 
best method to use that will work in people using screens of 600* and 1024* and 
both be able to view the site cleanly and easily?
   
  I will continue to surf.
   
  J


[PHP-DB] css #2

2006-02-09 Thread JeRRy
Okay I did some more surfing, on a VERY popular website used by neally a 
million users.  I checked their CSS and they use px and pt meassurements.  So 
maybe that is not my issue than.  Maybe I don't have an issue to worry about?
   
  What are people's thoughts on this, all the input the better here as I am 
creating a website that will be viewed by alot of people so want it readable by 
the majority.  I know screen res of 600* is very old and few would use it, the 
site appears pretty big with it but things appears just about where it should.  
However when you try and view the copyright notice it cuts the last line out, 
what causes this?  Would It be useful to add to breaks at the end?
   
  J
   
   
   
   
   
   
   
   
   
   
   
   
   
  Hi everyone,
   
  I have created this website in PHP and mySQL at http://www.bps-testntag.com/ 
but have come accross an error I was not aware of before.
   
  Now I am using stylesheets and I have been surfing the net for about 90 
minutes and yet to find a solution, so thought I'd post here, could be basic 
but i can't find it online anywhere.  Get alot of forum refrences but no 
solution.
   
  Here is the code below before I continue:
   
  style type=text/css
  html {
background : url(images/background3.jpg); 
} 
body {
margin : 0; 
padding : 0 1px; 
border : 0; 
height : 100px; 
background : url(images/background3.jpg); 
} 
body {
font-family : arial, serif; 
font-size : 16px; 
} 
#page {
margin : 310px 0 50px 250px; 
display : block; 
width : 500px; 
border : 1 solid #000; 
background : url(images/background3.jpg); 
padding : 10px; 
} 
#page .right {
font-size : 30px; 
float : right; 
} 
#menu {
display : block; 
top : 110px; 
left : 20px; 
width : 130px; 
position : fixed; 
border : 0; 
padding : 10px; 
text-align : center; 
font-weight : bold; 
color : #fff; 
} 
* html #menu {
position : absolute; 
} 
#menu a:visited, #menu a {
display : block; 
width : 120px; 
height : 20px; 
margin : 0 auto; 
border-top : 0 solid #fff; 
border-bottom : 0 solid #000; 
text-align : center; 
text-decoration : none; 
line-height : 20px; 
color : #000; 
} 
#menu a:hover {
background : #aaa; 
color : #fff; 
} 
.clear {
clear : both; 
} 
p:first-letter {
font-size : 25px; 
color : #cc; 
} 
#fixpic {
display : block; 
width : 108px; 
height : 145px; 
position : fixed; 
bottom : 0; 
left : 0; 
} 
* html #fixpic {
position : absolute; 
} 
#adsie {
position : absolute; 
top : 10px; 
right : 30px; 
} 
/style

  Now I have been told NOT to use px but use % for meassurements because 
this is relient on resolution/screen_size.  
   
  HOWEVER what does 1px equal in %?
   
  Some have said 30px equals 3% and some say 30px equals 30%.  30px and 30% 
don't seem right, I changed my CSS for this and it pushes everything only 
slightly to the RIGHT.  But removes the menu altogether.
   
  Can anyone offer some help here?
   
  Also if a table is made like this:
   
  table width=300 height=400  Is that default % or px or what?  What is the 
best method to use that will work in people using screens of 600* and 1024* and 
both be able to view the site cleanly and easily?
   
  I will continue to surf.
   
  J


Re: [PHP-DB] css #2

2006-02-09 Thread Adrian Bruce

Jerry

Not a php related question at all for starters but anywayi think you 
need to read up on CSS layout's if the site is properly structure using 
CSS then you will not have much to worry about regarding different 
resolutions.  Ever heard of floats?


google will show you the light!

Ade

JeRRy wrote:


Okay I did some more surfing, on a VERY popular website used by neally a 
million users.  I checked their CSS and they use px and pt meassurements.  So 
maybe that is not my issue than.  Maybe I don't have an issue to worry about?
  
 What are people's thoughts on this, all the input the better here as I am creating a website that will be viewed by alot of people so want it readable by the majority.  I know screen res of 600* is very old and few would use it, the site appears pretty big with it but things appears just about where it should.  However when you try and view the copyright notice it cuts the last line out, what causes this?  Would It be useful to add to breaks at the end?
  
 J
  
  
  
  
  
  
  
  
  
  
  
  
  
 Hi everyone,
  
 I have created this website in PHP and mySQL at http://www.bps-testntag.com/ but have come accross an error I was not aware of before.
  
 Now I am using stylesheets and I have been surfing the net for about 90 minutes and yet to find a solution, so thought I'd post here, could be basic but i can't find it online anywhere.  Get alot of forum refrences but no solution.
  
 Here is the code below before I continue:
  
 style type=text/css

 html {
background : url(images/background3.jpg); 
} 
body {
margin : 0; 
padding : 0 1px; 
border : 0; 
height : 100px; 
background : url(images/background3.jpg); 
} 
body {
font-family : arial, serif; 
font-size : 16px; 
} 
#page {
margin : 310px 0 50px 250px; 
display : block; 
width : 500px; 
border : 1 solid #000; 
background : url(images/background3.jpg); 
padding : 10px; 
} 
#page .right {
font-size : 30px; 
float : right; 
} 
#menu {
display : block; 
top : 110px; 
left : 20px; 
width : 130px; 
position : fixed; 
border : 0; 
padding : 10px; 
text-align : center; 
font-weight : bold; 
color : #fff; 
} 
* html #menu {
position : absolute; 
} 
#menu a:visited, #menu a {
display : block; 
width : 120px; 
height : 20px; 
margin : 0 auto; 
border-top : 0 solid #fff; 
border-bottom : 0 solid #000; 
text-align : center; 
text-decoration : none; 
line-height : 20px; 
color : #000; 
} 
#menu a:hover {
background : #aaa; 
color : #fff; 
} 
.clear {
clear : both; 
} 
p:first-letter {
font-size : 25px; 
color : #cc; 
} 
#fixpic {
display : block; 
width : 108px; 
height : 145px; 
position : fixed; 
bottom : 0; 
left : 0; 
} 
* html #fixpic {
position : absolute; 
} 
#adsie {
position : absolute; 
top : 10px; 
right : 30px; 
} 
/style


 Now I have been told NOT to use px but use % for meassurements because this is relient on resolution/screen_size.  
  
 HOWEVER what does 1px equal in %?
  
 Some have said 30px equals 3% and some say 30px equals 30%.  30px and 30% don't seem right, I changed my CSS for this and it pushes everything only slightly to the RIGHT.  But removes the menu altogether.
  
 Can anyone offer some help here?
  
 Also if a table is made like this:
  
 table width=300 height=400  Is that default % or px or what?  What is the best method to use that will work in people using screens of 600* and 1024* and both be able to view the site cleanly and easily?
  
 I will continue to surf.
  
 J


 



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



Re: [PHP-DB] css #2

2006-02-09 Thread JeRRy
Hi,
   
  Honesty, no I have not ever heard of floats  ... Well I have as in 
horse-floats but not for web-pages, I will search it up very soon.
   
  Thanks!
   
  Jerry

Adrian Bruce [EMAIL PROTECTED] wrote:
  Jerry

Not a php related question at all for starters but anywayi think you 
need to read up on CSS layout's if the site is properly structure using 
CSS then you will not have much to worry about regarding different 
resolutions. Ever heard of floats?

google will show you the light!

Ade

JeRRy wrote:

Okay I did some more surfing, on a VERY popular website used by neally a 
million users. I checked their CSS and they use px and pt meassurements. So 
maybe that is not my issue than. Maybe I don't have an issue to worry about?
 
 What are people's thoughts on this, all the input the better here as I am 
 creating a website that will be viewed by alot of people so want it readable 
 by the majority. I know screen res of 600* is very old and few would use it, 
 the site appears pretty big with it but things appears just about where it 
 should. However when you try and view the copyright notice it cuts the last 
 line out, what causes this? Would It be useful to add to breaks at the end?
 
 J
 
 
 
 
 
 
 
 
 
 
 
 
 
 Hi everyone,
 
 I have created this website in PHP and mySQL at http://www.bps-testntag.com/ 
 but have come accross an error I was not aware of before.
 
 Now I am using stylesheets and I have been surfing the net for about 90 
 minutes and yet to find a solution, so thought I'd post here, could be basic 
 but i can't find it online anywhere. Get alot of forum refrences but no 
 solution.
 
 Here is the code below before I continue:
 
   
  html {
background : url(images/background3.jpg); 
} 
body {
margin : 0; 
padding : 0 1px; 
border : 0; 
height : 100px; 
background : url(images/background3.jpg); 
} 
body {
font-family : arial, serif; 
font-size : 16px; 
} 
#page {
margin : 310px 0 50px 250px; 
display : block; 
width : 500px; 
border : 1 solid #000; 
background : url(images/background3.jpg); 
padding : 10px; 
} 
#page .right {
font-size : 30px; 
float : right; 
} 
#menu {
display : block; 
top : 110px; 
left : 20px; 
width : 130px; 
position : fixed; 
border : 0; 
padding : 10px; 
text-align : center; 
font-weight : bold; 
color : #fff; 
} 
* html #menu {
position : absolute; 
} 
#menu a:visited, #menu a {
display : block; 
width : 120px; 
height : 20px; 
margin : 0 auto; 
border-top : 0 solid #fff; 
border-bottom : 0 solid #000; 
text-align : center; 
text-decoration : none; 
line-height : 20px; 
color : #000; 
} 
#menu a:hover {
background : #aaa; 
color : #fff; 
} 
.clear {
clear : both; 
} 
p:first-letter {
font-size : 25px; 
color : #cc; 
} 
#fixpic {
display : block; 
width : 108px; 
height : 145px; 
position : fixed; 
bottom : 0; 
left : 0; 
} 
* html #fixpic {
position : absolute; 
} 
#adsie {
position : absolute; 
top : 10px; 
right : 30px; 
} 
  

 Now I have been told NOT to use px but use % for meassurements because 
 this is relient on resolution/screen_size. 
 
 HOWEVER what does 1px equal in %?
 
 Some have said 30px equals 3% and some say 30px equals 30%. 30px and 30% 
 don't seem right, I changed my CSS for this and it pushes everything only 
 slightly to the RIGHT. But removes the menu altogether.
 
 Can anyone offer some help here?
 
 Also if a table is made like this:
 
   Is that default % or px or what? What is the best method to use that will 
 work in people using screens of 600* and 1024* and both be able to view the 
 site cleanly and easily?
 
 I will continue to surf.
 
 J

 

  
  

[PHP-DB] Re: generating random id's

2006-02-09 Thread Dan Baker
JeRRy [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

  Just to let you all know I used PHP's unique ID generator to generate a 
 unique id for tracking purposes.
 I than md5 it hide the format a bit, would this be enough?
 Or can be easily worked out also?
 Need it pretty tight and keeping the likelyhood down of having multiple 
 listings of id's.
 It's using 32 chars.

So, I'm guessing/interpreting here:
You have a table that has records in it, each record has a unique ID (an 
auto-increment field).
You want to be able to send some magic ID with an html page, so that you can 
identify the record when the page response comes back.  But, you don't want 
the end-user to easily alter the ID to discover a different record.
Now, I don't have a clear understanding of what you have doe with the 32 
char item:
Idea #1) You have added another field RndID which you generate for each 
record, and use this as the published record ID.
Idea #2) You take the ID, and mangle it, and use the mangled ID as the 
published record ID.  When it comes back, you un-mangle it to get the true 
ID.

I've used idea #1 before.  I set the RndID field as Unique, so I never 
have duplicates.  If the record update fails, I generate a different random 
ID and try again.
I've never used idea#2.

DanB

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



Re: [PHP-DB] generating random id's

2006-02-09 Thread Miles Thompson

At 03:26 AM 2/9/2006, JeRRy wrote:



  Just to let you all know I used PHP's unique ID generator to generate a 
unique id for tracking purposes.  I than md5 it hide the format a bit, 
would this be enough?  Or can be easily worked out also?  Need it pretty 
tight and keeping the likelyhood down of having multiple listings of 
id's.  It's using 32 chars.


  Jerry



Yes, I've done something similar. Used the random number generator and 
chr()'d anything that's printable ascii, looping until I have the desired 
length, then md5'd it.

It works and generates a peculiar value.

Miles



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 267.15.3/254 - Release Date: 2/8/2006

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



[PHP-DB] Numbers to words

2006-02-09 Thread Ron Piggott (PHP)
Is there a command within PHP that would convert numbers to words:

echo 1;

# 1 appears on screen

echo command('1');

# one appears on screen --- what would the command be?

Ron

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



[PHP-DB] Re: Numbers to words

2006-02-09 Thread Ron Piggott (PHP)
I did some searching and found the function on the PHP web site.  Ron

?
/**
* convert long integer into American English words.
* e.g. -12345 - minus twelve thousand forty-five
* Handles negative and positive integers
* on range -Long.MAX_VALUE .. Long.MAX_VALUE;
* It cannot handle Long.MIN_VALUE;
*/

function num2words( $num ){
   $ZERO = zero;
   $MINUS = minus;
   $lowName = array(
 /* zero is shown as  since it is never used in combined forms
*/
 /* 0 .. 19 */
 , one, two, three, four, five,
 six, seven, eight, nine, ten,
 eleven, twelve, thirteen, fourteen, fifteen,
 sixteen, seventeen, eighteen, nineteen);

   $tys = array(
 /* 0, 10, 20, 30 ... 90 */
 , , twenty, thirty, forty, fifty,
 sixty, seventy, eighty, ninety);

   $groupName = array(
 /* We only need up to a quintillion, since a long is about 9 *
10 ^ 18 */
 /* American: unit, hundred, thousand, million, billion,
trillion, quadrillion, quintillion */
 , hundred, thousand, million, billion,
 trillion, quadrillion, quintillion);

   $divisor = array(
 /* How many of this group is needed to form one of the
succeeding group. */
 /* American: unit, hundred, thousand, million, billion,
trillion, quadrillion, quintillion */
 100, 10, 1000, 1000, 1000, 1000, 1000, 1000) ;

   $num = str_replace(,,,$num);
   $num = number_format($num,2,'.','');
   $cents = substr($num,strlen($num)-2,strlen($num)-1);
   $num = (int)$num;

   $s = ;

   if ( $num == 0 ) $s = $ZERO;
   $negative = ($num  0 );
   if ( $negative ) $num = -$num;

   // Work least significant digit to most, right to left.
   // until high order part is all 0s.
   for ( $i=0; $num0; $i++ ) {
   $remdr = (int)($num % $divisor[$i]);
   $num = $num / $divisor[$i];
   // check for 1100 .. 1999, 2100..2999, ... 5200..5999
   // but not 1000..1099,  2000..2099, ...
   // Special case written as fifty-nine hundred.
   // e.g. thousands digit is 1..5 and hundreds digit is 1..9
   // Only when no further higher order.
   if ( $i == 1 /* doing hundreds */  1 = $num  $num = 5 ){
   if ( $remdr  0 ){
   $remdr += $num * 10;
   $num = 0;
   } // end if
   } // end if
   if ( $remdr == 0 ){
   continue;
   }
   $t = ;
   if ( $remdr  20 ){
   $t = $lowName[$remdr];
   }
   else if ( $remdr  100 ){
   $units = (int)$remdr % 10;
   $tens = (int)$remdr / 10;
   $t = $tys [$tens];
   if ( $units != 0 ){
   $t .= - . $lowName[$units];
   }
   }else {
   $t = $inWords($remdr);
   }
   $s = $t .   . $groupName[$i] .. $s;
   $num = (int)$num;
   } // end for
   $s = trim($s);
   if ( $negative ){
   $s = $MINUS .   . $s;
   }

   $s .=  and $cents/100;

   return $s;
} // end inWords
?

On Thu, 2006-02-09 at 22:18 -0500, Ron Piggott (PHP) wrote:
 Is there a command within PHP that would convert numbers to words:
 
 echo 1;
 
 # 1 appears on screen
 
 echo command('1');
 
 # one appears on screen --- what would the command be?
 
 Ron

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