PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 15th, 2000, 10:40 AM
Robert_J_Sherman
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
A few days ago I posed the question about building a required validation set, to check for empty required fields, and to reject those fields should they be empty..

I received a number of responses, and below is what I finally came to bringing into play.

In short we build an array of those fields which are "empty" and then loop through them, displaying each empty field, without processing the database entry.

Just thought I'd share this tid bit of code, if anyone else has been looking for a way to accomplish this task.

Now all I need to do is assemble an email address validation set, and I'm in business..

Time to play with the EREG functions of PHP URL

//insert validation code here, to valid incoming data before inserting records.
if (!$city) { $missing[] = "City"; }
if (!$state_id) { $missing[] = "State"; }
if (!$zip) { $missing[] = "Zip"; }
if (!$name) { $missing[] = "Name"; }
if (!$address) {$missing[] = "Address"; }
if (!$isp_email) {$missing[] = "ISP Email"; }
if (!$phone_1) {$missing[] = "Phone1"; }

if ($missing) {
for ($i=0; $i < count($missing); $i++) {
echo "<li>".$missing[$i]."</li>n";
}
exit;
}

------------------
SnR Graphics,
Low Cost Hosting and Web Development.

[This message has been edited by Robert_J_Sherman (edited June 15, 2000).]

Reply With Quote
  #2  
Old June 16th, 2000, 02:37 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan

Now all I need to do is assemble an email address validation set


just read this:

http://www2.phpbuilder.com/columns/...616.php3?page=3

------------------
SR -
shiju.dreamcenter.net

"The fear of the LORD is the beginning of knowledge..."

[This message has been edited by Shiju Rajan (edited June 16, 2000).]

Reply With Quote
  #3  
Old June 16th, 2000, 04:29 AM
Robert_J_Sherman
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Shiju Rajan:

Now all I need to do is assemble an email address validation set


just read this:

http://www2.phpbuilder.com/columns/dario19990616.php3?page=3
[/quote]

Thanks, will take a look at the tutorial.

I'm rather familiar with the regexp aspect of things, from Perl Programming. It's just a matter of translating it all to PHP..

I personally think I'm progressing very quickly here, and am really enjoying the PHP experience!

------------------
SnR Graphics,
Low Cost Hosting and Web Development.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Building a Required Fields Set -- Revisited.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap