Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用$\u获取html href=?asd_Php - Fatal编程技术网

Php 如何使用$\u获取html href=?asd

Php 如何使用$\u获取html href=?asd,php,Php,我有一个包含输入文本和文本区域的html视图。我做了一个SQL查询,返回一个链接 我想做一个方法,如果我点击链接,我会在html视图中加载到 if(isset($_GET['asd'])){//load to view} 我不知道该怎么做 以下是视图: public function note($title,$text){ ?> <html> <head><title></title> <lin

我有一个包含输入文本和文本区域的html视图。我做了一个SQL查询,返回一个链接

我想做一个方法,如果我点击链接,我会在html视图中加载到

if(isset($_GET['asd'])){//load to view}
我不知道该怎么做

以下是视图:

public function note($title,$text){
    ?>
    <html>
    <head><title></title>
        <link rel="stylesheet" href="view/style.css">
    </head>
    <body>
    <div class="forms">
    <form action="" method="post" class="style-1">
        <input type="text" name="note_title" value='<?php echo $title?>'><br>
        <input type="text" name="note_text" value='<?php echo $text?>'><br>
        <input type="submit" name="sendNote" value="Save">
        <input type="submit" name="cancel" value="Cancel">


    </form>
        </div>
    </body>
    </html>

    <?php

}
但是我不知道如何加载sql结果来查看。我想我的链接错了,我读到了关于
href ans$\u GET
的文章,我看到了:
,但我不知道该如何使用它


有人能帮我解决这个问题吗?

要加载每个视图,请使用键/值对,例如view=editnote

echo "<u><a href='?view=editnote'>".$title."</a></u>";
使用视图中的变量,在每个php语句中添加分号

 <form action="" method="post" class="style-1">
        <input type="text" name="note_title" value='<?php echo $title; ?>'><br>
        <input type="text" name="note_text" value='<?php echo $text; ?>'><br>
</form>


您可以使用键/值对加载每个视图,例如view=editnote

echo "<u><a href='?view=editnote'>".$title."</a></u>";
使用视图中的变量,在每个php语句中添加分号

 <form action="" method="post" class="style-1">
        <input type="text" name="note_title" value='<?php echo $title; ?>'><br>
        <input type="text" name="note_text" value='<?php echo $text; ?>'><br>
</form>

 <form action="" method="post" class="style-1">
        <input type="text" name="note_title" value='<?php echo $title; ?>'><br>
        <input type="text" name="note_text" value='<?php echo $text; ?>'><br>
</form>