User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,024 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,703 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 4369 | Replies: 2 | Solved
Reply
Join Date: Jan 2005
Posts: 13
Reputation: nikez is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
nikez nikez is offline Offline
Newbie Poster

Help Accessing $_POST values - Its not working :(

  #1  
Jan 12th, 2005
Have a look at the following code. It is the only thing in the file...the following variables are defined outside the php file:
  • $required
  • $first_name

require_once("config.php");
if ($required)
{
	$require = explode(",",$required);
	for($n=0; $n<count($require); $n++);
	{
		$field = $require[$n];
		print $first_name;
		print $_POST[$first_name];
	}
}

When post data to this php file the value from the "first_name" field is printed - as shown above in the first print statement. However, the SAME data should be located in the $_POST array correct? So when I try to print the value (secont print statement) why does it show up blank? Nothing is there.

Any ideas?

Thanks,
JameZ
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2004
Location: in the j00-kay
Posts: 114
Reputation: ReDuX is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 5
ReDuX's Avatar
ReDuX ReDuX is offline Offline
Junior Poster

Re: Accessing $_POST values - Its not working :(

  #2  
Jan 12th, 2005
try print $_POST['first_name'];
I'm pink, therefore, im spam.
http://www.vivaci.net - Quality Webhosting
http://gaming.vivaci.net - FAST UK Gaming servers
http://www.getsigned.org - Free Image Uploads
Reply With Quote  
Join Date: Jan 2005
Posts: 13
Reputation: nikez is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
nikez nikez is offline Offline
Newbie Poster

Re: Accessing $_POST values - Its not working :(

  #3  
Jan 12th, 2005
niiiice

Thanks so much!!

JameZ
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 1:44 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC