[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] Re: UPDATE command

2005-06-20 Thread jusa_98
The trick is your using the wrong ' instead you need ` ...
 
go away from kl;-' and go to `-123 ;)
The key above the (Tab) key, or the key next to the number 1 above the q.  
 
so ...
 
$query=SELECT * FROM bibleverses WHERE `used` = 0 ORDER BY RAND() 
LIMIT 1;
 
When I first learned this also I was fooled and used ' instead of `.  But in 
some cases you don't need to use it also.
 
I hope this covers it!  Sorry if someone else has responded before me.  I might 
of been a bit slow! ;)

Jerry

 


From: Ron Piggott [EMAIL PROTECTED]
Reply-To: Ron Piggott [EMAIL PROTECTED]
To: Webmaster [EMAIL PROTECTED]
CC: PHP DB php-db@lists.php.net
Subject: [PHP-DB] Re: UPDATE command
Date: Fri, 17 Jun 2005 23:47:31 -0400

This is kind of interesting ...

$query=SELECT * FROM quiettimequotation WHERE used = 0 ORDER BY 
RAND()
LIMIT 1;

works;

$query=SELECT * FROM bibleverses WHERE 'used' = 0 ORDER BY RAND() 
LIMIT 
1;

doesn't!  Having the ' around used makes that select command fail --- 
but
the UPDATE command requires it!

Thanks for those of you who responded to my question below.  I am 
creating 
a
mailing list for my web site that I am wanting each entry which is 
randomly
selected from the database to only be used once and not be available 
again
until the entire list has been used.  I needed the UPDATE command to 
change
the used column all back to 0 again once the last entry had been 
selected
from the database.  I think I like programming mySQL stuff :)  Ron

---

 Does the UPDATE command only change one row or each occurance if the 
the
 criteria repeat itself through the table?

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


Send instant messages to your online friends http://au.messenger.yahoo.com 


**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.


GWAVAsigAdmID:2D9388A3F9FA0C7BE52690ABC7B22408



**

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.


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