Jump to content

Recommended Posts

 

//$config_website_url/$config_website_url_topic <<< what in them hopefully somethink deleted them...

 

 

a stab in the dark....

<?php


echo "<div id='logo'>";


echo"<a href='index.php?page=home'>Home</a>";


if($_GET['page'] == "home" ) {


echo "got correct result";

}else{

echo "incorrect result";
}

echo"</div>";

?>

 

if that what you want here it corrected ok......

<?php

if( $config_website_url_topic == "home" ) { 

echo "<div id='logo'><a href='$config_website_url/$config_website_url_topic/index.php?page=home'>Home</a></div>";
} else { 

echo"test"; 
} 

?>


<div id="logo"><a href="'.$config_website_url.'/'.$config_website_url_topic.'/index.php?page=home">Home</a>'. if( $config_website_url_topic == "home" ) { } else { echo"test"; } .'</div>

 

it is not displaying anything.

 

Mainly because the syntax is all wrong. If you want the IF on oneline this should work:

<?php
$insert = ($config_website_url_topic == "home")?"":"test";
echo '<div id="logo"><a href="'.$config_website_url.'/'.$config_website_url_topic.'/index.php?page=home">Home</a>'. $insert  .'</div>';

?>

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.