473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

problem in $_POST

25
Hello everybody
i have a problem in call $_post value. I need to upgrade the system. so in list menu already there have name that is 'fields[$threadfield[fieldid]]'

as usual, we call $_POST[region] but in this case the value like fields[$threadfield[fieldid]] cant put in $POST[fields[$threadfield[fieldid]]]
there will bring out the error like below:

The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected '[', expecting ']' in /home/newgadsc/public_html/includes/adminfunctions_template.php(3950) : eval()'d code on line 873

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


my code:

Expand|Select|Wrap|Line Numbers
  1. <select name="fields[$threadfield[fieldid]]" onchange="setCities(this)" tabindex="1" />
  2.                 <option value=""/>- Select a State -</option>
  3.                 <option value="Perlis" <if condition="$_POST[fields[$threadfield['fieldid']]] == Perlis">selected</if> />Perlis</option>          
  4.                 <option value="Kedah" <if condition="$_POST[fields[$threadfield['fieldid']]] == Kedah">selected</if> />Kedah</option>
  5.                 <option value="Penang" <if condition="$_POST[fields[$threadfield['fieldid']]] == Penang">selected</if> />Penang</option>    
  6.                 <option value="Kelantan" <if condition="$_POST[fields[$threadfield['fieldid']]] == Kelantan">selected</if> />Kelantan</option>  
  7.                 <option value="Terengganu" <if condition="$_POST[fields[$threadfield['fieldid']]] == Terengganu">selected</if> />Terengganu</option>  
  8.                 <option value="Perak" <if condition="$_POST[fields[$threadfield['fieldid']]] == Perak">selected</if> />Perak</option>    
  9.                 <option value="Pahang" <if condition="$_POST[fields[$threadfield['fieldid']]] == Pahang">selected</if> />Pahang</option>  
  10.                 <option value="Kuala Lumpur" <if condition="$_POST[fields[$threadfield['fieldid']]] == 'Kuala Lumpur'">selected</if> />Kuala Lumpur</option>
  11.                 <option value="Selangor" <if condition="$_POST[fields[$threadfield['fieldid']]] == Selangor">selected</if> />Selangor</option>    
  12.                 <option value="Negeri Sembilan" <if condition="$_POST[fields[$threadfield['fieldid']]] == 'Negeri Sembilan'">selected</if> />Negeri Sembilan</option>  
  13.                 <option value="Melaka" <if condition="$_POST[fields[$threadfield['fieldid']]] == Melaka">selected</if> />Melaka</option>
  14.                 <option value="Johor" <if condition="$_POST[fields[$threadfield['fieldid']]] == Johor">selected</if> />Johor</option>    
  15.                 <option value="Sarawak" <if condition="$_POST[fields[$threadfield['fieldid']]] == Sarawak">selected</if> />Sarawak</option>  
  16.                 <option value="Sabah" <if condition="$_POST[fields[$threadfield['fieldid']]] == Sabah">selected</if> />Sabah</option>          
  17.                 </select>
Apr 19 '10 #1
1 1307
chathura86
227 100+
$_POST[fields[$threadfield['fieldid']]]

here fields should be $fields i guess

Regards
Apr 19 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: newbie_mw | last post by:
Hi, I need urgent help with a novice problem. I would appreciate any advice, suggestions... Thanks a lot in advance! Here it is: I created a sign-up sheet (reg.html) where people fill in their...
0
by: newbie_mw | last post by:
Hi Ian, Thanks for help! The columns and variables are exactly matched so it shouldn't be the problem. Actually the original html and php files are pretty long. But I guess a more detailed...
10
by: Jack | last post by:
How would I add a variable that I will assign to a list of $_POST variables that I extract from a form? My form passes a value for $q. That works fine. What I want to do is run an if/else on it...
2
by: Neil McDermott | last post by:
Hi there, I'm a newbie on the php front but I've altered an email script to send a bunch of information from a HTML form to an email address. Can anyone see where I have gone wrong? I am...
6
by: Jeff Dunnett | last post by:
Hello, I have written the following HTML Form: <html><head><title>Survey</title></head> <body bgcolor="black" text="white" link="#f6b580" vlink="#c0c0ff"> <img src="logo.gif" width="324"...
2
by: Konrad Tuszkowski | last post by:
hello i have a form with 5 fields. and my problem is that if user put 2 or more same variables my script finds in db only 1 and i need to search all variables in db even if they r same. <http>...
8
by: Leszek | last post by:
Hi. Could you help solve the problem: i have a file that has two includes: //my script <?php include(.'/prog1.php'); include(.'/prog2.php'); ?>
4
by: bb nicole | last post by:
BElow is my php code for candidate search, it have 4 criteria which is academic background, functional experience, preferred location and languages ability. but it show yhe blanks page.. Emm, is it...
12
by: Twayne | last post by:
Hi, I can't get the following code snippet to stop throwing errors except to modify it exactly as shown here by adding the single quote to the end of the first line and commenting out all but...
4
by: liberty1 | last post by:
Hi everyone. I appreciate your effort at helping newbies like me. I have the following problems and will appreciate urgent help. PROBLEM NUMBER 1: Using PHP and MySQL, I am able to upload...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.