Part of a PHP form isn't getting put into email

I have a PHP form with the following two files:

index.php:

 <title>WikiHub Request Wiki</title> 

<form action="submit.php" method="post">

<fieldset>
     <label for="name">Your name:</label>

     <label for="email">Your email address:</label>

     <label for="wikiName">Name of your wiki:</label>

     <label for="metaNS">Meta namespace:</label>

         This is the name of the page name prefix that is used for 
            pages about your wiki.  Leave this blank if you want.

     <label for="subdomain">Subdomain</label>

         .wikihub.ssu.lt

     <label for="topic">Topic: Please describe the topic of your
                          wiki and what it will be about, or what
                          you plan to do with it.
Please write enough
                          to show us that this is a legitimate request
                          and not spam.</label>

  </fieldset>

</form>

submit.php

 <title>Form submitted</title> 

Your name: $name

Your email address: $email

Name of your wiki: $wikiName

Meta namespace (if specified): $metaNS

Domain of your wiki: $subdomain.wikihub.ssu.lt
Topic of your wiki:
$topic
";

?>

The Topic part keeps getting left out, both on submit.php and in the email.

2 Replies

I don't see a problem. Perhaps you can try this?

http://stackoverflow.com/questions/8719 … a-textarea">http://stackoverflow.com/questions/8719186/issue-using-post-with-a-textarea

Try $topic = trim($POST['topic']); - my guess would have been a different field or cookie with the same name - $REQUEST includes cookie data.

You should always try to be specific in PHP - this will reduce attack vectors. If you know the data is coming from a POST of a form use $_POST.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct