Calling a particular PHP function on form submit

后端 未结 6 1248
星月不相逢
星月不相逢 2020-11-28 22:11

I was trying to call a particular php function in submit of a form both the form and php scripts are in same page. My code is below.(it is not working and so I need help)

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 22:46

    you don't need this code

    
    

    Instead, you can check whether the form is submitted by checking the post variables using isset.

    here goes the code

    if(isset($_POST)){
    echo "hello ".$_POST['studentname'];
    }
    

    click here for the php manual for isset

提交回复
热议问题