close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Direct if Username exists using IP and date

Thread began 9/25/2011 10:58 pm by ijk76319396 | Last modified 9/26/2011 4:04 pm by ijk76319396 | 846 views | 5 replies


Direct if Username exists using IP and date

I want to restrict usernames based on IP address and the date. Basically I want the code below to be entered following $loginUsername =

This is the code I want to be there I just don't know how to write it in the redirect if username exists context...

<?php echo((isset($_SERVER["REMOTE_ADDR"]))?$_SERVER["REMOTE_ADDR"]:"") ?>_<?php echo date("Ymd")?>

This is the entire script...

// *** Redirect if username exists
if (isset($_POST[$MM_flag])) {
$loginUsername = NEED TO KNOW WHAT TO PUT HERE???
$LoginRS__query = sprintf("SELECT voterIP FROM points WHERE voterIP=%s", GetSQLValueString($loginUsername, "text"));
mysql_select_db($database_con2com, $con2com);
$LoginRS=mysql_query($LoginRS__query, $con2com) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);

//if there is a row in the database, the username was found - can not add the requested username
$MM_qsChar = "?";
//append the username to the redirect page
if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
$MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requsername=".$loginUsername;
header ("Location: $MM_dupKeyRedirect");

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...