Forum Moderators: coopster

Message Too Old, No Replies

SSI files not passing variable

         

kenwood

2:45 pm on Jan 26, 2006 (gmt 0)



Hey im new at programming, i have a SSI file that lists all the header information as a function passed through a variable, within that function i have a variable that will change within that function for everypage, $css, the css file location. Somethings not working and sorry to be so vaque.

Include:

<?php

function the_header($css)

{

$header = "<head>\n";
$header = css;
$header .= "<link rel='stylesheet' type='text/css' href='".$css."css.css'>\n";
$header .= "<title>Operartions Website../".$title."</title>\n";
$header .= "</head>\n";
$header .= "<body marginheight='5' marginwidth='5' leftmargin='15' topmargin='5'>\n";

return ($header);

}
?>

Index

<?php

$css = "css/";

include ("includes/header_footer.php");
$css = "css/";
print the_header($header,$css);

print $css;

coopster

4:39 pm on Jan 26, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, kenwood.

I see a couple of issues with the code as it stands. First, you are trying to pass two parameters to your function which only accepts one parameter. Second, the second line of your function is overwriting your $header variable with ... 'css' ...? Have a closer look at that.