URLLoader with php script variables

looking for an example of coding URLLoader / URLRequest with POST variables to a php script and vice versa. One can do this properly test locally using WAMP?

var urlloader:URLLoader = new URLLoader();

var urlR:URLRequest = new URLRequest ("yourphpscript.php");

var urlVar:URLVariables = new URLVariables();

urlVar.var1 = "whatever";

urlR.data = urlVar;

urlR.method = URLRequestMethod.POST;

urlloader.dataFormat = URLLoaderDataFormat.TEXT;

urlloader.addEventListener (Event.COMPLETE, completeF);

URLLoader.Load (urlR);

function completeF(e:Event):void {}

trace (URLLoader.Data);

}

Tags: Adobe Animate

Similar Questions

  • Create the HTML Contact form with PHP script

    Hello world

    I designed a contact form in HTML with the PHP script, but it doesn't seem to work. The PHP echo message does not appear after that I sent the form and the e-mail message is not delivered.  The URL is http://www.dreamaustraliastudytours.com.au/Test/ContactUs.html. Any thoughts would be greatly apprecipated

    Thanks in advance

    Paul

    I have always seen written as $_POST ['name'] - try to make your uppercase.

  • Problems with PowerCLI script variables

    Hello

    I hope that someone in the community can tell me where I was wrong in the script below. I have a few other PowerCLI scripts that work in a way similar to this work and these, but this one has a problem. The script is intended to collect information on a number of ESX objects in an array of arrays, $reportfinal, which can then be written to a CSV file that will have the column names for the objects, and each line will yield the values for RDM related objects for each virtual computer. The problem is that, rather than add the results to the table of $reportfinal, the results are crushed, and worse still, the values repeat themselves (for example the size of the various disks is reported as the same value).

    $report = @)

    $reportfinal = @)

    $VMs = get-VMHost | Get - VM | Get-View

    $rowcoll = "" | Select the virtual machine, VMController, SCSIBusShare, SCSIBusNumber, SCSIUnitNo, DeviceLabel, SCSISummary, DeviceFilename, DeviceCapKB, DeviceDiskMode, DeviceDiskUUID

    {ForEach ($VM to $VMs)

    #Clear table report for each virtual computer

    $report = @)

    Foreach ($SCSI_Controller in ($VM. Config.Hardware.Device | where {$_.} (({DeviceInfo.Label - like "SCSI *"})) {}

    $rowcoll. VM = $VM. Name

    $rowcoll. VMController = $SCSI_Controller.DeviceInfo.Label

    {Foreach ($Disk_Key to $SCSI_Controller.Device)}

    Foreach ($Disk_Device in ($VM. Config.Hardware.Device | where {$_.key - eq $Disk_Key})) {}

    $rowcoll. SCSIBusShare = $SCSI_Controller.SharedBus

    $rowcoll. SCSIBusNumber = $SCSI_Controller.BusNumber

    $rowcoll. SCSIUnitNo = $Disk_Device.UnitNumber

    $rowcoll. DeviceLabel = $Disk_Device.DeviceInfo.Label

    $rowcoll. SCSISummary = $SCSI_Controller.DeviceInfo.Summary

    $rowcoll. DeviceFilename = $Disk_Device.Backing.Filename

    $rowcoll. DeviceCapKB = $Disk_Device.CapacityInKB

    $rowcoll. DeviceDiskMode = $Disk_Device.Backing.DiskMode

    $rowcoll. DeviceDiskUUID = $Disk_Device.Backing.UUID

    }

    }

    }

    #Append the next line of the report data collection

    $report += $rowcoll

    #Append the next report to the final report data collection

    $reportfinal += $report

    }

    $reportfinal | Export-Csv-path D:\temp\SAP_Report_Disks_RDM_Mappings.csv - NoTypeInformation

    Note: Some parts of the script came another announcement on this forum about a script to display the ROW information for the list of virtual machines.

    See you soon,.

    Ed

    My mistake, I deleted the line wrong $report.

    Try this one

    $reportfinal = @()
    
    $VMs = Get-View -ViewType VirtualMachine
    
    foreach ($VM in $VMs) {
    
         #Clear report array for each VM
    
         foreach ($SCSI_Controller in ($VM.Config.Hardware.Device | where {$_.DeviceInfo.Label -like "SCSI*" } )) {
    
              foreach ($Disk_Key in $SCSI_Controller.Device) {
                   foreach ($Disk_Device in ($VM.Config.Hardware.Device | where {$_.key -eq $Disk_Key } )) {
                        $rowcoll = "" | select VM, VMController, SCSIBusShare, SCSIBusNumber, SCSIUnitNo, DeviceLabel, SCSISummary, DeviceFilename, DeviceCapKB, DeviceDiskMode,DeviceDiskUUID
                      $rowcoll.VM = $VM.Name
                      $rowcoll.VMController = $SCSI_Controller.DeviceInfo.Label
                        $rowcoll.SCSIBusShare = $SCSI_Controller.SharedBus
                        $rowcoll.SCSIBusNumber = $SCSI_Controller.BusNumber
                        $rowcoll.SCSIUnitNo = $Disk_Device.UnitNumber
                        $rowcoll.DeviceLabel = $Disk_Device.DeviceInfo.Label
                        $rowcoll.SCSISummary = $SCSI_Controller.DeviceInfo.Summary
                        $rowcoll.DeviceFilename = $Disk_Device.Backing.Filename
                        $rowcoll.DeviceCapKB = $Disk_Device.CapacityInKB
                        $rowcoll.DeviceDiskMode = $Disk_Device.Backing.DiskMode
                        $rowcoll.DeviceDiskUUID = $Disk_Device.Backing.UUID
                        $reportfinal += $rowcoll
                   }
              }
         }
    
    }
    
    $reportfinal | Export-Csv -path C:\SAP_Report_Disks_RDM_Mappings.csv -NoTypeInformation
    
  • [Help] Need help with php, Sql variables

    I have a users table contain fiedls "old, new and total."

    When file, update user DEFINED total is $total


    where $total = old + $nouveau

    I did it, I used echo to make sure it's ok, but it's not:

    / * Variable total Count * /.
    $old = ['old'] $row_rs_users;
    $new = $row_rs_users ['new'];
    $total = $vieux + $new;
    echo $total;
    If ((isset($_POST["MM_update"])) & & ($_POST ["MM_update"] == "doit_form")) {}
    $updateSQL = sprintf ("UPDATE users SET total = WHERE id = %s %s",)
    $total,
    GetSQLValueString ($_POST ['id'], "int"));

    Thank you

    As a part of your code, it is impossible to debug.

    However, your approach is bad anyway. All you need to do is add the new value to the old in the SQL query.

    $updateSQL = sprintf("UPDATE users SET total=(total+%s) WHERE id=%s",
                           GetSQLValueString($_POST['fieldName'], "double"),
                           GetSQLValueString($_POST['id'], "int"));
    

    $_POST ['fieldName'] is the new value. Use the 'double' if the value contains a decimal point. If it is an integer, replace 'double' 'int '.

  • How to put the SMS PHP script on the Web site using adobe DreamWeaver

    Where should we found a site that is easy to love your HTML codes with PHP scripts to receive or send TEXT messages? [suspect URL removed by Moderator] so we saw this Web site?

    [suspect URL removed by Moderator] Talking about how to skip the check for text Messages on a Web site, but it is possible to intergrate such a script in PHP coded in a designed HTML tag or the designed Web Adobe Muse site

    You could, but my favorite workflow is to use Dreamweaver for the entire project.  Muse code is very messy work with.

    Nancy O.

  • Passing variables from flash to php script - does not!

    Hey everybody. I was wondering if someone could help me. I use as2 to pass a variable from flash to my php and nothing happened! Here's the action script code that I put on my button:

    (release)

    {

    Amount.Text = 5;

    Form1 = new LoadVars();

    Form1.amount = amount.text;

    form1.sendAndLoad ("http://mywebpage.com/test.php", rise, "POST" ');

    }

    The amount of '5' is now in a dynamic text field with the variable name and instance of amount (which, in the future, will be hidden). This works very well when the button is clicked. What I'm trying to do without success, is to get this value of '5' to my test.php and did echo and it happens simply not . It comes to my php script:

    <? PHP

    $form_inp = $_POST ["amount"];

    If ($form_inp == "'")

    {

    Print "nothing entered < br >".

    }

    on the other

    {

    Print "you entered: $form_inp";

    }

    ? >

    I'm getting "Nothing entered" every time.

    I've tried different ways for the amount.text such as:

    (release)

    {

    Amount.Text = 5;

    Form1 = new LoadVars();

    Form1.amount = this. Amount.Text;

    form1.sendAndLoad ("http://mywebpage.com/test.php", rise, "POST" ');

    }

    and

    (release)

    {

    Amount.Text = 5;

    Form1 = new LoadVars();

    Form1.amount = this ._parent. Amount.Text;

    form1.sendAndLoad ("http://mywebpage.com/test.php", rise, "POST" ');

    }

    etc...

    I also tried to change the variable name in the function sendAndLoad amount to form1 as follows:

    (release)

    {

    Amount.Text = 5;

    Form1 = new LoadVars();

    Form1.amount = amount.text;

    form1.sendAndLoad ("http://mywebpage.com/test.php",form1, "POST");

    }

    and still nothing.

    In my php file, I even tried the GET instead of the POST and it always turns out nothing.

    <? PHP

    $form_inp = $_GET['monto"];

    If ($form_inp == ")

    {

    Print "nothing entered < br >".

    }

    on the other

    {

    Print "you entered: $form_inp";

    }

    ? >

    Additional info:  I put the .swf file and at the same level-.php file in the same folder on my server just to be safe, and the dynamic amount.text text field and button are at the same level in the .swf file.

    Anyone can shed some light on my situation... pretty please? I'm out!

    Thank you very much.

    Ok. So, do not let this thread unanswered, after a looooooong of trial and error, I went to as3 and began to do some testing. It turned out that the register_globals was off on my site and that is why I did not receive the variable passed with the $_POST in my php. So what I finally proposed is the following:

    In my fla/swf doc:

    to import flash.net.URLVariables;

    import flash.net.URLRequest;

    import flash.net.sendToURL;

    var urlVariables:URLVariables = new URLVariables;

    urlVariables.amount = "5";

    var urlRequest:URLRequest = new URLRequest ("http://mirador.mx/oaxaca/disco/receive_test.php");

    urlRequest.data = urlVariables;

    sendToURL (urlRequest);

    In my php file:

    $amount = $_GET ["amount"];

    echo "' AMOUNT IS:". " $amount;

    Now for all of you who have been following this thread, or which can be read in the future, I know that we we started with AS2 and finishing here with AS3 but I didn't know why it worked until I I'm so fed up I've changed in AS3 to see if I could understand. I, like many others I guess, felt a bit intimidated with AS3 and was unwilling to give it a try, but I highly recommend that you dive into it because once get you a grip on it is much more functional.

    So I m going to mark this thread as a response and hope it saves someone else all the time and the frustration that he made me... Good programming!


  • Problem loading the images with the php script.

    As a webdebdesigner that I developed a cms system to download images with php to a mysql database. Firefox version 5.0.1 for MAC and earlier versions have no problem with the script download. But after this version, it is impossible to upload images more large then 250 KB. The page where the customer chooses his image for the download hangs and the form is not sent to the real upload script, which must validate and process the image.
    This problem only occurs in Firefox, all other browsers work fine!
    In addition to this: give feedback for firefox is not possible for the Mac.

    Try announcement Web development / standards evangelism MozillaZine forum. The helpers there are better informed on issues related to the development of website with Firefox.

    http://forums.mozillazine.org/viewforum.php?f=25

    You will need to register and log in to post in this forum.

  • PHP script... where should I put my variables?

    I'm working on a PHP script, and I fill in the parts work but just can't get my head around the menu drop down and radio buttons.  I tried to type in the drop-down list in the part menu items "$body" of it, but then he did that send me everything.  If the sender wants only one thing in the dropdown menu, I just want to see what the customer wanted.  Not what is in all the menu.  E-mail for phone seems to work well but I guessed in the "service menu" drop and the name through comments also works in the part of the body as well but those pull down and radio parts do not send.  I don't know even what a NEM and what to type here or part of results as well.  Help, please!

    <? PHP

    / * Email Variables * /.

    $emailSubject = "contactformprocess.php";

    $webMaster = ' [email protected] ';

    / * Data variables * /.

    $email = $_POST ['email'];

    $name = $_POST ['name'];

    $comments = $_POST ['comment'];

    $phone = $_POST ['phone'];

    $service = $_POST ['web Design'];

    $budget = $_POST ['RadioGroup1_0'];

    $body = < < < NEM

    < br > < hr > < br >

    Name: $name < br >

    E-mail: $email < br >

    Phone: $phone < br >

    Comments: $comments < br >

    NEM;

    $headers = "from: $email\r\n";

    $headers. = "content-type: text/html\r\n";

    $success = mail ($webMaster, $emailSubject, $body,

    $headers);

    / * Results made in the HTML form * /.

    $theResults = < < < NEM

    < html >

    < head >

    < title > < /title > message sent

    < meta http-equiv = "refresh" content = "2; URL =http://thegoldenspindle.com/Contact.html "> "

    < style type = "text/css" >

    OK, you have your problem, script works fine, it is still the misspelling as you did in.

    You have

    But your variable is $service

    Necessary changes service: service

    You have

    But your variable is $budget

    Change Budget: budget, note the caps and the:

    That should do it.

    Gary

    PS, Get rid of this reset button shape, twice I reset instead of sent...

  • Download a file using a php script when running applications with LCD screens

    Hello! I'm developing an application in Flex 2 / Java - running on the LCD / JRun server.

    I'm trying to add downloading features. I use a script php to the download section.

    First, I'm just trying to put the script in the application directory. Does not work.
    After that I created an apache server where I put a small web site with my script. He tells me that my file is downloaded correctly, but I can't find the file. The apache log I don't give no errors.

    Can someone help me?

    Originally, I had problems w / the file placed in C:/whatever.ext b/c I was not using relative paths.

    This is the code I use:
    --------------------------------

    $MAXIMUM_FILESIZE = 1024 * 1024 * 2; 2 MB
    $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);

    }

    ---------------------------

    Editing of 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

  • undefined resutl tryng to get data from flash with php

    Hello

    I'm not a coder, but I understand the way that it work and can handle already-written script. I'm going through with a problem that I do not understand why is happening. I have a php and AS3 to get results from the database. Php works fine since I test. but demand for the Flash gives me a result "undefined". I have a text box on the flash file in which is supposed to show the results of the php. So far, this code:

    AS3:

    import flash.display.*;
    import flash.events.*;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.net.URLVariables;
    import flash.net.URLLoaderDataFormat;
    import flash.net.URLRequestMethod;
    
    
        
    // Assign a variable name for our URLVariables object
    var variables:URLVariables = new URLVariables();
    //  Build the varSend variable
    var request:URLRequest = new URLRequest();
    request.url = "ckBxSample_disp.php";
    request.method = URLRequestMethod.POST;
    request.data = variables;
    // Build the varLoader variable
    var varLoader:URLLoader = new URLLoader();
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    try
    {
        
        varLoader.load(request);
    }
    catch (error:Error)
    {
        trace("Unable to load URL");
    }
    // Handler for PHP script completion and return
          function completeHandler(event:Event):void{
           // Load the response from the PHP file
          if (event.target.data.returnBody == "") {
            output_txt.text = "No data coming through";
          } else {
            output_txt.condenseWhite = true;
            output_txt.htmlText = "" + event.target.data.returnBody;
            
          }
        
        }
    
    // Send the data to the php file
    varLoader.load(request);
    // Ready the variables for sending
    variables.requester = "phpRows";
    
    

    in php:



    If ($_POST ['applicant'] == 'phpRows') {}

    SQL connection code

    then mysql query here

    $sql = mysql_query ("SELECT blah blah blah

    then the while loop for all records, I like to shoot

    While ($Row = blah) {}

    call lines

    $id = $row ['id'];

    sending the results of th calle by flash

    $body = "$id";

    }

    Flash results

    Print "returnBody = $body";

    Close con

    mysql_close();

    Exit();

    }

    It is most of the code and I get a result that is not defined in the text box in flash

    can anyone help? Please

    Thanks in advance

    PHP is badly formatted.  use:

    <>

    I have remove the requirement to show the result of the database

    application of Flash

    ($_POST ['applicant'] == 'phpRows');

    Connect to the databese

    include_once 'connect_to_mysql.php '.

    $tbl_name = 'table_name ';

    $body = "";

    $con = mysql_connect ($mysql_hostname, $mysql_user, $mysql_password)

    or die ("Opps Fail to connect to the host");

    @mysql_select_db ($mysql_database, $con) or die ("Opps fail to connect to database");

    $sql = mysql_query ("SELECT * FROM $tbl_name");

    $result = mysql_query ($sql);

    While ($row = {mysql_fetch_array ($sql))}

    $id = $row ['id'];

    $uname = $row ['uname'];

    $client_song = $row ["client_song"];

    $body = "$id & $uname & $client_song;

    }

    Print $body;

    mysql_close();

    Exit();

    ?>

  • A question about external authentication with PHP OCI8 using a portfolio store

    Hello
    SQL> SELECT * FROM v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE     11.2.0.1.0     Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> 
    OS: Linux Fedora Core 17 (x86_64)
    PHP Version: 5.4.14
    Apache version (httpd): Apache/2.2.23 (Fedora) 
    I have a question about OCI8 connection to the Oracle server via portfolio, which I understand is a good practice because we do not have to hard code the users password. I'm trying to read pages 117 and 118 of the book The Underground PHP and Oracle manual online to learn how to set up a portfolio. I proceeded by steps as explained in these two pages (except that at the end I connect, as a normal user, not a privileged user) yet, apparently PHP does not detect the user.

    Here's what I write in my script
    $connection = 
                    oci_connect 
                        (
                            "training", 
                            "", 
                            "php_ora_usr", 
                            "AL32UTF8"
                        );
    the training is the name of the user that I use in my PHP scripts to connect to the oracle database and the password is mypassword (is not true, just for the purpose of this thread :)) the code above gives me the following error:)
    Warning: oci_connect(): ORA-01005: null password given; logon denied in /var/www/html/myscript.php on line 91
    
    Fatal error: Connection step: ORA-01005: null password given; logon denied in /var/www/html/myscript.php on line 13
    But if I also provide the password which is,
    $connection = 
                    oci_connect 
                        (
                            "training", 
                            "mypassword", 
                            "php_ora_usr", 
                            "AL32UTF8"
                        );
    Obviously it works, but at the same time, this means that my wallet is not operational.

    So I'll write here, step by step, how I did according to the instructions contained in the pages 117 and 118 of the above mentioned book and I would be grateful if you could kindly tell where I made the mistake (s)

    The following text was performed under my oracle linux (so the dbagroup)

    Step 01:_
    I created and provided the password for the directory of portfolio
    mkstore -wrl /home/oracle/wallet_dir -create
    Step 02:_
    I created an entry for my oracle user that will be used in my PHP scripts to connect to oracle
    user: training
    password: mypassword
    mkstore -wrl "/home/oracle/wallet_dir" -createCredential php_ora_usr training mypassword
    I also checked that the entry was actually created for my user in the portfolio
    $ mkstore -wrl "/home/oracle/wallet_dir" -listCredential
    Oracle Secret Store Tool : Version 11.2.0.1.0 - Production
    Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
    
    Enter wallet password:                
       
    List credential (index: connect_string username)
    1: php_ora_usr training
    $ 
    Step 03:_
    I added the following to my $TNS_ADMIN/tnsnames.ora
    .  .  .
    php_ora_usr = 
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = db02)
        )
      )
    .  .  .
    Step 04_
    I added the following to my $TNS_ADMIN/sqlnet.ora
    # sqlnet.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora
    # Generated by Oracle configuration tools.
    
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    
    ADR_BASE = /u01/app/oracle
    
    WALLET_LOCATION =
        (SOURCE =
            (METHOD = FILE)
            (METHOD_DATA =
                (DIRECTORY = /home/oracle/wallet_dir)
            )
        )
    SQLNET.WALLET_OVERRIDE = TRUE
    SSL_CLIENT_AUTHENTICATION = FALSE
    SSL_VERSION = 0
    _ Step 05
    The TNS_ADMIN environment variable is already set correctly in * / etc/sysconfig/httpd * so I didn't need to do something for this step


    Step 06_
    I gave to access Apache (as root) in the directory of portfolio (in fact, it seems that the user oracle (dba) of linux also has the required privileges to grant this access to the apache)
    # setfacl -m u:apache:rx /home/oracle/wallet_dir
    # setfacl -m u:apache:r /home/oracle/wallet_dir/{cwallet.sso,ewallet.p12}
    Step 07_
    Restart Apache
    # service httpd restart
    Step 08_
    Finally make a test connection using the connection string php_ora_usr which the entry was created earlier. And the test was not successful, as indicated above
    $connection = 
                    oci_connect 
                        (
                            "training", 
                            "", 
                            "php_ora_usr", 
                            "AL32UTF8"
                        );
    The error message:
    Warning: oci_connect(): ORA-01005: null password given; logon denied in /var/www/html/myscript.php on line 91
    
    Fatal error: Connection step: ORA-01005: null password given; logon denied in /var/www/html/myscript.php on line 13
    I would appreciate it if you could kindly shed some light.

    Thanks in advance,
    Dariyoosh

    That gives a good clue to begin with. With your platform/Apache/DB, you might need different ACLs. Test directory and permissions. Check what euid your Apache runs as. Good luck.

  • Fill in the fields from a php script

    Hello

    I am filling the fields of text from a PHP script directly in Acrobat Reader.

    Lets not talk about database right now, I just want to know how to take a variable in PHP, right in the form of livecycle designer.

    I've seen a lot of things like submitform() using http post, etc., but I can't make it work.

    Thank you in advance.

    If you want to fill in the LiveCycle Designer form, then you will need to go with the data file.

    The data file can be an XML file or a database or WebService.

    You can't fill out the PDF from a PHP script directly. Is what you can do, a LiveCycle process created in Workbench and then call the PHP application process information. The Livecycle process will merge the data with the model and the PDF back to the client application.

    There is another feature in Acrobat PRO you can import an XML file directly to PDF, but it's a manual work. You cannot link to a PHP Script.

    Thank you

    Srini

  • Using PHP Script?

    Problem with the script php below. I want the name of the file downloaded to appear in the subject line and the body of the email that it generates. It seems that the script is supposed to write the file name in the confirmation (see first if / echo statement), but this does not happen. Also, is there an easy way to redirect to a custom confirmation page?
    Any help would be greatly appreciated!
    Thank you

    The $target variable contains the path and name of the downloaded file.
    The name of the file itself is given by the basename() function, for example,

    <>
    $path = ' / home/httpd/html/index.php ';
    $file = basename ($path); $file has the value 'index.php '.
    $file = basename ($path, ".php"); $file has the value "index".
    ?>

    So - if you want filename to appear in the subject of the e-mail, you
    He would do the same-

    $subject = "new file Upload. ' ' . baseName ($_FILES ['uploaded'] ['name']);

    In other words, concatenate the text 'New file Upload' with a space, and
    then with the name of file, as returned by this function.

    > The script contains two variable $target. Looks like
    > one refers to the directory that contains the downloaded files, while
    > the
    > then designates the directory AND file name.

    In fact the first instance sets $target to the directory and the second
    instance adds the name of the file to the value of this variable (note the '. ' for)
    indicate the concatenation). The $target variable now contains just the
    path to the file.

    To add the file name to the variable $message, you would use-

    $message = "new file". ' - ' . baseName ($_FILES ['uploaded'] ['name']).
    "has been...

    Finally, if the email is sent, then the redirect SHOULD work, assuming that
    Is the name of the correct redirect page-

    Custom - confirmation.php

    --
    Murray - ICQ 71997575
    Adobe Community Expert
    (If you * MUST * write me, don't don't LAUGH when you do!)
    ==================
    http://www.projectseven.com/go - DW FAQs, tutorials & resources
    http://www.dwfaq.com - DW FAQs, tutorials & resources
    ==================

    "TGC80104" wrote in message
    News:g68v2n$4k8$1@forums. Macromedia.com...
    > I tried your suggestions, but no go. I do not know I did something wrong. The
    > modified script is below. Expected the variables $subject and $message
    > include the
    > variable $target as well? The script contains two variable $target. Seems
    > as
    > one refers to the directory that contains the downloaded files, while
    > the
    > then designates the directory AND file name. Example, from scripts
    > first
    > two lines:
    >
    > $target = "Download";
    > $target = $target. baseName ($_FILES ['uploaded'] ['name']);
    >
    > Yes, maybe...
    >
    > $subject = 'New file Upload' $target. basename)
    (> _FILES ['uploaded'] ['name']) $;
    >
    > Or not?
    > Forgive my ignorance, but I'm a complete newbie to PHP.
    > Thanks for your help!
    >
    ><>
    > $target = "Download";
    > $target = $target. baseName ($_FILES ['uploaded'] ['name']);
    $ok > = 1;
    > $to = "enter the email address";
    > $subject = "new file Upload. baseName ($_FILES ['uploaded'] ['name']);
    > $message = "new file". baseName ($_FILES ['uploaded'] ['name']) ' has been
    > downloaded in the DOWNLOAD folder on puremash.com';
    > $headers = ' from: Enter e-mail address. "\r\n".
    > "Reply-To: enter repl - address."\r\n"."
    > ' X-Mailer: PHP /'. phpversion();
    >
    >
    > If (move_uploaded_file ($_FILES ['download'] ['tmp_name'], $target))
    > {
    > echo "the file. baseName ($_FILES ['uploaded'] ['name']). "has been".
    "> uploaded ';
    > mail ($ $subject, $message, $headers);
    > header ("Location: custom - confirmation.php");
    > exit();
    > }
    > {else}
    > echo "Sorry, there was a problem downloading your file.";
    > }
    > If ($uploaded_type == "text/php")
    > {
    > don't echo "no PHP files.
    ";
    $ok > = 0;
    > }
    > If ($uploaded_type == ' text/html')
    > {
    > don't echo 'no HTML files.
    ";
    $ok > = 0;
    > }
    > ?>
    >
    >

  • Working with PHP in Widgets

    Hi, I have just a few questions about PHP with Widgets:

    1. I've read in a few places that you can use PHP in Widgets, but when I tried to include an index.php in my Widget, it notified me that he has not been supported. So I guess I must have my PHP stored on a remote server and bind it using an anchor for example. (Also white list my field).

    If it works, I'm still able to access those Widget API? I have a Javascript with a few Blackberry Menu API file and would like to know if these still work when they are on my remote server.

    2. If I have a remote PHP file and a remote JS file does not work, how I would approach to access a local copy of the JS file that I compiled with the widget?

    I ask these questions because I have a lot of dynamic pages, I'd like to see on my Widget, but would also have the API Widget at hand, as well for menus and other.

    Thank you!

    1. I've read in a few places that you can use PHP in Widgets, but when I tried to include an index.php in my Widget, it notified me that he has not been supported. So I guess I must have my PHP stored on a remote server and bind it using an anchor for example. (Also white list my field).

    Correct... you can not add a PHP page directly in the Archives of your widget.  You can either make it in your widget by white first listing of the URLS in the file config.xml elements and then going to your page via an anchor tag or the definition of the location.href via JavaScript.

    You can also call your PHP via AJAX scripts if you use them to turn the pieces of HTML or data.

    If it works, I'm still able to access those Widget API? I have a Javascript with a few Blackberry Menu API file and would like to know if these still work when they are on my remote server

    Yes, you are still able to access your Widget API from your pages side server.  Each API you wish to access must have its id function declared for the field in the white list.  For example, if your page is located at 'http://www.foo.com' and you want to have access to the API of blackberry.ui.menu... your config.xml element will look like the following:

    http://www.foo.com" subdomains="true">
      
    
    

    This will allow any page that is loaded from the www.foo.com field to access the API JavaScript menu.  This allows you to place the functional parts of your widget where they make sense for your application.

    There is another parameter config.xml that you will be probably interested as well.  You can define your own custom for a BlackBerry Widget header value.  It is thus on your side server PHP code, you can check to make sure that your real widget hitting your PHP script.  The attribute is called "rim: header ' and is located in the root element.  You can consult the Guide to the developer for further details if you are interested.

    2. If I have a remote PHP file and a remote JS file does not work, how I would approach to access a local copy of the JS file that I compiled with the widget?

    Number 1) will work, but you can also do what you ask for (2).  Your PHP page of code on server side, you have white listed and displayed in the widget, has access to your local resources of the widget.  It is quite convenient for common resources that you do not want to draw on the network such as images, css, and JavaScript.

    You can link to these resources by setting their path in your HTML to 'local:///myimage.png '.  The "local: / / /" is a local path that begins at the root of archive widget.  For example if you want to load an image from the local widget it would look like the following:

    
    

    I hope this helps

  • Sending data to the PHP Script

    I am writing an application that needs to send a GET request with parameters (ie: http://blah.com/GET?name=bob) to a PHP script that interacts with a MySQL database on a server.

    Anyone know where I can find a good tutorial on this or point me to another thread?

    You can use URLEncodedPostData (check the documentation for the API).

    You should do something like this:

    
    URLEncodedPostData postData = new URLEncodedPostData(URLEncodedPostData.DEFAULT_CHARSET, true);
    
    postdata.append("www.myurl.com/foobar?");
    postdata.append("name",m_nameParam);
    postData.append("id",Integer.toString(m_locationId));
    postData.append("text",m_checkinText);
    
    return postData.toString();
    

Maybe you are looking for