As I am working on Mssql rather than Mysql, I have to try and re-write most of the functions in this script.
I wanted to simplify the check availability process on my username field within registration because mssql doesnt support some of the same commands.
At present I have gotten this far:
Conregister.php
checkuser.phpCode:<p>Username<span class="required">*</span></p> <input name="user_name" type="text" id="user_name" class="required username" minlength="5" > <input name="btnAvailable" type="button" id="btnAvailable" onclick='$("#checkid").html("Please wait..."); $.get("checkuser.php",{ cmd: "check", user: $("#user_name").val() } ,function(data){ $("#checkid").html(data); });' value="Check Availability"> <span style="color:red; font: bold 12px verdana; " id="checkid" ></span>
But on clicking this, it gives me:Code:<?php include 'dbc.php'; foreach($_GET as $key => $value) { $get[$key] = filter($value); } $user = $get['user']; if(isset($get['cmd']) && $get['cmd'] == 'check') { if(!isUserID($user)) { echo "Invalid User ID"; exit(); } if(empty($user) && strlen($user) <=3) { echo "Enter 5 chars or more"; exit(); } $rs_duplicate = mssql_query("select count(*) as total from Consumer where user_name='$user' ") or die(); list($total) = mssql_fetch_row($rs_duplicate); if ($total > 0) { echo "Not Available"; } else { echo "Available"; } } ?>
Fatal error: Call to undefined function mssql_query() in C:\HostingSpaces\JoPoTa\jopota.passingbuys.co.uk\wwwroot\checkuser.php on line 25
and I am not too sure what the problem is.
Is there anyway of getting this to work? And if not, is there a way of simplifying the onclick function to just say "when clicked, check the database and return taken or available" without any of this please wait stuff.
Thanks, Adey


Reply With Quote
Bookmarks