Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Need help with simple code.

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Need help with simple code.

Postby Bjawnie » Mon Nov 25, 2002 1:34 pm

Hii

So far I've only coded in ASP and now that I'm creating a site om a server that only can handled PHP I need a little help :wink: .

What I'm asking is if someone could write the following code for me (it should be rather easy)

If ?mode=print is added after the filename (.php) then use this css:

<LINK href="../css/print.css" type=text/css rel=stylesheet>

instead of this one:

<LINK href="../css/Style.css" type=text/css rel=stylesheet>



In ASP it would look like this:

<%If request.querystring("mode")="print" then%>
<LINK href="../css/print.css" type=text/css rel=stylesheet>
<%else%>
<LINK href="../css/style.css" type=text/css rel=stylesheet>
<%end if%>

Hope someone understands what I'm aiming for :D
Bjawnie
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Nov 25, 2002 1:25 pm

Postby Joan Garnet » Mon Nov 25, 2002 3:25 pm

Hi Bjawnie,
something like this (if I understood it :) )

Code: Select all
<?php
if($HTTP_GET_VARS['mode'] = "print"){
   echo "<LINK href='../css/print.css' type=text/css rel=stylesheet>";
}else{
   echo "<LINK href='../css/style.css' type=text/css rel=stylesheet>";
}
;?>
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

thanX

Postby Bjawnie » Mon Nov 25, 2002 3:31 pm

thanX Joan you've really saved me a lot of time and coffee :wink:
Bjawnie
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Nov 25, 2002 1:25 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron