Advertisement

09.02.2008 at 01:37PM PDT, ID: 23697361
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

preg_grep using session variable

Asked by webenerds in PHP and Databases

Tags:

I have a file that contains a number of IP's that can connect to a mail relay.  A user wants to add an IP to the relay using the form I've built.  Before writing that new ip I want to check to see if it already exists.  Taking the session variable $_SESSION['ip'] and the allowed relay list, I want to preg_match, see code below:


$data = file_get_contents("/etc/postfix/allowed_relay_ip");
if (preg_match($_SESSION['ip'], $data))
 {
     do this
 }

else
{
     do this
}


I get the following error:
Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in /var/www/process.php on line 42.


Is it possible to use a session variable in a preg_match?  Is there a better way?  I have other preg_match and preg_grep functions in the scripts, but none w/ apostrophes, they are all variables ($var_name).  Guessing this may be my problem but would love some help on this.Start Free Trial
[+][-]09.02.2008 at 02:21PM PDT, ID: 22371852

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP and Databases
Tags: PHP
Sign Up Now!
Solution Provided By: rutgerhensel
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.02.2008 at 02:55PM PDT, ID: 22372111

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.02.2008 at 02:58PM PDT, ID: 22372139

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 05:38PM PDT, ID: 22373072

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 05:58PM PDT, ID: 22373142

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628