duanjianxiu9400 2011-04-06 21:33
浏览 32

在不改变页面的情况下在php中回应

I have a simple input form on my site for people to enter in information for submission. The code looks like this in the case they do not enter anything:

this is form.php

if ($_POST['q'])  == NULL ){
   echo "Please enter your information"

The code works great, but it sends the user to form.php with the echo, where I want this to be echoed on my main page index.html right below the input box - basically so it doesn't navigate away from the page. Is this doable in php or will I need some javascript. I would have searched for ways to do this but I don't know what this method is called.

Thanks!

  • 写回答

5条回答 默认 最新

  • doukang1962 2011-04-06 21:38
    关注

    dont set a action in the url and it will submit to its self, if that still wont work you will need rewrite rules.

    评论

报告相同问题?