Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old December 17th, 2002, 08:32 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
PHP and .CSS working together in links

Well... here is the problem. At the navigation bar I need the page link to turn black when you click that link... so it was grey before when your not on that page, but when your on the page its black. Basically I'm using .css, so Im changing it from "nav" to "nav2".

Heres the code:

php Code:
Original - php Code
  1. <?php
  2. $home = "home"; $bios = "bios"; $about = "about"; $media = "media"; $shows = "shows"; $thanks = "thanks"; $contact = "contact"; $links = "links"; $merch = "merch"; $streetteam = "street-team";
  3. $_home = "mainpage.htm"; $_bios = "bios.htm"; $_about = "about.htm"; $_media = "media.htm"; $_shows = "shows.htm"; $_thanks = "thanks.htm"; $_contact = "contact.htm"; $_links = "links.htm"; $_merch = "http://members.lycos.co.uk/soldoutrecords/merch.htm"; $_streetteam = "streetteam.htm";
  4. $n2home = "nav2"; $n2bios = "nav2"; $n2about = "nav2"; $n2media = "nav2"; $n2shows = "nav2"; $n2thanks = "nav2"; $n2contact = "nav2"; $n2links = "nav2"; $n2merch = "nav2"; $n2streetteam = "nav2";
  5. $nhome = "nav"; $nbios = "nav"; $nabout = "nav"; $nmedia = "nav"; $nshows = "nav"; $nthanks = "nav"; $ncontact = "nav"; $nlinks = "nav"; $nmerch = "nav"; $nstreetteam = "nav";
  6. $navselect = "$home"; $updated = "17/12/02"; $thispage = $main;
  7. $head = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'><html><head><title>SecondMonday</title><meta name='Author' content='Will Law'><meta name='Keywords' content='secondmonday, second, monday, SecondMonday, Second Monday, SecondMonday UK, UK, Punk, Rock, Punk Rock, Emo, Emo-Hardrock, Will Law, James Hopkinson, Fred Furber, Rich Rowe'><meta name='Description' content='SecondMonday are a band from south England playing pop-punk to emo-hardrock.'></head>";
  8. $nav = "<body bgcolor='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><span class='one'><center><table cellspacing='0' cellpadding='0' width='700'><td bgcolor='#eeeeee' background='images/corner.jpg' width='300' height='70'></td><td bgcolor='#222222' width='1' height='70'></td><td bgcolor='#eeeeee' background='images/topright.jpg' width='399' height='70' align='left' valign='bottom'><span class='one'><font color='#999999'>&nbsp; designed/programmed: will law | photography: will law, fred furber<br>&nbsp; site best viewed at 800x600+ resolution | <font color='#555555'>last updated: $updated</font><br>&nbsp; all material, unless otherwise stated is copyright © secondmonday</font></span></td></table><table cellspacing='0' cellpadding='0' width='700'><tr><td bgcolor='#000000' width='700' height='1'></td></tr><tr><td bgcolor='#eeeeee' style='background-image: url(images/secondmonday.gif); background-repeat: no-repeat;' width='700' height='20'><table cellspacing='0' cellpadding='0' width='700'><td background='images/navleft.jpg' width='26' height='20'></td><td width='648' height='20' align='right' valign='middle'><span class='two'><a href='$_home' onFocus='if(this.blur)this.blur()' class='$nhome'>$home</a>&nbsp; <a href='$_bios' onFocus='if(this.blur)this.blur()' class='$nbios'>$bios</a> &nbsp; <a href='$_about' onFocus='if(this.blur)this.blur()' class='$nabout'>$about</a> &nbsp; <a href='$_media' onFocus='if(this.blur)this.blur()' class='$nmedia'>$media</a> &nbsp; <a href='$_shows' onFocus='if(this.blur)this.blur()' class='$nshows'>$shows</a> &nbsp; <a href='$_thanks' onFocus='if(this.blur)this.blur()' class='$nthanks'>$thanks</a> &nbsp; <a href='$_contact' onFocus='if(this.blur)this.blur()' class='$ncontact'>$contact</a> &nbsp; <a href='$_links.htm' onFocus='if(this.blur)this.blur()' class='$nlinks'>$links</a> &nbsp; <a href='$_merch' onFocus='if(this.blur)this.blur()' class='$nmerch' target='_blank'>$merch</a> &nbsp; <a href='$_streetteam' onFocus='if(this.blur)this.blur()' class='$nstreetteam'>$streetteam</a></span></td><td background='images/navright.jpg' width='26' height='20'></td></table></td></tr><tr><td bgcolor='#000000' width='700' height='1'></td></tr></table>";
  9. $main = '<table cellspacing="0" cellpadding="0" width="675"><td bgcolor="#ffffff" style="background-image: url(images/mainbg.jpg); background-repeat: no-repeat;" width="675" height="246"><span class="one"><table cellspacing="0" cellpadding="0" width="675"><td width="378" align="left" valign="top"><iframe src="news.htm" width="378" height="246" frameborder="0" name="newsframe">Your browser does not support frames, please update it.</iframe></td><td width="297" align="left" valign="top"><table cellspacing="0" cellpadding="0" width="297"><td height="50" align="center" valign="middle"><span class="two"><form method="link" action="mailinglist.htm"><input class="TextBox" type="submit" value="subscribe to the mailing list"></form></span></td></table><table cellspacing="0" cellpadding="0" width="297"><td width="297" height="174" align="center" valign="top"><span class="two"><img src="images/reviews/cuttingties.jpg" border="1"></span></td></table><table cellspacing="0" cellpadding="0" width="297"><td width="10" height="1"></td><td bgcolor="#000000" width="287" height="1"></td></table><table cellspacing="0" cellpadding="0" width="297"><td width="10" height="1"></td><td bgcolor="#000000" width="1" height="15"></td><td bgcolor="#eeeeee" width="286" height="15" align="left" valign="top"><span class="two">&nbsp;<a href="cuttingties.htm" onFocus="if(this.blur)this.blur()" class="nav" target="newsframe">cutting the ties between enemies and friends</a></span></td></table><table cellspacing="0" cellpadding="0" width="297"><td width="10" height="1"></td><td bgcolor="#000000" width="287" height="1"></td></table><table cellspacing="0" cellpadding="0" width="297"><td height="5"></td></table></td></table></span></td><td bgcolor="#555555" width="1"></td></table>';
  10.  
  11. print "<link rel='stylesheet' href='stylesheet.css' type='text/css'>";
  12. print $start;
  13. if($thispage = $main){
  14. $nhome = $n2home; //here is where it should change from grey to black
  15. print $nav;
  16. print $main;
  17. }
  18. else {
  19. print "oh dog poo...";
  20. }
  21. ?>


If you could help it would be great.. thanks!

Will

Reply With Quote
  #2  
Old December 18th, 2002, 03:45 PM
bob0099 bob0099 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: manchester,n.h.,usa
Posts: 172 bob0099 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: PHP and .CSS working together in links

Kind of hard to read but it looks like your if statement should be before your html output.

Reply With Quote
  #3  
Old January 23rd, 2003, 11:39 AM
sadekj sadekj is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 sadekj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to sadekj
RE: PHP and .CSS working together in links

hellow

I think the problem is the if statment syntax:
php Code:
Original - php Code
  1. if($thispage = $main){ 


maybe if you try :
php Code:
Original - php Code
  1. if($thispage == $main){


use double == sign to test equality. your current code is assigning $thispage to $main !

I hope this solves the problem.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > PHP and .CSS working together in links


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek