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 7563253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:37:08+00:00 2026-05-30T13:37:08+00:00

I have some variables stored using php and an html textarea. I would like

  • 0

I have some variables stored using php and an html textarea. I would like the value from the textarea (whatever user types in) to be stored in a variable $options and pass all of the variables from the same page using . I am getting stuck on how to combine the value from the textarea with the php variables’ values. This is the code I have so far:

$price = $_GET['price'];
$title = $_GET['title'];
$retailer = $_GET['retailer'];

<textarea rows="3" id="textarea" class="input-xlarge" placeholder="Size, color, style, etc" name ="options"></textarea>

<a href = "viewcart.php?retailer=<?php echo $retailer?>" class="btn btn-success" type="submit"><i class="icon-shopping-cart icon-white"></i>  Add to Cart</a>

How do I combine the three variables together?

  • 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-30T13:37:09+00:00Added an answer on May 30, 2026 at 1:37 pm

    UPDATE

    Use this code, you have to add some javascript code to get value of text area.

    $price = $_GET['price'];
    $title = $_GET['title'];
    $retailer = $_GET['retailer'];
    
    <textarea rows="3" id="textarea" class="input-xlarge" placeholder="Size, color, style, etc" name ="options"></textarea>
    
    <script language="javascript">
    function test()
    {
        var val=document.getElementById("textarea").value;  
        var hrf="viewcart.php?retailer=<?php echo $retailer?>&price=<?php echo $price; ?>&title=<?php echo $title; ?>&option="+val;
        document.getElementById("a_link").href=hrf;
    }
    </script>
    <a href ="#" id="a_link" onclick="test();" class="btn btn-success" type="submit"><i class="icon-shopping-cart icon-white"></i>  Add to Cart</a>
    

    Update your code with my code and test it.

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

Sidebar

Related Questions

I have some html content stored in a database field. I would like trusted
I have this string stored in a variable: IN=bla@some.com;john@home.com Now I would like to
I have some text that is stored in a variable like this: <div class=foo>text
I am designing some immutable classes but I have to have some variables like
Hey right now I'm using jQuery and I have some global variables to hold
I have some user-submitted variables that I want to display in a different part
I'm having some trouble using sessions with php.. I think I have figured out
Im new to PHP and would like to get some advice on the following
I have some variables inside a template and I don't know where I assigned
Basically I have some variables that I don't want to preinitialize: originalTime = None

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.