Jump to content

steply

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Posts posted by steply

  1. I've not been able to get an answer to the below elsewhere. So I have found may way here. This code posts to existing files although I need to:

     

    a)Limit bytes written or added.

     

    b) How to add the following to record the date in MySQL:

    <input type="hidden" name="RetEdit" value="<?php echo date('Y-m-d', strtotime("+0 days")); ?>">

     

    <?php

    // umask to maintain file permissions during next procedure

    umask(000);

    $filename = $row_Recordset_rs['ReID'].'__r.txt';

    $fullfilename=$_SERVER['DOCUMENT_ROOT']."/file3/".$filename;

    if (file_exists($fullfilename)) {

    if (isset($_POST['submit']) && isset($_POST['contents'])) {

    if (is_writable($fullfilename)) {

    if ($fp = fopen($fullfilename, 'wb')) {

    $bytes = fwrite($fp, $_POST['contents']);

    if ($bytes === false) {

    echo "Error: could not write to file '{$fullfilename}'";

    }

    else {

    echo "{$bytes} bytes written to file '{$fullfilename}'";

    }

    fclose($fp);

    }

    else {

    echo "Error: could not open file '{$fullfilename}' for writing";

    }

    }

    else {

    echo "Error: file '{$fullfilename}' is not available for writing";

    }

    }

    else {

    if (is_readable($fullfilename)) {

    echo '<form action= "' . $_SERVER['PHP_SELF'] . '" method="post">'

    . '<textarea name="contents" rows="15" cols="80">'

    //for PHP 4.3.0 or newer, which this server has

    . htmlspecialchars(file_get_contents($fullfilename))

     

    . '</textarea><br />'

    . '<input type="submit" name="submit" value="Update Q"></form>' ;

     

    }

    else {

    echo "Error: could not open file '{$fullfilename}' for reading";

    }

    }

    }

    ?>

  2. I need to join a table [to simply drag all recordset column values over into rows. No need for repeat region on page.]

     

    Already I have a seperate result page coming from a search menu.

    This works with the first of the two tables I am using.

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

    SELECT JoID, `Jopot`, Joping FROM posts

    WHERE 'Jopot` LIKE '%colname%'

     

    NAME: colname

    Default: 1

    $HTTP_Get_Vars['Jopot']

     

    Table 'Easy' has a primary 'ID' named this way, with:

    ID

    Epos

    EPost

    EClass

    EStart

    EEnd

     

    note: 'EasID'column appears on this same table 'posts' as a foreign key to table 'Easy' .

    Table 'posts' has:

    JoID (primary, autonumber)

    EasID (foreign to Easy)

    Jopot

    Joping

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

    I've tried SELECT * many different ways but haven't been able to make this move! I've heard perhaps I should itemize these columns one by one to make them display better (for ordering/renaming column). This right?

     

    How would MySQL statement read?

  3. josh,

     

    want to be able to search account information by three options

     

    Don't know if this will help, but by the way I understand it one option may be to apply recordsets for all three results and only display the ones you want by using "show region" server behavior (can be applied to a recordset result directly)

     

    Another option may be to link the tables or do a table join (foreign keys, etc), to help keep everything tidy and then simply drag the resulting recordset fields where you want them. Sounds as if you wouldn't need a repeat region for this.

    (don't know if you have multiple accounts or listings for same company, etc)

     

    I have a related situation, posted today (creating additional select menu; menu names and variables/the statement for this).

     

    Hope this brought you closer.

     

    Brad

     

     

     

     

     

     

     

  4. I am adding a second select menu on a php search pg, with repeat recordset results on the same page. A seperate search independent from the 1st menu; a single word search, different subject, but using the same MYSQL statement. The form action is set to this page address, "get". Also for this 1st select menu : <select name="menu3" >

     

    So menu3 is the run-time variable for the SQL statement.

     

    This breaks into mainly a two part question:

    1) Can I simply double the select name of <select name="menu3" > and use it in to the second select menu on this page or does this new menu need a different select name, in addition to a different name identified with the action?

    2) With the runtime variable of the first menu set to:

    default value 1 $HTTP_GET_VARS['menu3']

     

    -Can I add a second runtime variable, say $HTTP_GET_VARS['menu4'] -- if there needs to be second select name -- Or better yet, is there a way to write them as the same runtime time value together maybe 'menu3,menu4' or how? I don't know. -So the edit will be made easier, cleaner on the page too.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.