需要简单的PHP帮助,但我还不知道php

时间:2015-06-03 20:39:37

标签: php hyperlink

<div class='rate-results'>
<div class='button-container'>
    <input type='submit' id='btn-calculate' class='pure-button pure-button-primary' value='{$a['label_button_continue']}'></input>
</div><div class='rate-container'>
    <div class='label_calculated_rate'>{$a['label_calculated_rate']}</div>
    <div id='calculated_rate'>{$a['default_price']}</div>
</div>

如何应用此按钮的链接?

['label_calculated_rate']  

似乎拉文本

&#34;得到报价&#34;

从上面的代码,但我无处可以找到如何将此按钮变为链接。上面提到的代码如下......

static function handle_shortcode($atts){
        self::$add_script = true;
        self::$add_styles = true;

            $a = shortcode_atts( array(
            'title' => 'Get a FREE Price Estimate',
            'label_days' => 'Total days of coverage needed?',
            'units_days' => 'days',
            'label_attendance' => 'Estimated daily attendance?',
            'units_attendance' => 'people',
            'label_event_type' => 'What type of event is it?',
            'label_sample_certificate' => 'View sample certificate',
            'link_sample_certificate' => '#',
            'label_button_continue' => 'Get Free Quote',
                        'label_calculated_rate' => 'Estimated Cost',
            'default_price' => '$ 95.95',
            'form_action' => 'javascript:void(0);',
            'default_event_type' => ""
        ), $atts);

        return "<form action='{$a['form_action']}' id='main_calculator' class='pure-form pure-form-aligned' data-default-event-type='{$a['default_event_type']}'>
        <h3 class='title'>{$a['title']}</h3>

1 个答案:

答案 0 :(得分:0)

替换

<div class='label_calculated_rate'>{$a['label_calculated_rate']}</div>

<a href="http://www.w3schools.com/html/"><div class='label_calculated_rate'>{$a['label_calculated_rate']}</div></a>

http://www.w3schools.com/html/替换为您希望按钮链接到的位置。

因此添加了一个指向按钮的链接:

['label_calculated_rate']