[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Php For Loop Form Data

Posted on 2013-01-29
2
Medium Priority
?
240 Views
Last Modified: 2013-02-06
Hello I'm trying to get this for loop to work on data submitted on form i dont think i have the syntax correct on it

for ($i=1; $i<=25; $i++)
  {
  $message .= $i. ". " .$_REQUEST['state'.$1] "/" .$_REQUEST['county'.$1]. "/".$_REQUEST['searchfee'.$1]. "/".$_REQUEST['copyfee'.$1]. "/".$_REQUEST['recordingfee'.$1]. "/".$_REQUEST['miscfee'.$1]. "/".$_REQUEST['turntime'.$1]. "\n";
  }

Open in new window


There are 25 variables can you provide advice as to why this code is not working
0
Comment
Question by:akuss
[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
2 Comments
 
LVL 16

Expert Comment

by:kmslogic
ID: 38832144
You are missing a dot after the first $_REQUEST
0
 
LVL 11

Accepted Solution

by:
mcnute earned 2000 total points
ID: 38834757
Your snytax isn't entirely correct as kmslogic pointed out. Further I would use the appropriate request name such as post or get instead of the geral request method.

For better debugging add an error_reporting(E_ALL); at the top of your php document.
error_reporting(E_ALL); 
for ($i=1; $i<=25; $i++)
  {
  $message .= $i. ". " .$_REQUEST['state'.$1]. "/" .$_REQUEST['county'.$1]. "/".$_REQUEST['searchfee'.$1]. "/".$_REQUEST['copyfee'.$1]. "/".$_REQUEST['recordingfee'.$1]. "/".$_REQUEST['miscfee'.$1]. "/".$_REQUEST['turntime'.$1]. "\n";
  }

Open in new window


the error_reporting might reveal further syntax errors or other errors related to the 25 variables.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

649 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