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
  #1  
Old December 17th, 2002, 07: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: 24
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, 02: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: 2
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, 10: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!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway