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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:26:16+00:00 2026-06-09T13:26:16+00:00

PHP Part is here So when I post it, else part does not work

  • 0

PHP Part is here So when I post it, else part does not work at all (meaning: the text I set just disappear), while the other half works (meaning: I can assign variables, but can’t leave it blank). I have been struggling with it all night…please help!
So this is the second page, if you need to take a look at the code on the first page, please let me know!

<?php
$lovers = $_POST['lovers'];
$quote = $_POST['quote'];
$color = $_POST['color'];
$font = $_POST['font'];
$imdblink = $_POST['imdblink'];
?>

<?php
if (isset($_POST['lovers']))  
    {
$lovers = $_POST['lovers'];
    }else{
        echo "P & M";
     }

if (isset($_POST['quote']))  
     {
        $quote = $_POST['quote'];
     }else{
        echo "I love you.";
     }

  if (isset($_POST['color']))  
     {
        $color = $_POST['color'];
     }else{
        echo "yellow";
     }

  if (isset($_POST['font']))  
     {
        $font = $_POST['font'];
     }else{
        echo "Futura";
     }

  if (isset($_POST['imdblink']))  
     {
        $imdblink = $_POST['imdblink'];
     }else{
        echo "http://www.imdb.com/";
     }
?>

Here is the HTML part: Is there anything wrong here? Please help!

<div class="artGroup slide">
  <div class="artwork"> <img src="../_images/M&P.png">
    <div class="detail">
      <div class="movie01c" style="font-family: <?php echo "{$font}"; ?>; font-size: 20px; color: <?php echo "{$color}";?>;">
     <?php echo "{$quote}";?>
      </div>
      <div class="movie01t"><a href="<?php echo "{$imdblink}";?>">
      <?php echo "{$lovers}";?>
      </a></div>
    </div>
  </div>
</div>
  • 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-09T13:26:17+00:00Added an answer on June 9, 2026 at 1:26 pm

    Instead of using echo, use variable assignment too in the else part.

    if (isset($_POST['lovers'])) {
        $lovers = $_POST['lovers'];
    }else{
        $lovers = "P & M";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a fix for this. here is just part of my code <?php
json_decode function is not part of PHP 5.1, so I cannot use it. Is
I'm having trouble getting some PHP code to work. Here is the function: function
Here is my last login part that dosen't seem to work here it is.
I have a few issues with the following php functions (part of a bigger
I am working on code re-factoring of configuration file loading part in PHP. Earlier
In part of my PHP application, I need to make an REST style API
Do PHP sessions timeout by default - ie without any coding on my part
The following is a part of a bigger PHP script which adds or disables
I have this part of code in my functions.php: function cc_admin_enqueue_scripts($hook) { $file_dir=get_bloginfo('template_directory'); wp_enqueue_script('media-upload');

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.