PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1848
Number of posts: 5016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Forms, Variables, and REQUEST Posted by nathansizemore on 8 Feb 2012 at 3:24 PM
Hello,
First, I am uber fresh to PHP and HTML. First time looking at the languages so please bear with me because I am sure I will be flooding the PHP Forum with ridiculously stupid questions until I get a grasp of what PHP is all about...
So, that being stated, I did try and search the forum with 'form request' before I made this topic, but the site gave me an error, hence this post.

What is the deal with globals in PHP? My ini files has arrays ok in get and post, but variables are turned off? Before I turn them on, let me give you a background on what I am trying to accomplish...
I am wanting to create a form for users to enter information in and PHP will take that information and store it into a database. Currently have a WAMP stack. Now, if I have globals turned on, if more than one user is entering data, wouldn't that create confusion as to which user the globals get information from? Assuming more than one hit the 'submit' button at the same time?
Now, onto my immediate questions:
This is my test code:
HTML
<html>
	<form 
		method = "post"
		action = "zipTest.php">
		Zip code: 
		<input
			type = "text"
			name = "zipCode"
			value = "">
		<input
			type = "submit">
	</form>
</html>

PHP
<?
	$zipCode = $_REQUEST["zipCode"];
	print "zip code - $zipCode";
?>

When I click 'Submit', the next page displays nothing. I have a PHP/MySQL book, and it states that if globals are turned off, you can place this:
$zipCode = $_REQUEST["zipCode"];

At the beginning of the PHP file, and it will work. Well, it doesn't. How do I make things display? Or what I feel is going on, is my variable is not receiving a value, so it displays nothing...?
Thanks in advance!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.