/    Sign up×
Community /Pin to ProfileBookmark

Help with php script

I need a script that will leave the layout of a certain page the same, but that changes the look of the page by adding CSS into it. What I need my website to do is, have a big form where users can edit the look of their page by editing the various options in the form. (Meaning, font, color, table borders, etc.) When they click “preview”, I need it to produce a moderately large (600+ lines of html) with fixed content, except WITH the CSS generated by the form.

HELP!!!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@pcthugAug 17.2006 — [code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css">
<?php
// firstly we'll print the css selector and property to the browser
echo 'body { background-color: ';

// then we'll do some error checking of our post variable value to prevent an erroneous outcome
if(ctype_xdigit($_POST['body_bgcolor']))
{
// if the entered value is valid print it to the browser
echo "{$_POST['body_bgcolor']}; }n";
}
// otherwise
else
{
// display a default value
echo "#ff00ff; }n";
}

// repeat.
?>
</style>
</head>
<body>

<?php include 'fixed_content.txt'; ?>

</body>
</html>[/code]
Copy linkTweet thisAlerts:
@dominicanpapi82authorAug 17.2006 — Perfect!! This is exactly what I need!!

[code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css">
<?php
// firstly we'll print the css selector and property to the browser
echo 'body { background-color: ';

// then we'll do some error checking of our post variable value to prevent an erroneous outcome
if(ctype_xdigit($_POST['body_bgcolor']))
{
// if the entered value is valid print it to the browser
echo "{$_POST['body_bgcolor']}; }n";
}
// otherwise
else
{
// display a default value
echo "#ff00ff; }n";
}

// repeat.
?>
</style>
</head>
<body>

<?php include 'fixed_content.txt'; ?>

</body>
</html>[/code]
[/QUOTE]
×

Success!

Help @dominicanpapi82 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...