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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:34:45+00:00 2026-05-20T16:34:45+00:00

I have the following options: <li><label for=r1><input type=radio name=post_category id=r1 value=12 checked=checked /> Share

  • 0

I have the following options:

<li><label for="r1"><input type="radio" name="post_category" id="r1" value="12" checked="checked" /> Share an Article</label></li>
                                    <li><label for="r4"><input type="radio" name="post_category" id="r4" value="14" /> Share a Link</label></li>
                                    <li><label for="r3"><input type="radio" name="post_category" id="r3" value="13" /> Share some Code</label></li>

and I have these two lines to send data from two fields, now if the options arn’t selected then I don’t want the content being sent to these fields so they need some conditionals around them that check if an option is selected or not:

$post_url = $_POST['post_url'];

$post_code = htmlentities($_POST['post_code'], ENT_QUOTES, 'UTF-8');

so only post the URL field if the link option is chosen and only post the CODE field if the code option is chosen. can anyone help?

  • 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-20T16:34:46+00:00Added an answer on May 20, 2026 at 4:34 pm

    Check the value of the button(only the checked button will be submitted) , it might be 12, 13 or 14.

    Example for the link:

    if(isset($_POST['post_category']) && $_POST['post_category']==14){
    //do it with the link
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following snipped of my page: <div class=radio-group> <input type=radio name=group1 checked=checked
I have the following part of my form: <input type=checkbox class=hide id=additional-webinar name=additional-webinar-check value=additional-webinar-box>
I have the following fields: <label>Company Type:</label> <label for=primary><input onclick=javascript: $('#sec').hide('slow');$('#primary_company').find('option:first').attr('selected','selected'); type=radio runat=server name=companyType
So I have the following html: <div id=divForComponents> <input type=button value=+ onclick=addFilter('divForComponents')/> </div> And
I have the following h:selectOneRadio : <h:selectOneRadio id=#{prefix}_rating value=#{examinationPanel.tempResult} > <f:selectItems value=#{examinationPanel.options}></f:selectItems> </h:selectOneRadio> And
i have the following jquery code: $(document).ready(function() { $('.restrictiveOptions input[type!=checkbox], .restrictiveOptions select').change(function() { //
I have following code in a html form <select name=category class=input onchange=ShowTB(this,'suggest');> <option value=0
Im including the popular file jquery.form.js. I have the following: var options = {
I have following code for alertdialog: AlertDialog.Builder helpBuilder = new AlertDialog.Builder(this); helpBuilder.setTitle(Options); helpBuilder.setMessage(Choose Your
I have the following rewrites in my .htaccess: Options +FollowSymLinks RewriteEngine On RewriteRule \.(css|jpe?g|gif|png)$

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.