1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Naming-Writing and Retrieving from ….

Discussion in 'PHP' started by tin2mon, Sep 17, 2010.

  1. #1
    Hi there,

    I have this time an unusual request to which I like to find an answer if possible. I’m using ADOBE FLEX 3 as the main application!

    Within my ‘LogIn’ file I have this code:
    ‘$tableName’ the variable is getting its text information directly from the FLEX 3 App.

    Original Code:
    SEMrush
    <?php
    // Writing Table Name to Text file.
    $filename = "tableName.txt";
    file_put_contents($filename, $tableName);
    exit;
    ?>


    Within another file I have this code calling the text information of that file to be used as the ’$tableName’ variable:

    Original Code:

    <?php
    // Recover table name from text file to use as a static variable for a SELECT statement.
    $filename = "tableName.txt";
    $fh = fopen($filename, 'r');
    $tableName = fread($fh, filesize($filename));
    ?>


    ***********************************************
    Everything works fine this way, but I would like to do something different. I would like to use in the ‘LogIn’ file this code to give the text file also the same variable name! I have tried it and it worked! ??? Any better Ideas ???


    $filename = "$tableName.txt";


    Now of course I would like to retrieve my information and I have
    only this in my file send from the FLEX 3 App. to write my Xml –
    Dom 4 information.

    <?php
    if (isset($_POST['fullName'])) {
    $title = $_POST['title'];
    $fullName = $_POST['fullName'];
    }
    ?>


    Or another similar file:


    <?php
    if (isset($_POST['lastName'])) {
    $firstName = $_POST['firstName'];
    $lastName = $_POST['lastName'];
    }
    ?>


    The question here is now:
    How would I be able to use the details e.g. FirstName, LastName Or FullName to 'ID' the file name and the name within!

    I would appreciate if somebody could help to steer me into the write direction or somebody has some code lines to solve this problem.
     
    tin2mon, Sep 17, 2010 IP
    SEMrush
  2. imperialDirectory

    imperialDirectory Peon

    Messages:
    395
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    So you looking for firstName, lastName or fullName columns info within a static file? What type of formatting is that file, is it CSV?
    Will be easier to give you an answer if you can copy and paste some sample data
     
    imperialDirectory, Sep 17, 2010 IP