How do you post data with a link

后端 未结 7 1959
感情败类
感情败类 2021-01-30 18:15

I have a database which holds the residents of each house in a certain street. I have a \'house view\' php web page which can display an individual house and residents when give

7条回答
  •  后悔当初
    2021-01-30 18:56

    This is an old thread but just in case anyone does come across i think the most direct solution is to use CSS to make a traditional form look like an anchor-link.

    @ben is correct you can use php and javascript to send a post with a link, but lets ask what the js does -- essentially it creates a form with style='display:none' sets an input/text line with value='something' and then submits it.

    however you can skip all this by making a form. setting style='display:none' on the input/text lines (not the form itself as above) and then using CSS to make the button look like a normal link.

    here is an example is i use:

    in PHP Class,

    public function styleButton($style,$text){
        $html_str = "
    "; $html_str .= ""; $html_str .= ""; $html_str .= "
    "; return $html_str; }

    Then in the CSS id="view_form" set "display:inline;" and in the CSS id="view_button" set to something like: "background:none;border:none;color:#fff;cursor:pointer"

提交回复
热议问题