Posting script help

Heya, im having problems with my php post script,
I want the script to write to the file that will be included in my html document.
Now, the problem I’m having is I want to write this code with the url, but to keep it exact as the original,
because when I write a variable I cant store exact information because of “” , and when I want to add a source I must have ‘’. Is there a way to do this? Doesn’t have to be this way, just a way that will work. :-X
Help :S

<a href="ANY URL" onclick="return hs.htmlExpand(this, {objectType: 'iframe', width: 480, height: 385, allowSizeReduction: false, wrapperClassName: 'draggable-header no-footer', preserveContent: false, objectLoadTime: 'after'})" class="highslide"> Display YouTube movie </a>

You could store your code inside a file as a template, then replace the URL area with your URL:

In video_link.tpl.html:

<a href="{url}" onclick="return hs.htmlExpand(this, {objectType: 'iframe', width: 480, height: 385, allowSizeReduction: false, wrapperClassName: 'draggable-header no-footer', preserveContent: false, objectLoadTime: 'after'})" class="highslide">Display YouTube movie</a>

Note the {url}.

In replace.php:

[php]$path = ‘video_link.tpl.html’;
$raw = file_get_contents($path);

$new = str_replace(’{url}’, ‘NEW_LINK_HERE’, $raw);

file_put_contents(‘new_file.html’, $new);[/php]

The str_replace function replaces the {url} put in out template with the link that you want to use. The template (with parsed {url}) is placed in the $new variable).

Sponsor our Newsletter | Privacy Policy | Terms of Service