Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
links on page 1 use different CSS when arriving on page 2
Old 02-21-2009, 01:04 AM links on page 1 use different CSS when arriving on page 2
ericson3000's Avatar
Experienced Talker

Posts: 40
Name: Bob Davis
Location: Los Angeles, CA
Trades: 0
Hey guys - is there a way to pass a variable somehow in a link on page 1 that sends the user to page 2 and the variable is somehow used in an "if... then..." statement to link to one of 3 different CSS documents?

In other words:

There are 3 buttons on page 1 and all take the user to page 2.

I want to use a different linked CSS document for page 2 depending on which button was clicked on page 1.

ericson3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-21-2009, 08:39 AM Re: links on page 1 use different CSS when arriving on page 2
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You'll need at least javascript to do that.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-21-2009, 12:42 PM Re: links on page 1 use different CSS when arriving on page 2
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Quote:
Originally Posted by LadynRed View Post
You'll need at least javascript to do that.
Yes, though I would personally recommend PHP, since it is a server-side script. You would want to use something like...

Page1.html
HTML Code:
<form method="post" action="Page2.php">
<input type="submit" name="CSS1" value="CSS 1">
<input type="submit" name="CSS2" value="CSS 2">
<input type="submit" name="CSS3" value="CSS 3">
</form>
Page2.php
PHP Code:
<?php
if($_POST['CSS1']) { echo '<link rel="stylesheet" type="text/css" href="CSS1.css" />CSS1'; }
if(
$_POST['CSS2']) { echo '<link rel="stylesheet" type="text/css" href="CSS2.css" />CSS2'; }
if(
$_POST['CSS3']) { echo '<link rel="stylesheet" type="text/css" href="CSS3.css" />CSS3'; }
?>
- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to links on page 1 use different CSS when arriving on page 2
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44259 seconds with 12 queries