/    Sign up×
Community /Pin to ProfileBookmark

base64 encoding files

I know this may not work, but I was hoping to have the file my javascript code is in output in base64 so it is illegible to the user, and legible to the browser.. but I didn’t know what to set the type of the content to.. would it be text/base64 or something like that… and also could I just read in the file line by line appending it into one variable and base64_encode that variable then echo it or would that not work?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@ScriptageApr 13.2004 — If you output the script to a <script> tag with php ie <script src="base64.php"></script> the browser will take the base64 code as javascript and produce errors.
Copy linkTweet thisAlerts:
@mrchipps69authorApr 16.2004 — what about if you do <script src="base64.php" type="base64/javascript" language="javascript"></script>


or even type="text/base64" since the language is already set.... can't you tell the browser how to interpret it?
Copy linkTweet thisAlerts:
@ScriptageApr 16.2004 — doubt it, try google... If you can't find it on there, chances are it isn't possible.
×

Success!

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