php/mysql/javascript question

  • Started
  • Last post
  • 1 Response
  • frankosonik

    For every page on a web site, I'm creating a separate content management page using php/mysql. The content management page has a JavaScript that allows the user to add HTML tags without having to know HTML.

    The javascript is referenced in name attribute of the textarea tag with the name "editentry," like this:

    textarea name="editentry" cols="30" rows="30"
    php echo $row_Recordset1['p_ind_txt'];
    /textarea

    The problem is the php can't change the entry in the database unless the name attribute is the same as the database field ('p_ind_txt'). And the JavaScript won't work if the name attribute is not "editentry."

    Aside from making a separate JavaScript file for each content management page, how can I get this to work with the JavaScript and the database record?

    Thanks!

  • welded0

    Can't you just assign "p_ind_txt" to be equal to "editentry" before submitting it?
    $p_ind_txt = $_POST['editentry'];
    Or whatever.