0
我有一个简单的用户名和密码表单,我如何将通过用户输入的值传递到我的php数组中?将表单值传递到我的PHP数据数组中
我的数组
$post_data = array(
'username' => 'user',
'password' => 'pass#',
);
形态 - 阵列
<form action="">
<div class="">
<label><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Login</button>
</div>
</form>
<?php
session_start();
$service_url = 'http://localhost/app/sapi/user/login.xml'; // .xml asks for xml data in response
$post_data = array(
'username' => 'user',
'password' => 'pass#',
);
$post_data = http_build_query($post_data, '', '&'); // Format post data as application/x-www-form-urlencoded