I also can't POST

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
antaresdata
Forum Newbie
Posts: 2
Joined: Wed May 22, 2002 9:10 pm

I also can't POST

Post by antaresdata »

I send vars to a PHP file and <?echo $contact?> wont work. If I place <? phpinfo();?> i can see the variable was passed to the php file. This is a new install on a win 2K. In phpinfo() PHP Variables this is what I get. It is passing the correct but echo does not work.


_POST["contact"] Test Name

Thanks,
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post by sam »

php 4.1.2 < ships with register globals off so you will have to use the $_POST["contact"] style of data retreval or edit the php.ini as follows:

; edit this line in your file
register_globals=On

Cheers Sam
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

take a look at register_globals
if set to false the posted variables aren't accessible by $<name> but $_POST or $_REQUEST

p.s.: and again somebody was faster than I was :twisted:
p.p.s.: how about a sticky (readonly) faq-thread with the title "READ THIS before posting"? ;)
yjanni
Forum Newbie
Posts: 8
Joined: Wed May 22, 2002 3:17 pm

Post by yjanni »

>sigh<

dont you just wish that everyone installing php 4.2.1 would read this article:

http://www.webmasterbase.com/article.php?pid=0&aid=758

Simply put DO *NOT* TURN REGISTER GLOBALS ON!!!

:wink:

j
antaresdata
Forum Newbie
Posts: 2
Joined: Wed May 22, 2002 9:10 pm

It works

Post by antaresdata »

I turned register_globals = off and used

$company = $_REQUEST['company']; instead of just $company.


This works great!!!!

Thanks for the help

[/quote]
Post Reply