2017-04-01 92 views
-2

这是下面的代码,我想知道要在HTML表单中输入onclick属性,以便我可以从一个页面到另一个。如何使用html表单中的onclick属性从一个html页面转到另一个页面

<form class="login-container" action="/var/www/html/upload.php" method="post" enctype="multipart/form-data"> 
    <p> 
    Select Image<input type="file" onchange="previewFile()" class="imageupload" name="image" id="image" placeholder="Select Image"/> 
    <br/> 
    <img src="" height="200" alt="Image preview..."/> 
    <br/> 
    <input type="number" min="1" name="quantity" placeholder="Quantity"/> 
    <br/> 
    <textarea rows="5" cols="40"placeholder="describe how you want the picture to be done"></textarea> 
    <br/> 
    <input type="submit" value="Next" onclick=" "/></p> 
</form> 
+0

你是什么意思,从一个页面到另一个页面? – Panther

+0

当按钮被点击时,表单将被提交,并且它本身会带你到你的'.../upload.php'返回的任何页面。 – nnnnnn

回答

0

当你点击上upload.php的在这里您将您的数据到数据库表的提交按钮都将是后期。 成功插入数据后,在下面的代码中将重定向到另一个页面,您想在按钮单击时打开该页面。

header('location:page2.php');

相关问题