0
<?
echo '<html>
<script language=javascript>
function validate()
{
    alert("validate");
    document.form1.action="validate.php";
    document.form1.submit();
    return false;
}
function del()
{
    alert("delete");
    document.form1.action="delete.php";
    document.form1.submit();
    return false;
}
</script>

<style>
.id
{
    background-image:url("http://localhost/troubleshoot/imges/bg1.jpg");
    background-position:center;
    background-repeat:no-repeat;
    background-size:2000px 2000px;
    border-radius:5px;
}
table
{
    border-radius:5px;
}
.id1
{
    border-radius:5px;
    background-color:DDDDDD;
}
id3
{
    padding-top:5em;
    padding-bottom:5em;
    height:40px;
}
.id2
{
    text-shadow:0px 0px 5px black;
    color:#FFFFDD;  
    font-size:20;
    font-style:bold;
}
</style>
<body> 
<table width=70% align=center>
    <td><img src="http://localhost/troubleshoot/imges/banner.jpg" height=150 width=100% style="border-radius:5px">
</table>
<table width=70% bgcolor=#3E638C align="center" border=0 style="border-radius:5px;" cellspacing=20>
<tr><td align="center"><a href="home.html"><font color=white>Home</a></td>
       <td align="center"><a href="about.html"><font color=white>About Us</a></td>  
       <td align="center"><a href="articles.html"><font color=white>Articles</a></td>
       <td align="center"><a href="work.html"><font color=white>Work</a></td>
       <td align="center"><a href="contact.html"><font color=white>Contact Us</a></td>
</tr></table>';
$c=mysql_connect("localhost","root","");
mysql_select_db("troubleshoot",$c);
$q=mysql_query("select * from clientbugandsol");
$count=mysql_num_rows($q);
echo "<table width=70% align=center border=1 style='border-radius:5px;'>
<tr><td width=100% align=center> <font face=algerian color='#A52A2A'>There are $count bugs received</tr>
<tr><td>";
$i=1;$j=0;
while($s=mysql_fetch_row($q))
{
    echo "<form name=form1 method=post>
<table width=90% bgcolor='#6CDAF5' align=center>
        <tr><th align=left> Bug $i: </tr>
        <tr><td>Username: <td> <input type=text value='$s[0]' name=username> </td></tr>
        <tr><td>User email-id: <td><input type=text value='$s[1]' name=email> </td></tr>
        <tr><td>User Contact-no :<td><input type=text value='$s[2]' name=contactno> </td></tr>
        <tr><td>Bug: <td><textarea rows=5 cols=40 name=bug>$s[3]</textarea></td></tr>
        <tr><td>Bug-Reason: <td><textarea rows=5 cols=40  name=text1>$s[4]</textarea></td></tr>
        <tr><td>Bug-Solution:<td><textarea rows=5 cols=40 name=text2>$s[5]</textarea></td></tr>
        <tr><td>Updated-date:<td><input type=text value='$s[6]' name=date></td></tr>
        <tr><td width=100% align=right colspan=2><input type=submit value='add this bug with main bugs'  OnClick='validate()'>
        <input type=submit name=delete  value='delete this bug' OnClick='del()'></tr>
        </table><br></form>";

}

echo '  

</body>
</html>';
?>
<html>

</html>

我无法加载资源错误..在执行此代码时,在javascript document.form1.action 中不起作用....所以它不会重定向到另一个页面..我必须清除这个...请帮助我

4

1 回答 1

0

除了您的 html 结构的所有问题之外,我怀疑您遇到的根本问题是您的浏览器找不到 delete.php 文件,我假设该文件与此代码所在的文件位于同一目录中虽然在服务器上这种形式的路径相对寻址会起作用,但一般来说,出于安全目的,浏览器会阻止从主机文件系统加载文件。

更改您的操作以通过您的 localhost Web 服务器(即)访问 delete.php http://localhost/troubleshoot/delete.php,您应该能够加载该文件。

于 2013-06-08T16:47:41.327 回答