Hey, i am working on a new project, and has the same concept of myspace (but very different features etc) So i am wanting to change the style sheet whilst on a profile page e.g. www.example.com - stylesheet 1 www.example.com/?mod=signup - stylehsheet 1 www.example.ccom/?mod=auth - stylesheet 1 -- www.example.com/danny - style sheet 2 (new style) (using mod rewrite from www.example.com/?viewprofile=danny) I tried using if/else but failed, does anyone have any advice on how to do it? Regards, Danny.
If should work. Show some code. How are you getting the url, are you using a function to extract the relevant pieces etc.
So i have finally got the basics to work... <?php $pageurl .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; $profile = htmlentities($_GET['viewprofile']); if($pageurl == "www.example.com/?viewprofile=$profile"){ echo "Profile CSS"; }else{ echo "Main CSS"; } ?> PHP: Now is it even possible to work around the mod-rewrite rule. since it works as... www.example.com/?viewprofile=danny but not www.example.com/danny Any advice on how to do this? Thanks, Danny.
if($pageurl == "www.example.com/$profile"){ echo "Profile CSS"; } could do it as an OR with the IF statement, elseif is an option too.
Thanks, finally got it to work <?php $profile = htmlentities($_GET['viewprofile']); if(!$profile){ echo "<link href=\"$domain/templates/default/styles.css\" type=\"text/css\" rel=\"stylesheet\" />"; }else{ echo "Main CSS"; } ?> PHP: