English 中文(简体)
超文本形式行动延伸到错误的地方,不把变数发送到预定的档案中。
原标题:HTML form action goes to wrong place, doesn t send variables to intended file

因此,我几天来一直在与这一斗争,我似乎无法做到这一点。 每当我报到提交书的纽顿时,浏览器就应当寄出员额变量来书写.php,但只是转回网站主页或文件根。 这应该真正简单,我以前就这样做了,但现在我没有工作。 我想知道的是,这是否与我的网络服务器设置或PHP形成问题,或只是我的一个 st错。 它只是一种简单的超文本形式,而不是真正的特殊形式,因此,它本身在指数中就是如此。

<p style="font-size:13px">
<?php
$rp = fopen( mainlog.txt ,  r );
while(!feof($rp))
{
$read = fgets($rp);
echo($read).( <br/> );
}
fclose($rp);
?>
</p>

<form action="write.php" method="post">
Name: <input type="text" name="user" /><br/>
Changes:<br/>
<textarea cols="70" rows="8" name="change" style="background-color:#555;color:#ccc;font-family:verdana,arial,helvetica,sans-serif;font-size:13px"></textarea><br/>
<input type="submit" value="Add Entry"/>
</form>

这里是寄给的,是书面的。 php:

<?php
$fp = fopen( mainlog.txt ,  a );
$wr1 = $_POST[ change ];
#$my_t = getdate(date("g"));
date_default_timezone_set("America/New_York");
$date = date("n").( / ).date("d").( / ).date("Y").( ,  ).date("g").( : ).date("i").( : ).date("s");
$who = $_POST[ user ];
$write = $date.(  by  ).$who.( 
 ).$wr1.( 
 );
fwrite($fp, $write);
fclose($fp);

header( Location: http://www.zennixstudios.com/first/chlog/ );
?>

我在我的阿帕奇·2.2专用服务器上,在PHP 5上,在自由BSD8.2上,以及在XAMPP上,对视窗进行了同样的试验。 我怀疑它可能有一些与购买力平价有关的事情,特别是PHP(包括()),因为我在本页上有几个人,而且当我用XAMPP把这一点放在朋友的电脑上时,没有包括档案,就包括(a) 只是把错误放在屏幕上,而“超文本”则突然操作。 因此,是否有任何已知的以超文本形式出现的冲突和某些购买力平价的功能?

Other Notes: The code shown above for index.php is within the main page div, but if you want the whole page source just ask. I m pretty sure the error isn t in write.php, because I KNOW that the browser never sends anything to it, because it would at least put the date in mainlog.txt. If you want to see what this looks like in context, go to http://www.zennixstudios.com/first/chlog/

Thanks, Chaos

最佳回答

您的问题是:

<table align="right"><tr><td align="right"><form action="/" method="post">Username: <input action="login.php" type="text" name="uname"/><br/>Password: <input type="password" name="passwd"/><br/><input type="submit" value="Login" align="right"/></td></tr></table>

您从来就没有填写用户名和密码的表格,因此,您的<代码><form action=”/“post”>大部分用于整个网页和write.php>。 你们需要把你头盔中的表格关闭,以便妥善工作。

为了重申:没有调整方向,你实际上将所有数据从两种格式上调至具体地点<代码>/

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签