Jump to content

Add html into <Head>?


blueman378

Recommended Posts

Hi guys, i was wondering what functions do i need to add a stylesheet into the head section of a page?

 

eg

 

<?php
include("somefile.php"); ?>
<html (blablabla doctype blablabla>
<head>
<meta blablabla>
<title>blablabla</title>
//i want included somefile to add a stylesheet here
</head>
...

 

im assuming i will be looking for the </head> tag and replacing it with

 

mystylesheet

</head>

 

?

Link to comment
https://forums.phpfreaks.com/topic/136338-add-html-into/
Share on other sites

lol i know that part,

 

i mean it dynamically, so for example i have a script which makes i dunno a table,

 

so i include that script

 

i want that script without the user having to place anything inside the head section i want the script itself to add the css sheet

Link to comment
https://forums.phpfreaks.com/topic/136338-add-html-into/#findComment-711270
Share on other sites

basically what im making is a for generator/(validator)

one option os for the styling of the form.

for that im doing it through css.

so a user includesfg.php

which includes all required classes ect.

the user users: 

$form1 = new formgenerator;

$form1->style = "singleline";

$form1->reset = on;

$form1->create("My Form", "showme.php", "post");

$form1->addelement("select", "myname1", "1", "months.php", off);

$form1->addelement("select", "myname2", "10", "months.php", on);

$form1->addelement("textbox", "mytextbox", 30, 50, off, "alphanum");

$form1->addelement("password", "mypassword", 30, 50, off, "alphanum");

[/code]

 

to create the form.

 

they then place :$form1->generate(); where they want the form to appear.

 

that work fine.

 

but for the styling i need to include a css sheet.

 

a different one depending on the stylew choosen.

 

anyway i dont want the user to have to include

 

fg.php

 

and then have to include eg fgcss.php inside the head section

 

so i dont know what the end html of the page will look like or what the rest of the page entails.

 

so what i really need is a way to capture what php has saved the current page state as and quickly add in my css

 

(this is assuming that php writes the html to itself as it is iterating through the php code)

Link to comment
https://forums.phpfreaks.com/topic/136338-add-html-into/#findComment-711293
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.