HTML + JS in PHP

oxyshow

New Member
Messages
13
Reaction score
0
Points
0
Okay, I'm trying to put a css style switcher on my portfolio. I already have all the required codes, but I don't know where to put them.

I need to insert:

<link rel=”stylesheet” type=”text/css” href=”yourdefaultstyle.css” title=”default” />
<link rel=”alternate stylesheet” type=”text/css” ref=”youralternatestyle.css” title=”alternate” />
<script type="text/javascript" src="/scripts/styleswitcher.js"></script>

into my header which apparently only allows HTML.

I also need to insert this into my body which also only allows HTML:

<a href=”#” onclick=”setActiveStyleSheet(‘default’); return false;”>Change style to default</a>
<a href=”#” onclick=”setActiveStyleSheet(‘alternate’); return false;”>Change style to alternate</a>

Could somebody with experience on these issues help?
 

rockee

New Member
Messages
120
Reaction score
0
Points
0
Basically you may need to follow this multi-code web page template for a placing your additional code.

If you like you can always attach a text file with your page code so I or some other member can take a look and make a more informed reply.
Code:
<?php
<-- some php content here -->
?>

<--!DOCTYPE declaration here-->
<html>
<head>
<title>Title</title>
<--other meta tags here-->
<link rel=”stylesheet” type=”text/css” href=”yourdefaultstyle.css” title=”default” />
<link rel=”alternate stylesheet” type=”text/css” ref=”youralternatestyle.css” title=”alternate” />
<script type="text/javascript" src="/scripts/styleswitcher.js"></script>
</head>
<body>
<--html code, javascript code, and php code here-->

<-- some JavaScript code here -->
<script>blah</script>

<-- some html code here -->

<a href=”#” onclick=”setActiveStyleSheet(‘default’); return false;”>Change style to default</a>

<?php
<-- some php content here -->
?>

<-- more html content here -->

<a href=”#” onclick=”setActiveStyleSheet(‘alternate’); return false;”>Change style to alternate</a>

<?php
<-- more php content here -->
?>

<-- more html content here -->
</body>
</html>

<?php
<-- more php content here -->
?>
Get the idea?

NOTE - because the file contains php code then it most always has a .php file extension so the server knows to parse the php code and not just display the code as text, as would be the case if a .html file extension were to be used.

Regards,
Rocky
 
Last edited:

phpasks

New Member
Messages
145
Reaction score
0
Points
0
You can used all js, css, meta tag into your head portion
head tag start & close between
user can put css, js file & meta tag & also favicon icon also.
Body part display for your borwser
HTML:
<html>
<head>
<!- here put your js, css, favicon icon, meta tag -->
</head>

<body>
<!- Display here layout -->
</body>
</html>
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
You can used all js, css, meta tag into your head portion
head tag start & close between
user can put css, js file & meta tag & also favicon icon also.
Body part display for your borwser
HTML:
<html>
<head>
<!- here put your js, css, favicon icon, meta tag -->
</head>

<body>
<!- Display here layout -->
</body>
</html>

Now in english?
 
Top