You are here: Re: hlp regarding Registration Form « All PHP « IT news, forums, messages
Re: hlp regarding Registration Form

Posted by Danny on 08/16/06 14:15

Hi Mark,

Thnx 4 the hlp. But i already have the submit button which will
invoke the register.php page...thats y i used a button which invokes
javascript function(i know i'm complicating myself!)...which inturn
invokes PHP function!!!...pls hlp me to simplify my code.

here is my code:

<?php
include_once "siteincludes.php";
require_once "dbconnect.php";
function test($name)
{
$msg="";
$query="select * from tblusers where username='".$name."'";
$result=mysql_query($query);
if(mysql_num_rows($result)==0)
{
$msg="<font color='green'>"."User ID is not available!"."</font>";
}
else
{
$msg="<font color='red'>"."User ID is available!"."</font>";
}//end of else
echo $msg;
}
?>
<body>
<form name="registrationfrm" action="register.php" method="post">
User ID:<input type="text" name="cname">
<button onclick="checkuser()">Check Availability!</button>
<h6 id='display' name='display'></h6>
<script language=javascript>
function checkuser(){
name=document.registrationfrm.cname.value;
display.innerHTML="<?php $name='"+name+"'; test($name);?>";
}
</script>
</form>
</body>

Thanks,
Danny.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация