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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:48:37+00:00 2026-06-01T08:48:37+00:00

So I have the following code: echo ‘<li><a href="’.$Website.$Elements[2].’/’.$Row["povezava"].’" class="leftMenuArticlesInactive"></a><li>’; $Website contains: http://www.somesite.com/test/ $Elements[2]

  • 0

So I have the following code:

echo '<li><a href="'.$Website.$Elements[2].'/'.$Row["povezava"].'" class="leftMenuArticlesInactive"></a><li>';
  1. $Website contains: http://www.somesite.com/test/
  2. $Elements[2] contains: sometext
  3. $Row["povezava"] contains: sometext2

All variables have nothing but letters in them.

Now my problem.
If I try to echo the following I get:

// I'm missing "sometext":
http://www.somesite.com/test/sometext2
// Should be like this:
http://www.somesite.com/test/sometext/sometext2

If I do print_r($Elements) I can see that $Elements[2] is "sometext".

Why can’t I echo $Elements[2] along with a few other variables?

edit: added more code

$Website = 'http://' . $_SERVER["SERVER_NAME"] . '/' . $Elements[1] . '/';

function ShowMenuOfParent($Parent, $Spacing) {
    $Query = mysql_query("SELECT * FROM `izdelki_meni` WHERE `stars` = '$Parent';");
    if(mysql_num_rows($Query) != 0) {
        while($Row = mysql_fetch_array($Query)) {
            $s = '<li><a href="'.$Website.$Elements[2].'/'.$Row["povezava"].'" class="leftMenuArticlesInactive">';
            for($i = 0; $i < $Spacing;$i++) {
                $s .= '&nbsp;';
            }
            $s .= $Row["ime"].'</a></li>';
            echo $s;
            ShowMenuOfParent($Row["id"], $Spacing + 8);
        }
    }
}

$Query = mysql_query("SELECT * FROM `izdelki_meni` WHERE `stars` = 0;");
if(mysql_num_rows($Query) != 0) {
    echo '<ul>';
    while($Row = mysql_fetch_array($Query)) {
        echo '<li><a href="'.$Website.$Row["povezava"].'" class="leftMenuArticlesActive">'.$Row["ime"].'</a></li>';
        if($Elements[2] == $Row["povezava"]) {
            ShowMenuOfParent($Row["id"], 8);
        }
    }
    echo '</ul>';
}
  • 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-01T08:48:39+00:00Added an answer on June 1, 2026 at 8:48 am

    Why can’t I echo $Elements[2] along with a few other variables?

    Actually, echo can do that, so only this part of your question remains unresolved:

    Why can’t I?

    What you can and what you can not often depends on what you’ve learned so far to do. As learning is subjective, it’s hard to answer that question by somebody else than you. But probably you can add more information what especially hinders you to understand your actual problem so others can better assist you.


    The information you provide with your question is factually wrong. I can understand you have a problem and you would like to fix it, but what you actually do is that you make your problem bigger than it is by posting it here as an invitation for others to even do more guessing. I mean 10 persons are able to guess more than one person. So the way you ask is actually counter-productive and not helpful. Both for yourself as anybody else.

    Instead of guessing you need to start to actually proof things step by step. Start with your own expectation:

    Now my problem. If I try to echo the following I get:

    // I'm missing "sometext":
    http://www.somesite.com/test/sometext2
    // Should be like this:
    http://www.somesite.com/test/sometext/sometext2
    

    And the code you’ve posted that is related to the output is:

    echo '<li><a href="'.$Website.$Elements[2].'/'.$Row["povezava"].'" class="leftMenuArticlesInactive"></a><li>';
    

    You write that $Website ends with /test/, and additionally there is a slash in the output string (.'/'.), however the output itself does not even contain that extra string according to you:

    http://www.somesite.com/test/sometext2
    

    And that is already regardless what $Elements or $Row contains. Start thinking first, you need to analyze why that happens, and others can not help your with that, because we don’t have your software and your data to debug it. With some time you will learn your own best ways to find the mistakes you do.

    Take the time to setup yourself the xdebug debugger and step through your code then. It helps you to locate errors very quickly. And not only this time but also in the future.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: <div><strong>Name: </strong><?php echo anchor('http://'.$link, $row->Name); ?></div> Which takes a
I have the following code: <select name=to class=combo value=' <?php if(isset($_POST['reply'])) { echo <option
All, I have the following code: echo '<a href=register>Please try again</a>'; I'm using Wordpress
I have the following PHP code: echo ' <td id='.$metaso['semanaventa'].'td1><form id='.$metaso['semanaventa'].'form name='.$metaso['semanaventa'].'form class=dinamic action=compromiso_funciones.php
I have the following code: <?php class Human() { function __construct() { echo A
I have the following code: echo <script type='text/javascript'> if(window.location.href.toLowerCase().indexOf('test') != -1) { } else
I have following PHP code: if($_SESSION['msg']['login-err']) { echo '<p class=error>'.$_SESSION['msg']['login-err'].'</p>'; unset($_SESSION['msg']['login-err']); } Everything working
I have this following code. $sn_count = 1; foreach($points as $point){ echo <div class=\points\>;
I have to image with the following code: echo '<div class=thumb style=width: '.$array['thumb_width'].'px; height:
I have the following code: class A { function example($bool) { echo Bob; if($bool

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.