Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 302185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:04:27+00:00 2026-05-12T07:04:27+00:00

I hope I can be clear enough in what I need here. What I

  • 0

I hope I can be clear enough in what I need here. What I have is a function that contains some html for an email client app I’m developing. This part of the app uses a common forward, reply and “reply to all” form. Since they are all basically the same, I figured I’d go the lean route and just use a single function to handle this. The only real differences I can see between the 3 actions I mentioned above are that in a reply to all, there will be multiple email addys in the CC part of the form. For a forward, no (cc) and the (to) box should be blank. I need to represent all of this functionality and I’m kind of confused on what the best way to do this is. Can anyone please offer any help? Thanks.

I can certainly post the html is need be, I just wanted to start light.

EDIT:
I almost forgot, there will be POST values when the user submits the form in the event that the form validation fails.


function compose($type,$contents=null)
{
    echo'
        <tr>
          <td>
            <tr>
              <td valign="top">
                <form method="post" action="">
                  <table width="100%" cellpadding="0" cellspacing="0" border="0" id="reply">
                    <tr>
                      <td><h2>'.$type.'</h2></td>
                    </tr>
                    <tr>
                      <td width="1%" valign="top" nowrap><b>To:</b><br><input name="to" id="focus" title="Enter a single system user here" value="" type="text" size="64"></td>
                    </tr>
                    <tr>
                      <td nowrap><b>Cc:</b><br><input name="cc"" value="" type="text" size="64"></td>
                    </tr>
                    <tr>
                      <td nowrap><b>Subject:</b><br><input name="subject" title="Enter your subject here" value="" type="text" size="64" maxlength="30"></td>
                    </tr>
                    <tr>
                      <td valign="top"><b>Message:</b><br><textarea name="message" title="Enter your message here" rows="5" cols="50" wrap="virtual"></textarea></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td><input type="hidden" name="id" value=""><input type="submit" name="send" value="Send"></td>
                    </tr>
                  </table>
                </form>
              </td>
            </tr>
          </td>
        </tr>';
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:04:27+00:00Added an answer on May 12, 2026 at 7:04 am

    EDIT: Example modification of posted code (I haven’t added all the different cases or even changed the output really, just showing the concept – all that’s here is a check for a type of Reply and a check for the ‘to’ POST value.)

    function compose($type,$contents=null)
    {
        $toValue = '';
        if(isset($_POST['to']))
        {
            // Might want to actually validate this to prevent XSS, but this is just a basic example
            $toValue = $_POST['to'];
        }
    
        echo'
            <tr>
              <td>
                <tr>
                  <td valign="top">
                    <form method="post" action="">
                      <table width="100%" cellpadding="0" cellspacing="0" border="0" id="reply">
                        <tr>
                          <td><h2>'.$type.'</h2></td>
                        </tr>';
    
        if($type == "Reply") {
            echo'
                        <tr>
                          <td width="1%" valign="top" nowrap><b>To:</b><br><input name="to" id="focus" title="Enter a single system user here" value="' . $toValue . '" type="text" size="64"></td>
                        </tr>
                        <tr>
                          <td nowrap><b>Cc:</b><br><input name="cc"" value="" type="text" size="64"></td>
                        </tr>';
        }
    
        echo'
                        <tr>
                          <td nowrap><b>Subject:</b><br><input name="subject" title="Enter your subject here" value="" type="text" size="64" maxlength="30"></td>
                        </tr>
                        <tr>
                          <td valign="top"><b>Message:</b><br><textarea name="message" title="Enter your message here" rows="5" cols="50" wrap="virtual"></textarea></td>
                        </tr>
                        <tr>
                          <td> </td>
                        </tr>
                        <tr>
                          <td><input type="hidden" name="id" value=""><input type="submit" name="send" value="Send"></td>
                        </tr>
                      </table>
                    </form>
                  </td>
                </tr>
              </td>
            </tr>';
    }
    

    (Original inquiry)
    Is this function processing the results of the form, or is it displaying the form in the first place? Your question is a bit unclear about which point in the process you’re talking about.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope I can explain my problem in a way that it's clear for
hope someone can answer this. Here is some sample code. namespace std { #ifdef
I hope I can make this question clear enough. I'm looking to put a
I need some help. I have a 2 pages in my app. Page #1
I hope the question is clear enough. Here's my query: SELECT 'Total Complete' AS
I hope I can make myself clear in English and in what I want
hope someone can help. I have two tables: Users -UserID -UserName UsersType -UserTypeID -UserID
I hope somebody can help here, its an ongoing issue with no obvious solution.
I have some trouble writing some code (I might be tired), so I need
I have an application that compiles some code dynamically, and creates an assembly as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.