0

I am displaying description of an item on my website. I need to show full content on desktop view and ellipsis on mobile. So i created two element and show/hide the element as per the window width. But if both of my element is on html, 500 (Internal server error) status is rendering. If remove one element, it is working good.

Here is my code

<?php
$desc = "";
    if(!empty($evVal["desc"])){
           $desc = trim($evVal["desc"]);
    }
?>
<div class="desktop_site"><?php echo $desc; ?></div>
<p class="mobile_site hide"><?php echo $desc; ?></p>
  • please share the error from your server – atefth May 30 '20 at 11:31
  • it's simply says.. 500 internal server error. I also check for syntax error but its has none –  May 30 '20 at 11:33
  • 4
    This is not the code which is causing the error please provide whole code – Kunal Raut May 30 '20 at 11:34
  • If I remove first `div` or second `p`, it works. –  May 30 '20 at 11:36
  • what second `p` ? what does `it works` mean ? please show your code. – YvesLeBorg May 30 '20 at 11:41
  • it works means... the page opens. Gives 200 response. Everything on the page is visible. and when both element present, it gives 500... page never opens. full blank page. –  May 30 '20 at 11:45
  • 2
    You need to find the actual error message. Look in your web servers error log to find it. If you're running this locally, you should set display errors to true in your php.ini. [Here's how](https://stackoverflow.com/a/21429652/2453432). There's nothing in the posted code that would throw a 500 error. – M. Eriksson May 30 '20 at 12:55

0 Answers0