Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$_POST array is empty
#1
Hey everyone, haven't posted here in a while but I'm having an issue with PHP and figured this would be a good place to go.

I'm working on a custom script, specifically the messaging system, and I have the form to submit the message -

Code:
<form action="inc/msg/send.php" method="post">
    <label>To:
        <input type="text" name="to"></input>
    </label><br><br>
    <label>Subject:
        <input type="text" name="subject"></input>
    </label><br><br>
    <label>Message:
        <textarea name="message"></textarea></input>
    </label><br><br>
    <input type="submit"></input>
</form>

- but when I access the $_POST array, the value for any array item is " ". It can be accessed via -

PHP Code:
$data file_get_contents('php://input'); 

- though. Any ideas on what might be causing this?
Robert Picard
http://www.rpicard.net
Reply
#2
(05-31-2010, 11:36 AM)RPicard Wrote: Hey everyone, haven't posted here in a while but I'm having an issue with PHP and figured this would be a good place to go.

I'm working on a custom script, specifically the messaging system, and I have the form to submit the message -

Code:
<form action="inc/msg/send.php" method="post">
    <label>To:
        <input type="text" name="to"></input>
    </label><br><br>
    <label>Subject:
        <input type="text" name="subject"></input>
    </label><br><br>
    <label>Message:
        <textarea name="message"></textarea></input>
    </label><br><br>
    <input type="submit"></input>
</form>

- but when I access the $_POST array, the value for any array item is " ". It can be accessed via -

PHP Code:
$data file_get_contents('php://input'); 

- though. Any ideas on what might be causing this?

I have literally never seen that file_get_contents method for returning a value. You're better off using $data = $_POST['']
Reply
#3
I don't know why you're doing it that way, I too have never seen that used in any code. Just literally use $_POST...
MyBB Support Team Lead
Reply
#4
I am using $_POST, I just mentioned file_get_contents to show that the information is being passed. I actually got this fixed. There was an error with the function in another part of the process.

Thanks for responding.
Robert Picard
http://www.rpicard.net
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  What is array and the the use of it?can someone explain to me? Advertise4you 2 976 10-30-2011, 02:13 PM
Last Post: ★Cooldude★
  Put the data from a MySQL column in an array RPicard 3 867 06-01-2010, 01:51 PM
Last Post: RPicard
  PHP Array Help Dutchcoffee 2 825 03-01-2010, 10:03 PM
Last Post: Dutchcoffee
  Array Condition on MyBB Forums (PHP Enabled) Rafael 4 1,149 02-09-2010, 06:36 AM
Last Post: Rafael
  Create an empty file on server zone 8 1,800 11-07-2009, 01:00 AM
Last Post: zone

Forum Jump:


Users browsing this thread: 1 Guest(s)