/    Sign up×
Community /Pin to ProfileBookmark

Script HTML to PHP

Hey everyone, I’ve ran into a problem and it’s starting to get to me so I thought I would post here and get some expert help.

The code below will not work on my PHP website because it’s written for HTML. Can you help me make the code ready for PHP?

[CODE]<script type=”text/javascript”>

<!–

document.write(unescape(“%3Cscript id=’omniaff_o789258′ src='” + ((“https:” == document.location.protocol) ? “https://” : “http://”) +

“www.rollsafer.com/affiliate/track.js’ type=’text/javascript’%3E%3C/script%3E”));//–>

</script>[/CODE]

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@ChipzzzOct 05.2010 — There are alternatives, but here's the quickest way:

[code=php]
<?php

/*
Some php code goes here and when you're ready to insert your js snippet...
*/

?>

<script type="text/javascript">

<!--

document.write(unescape("%3Cscript id='omniaff_o789258' src='" + (("https:" == document.location.protocol) ? "https://" : "http://") + "www.rollsafer.com/affiliate/track.js' type='text/javascript'%3E%3C/script%3E"));//-->

</script>

<?php

/*
And now we're back into the PHP code
*/

?>
[/code]
Copy linkTweet thisAlerts:
@ScuzzelbuttauthorOct 06.2010 — This doesn't work on the page, any ideas?


[CODE]<?php

<script type="text/javascript">

<!--

document.write(unescape("%3Cscript id='omniaff_o789258' src='" + (("https:" == document.location.protocol) ? "https://" : "http://") +

"www.rollsafer.com/affiliate/track.js' type='text/javascript'%3E%3C/script%3E"));//-->

</script>

?>[/CODE]
Copy linkTweet thisAlerts:
@ChipzzzOct 06.2010 — This might work:

[code=php]
<?php

/*
Some php code goes here and when you're ready to insert your js snippet...
*/

?>

<script id='omniaff_o789258' src='http://www.rollsafer.com/affiliate/track.js' type='text/javascript'></script>

<?php

/*
And now we're back into the PHP code
*/

?>
[/code]
×

Success!

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