Re: Can $_POST variables be modified in a function?
- From: Kevin Audleman <kevin.audleman@xxxxxxxxx>
- Date: Tue, 8 Apr 2008 09:48:03 -0700 (PDT)
Hello Erwin,
It's a little bit different. I'm trying to modify the $_POST variables
inside a function. When I modify $_POST inline like you show, it works
just fine. It's when it's within a function that the outcome is
screwy. My example would look like this:
<?php
function modifyPost() {
$_POST['var1'] = 'foo';
}
?>
Post before:
<br>
<pre>
<?php print_r($_POST); ?> //Prints [var1] = foo
</pre>
<?php
modifyPost();
?>
<hr>
after:
<br>
<pre>
<?php print_r($_POST); ?> // Prints [var1] = ''
</pre>
.
- Follow-Ups:
- Re: Can $_POST variables be modified in a function?
- From: Erwin Moller
- Re: Can $_POST variables be modified in a function?
- References:
- Can $_POST variables be modified in a function?
- From: Kevin Audleman
- Re: Can $_POST variables be modified in a function?
- From: Erwin Moller
- Can $_POST variables be modified in a function?
- Prev by Date: Memory usage of foreach
- Next by Date: Re: Are you a GoDaddy user?
- Previous by thread: Re: Can $_POST variables be modified in a function?
- Next by thread: Re: Can $_POST variables be modified in a function?
- Index(es):
Relevant Pages
|