General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 5th, 2002, 01:36 PM
douglas douglas is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 4 douglas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unable to read POST variables...

Helllo,

I am trying to create a page that calls itself and checks for variables. I am having some problems, so I figured I would create a simple test page and even that one does not work for me. Here is the code....can anyone help? Thanks!!

<?php
$message="";
if ( ! IsSet($PostVar) )
{
$message="Welcome...please don't forget to set the PostVar on your way out!";
}
else
{
$message = "Thanks for setting the PostVar";
}
?>
<html>
<head>
<title>Self-Fulfilling Prophecy</title>
</head>
<body>
<h1><?php print $message ?> </h1>
<form action="<?php print $PHP_SELF?>" method="POST">
Set the post variable here: <input type="text" name="PostVar">
<input type=submit>
</form>
</body>
</html>

Reply With Quote
  #2  
Old June 5th, 2002, 05:13 PM
douglas douglas is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 4 douglas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Just found out why this (and many others) did not work anymore. Apparently, the latest builds of php have the "register_globals" setting in the php.ini file set to OFF as the default. Previously this setting was true. So, once i set it back to ON everything worked fine.

Apparently, one reason this change to the default setting was made is to make php code more secure. Now that I know everything is working, I'll probably reset to the default (OFF) and modify my code to get the variables as the Release notes suggest.

....douglas

Reply With Quote
  #3  
Old June 5th, 2002, 06:30 PM
epyon epyon is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Chicago
Posts: 22 epyon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
just change the variables to $_POST[something]

Reply With Quote
  #4  
Old June 5th, 2002, 06:33 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
i personally find that the global command stops the errors, regardless of what version of php you are using

global $PostVar;

Reply With Quote
  #5  
Old June 7th, 2002, 09:38 AM
sylow sylow is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Alkmaar, Netherlands
Posts: 11 sylow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sylow
using globals is not good way of programming.
It makes your code less flexible.
IMHO

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Unable to read POST variables...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek