/    Sign up×
Community /Pin to ProfileBookmark

Script Variable Help

I have this ticker script, that is flat file based. It writes the variables to a conf.php file. Here is that code:

[code=php]
<?php
$tablewidth= “100%”;
$tableheight= “80”;
$bgcolor = “#FFFFFF”;
$border = “0px”;
$scrollspeed = “35”;
$fontsize = “2”;
$fontstyle = “Univers”;
$fontcolor = “#C41F3A”;
$bold = “100”;
$lineheight = “0.8cm”;
$sent1 = “<b>test1</b>”;
$sent2 = “<i>test2</i>”;
$sent3 = “<u>test3</u>”;
$sent4 = “<a href=”http://dets2005/bna-intranet/”>Text</a>”;
$sent5 = “<b>test5</b>”;
$sent6 = “<b>test6</b>”;
$sent7 = “<u>test7</u>”;
$sent8 = “<u>test8</u>”;
$sent9 = “test9”;
?>
[/code]

I wrote a backup script that takes all those variables, and outputs/backs them up to a html file. However, when it outputs the variables to the html file, the universal font color and family doesnt show. It should display the text [COLOR=crimson]#C41F3A [/COLOR] in color, but it doesnt. Can someone tell me how to get that variable in my html file?

Here is the code for the backup script:

[code=php]
<?

include(“conf.php”);

$textarea[1] = “$sent1”;
$textarea[2] = “$sent2”;
$textarea[3] = “$sent3”;
$textarea[4] = “$sent4”;
$textarea[5] = “$sent5”;
$textarea[6] = “$sent6”;
$textarea[7] = “$sent7”;
$textarea[8] = “$sent8”;
$textarea[9] = “$sent9”;
$textarea[10] = “$sent10”;
$textarea[11] = “$sent11”;
$textarea[12] = “$sent12”;
$textarea[13] = “$sent13”;
$textarea[14] = “$sent14”;

$counttextareas = count($textarea);
$array = array();

FOR($i = 1; $i <= $counttextareas; $i++) {
array_push($array, $textarea[$i]);

$today = date(“M-d-Y”);

$filename = $today.”.ticker_archive.html”;
$path = “C:/Inetpub/wwwroot/bna-intranet/ticker_archive/”;
$somecontent = $textarea[$i].”<br /><br />”;

// Let’s make sure the file exists and is writable first.

// In our example we’re opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that’s where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, ‘a’)) {
echo “Cannot open file ($filename)”;
exit;
}

// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo “Cannot write to file ($filename)”;
exit;
}

echo “<b>Success</b>, wrote $somecontent to file ($filename)<br />”;

fclose($handle);

}

echo “<br /><br /><br /><br />”;

if (!copy($filename, $path.$filename)) {
echo “Failed to copy $filename…<br />n”;
} else {
echo “Your file has been copied too $path<br /><br />n”; }

if (file_exists($filename))
{
unlink($filename);

}else{
echo (“$filename could not be found!”);
}

?>
[/code]

Here is a screenshot of what the html file displays. The color though should be that # hex code color

[upl-file uuid=e4c6fe61-97a3-4839-8c2f-79af9dfe7693 size=13kB]test3.jpg[/upl-file]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@ShrineDesignsJul 16.2004 — how is it suppost to change the color, when no reference to $fontcolor exists in your second script
Copy linkTweet thisAlerts:
@chugger93authorJul 16.2004 — well right... I figured since I included (conf.php) that it would? I dunno. Where can I include $fontcolor then so the text is that color?

Sorry, newbie (php)
Copy linkTweet thisAlerts:
@ShrineDesignsJul 16.2004 — newbie (html) more likely lol

insert after include('conf.php');echo "&lt;font color="$fontcolor"&gt;";

insert at end of php code block:echo "&lt;/font&gt;";
×

Success!

Help @chugger93 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,
)...