Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PHP HTML POST Arrays and Checkboxes

Posted on 2007-04-03
3
Medium Priority
?
269 Views
Last Modified: 2013-12-12
Making an fairly large html form across 8 pages that updates a mysql database and then fills out a pdf.

My question has to do with pages auto-populating with session variables if the user has already been to that page. Pretty easy.
However, I have a lot checkboxes, so I'm looking for advice. The checkboxes are obviously posted as arrays (have to use POST)
Is there a simple way to see if an array contains a value without looping through it?

I have to put the arrays into a database in the form of values like 01/02/03/04 - should I go ahead and make my string an then regular expression search?

Is there a better option. I know I can do it, I'm looking for efficiency here - I'm talking up to 500 checkboxes a page on some of these - I don't want to loop through an array to see if it contains a value 500 times - I'm guessing there is a better option to set a checkbox to checked if it is supposed to be.

Thanks in advance
0
Comment
Question by:chuckbeats
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 20

Accepted Solution

by:
steelseth12 earned 2000 total points
ID: 18846998
you can use array_search to search through the array

http://www.php.net/manual/en/function.array-search.php
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question