Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7443107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:16:49+00:00 2026-05-29T11:16:49+00:00

i have some swf apps that open in a lightbox when a link to

  • 0

i have some swf apps that open in a lightbox when a link to an swf file is clicked on the page

it is purely standard link required to trigger the lightbox

<a href"http:// {url} /swf/ {file} .swf">Name</a>

i have been trying to implement a script to write a timestamp (date(‘U’) in php coding, as that is the format i need the timestamp) and the “href” value of the link clicked to a txt file … i have been using onClick=”function()”

but i cannot seem to get it to work….

i am hoping to have lines written to the txt file like this

1328984654|http:// {url} /swf/ {file} .swf
1328984829|http:// {url} /swf/ {file2} .swf

i would presume the line breaks are implemented with \r\n

i dont necessarily need the file extention to be written, however i would presume it would be easier just to write the full link url….

the method i have been using was hidden form that submits onclick but its not very economical, as i need hidden iframe blah blah …… too much work, when i think this could be implemented in one script….

i can easily change my existing link generating script, so that it can add

onClick="new_function()"

or any variation of this to be able to link it to the function….

i am not very experienced with javascript, and i know the click script will need to be client side 🙁

thanks in advance if anyone can help me, cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:16:50+00:00Added an answer on May 29, 2026 at 11:16 am

    Javascript does not have access to the server file system and can not write anything to a file. However you can use javascript (read Ajax) to run a PHP file that writes whatever data you send it to a file.

    For Ajax requests using jQuery is by far the easiest solution, as writing XMLHttpRequests in vanilla JS is a bit more complicated. In jQuery you would do something like:

    HTML:

    <a href"http:// {url} /swf/ {file} .swf" id="mylink">Name</a>
    

    –

    $("#mylink").click(function() {
        $.ajax({ 
           type: 'POST', 
           data: {swf : '1328984654|http: {url} /swf/ {file} .swf'}, 
           url: 'write_to_file.php',
           success: function(data) {
              alert('file saved');
           },
           error: function() {
              alert('error');
           }
        });
    });
    

    In PHP you’ll get the data from the $_POST superglobal like so:

    $data = $_POST['swf'];
    

    Then use file_put_contents or one of the many other solutions for saving the data to your file, and since you’ve had this working with a form I’m not going to go into that part. You could also generate the timestamp in PHP and append that at the same time, no need to do that in JS. It is of course a bit more involved than this, for instance you should do the normal isset check on $_POST, and sanitize any data that comes from the clientside, but if you do a little reading and testing on your own you’ll figure it out in no time, it’s really not that hard, and just a few lines of code is enough to get a basic example of what you are trying to do up and running.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some AS2 code that opens a SWF file through an HttpHandler. I'm
I have a swf file (a flash game). I want to run some script
I have many SWF file those I have included in my web page using
I have a Flex application here If you open that link, you'll see it
I want to pulish SWF file from .fla file. I have some scripts there,
I have a flash swf file that I want to embed in a view
I have some UI in VB 2005 that looks great in XP Style, but
We have some input data that sometimes appears with &nbsp characters on the end.
We have some files on our website that users of our software can download.
I have some images floating around in my SWF. The SWF holds several buttons,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.