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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:34:47+00:00 2026-06-15T17:34:47+00:00

I’ll try and be brief but concise. I have a PHP form page that

  • 0

I’ll try and be brief but concise.

I have a PHP form page that populates a drop-down box with data (magazine names) from an array, and then, if posted, outputs it to another page.

However, I have a second array within the form (containing subscription links), that I also need to send to the output page, depending on what was chosen from the drop-down box. If that makes sense.

For example, if the value for for $arrayOne[7] is chosen from the drop-down box, I need to post_GET the value for $arrayTwo[7] over to the output page automatically, as well.

Can anyone help?

default.php:

$arrayOne[0] = "magazineA";
$arrayOne[1] = "magazineB";
etc...

$arrayTwo[0] = "subscriptionLinkA";
$arrayTwo[1] = "subscriptionLinkB";
etc...

<form action="index2.php" method="get">
<?php

echo '<select name="publication">';
foreach ($magazine as $publication)
{
    echo '<option name="publication" value="' . $publication . '">' . $publication . '</option>';
}
echo '</select>';

?>
<input type="submit">
</form>

index2.php:

<p>
If you have subscribed to <?php echo $_GET["publication"]; ?>,
you will receive your hard-copy in due course. If you are not a current subscriber,
<a href="#">click here</a> to subscribe.
</p>
  • 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-15T17:34:47+00:00Added an answer on June 15, 2026 at 5:34 pm

    Since the value from $array2 is completely dependant on the value of $array1, $_GET['a1'] can act as a lookup for the other value. ie you don’t have to pass $a2 at all.

    On index2.php, you’d have something like this:

    $arr2= array( 'magazineA' => 'subscriptionLinkA',
                  'magazineB' => 'subscriptionLinkB');
    
    $pub= $_GET['a1']; //you'd want to sanitize this value of course
    $link= $arr2[$pub];
    
    echo  <<< EOT
    <p>
    If you have subscribed to $pub
    you will receive your hard-copy in due course. If you are not a current subscriber,
    <a href="$link">click here</a> to subscribe.
    </p>
    EOT;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I have a text area in my form which accepts all possible characters from
I want to construct a data frame in an Rcpp function, but when I

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.