Hy Beyler,
Ben PHP yeniyim, ben bahsediyorum PHP kitabı diyor - "gerçek işlev tanımı kodu görünür önce fonksiyonlar çağrılabilir.". Işlevi aşağıda tanımlanmıştır önce _ ama ben alıyorum hata değilim; aşağıdaki kodda, I) (_reg_form arıyorum. Neyi yanlış yapıyorum.
Bir göz için teşekkür ederiz.
<?php
include('common_db.inc');
include('validation.php');
if(!$link=db_connect()) die(sql_error());
if($_POST['submit'])
{
$userid = $_POST['userid'];
$userpassword=$_POST['userpassword'];
$username=$_POST['username'];
$userposition = $_POST['userposition'];
$useremail=$_POST['useremail'];
$userprofile=$_POST['userprofile'];
$result=validate();
if($result==0)
{
reg_form();
}
else
{
mysql_query("INSERT INTO user VALUES(NULL,'$userid',Password('$userpassword'),'$username','$userposition','$useremail','$userprofile')",$link);
}
}
else
{
?>
<?php
function reg_form()
{
echo "<table border='1'>
<form action='form_test.php' method='post'>
<tr><td>Desired ID:</td>
<td><input type='text' size='12' name='userid' /></td></tr>
<tr><td>Desired Password:</td>
<td><input type='password' size='12' name='userpassword' /></td></tr>
<tr><td><input type='hidden' name='submit' value='true' />
<input type='submit' value='Submit' />
<input type='reset' value='Reset' /></td></tr>
</form>
</table>";
}
reg_form();
?>
<?php
}
?>