# Attach line of PHP to flash (as2)

**URL:** <https://forum.kirupa.com/t/attach-line-of-php-to-flash-as2/317678>\
**Category:** flash\
**Created:** [December 29, 2010, 8:14pm UTC](https://forum.kirupa.com/t/attach-line-of-php-to-flash-as2/317678 "2010-12-29T20:14:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cantaloupe](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@cantaloupe](https://forum.kirupa.com/u/cantaloupe)\
**Post date:** [December 29, 2010, 8:14pm UTC](https://forum.kirupa.com/t/attach-line-of-php-to-flash-as2/317678/1 "2010-12-29T20:14:44Z")

</div>

Hi,

I’ve used a php script to password protect my pages which requires me to add a line of php in the head of each page that my flash is embedded in.

Here’s the problem… People can still type in a direct link in the address bar to the swf and access the file. I can’t allow this as access to the site is paid for - so basically, I need to add the line of php which activates my protection to the swf itself:

```auto
       <?php
$groupswithaccess="en";
require_once("../../slpw/protect.php");
?>

```

This is something I’ve not done before. Is it possible using loadvars? Would I need an external file?

Sorry if this is a silly question!

Thanks!
