Run a php script

Is there a way to run a script if the user closes the browser
window, or hits backspace?
I can do this with <body> tag supports an onUnload
attribute, however I was hoping flash may be able to do it, as I am
trying to pass the username to the script I want to run,therefore
it be easier all rond if flash could do it. Thansk to any
responders. J

basically I am trying to log a user out, so I know what users
are online, but if they don't logout themselves, my mysql databse
will still have them as logged in... any solutions?

Similar Messages

  • Error on running a PHP script

    I just migrated my web server over to Leopard and I am having an annoying issue with some PHP scripts. When I call a certain subroutine library (specifically Graph->Stroke from the JpGraph PHP library, http://www.aditus.nu/jpgraph/), the PHP code crashes with the following errors recorded in the /var/log/apache2/error_log:
    The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
    Break on _THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___Y OU_MUST_EXEC_() to debug.
    Now, I did a bit of poking around and discovered that Leopard did make a change (for security?) where a process that is forked is no longer allowed to call CoreFoundation routines (see http://developer.apple.com/technotes/tn2005/tn2083.html#SECDAEMONVSFRAMEWORKS). I have a vague idea of CoreFoundation (I am not a MacOS programmer), and I am guessing that the specpfic JpGraph command I am executing is triggering CoreFoundation to do some file handling. I am not sure about this because my own PHP routines that create files work just fine, but this JpGraph package chokes.
    Does anyone have any idea if there are some PHP tweaks I could make (via editing the php.ini file) that might prevent "forking" or of any other techniques that might avoid this problem.

    Hi if you are unable to go to this page after doing some personalizations ,
    then you need to do the following :
    ACTION PLAN
    ===========
    1. Login to application
    2. Select Responsibility Functional Administrator
    3. Click Personalization Tab ( Upper Right)
    4. For Application , Enter the following: Self-Service Web Applications
    5. Click on the Personalized Checkbox
    6. Click Go
    7. Remove or De-activate your personalization that is causing the issue
    8 Re-test your login.
    Thanks ,
    Raj.

  • Need to run php script before the Flash component kicks in

    I have a slide show component in Flash which uses an xml file to load images. The xml file, however, is created dynamically when the user selects which slide show they want to see. How do I run the php script BEFORE the slide show component has a chance to look for it? Usually it begins as soon as the .swf is run.
    thanks,
    chop

    thank you for responding.
    I'm still new at as3 so forgive me for needing details.
    I searched adobe for help and came up with the following to import the component. However, it seemed too easy to be true and so it was. I received errors when I ran it. The component is a commercial one called SlideshowBox and is in my library with that exact name.
    //add a component to the stage
    import fl.controls.SlideshowBox;
    var aSlideshowBox:Button = new Button();
    addChild(aSlideshowBox);
    errors:
    Scene 1, Layer 'Actions', Frame 1, Line 3    1172: Definition fl.controls:SlideshowBox could not be found.
    Scene 1, Layer 'Actions', Frame 1, Line 3    1172: Definition fl.controls:SlideshowBox could not be found.
    Scene 1, Layer 'Actions', Frame 1, Line 4    1180: Call to a possibly undefined method Button.
    thank you, k

  • Determine when a php script has run, then continue in actionscript

    I  want to run a php script before continuing to processs any more a.s. because the php script creates an xml file on which the a.s. depends. In addition, I need to send a variable to the php script that tells it what kind of xml script it will create.
    (i suppose I could just add the rest of the a.s. into a later frame but that sounds like a method when all else fails)
    Here's how it works in detail:
    1. someone clicks on the "oil" button which means they want to view all the images in the "oil" gallery.
    2. A php script creates an xml that includes only the oil images (that''s the variable it must receive from Flash "oil").
    3. The php script finishes its job before a.s. script continues
    Here's how I started but I'm not even sure what type of "event" is used to listen for a finished php script or where to put the variable parameter:
    oil_btn.addEventListener(MouseEvent.CLICK,xmlGenesis);
    function xmlGenesis
    (evt:MouseEvent):void{
        var urlRequest:URLRequest= new URLRequest
        ('xmlGenesis.php');
        navigateToURL (urlRequest);
    thank you for your assistance
    chop

    Well, after a few hours of looking around the Internet and in reference books and at the example you indicated, I finally managed to nail the pieces together to get something that works... just before I decided to start drinking again. whew! It works!
    var myVariables:URLVariables = new URLVariables();
    myVariables.gallery = "nature";
    var myURLRequest:URLRequest = new URLRequest("xmlGenesis.php");
    myURLRequest.data = myVariables;
    var ulLoader:URLLoader= new URLLoader();
    ulLoader.addEventListener(Event.COMPLETE,xmlComplete);
    ulLoader.load(myURLRequest);
    function xmlComplete (ev:Event):void{ // finished creating xml file
    do everything else
    thank you
    That which doesn't kill us makes us stronger.
    Friedrich Nietzsche

  • Launchd not running php script in background

    Hi there,
    I am trying to run a php script repeatedly after every 2 minutes using launchd. I am using mac 10.9.2.
    Here is my plist file-->
    com.mycompanyname.mydepartment.mytaskname.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.mycompanyname.mydepartment.mytaskname</string>
        <key>ProgramArguments</key>
        <array>
              <string>/Applications/XAMPP/xamppfiles/htdocs/oauth/job.php</string>
        </array>
        <key>StartInterval</key>
        <integer>50</integer>
    </dict>
    </plist>
    /Applications/XAMPP/xamppfiles/htdocs/oauth/job.php --->
    #!/usr/bin/php
    <?php 
    $File = "YourFile.txt"; 
    $Handle = fopen($File, 'a');
    $Data = "Jane Doe\n"; 
    fwrite($Handle, $Data); 
    $Data = "Bilbo Jones\n"; 
    fwrite($Handle, $Data); 
    print "Data Added"; 
    fclose($Handle); 
    ?>
    My command line for your reference-->
    studio-film1:oauth MetricFilm$ sudo chmod a+x job.php
    studio-film1:oauth MetricFilm$ sudo cp com.mycompanyname.mydepartment.mytaskname.plist /Library/LaunchDaemons
    studio-film1:oauth MetricFilm$ sudo launchctl load -w /Library/LaunchDaemons/com.mycompanyname.mydepartment.mytaskname.plist
    studio-film1:oauth MetricFilm$ sudo launchctl load -w /Library/LaunchDaemons/com.mycompanyname.mydepartment.mytaskname.plist
    com.mycompanyname.mydepartment.mytaskname: Already loaded
    When i drag and drop my job.php script on terminal, it shows its path and when i enter.... It is not giving me any error & it is running on command line too & creating "YourFile.txt" if it does not exists & if it exists then it writes two lines into it.
    Problem is---->
    "YourFile.txt"  is not getting generated neither if it is there is getting written by php script. Which means it is not running into memory even a once.
    What should i do to make launchd run this script repeatedly.
    Thanking you

    Thanks dear,
    Should i change relative path mentioned into PLIST file
    <string>/Applications/XAMPP/xamppfiles/htdocs/oauth/job.php</string>
    to Absolute...?
    And is there any other command to start a plist task running after we have loaded it with launchctl??
    Thank you

  • [SOLVED] PHP script returning a 255 errorcode

    Hello,
    I have a rather strange problem at hand currently.  I am using the stock binary PHP supplied in the repositories with sqlite3, pdo ,pdo-sqlite, and soap modules enabled.  Whenever I try to run a PHP script, however, no output is returned to STDOUT (although there should be) and when I execute it in ScITE, I get an exit code of 255.  The exact same script works on a FreeBSD server that I have access to and did work fine on SUSE linux, and also on this machine until two days ago.  It is intermittent, I briefly fixed the issue by rewriting the ?> brackets and saving the file, then by converting the EOLs from CRLF to LF using dos2unix, however both times the script reverted.  There are other PHP scripts that work fine, and even this one used to work OK.  I also want to mention that I had edited the file using DEV-PHP 2.2 for Windows but while the file was on the BSD server, and on Arch and SUSE.  Thank you all!
    Last edited by ibnpaul (2007-11-07 05:04:33)

    > ~/Development/1&1/Abuse/lgrp_beta  $  ./lgrp.php
    > ~/Development/1&1/Abuse/lgrp_beta  $  php -l lgrp.php
    Errors parsing lgrp.php
    > ~/Development/1&1/Abuse/lgrp_beta  $  ./lgrp
    LogGrep v0.3 -- Help
    Usage: lgrp [-option [parameter]]...
    This above code shows that calling ./lgrp.php does not work, we hit errors when trying to check syntax, and a copy of the script, lgrp, runs fine, as can be seet by the output.  Does anyone have any ideas?  Thanks again!

  • Uploading a file using a php script while running application with LCDS

    Hi! I developping an application under Flex 2 / Java -
    running on LCDS / JRun server.
    I'm trying to add uploading capabilities. I'm using a php
    script for the upload part.
    First, I just try to put script on the app directory. Doesn't
    work.
    After that I set up an apache server from where I put a small
    web site with my script. It's telling me that my file is
    succesfully uploaded, but I can't find the file. The apache log
    give me no error.
    Someone can help me?

    Originally, I had problems w/ the file being placed in
    C:/whatever.ext b/c I wasn't using relative paths.
    This is the code I use:
    $MAXIMUM_FILESIZE = 1024 * 1024 * 2; // 2MB
    $newFileLoc = "./wherever/file.jpg"
    if ($_FILES['Filedata']['size'] <= $MAXIMUM_FILESIZE) {
    move_uploaded_file($_FILES['Filedata']['tmp_name'],
    "./temporary/".$_FILES['Filedata']['name']);
    rename( "./temporary/".$_FILES['Filedata']['name'],
    $newFileLoc );
    chmod( $newFileLoc, 0777 );
    Modified from this article by Adobe:
    http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=17_Networking_and_communications_173_6.html

  • PHP script won't run in the background

    Hi all
    Hope someone can help me with a weird issue I have...
    I am trying to run a php CLI script in the background and it just won't run - it has a status of Stopped SIGTOU (Trying to write output) - Here are the details
    OS
    Mac OS X Lion 10.7.2
    PHP
    PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep  8 2011 19:34:00)
    Copyright (c) 1997-2011 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
    I created a basic script  test.php
    <?php echo 'Hello world'.PHP_EOL; ?>
    Here are the results of various tests:-
    Test 1) php -f test.php  (Hello world gets displayed)
    Test 2) php -f test.php >test.log 2>&1 (Hello world gets put into test.log)
    Test 3) php -f test.php >test.log 2>&1 & --- I get [1]+  Stopped(SIGTTOU)        php -f test.php > test.log 2>&1 -- and the job just sits there doing nothing nothing gets logged however lsof shows the log file is open
    It has to be something to do with Apple's php build because a similar bash shell script gets executed no problems in the background...
    This has me stumped ... any ideas? What can I do to find out what is going on ...?
    TIA
    Rich

    Just realized your trying to load the php files by using the File->Open menu item in the Browser.  That won;t work.
    You have to load the php file by placing it in the Sites folder and entering http://localhost/file.php
    (or if you have user Sites enabled http://localhost/~user/file.php)
    The reason it is grayed out is that the browser doesn't run (or know of) php files. The web server runs those (via php) and the output of the file goes to the web browser.
    This page How to enable Web Sharing in OS X Mountain Lion does a pretty good job of explaining it. (as does the user tip I lonked to before)

  • RUNNING PHP SCRIPT WITH ZEND FRMWRK IN WINDOWS TASK SCHEDULER

    I have a PHP script which includes the Zend framework Mail.php for sending mails.
    I am running a WAMP server and i used DW to create it.
    I want to run my script in every 5 mins, How i can schedule it in Windows task scheduler.
    I tried running a bat which contains the php.exe path and arguments as php file but it gives an error that zend/mail.php not found.
    Please help its really urgent.

    Thanks for your response.
    bat file has:
    path of the php.exe -f path of php file.
    But when it runs it gives an error that the zend framework file not found.
    I have a seperate PHP includes folder under which zend FW is stored.
    That folder is marked in includes_paths in php.ini.

  • Run PHP script

    Hello, everybody. I'm wondering if it's possible to run a HTML PHP script in a report region which type is HTML format? Something like:
    <?php
    echo phpinfo();
    ?>
    As I can imagine, this code could not be handled to PHP compiler although as I know, the ORACLE appication server has been compiled together with PHP 5. So is there any tricks to make this work, or does APEX have some plan to make similar things work in the later version?
    Thanks!

    I have a PHP application that opens up a template (MS
    Word) invoice file, inserts some information in the
    file (eg. today's date, customer name) and then saves
    it as a new Word file. My questions are as follows.
    1- How can I call this script from my Java
    application. Please note that I want to be able to
    pass parameters (eg. custome name read from a DB) from
    my Java app. to this script.You would have to call the PHP interpreter through Runtime.exec(), I believe. I haven't done anything with it, but you would have to build the command that would normally be typed on the command line as a string and pass it to Runtime.exec().
    2- Is it possible to print already saved MS Word
    documents from Java? If so, how?Try looking at the Jakarta POI project.
    3- Is it possible to do what my PHP script is doing in
    pure Java? I couldn't find a simple way of doing this,
    that's why I used PHP but I would like to do this in
    Java if I can.Same as 2.

  • Run PHP script in Java app.

    Hi,
    I have a PHP application that opens up a template (MS Word) invoice file, inserts some information in the file (eg. today's date, customer name) and then saves it as a new Word file. My questions are as follows.
    1- How can I call this script from my Java application. Please note that I want to be able to pass parameters (eg. custome name read from a DB) from my Java app. to this script.
    2- Is it possible to print already saved MS Word documents from Java? If so, how?
    3- Is it possible to do what my PHP script is doing in pure Java? I couldn't find a simple way of doing this, that's why I used PHP but I would like to do this in Java if I can.
    thanks in advance,
    Mete

    I have a PHP application that opens up a template (MS
    Word) invoice file, inserts some information in the
    file (eg. today's date, customer name) and then saves
    it as a new Word file. My questions are as follows.
    1- How can I call this script from my Java
    application. Please note that I want to be able to
    pass parameters (eg. custome name read from a DB) from
    my Java app. to this script.You would have to call the PHP interpreter through Runtime.exec(), I believe. I haven't done anything with it, but you would have to build the command that would normally be typed on the command line as a string and pass it to Runtime.exec().
    2- Is it possible to print already saved MS Word
    documents from Java? If so, how?Try looking at the Jakarta POI project.
    3- Is it possible to do what my PHP script is doing in
    pure Java? I couldn't find a simple way of doing this,
    that's why I used PHP but I would like to do this in
    Java if I can.Same as 2.

  • Running PHP Script

    I've enabled the Apache server on my mac, and when I access my local IP address I can see the web page I've created. However, it appears that the server doesn't process PHP scripts, and just returns the source code of the PHP script when I try to open the script in Safari 4. How do I get the built-in Apache server to process PHP scripts and return the desired result?

    PHP is disabled by default. To enable it, you must edit Apache's configuration file. To do this, open up /private/etc/apache2/httpd.conf with a text editor. The file is owned by root, so you'll need appropriate access to modify the file. Text editors like BBEdit or TextWrangler can make this step much easier.
    Fairly early on in the configuration file is the section for the Dynamic Shared Object support - these are the modules that Apache loads to enable it to perform various tasks. In this section are a whole bunch of "LoadModule" statements - one for each module that Apache is loading. One of these is for PHP support. In the httpd.conf file on my machine, the built-in PHP module's statement is on line 114, the next to last item in this section. It reads: "#LoadModule php5_module libexec/apache2/libphp5.so" Remove the "#" from the beginning of the line, save the file, and restart Apache.
    If you plan on using PHP files as the default page for a directory (index.php, for example), you'll need to add index.php to the Directory Index section (line 225 in my file). Apache looks for them in the order listed, so if you list index.php after the index.html that's already there, Apache will look for index.html when asked for the directory before looking for index.php. If you're going to have index.php for most of your directories, you may want to list it first, before index.html.
    With regard to PHP itself, Apple's included PHP isn't any more official that the one I mentioned from Marc Liyanage. They're both compiled from the same source code. And, as far as updating goes, I'd argue that it's easier to update Marc's version, as you simply download an updated version and the installer will overwrite the old version. And, you don't have to wait for Apple to release a new version of OS X or a security update to see if you get a more current version. His versions will almost always be more current than the one Apple provides.
    In any event, Marc's version does not remove Apple's version from your system. His installs in /usr/local/ and leaves Apple's version intact. So, you can always go back to Apple's version by changing a few lines in a configuration file.

  • Running PHP script from Java apps

    Hi,
    I have a PHP application that opens up a template (MS Word) invoice file, inserts some information in the file (eg. today's date, customer name) and then saves it as a new Word file. My questions are as follows.
    1- How can I call this script from my Java application. Please not that I want to be able to pass parameters (eg. custome name read from a DB) from my Java app. to this script.
    2- Is it possible to print already saved MS Word documents from Java? If so, how?
    3- Is it possible to do what my PHP script is doing in pure Java? I couldn't find a simple way of doing this, that's why I used PHP but I would like to do this in Java if I can.
    thanks in advance,
    Mete

    Don't reply here. Go here instead.
    http://forum.java.sun.com/thread.jsp?forum=54&thread=479160&tstart=0&trange=15
    Cross-listed
    Sorry, I thought this didn't post before.

  • PDF files pushed by PHP scripts cannot be previewed in the browser (only "Save as" dialog is displayed). How can I fix this?

    Running Firefox 27.0 on Linux Mint Petra (16).
    Direct download links to PDF files (URLs that end in .pdf) preview or open (or whatever I set in the App preferences dialog) no problem. However, any PDF file that is pushed by a php script can only be downloaded (no matter what I set in the App preferences dialog).
    I have several PCs running the same software (Linux Mint Petra with FF 27). All of them exibit the same problem.
    I've tried all solutions to similar problems listed here. None of them worked.

    You need to install server software to process the php code and send the file as text/html to Firefox.
    <pre><nowiki><?php header('Content-Type: text/html; charset=utf-8'); ?>
    </nowiki></pre>

  • Flex application works locally, fails when online (connecting to PHP script to insert row into DB)

    Hi everyone,
    I've got a Flex application that works wonderfully when I test it on my machine locally. It uploads files and send variables to a PHP script (that inserts them into a DB) with no errors when I run it locally. As soon as I put it online, the upload continues to work but something between my Flex application and the PHP script fails because no data is committed to the DB. I know the PHP script works fine - not only does it work when I run the Flex application locally but when I go directly to the PHP file online, a new empty line is added to the DB.
    I initially thought that this was a cross domain issue so I added the following to the root of my hosted account:
    <cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*.MYURL"/>
    <allow-http-request-headers-from domain="*.MYURL" headers="*" secure="false"/>
    </cross-domain-policy>
    I based this off of what I found online which seems to have done nothing for me. I'd also be happy to provide an error message but I don't get one when I debug.
    Any thoughts would be greatly appreciated.

    Use a network monitor to see if the Flex app is truly requesting the right URL.
    -Alex

Maybe you are looking for

  • Quicktime pro not loading/working

    I purchased the key for quicktime pro, upgraded to qt7, entered my registration key and it shows pro in the box, but the box does not seem to go away, and then the pro options in the program don't allow me to press? I don't seem to have the pro versi

  • Identity-type is not JDO 1.0 compliant

    kodo supports (application|datastore|none), but the JDO 1.0 spec specifies (application|datastore|nondurabe). I discovered this when searching for the reason why kodo used "datastore" (The reason was that I mistyped "application" and kodo seems to de

  • A query to display sales orders with corresponding outbound deliveries

    Hi Experts, Don't know if this is the right place to post the question but i would like to know if a query, in SAP, can display sales orders with their corresponding outbound deliveries, i tried using table LIKP and VBAK, VBKD didn't help. the whole

  • IPad2 Bluetooth connectivity issue

    iPad2 with 8.0.2 trying to connect to Apple wireless keyboard.  Last connected sometime this summer (so before the last update).  Will not connect.  They communicate, because if I put in the wrong code, the iPad says 'unsuccessful' immediately.  With

  • HT5824 if i reset my icloud would it reset and delete everything on my phone device..?

    my girlfriend had a situation where her phone was stolen at work, if she reset the phone icloud will it delete her personal information which she wants to delete.? if theres any way she could block the phone for being able to use , any idea how to do