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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:23:57+00:00 2026-05-13T20:23:57+00:00

So i have this form.. With 2 fields. Youtube and link I want to

  • 0

So i have this form..
With 2 fields. “Youtube” and “link” I want to do if you have filled in YouTube, it should do this:

if(!empty($youtube)) {
 if ($pos === false) { 
 echo "Du skal indtaste youtube et URL, som starter med 'http://www.youtube.com/watch?..<br>";
 echo "<br> Har du ikke din video på YouTube, skal du ikke udfylde feltet, men kun 'Link' feltet.<br><br>";
 echo "<a href='javascript:history.back();'>Gå tilbage</a>";
 }

}

This do its job, but i also want to check on the same if(), if nothing in link.
So ive did this:

    if(!empty($youtube) && empty($link)) {
     if ($pos === false) { 
     echo "Du skal indtaste youtube et URL, som starter med 'http://www.youtube.com/watch?..<br>";
     echo "<br> Har du ikke din video på YouTube, skal du ikke udfylde feltet, men kun 'Link' feltet.<br><br>";
     echo "<a href='javascript:history.back();'>Gå tilbage</a>";
     }
}

But what if i want to check the opposite, if theres something in LINK and nothing in youtube?
And if i want to check if theres nothing at all in those two?

  • 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-13T20:23:58+00:00Added an answer on May 13, 2026 at 8:23 pm
    if(!empty($youtube) && empty($link)) {
    
    }
    else if(empty($youtube) && !empty($link)) {
    
    }
    else if(empty($youtube) && empty($link)) {
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this function to edit all fields that come from the form and
I have this: form = $('#<%= params[:board_id] %>'); var $parent = form.closest(.biscuit).eq(0); I want
I have this form with a date input. echo $this->Form->create('Nodata'); echo $this->Form->input('date1', array('type' =>
i have this dynamically populated form fields. <input type=text name=quantity[] placeholder=quantity/> <input type=text name=quantity[]
I have this form in my site that uses JavaScript to clear the fields
I have this form inside a table: <table id=fields> <form method=post id=accountform></form> <tbody><tr><td class=key>First
I have this code here: var fields = row.split(/regex goes here/); I want to
I have this custom form field {# src/Acme/DemoBundle/Resources/views/Form/fields.html.twig #} {% block gender_widget %} {%
I have this form that validates the fields on submit through ajax (using Codeigniter's
I have two fields in a form (ip:port) seperately. I want to add them

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.