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

  • SEARCH
  • Home
  • 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 7989735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:49:58+00:00 2026-06-04T12:49:58+00:00

This is for an online form for product returns. The user selects from a

  • 0

This is for an online form for product returns. The user selects from a menu, Refund, Replacement, 90DaysExpired, etc… (choices shown below). Each of those choices, has a corresponding message(inside a variable, also shown below). I want the value of the variable($tbrefund, $tbreplace, etc), based on the choice of the user, to be passed to the variable ‘$message’.

This is what I have so far, and I get the following error:

Notice: Undefined variable: message

$Rarray = array(
"Refund" => "$tbrefund",
"Replacement" => "$tbreplace",
"90DaysExpired" => "$expiredwarranty",
"ContactTech" => "$contacttech",
"RefundExpiredReplace" => "$outsiderefund",
"NoExRefund" => "$noexchange",
"ManuWarranty" => "$manuwarranty",
);

if (isset($Rarray[$Request]))
   $message =  $Rarray[$Request];

Any help is greatly appreciated.

edit:
this is the line producing the error, I already know it’s not relevent…

$send_contact=mail($to,$subject,$message,$header);

Why would you downvote someone asking for help? It will only make new people reluctant to ask anything…

  • 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-06-04T12:49:59+00:00Added an answer on June 4, 2026 at 12:49 pm

    The error is because $Request is not set correctly.

    if (isset($Rarray[$Request]))
    {
       $message = $Rarray[$Request];
    }
    else
    {
       $message = "Invalid";
    }
    

    So your actual question is “why is $Request not working”?

    The answer is it depends on where $Request is coming from, so you need to show us some examples of $Request echoed (or var_dump() ) – but I would hazard a guess that you are sending the $Request lowercase (if it is via a URL or something) – but your array is capitalised.

    Edit: and I hope you are not expecting your messages to be something other than “$tbreplace” or something.

    I guessing you meant to do something like this?

    $Rarray = array(
    "Refund" => $tbrefund,
    "Replacement" => $tbreplace,
    "90DaysExpired" => $expiredwarranty,
    "ContactTech" => $contacttech,
    "RefundExpiredReplace" => $outsiderefund,
    "NoExRefund" => $noexchange,
    "ManuWarranty" => $manuwarranty
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an online form. Before a user fills in this form,
I am creating an online enrollment form. When a user advances to page 2,
I am trying to send data(a username and password) to an online form from
Im writing my first online shop in PHP. Now working on add product form
This question assumes familiarity with FormStack , a drag-and-drop WYSIWYG online form builder. Background
I am trying to include form on product page using renderPartial but it gives
I'm using an online form at one of my web sites. Every mail sent
I am building a online form, with about 20 multiple choice checkboxes. I can
I have an online form which collects member(s) information and stores it into a
I have an online form which collects consumer data and stores in a dedicated

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.