我正在使用PHP,我正在创建一个表单发布到的操作页面.页面检查错误,然后如果一切正常,它会将它们重定向到已发布数据的页面.如果没有,我需要将它们重定向回到它们所处的页面,并显示错误和POST变量.以下是它如何运作的要点.
HTML看起来像这样......
<form name="example" action="action.php" method="POST">
<input type="text" name="one">
<input type="text" name="two">
<input type="text" name="three">
<input type="submit" value="Submit!">
</form>
Run Code Online (Sandbox Code Playgroud)
action.php看起来像这样......
if(error_check($_POST['one']) == true){
header('Location: form.php');
// Here is where I need the data to POST back to the form page.
} else {
// function to insert data into database
header('Location: posted.php');
}
Run Code Online (Sandbox Code Playgroud)
如果出现错误,我需要将其POST回第一页.我不能使用GET,因为输入太大了.如果可能的话,我不想使用SESSION.这可能吗?
表格1
id1 ==>数字
id2 ==>数字
id希望id1包含uniqe编号,id2包含唯一编号.
如何设置id1和id2 primary key?
如果有人可以帮我弄清楚为什么浏览器无法加载图像会很棒(错误404).代码工作,图像源是正确的,但我无法弄清楚出了什么问题.(使用localhost)
$dir = '/home/user/Pictures';
$file_display = array(
'jpg',
'jpeg',
'png',
'gif'
);
if (file_exists($dir) == false) {
echo 'Directory \'', $dir, '\' not found!';
} else {
$dir_contents = scandir($dir);
foreach ($dir_contents as $file) {
$file_type = strtolower(end(explode('.', $file)));
if ($file !== '.' && $file !== '..' && in_array($file_type, $file_display) == true) {
echo '<img src="', $dir, '/', $file, '" alt="', $file, '" />';
}
}
}
Run Code Online (Sandbox Code Playgroud) 我想用 typeorm 连接到 oracle
createConnection().then(async connection => {
const app = express();
const userRepository = getRepository(User);
const users = await userRepository.find();
console.log(users);
app.listen(3000);
}).catch(error => console.log("xxx",error));
Run Code Online (Sandbox Code Playgroud)
ormconfig.json是在./Myproject/ormconfig.json但说错误:错误:在任何 orm 配置文件中找不到连接选项。
通过这些设置,我已经使用 oracledb 连接到数据库。
请帮我
更新
我用这个生成项目typeorm init --name MyProject --database oracle。这是 typeorm 的默认结构。
我正在使用ckeditor格式化我的内部数据 textarea
<textarea id="editorAbout" rows="70" cols="80" name="editorAbout"></textarea>
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试使用jQuery.ajax这样的方式发布此数据时,
var about=escape( $("#editorAbout").text());
$.ajax({
type: "POST",
url: "../Allcammand.aspx?cmd=EditAboutCompany&about="+about,
type:"post",
async: false ,
success: function(response){
},
error:function(xhr, ajaxOptions, thrownError){alert(xhr.responseText); }
});
Run Code Online (Sandbox Code Playgroud)
我收到了错误
HTTP错误414.请求URL太长.
我在这里收到错误:http://iranfairco.com/example/errorLongUrl.aspx
尝试单击该页面左下角的" 编辑文本"按钮.
为什么会这样?我该如何解决?
表:UserTypes
领域:row,name,Type
此代码无效:
Int64 row = 1;
var myType = (from b in dc.UserTypes where b.Row == user.Row select b).Single();
myType.Type = "personalPage";
dc.SubmitChanges();
Run Code Online (Sandbox Code Playgroud)
但是,这段代码确实......
dc.ExecuteQuery<UserType >("update dbo.UserType set Type='personalPage' where row={0}",user.Row);
我收到此错误:
键入单词是一个单词reserved.i不能用户单词
Type
编辑
DBML
[Table(Name="dbo.UserType")]
public partial class UserType
{
private long _Row;
private string _Type;
public UserType()
{
}
[Column(Storage="_Row", DbType="BigInt NOT NULL")]
public long Row
{
get
{
return this._Row;
}
set
{
if ((this._Row != value))
{
this._Row = value;
} …Run Code Online (Sandbox Code Playgroud) 我想得到网址的扩展文件.
例如,获取扩展名http://www.iranfairco.com/download-file/02912bb889cb24.如果扩展名此文件是gif.
编辑:
例如这个网址"http://www.online-convert.com/result/d8b423c3cbc05000cc52ce7015873e72"
请帮帮我如何获得这个网址的扩展?
我想在laravel Excel中为所有行应用高度和宽度
我可以通过使用以下代码来更改单个行的高度和宽度
$sheet->setSize('A1', 25, 18);
$sheet->setSize('B1', 25, 18);
$sheet->setSize('C1', 25, 18);
$sheet->setSize('D1', 25, 18);
$sheet->setSize('E1', 25, 18);
$sheet->setSize('F1', 25, 18);
Run Code Online (Sandbox Code Playgroud)
现在的问题是我有成千上万的行,那么我该如何管理呢?
我有以下代码
\Excel::create('Users Report'.$time, function ($excel) use ($arrUsers) {
$excel->sheet('Users', function ($sheet) use ($arrUsers) {
// Set all margins
$sheet->fromArray($arrUsers, null, 'A1', true);
$sheet->setSize('A1', 25, 18);
$sheet->setSize('B1', 25, 18);
$sheet->setSize('C1', 25, 18);
$sheet->setSize('D1', 25, 18);
$sheet->setSize('E1', 25, 18);
$sheet->setSize('F1', 25, 18);
$sheet->row(1, array(
'Name', 'Username', 'Contact', 'Email', 'Verified', 'Inactivity'
));
// Freeze first row
$sheet->freezeFirstRow();
$sheet->cell('A1:F1', function($cell) {
// …Run Code Online (Sandbox Code Playgroud) HtmlTable baseCalendar = new HtmlTable();
HtmlTableRow calendarRow=new HtmlTableRow();
HtmlTableCell calendarCell = new HtmlTableCell();
for(int i=0;i<6;i++){
calendarCell = new HtmlTableCell();
calendarCell.Controls.Add(new LiteralControl(i.ToString()));
calendarCell.Style.Add("color", "red");
calendarRow.Cells.Add(calendarCell);
}
string resutlt=baseCalendar.innerHtml.Tostring();
Run Code Online (Sandbox Code Playgroud)
这行说错误:HtmlTable'不支持InnerHtml属性?????
datacontextclass dc=new datacontextclass ();
var news= dc.GetNewsCompany(Int64.Parse ( _idCompany));
if (news.GetEnumerator().MoveNext())
{
foreach (var item in news)
{
drpListNews.Items.Add(item.Title);
}
}
Run Code Online (Sandbox Code Playgroud)
返回错误:{"查询结果不能多次枚举."}
如何检查结果!= LINQ中的null;
asp.net ×4
c# ×4
php ×3
html ×2
linq ×2
linq-to-sql ×2
ajax ×1
header ×1
javascript ×1
jquery ×1
laravel ×1
ms-access ×1
node.js ×1
oracle ×1
post ×1
primary-key ×1
response ×1
sql-server ×1
typeorm ×1
typescript ×1