所以,我目前正在学习PHP并正在阅读一本关于密码的md5函数的书,所以我决定尝试一下,看看它是怎么回事.我还决定使用POST方法而不是GET,因为我看到人们说它更安全,并且不会让变量出现在URL上.
对于我的测试项目,我做了一个非常简单的表格,如下:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<form action="dologin" method="POST">
<table border="0">
<tbody>
<tr>
<td>Username:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password"></td>
</tr>
</tbody>
</table>
<input type="submit" value="Login">
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
问题是当我在BOTH字段中输入值并单击"Login"时,我在另一个PHP文件上得到以下输出.
Notice: Undefined index: username in C:\xampp\htdocs\md5\home\dologin\index.php on line 11
Username non existent
Run Code Online (Sandbox Code Playgroud)
以下是"/dologin/index.php"文件的代码
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
mysql_connect("localhost", "root") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());
$query = "SELECT password FROM users …Run Code Online (Sandbox Code Playgroud) 我正在构建一个应用程序,将麦克风的音频记录到文件(.mp3).我希望我的应用程序仅在检测到足够高的幅度时才将数据写入文件.我在尝试保存所选数据时遇到问题.我得到的只是一个快速失真,甚至没有记录下来.
这是我的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NAudio.Wave;
namespace NAudio_Testing
{
public partial class Form1 : Form
{
int counter = 0;
int passed = 0;
private BufferedWaveProvider bufferedWaveProvider;
WaveIn waveIn;
WaveFileWriter writer;
string output = "C:/Users/klein/AppData/Roaming/Microsoft/Windows/gravacao.mp3";
public Form1()
{
InitializeComponent();
waveIn = new WaveIn();
writer = new WaveFileWriter(output, waveIn.WaveFormat);
waveIn.DataAvailable += new EventHandler<WaveInEventArgs>(new_dataAvailable);
bufferedWaveProvider = new BufferedWaveProvider(waveIn.WaveFormat);
bufferedWaveProvider.DiscardOnBufferOverflow = true;
waveIn.StartRecording();
}
private void Form1_Load(object …Run Code Online (Sandbox Code Playgroud)