Jump to content

Echoed 'Logout' link not working...


INeedAGig

Recommended Posts

Hey there guys, small problem here that I can't seem to figure out. I am in the process of programming a database with user-access control.  I have the log-in system working great, but the logout link, which is located next to the logged-in username seems to not be echoing correctly. It is loading the 'Logout' text in text-form only, not link-form....

 

Any ideas on what may be causing this small glitch?? Thanks!! 

 

I have attached relevant code for said part for reference.

 

<img src="images/username.png" height="20" width="20"> <b>Welcome</b> <?php echo ("<font color=#9e0219>$username</font>");?>, <?php echo '<a href="logout.php">Logout</a>';?>

Link to comment
Share on other sites

Works for me too. The Snippet of posted code is probably inside of some other broken html or possibly has some css that renders it impotent.

 

Edit: Any chance that username being displayed contains some html special characters?

Link to comment
Share on other sites

Hey there guys, small problem here that I can't seem to figure out. I am in the process of programming a database with user-access control.  I have the log-in system working great, but the logout link, which is located next to the logged-in username seems to not be echoing correctly. It is loading the 'Logout' text in text-form only, not link-form....

 

Any ideas on what may be causing this small glitch?? Thanks!! 

 

I have attached relevant code for said part for reference.

 

<img src="images/username.png" height="20" width="20"> <b>Welcome</b> <?php echo ("<font color=#9e0219>$username</font>");?>, <?php echo '<a href="logout.php">Logout</a>';?>

 

Just to confirm, the "Logout" text is no clickable at all?  It's not something silly like that container <div> has text-decoration:none or something like that, correct?

Link to comment
Share on other sites

Hows it work with full quotes?

<img src="images/username.png" height="20" width="20"> <b>Welcome</b> <?php echo "<span style=\"color=#9e0219;\">$username</span>"; ?>, <?php echo "<a href=\"logout.php\">Logout</a>"; ?>

 

That's not valid inline CSS.  See color=#9e0219 should be color:#9e0219

 

His initial code was OK.  HTML without quotes is still valid HTML.  It only becomes invalid when you have declared your document as XHTML, but who does that anymore?

Link to comment
Share on other sites

Yes an obvious over site on my part when making the conversion.  However <font> is an old depreciated coding style.

 

You're right, it is.  But there is more to this than his current HTML markup.  That's why I asked him to simply see if the 'Logout' text was in fact clickable as I fear, and have seen a million times before in similar cases, that the containing DIV simply has a text-decoration:none style attached to it for all hyperlinks.  Might not be the case, but it needs to be ruled out for my sanity.

 

Aside from that, I fail to see how a DIV could otherwise manipulate the content within and break links without it being controlled by javascript.

Link to comment
Share on other sites

Yes an obvious over site on my part when making the conversion.  However <font> is an old depreciated coding style.

 

You're right, it is.  But there is more to this than his current HTML markup.  That's why I asked him to simply see if the 'Logout' text was in fact clickable as I fear, and have seen a million times before in similar cases, that the containing DIV simply has a text-decoration:none style attached to it for all hyperlinks.  Might not be the case, but it needs to be ruled out for my sanity.

 

Aside from that, I fail to see how a DIV could otherwise manipulate the content within and break links without it being controlled by javascript.

I agree.  It must be the css for the containing div or its parent that causing the problem.  Showing relevant code, div/wrappers etc and css would shed some light on the problem.
Link to comment
Share on other sites

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.