Jump to content

Please I need help with registration form


dhune

Recommended Posts

I will try to explain myself as best as I can.

 

Currently this simple registration form on my website wish only purpose is to take in some basic information at registration does this action on submit---> <form  method="post" action="reg_new_acct.php"> 

 

and after doing so it redirects a user to a confirmation page to login.

 

so today i feel brave  ;D and stupid  ??? and would very much like to throw in a paypal or 2co button into the equation.

 

So by putting in the paypal button, in place place of the original one now of course it is only posting to this on submit ----> <form action="https://www.paypal.com/cgi-bin/webscr" method="post">

 

so basically what i need(me thinks) is to have paypals button submit and return  -->  <form  method="post" action="reg_new_acct.php">  on paypals payment confirmation. sounds like a plan?

 

I just dont have the slightest idea  ??? on how to do this and I'm too broke to pay anyone to do this for me. so I'm here beggin for help like a helpless bug.

 

 

please please please help me.  :'(

 

David

 

P.s this is a copy of the eg_new_acct.php wish the form method is posting to to retrieve registration information, and how do  know this?  I haven't the slightest idea really.  ;)

 

-------------------------------------------------------------------------------------------------------

eg_new_acct.php

 

---------------------------------------------------------------------------------------------------

 

<?php

 

$register = "";

$x = "";

$topleveldomain = "";

 

 

 

if(!empty($_GET)) extract($_GET);

 

if(!empty($_POST)) extract($_POST);

 

 

include('config.php');

 

if(!$register){

 

include('html/header_register.html');

 

 

?>

 

<center><br>

 

<font size=2 face=verdana,arial color=#000000>

<b>Please enter the information below to create a New WebSite Account.</b>

</font>

<form  method="post" action="register_newaccount.php">

  <TABLE>

 

  <TBODY>

 

 

<? if ($domain == "yes") { ?>

 

<TR>

 

      <TD align="right"><font face=verdana,arial size=2>Top Level Domain Name: <b>http://</b></font></TD>

 

      <TD>

 

      <INPUT size="20" type="text" name="topleveldomain">

 

      </TD>

 

    </TR>

 

<? } ?>

 

 

    <TR>

 

      <TD align="right"><font face=verdana,arial size=2>Username</font></TD>

 

      <TD>

 

      <INPUT size="20" type="text" name="newloginID">

 

      </TD>

 

    </TR>

 

    <TR>

 

      <TD align="right"><font face=verdana,arial size=2>Password</font></TD>

 

      <TD>

 

      <INPUT size="20" type="password" name="newpass">

 

      </TD>

 

    </TR>

 

  <TR>

 

      <TD align="right"><font face=verdana,arial size=2>Confirm Password</font></TD>

 

      <TD>

 

      <INPUT size="20" type="password" name="newpass2">

 

      </TD>

 

    </TR>

 

    <TR>

 

      <TD align="right"><font face=verdana,arial size=2>E-Mail Address</font></TD>

 

      <TD>

 

      <INPUT size="40" type="text" name="newemail">

 

      </TD>

 

    </TR>

 

 

 

 

 

    <TR>

 

      <TD colspan="2" align="center"><br>

        <input type="hidden" name="register" value="ok">

        <input type="hidden" name="flash" value="no">

<input type="hidden" name="registertype" value="html">

 

<input type="hidden" name="newuserlevel" value="1">

        <input type="hidden" name="newsavefiles" value="no">

        <input type="hidden" name="newtopbanner" value="yes">

        <input type="hidden" name="newbottombanner" value="yes">

 

        <INPUT type="submit" name="Add User" value="New WebSite Account Signup">

 

      </TD>

 

    </TR>

 

  </TBODY>

 

</TABLE>

 

</FORM>

 

 

 

 

 

 

 

 

 

 

<?

include('html/footer_register.html');

exit;

 

} else {

 

 

 

 

$remote_ip = getenv("REMOTE_ADDR");

 

include('config.php');

 

if(!$newloginID || !$newpass || !$newemail || !$newuserlevel || !$newsavefiles || !$newtopbanner || !$newbottombanner){

 

 

if($flash == "no") {

 

include('html/header_register.html');

echo "<center><br><br><font face=verdana,arial size=2>All fields are required!! Please <A HREF=\"javascript:history.go(-1)\">go back</a></center><br><br>";

include('html/footer_register.html');

exit;

} else {

 

echo "&results=<P ALIGN='CENTER'><B>All fields are required!</b></p>&";

 

exit;

 

}

 

}

 

 

if (ereg("[^a-zA-Z0-9_-_.]",$newloginID)) {

 

if($flash == "no") {

 

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newloginID contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

 

 

echo "&results=<P ALIGN='CENTER'><B>$newloginID contains special characters!</b></p>&";

exit;

    }

}

 

if ($newloginID == "www") {

 

if($flash == "no") {

 

include('html/header_register.html');

echo "<br><br><center><font face=verdana,arial size=2>The username you entered: $newloginID already exists!! Please <A HREF=\"javascript:history.go(-1)\">go back</a><br><br></center>";

include('html/footer_register.html');

exit;

} else {

 

 

echo "&results=<P ALIGN='CENTER'><B>The username you entered: $newloginID already exists!</b></p>&";

exit;

    }

}

 

if (ereg("[^a-zA-Z0-9_-]",$newpass)) {

     

if($flash == "no") {

 

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newpass contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

 

echo "&results=<P ALIGN='CENTER'><B>$newpass contains special characters!</b></p>&";

exit;

    }

 

}

 

if ($newpass != $newpass2) {

     

if($flash == "no") {

 

include('html/header_register.html');

echo "<center><br><br><font face=verdana,arial size=2>Passwords do not match,  Please <A HREF=\"javascript:history.go(-1)\">go back</a> and re-enter your passwords.<br><br></center>";

include('html/footer_register.html');

exit;

} else {

 

echo "&results=<P ALIGN='CENTER'><B>Passwords do not match, please go back and re-enter your passwords.</b></p>&";

exit;

    }

 

}

 

 

if (ereg("[^a-zA-Z0-9_-]",$newuserlevel)) {

   

if($flash == "no") {

 

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newuserlevel contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

 

  echo "&results=<P ALIGN='CENTER'><B>$newuserlevel contains special characters!</b></p>&";

exit;

    }

}

 

 

if (ereg("[^a-zA-Z0-9_-]",$newsavefiles)) {

 

if($flash == "no") {

 

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newsavefiles contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

 

 

      echo "&results=<P ALIGN='CENTER'><B>$newsavefiles contains special characters!</b></p>&";

exit;

    }

}

 

 

if (ereg("[^a-zA-Z0-9_-]",$newtopbanner)) {

 

if($flash == "no") {

 

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newtopbanner contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

 

      echo "&results=<P ALIGN='CENTER'><B>$newtopbanner contains special characters!</b></p>&";

exit;

    }

}

 

 

if (ereg("[^a-zA-Z0-9_-]",$newbottombanner)) {

 

if($flash == "no") {

 

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newbottombanner contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

      echo "&results=<P ALIGN='CENTER'><B>$newbottombanner contains special characters!</b></p>&";

exit;

    }

}

 

 

if (strrpos($newloginID,' ') > 0) {

 

if($flash == "no") {

 

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newloginID contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

echo "&results=<P ALIGN='CENTER'><B>$newloginID contains spaces!</b></p>&";

 

exit;

}

}

 

 

if (strrpos($newpass,' ') > 0) {

if($flash == "no") {

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newpass contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

echo "&results=<P ALIGN='CENTER'><B>$newpass contains spaces!</b></p>&";

 

exit;

 

}

}

 

 

if (strrpos($newemail,' ') > 0) {

if($flash == "no") {

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newemail contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

echo "&results=<P ALIGN='CENTER'><B>$newemail contains spaces!</b></p>&";

 

exit;

 

}

}

 

 

if (strrpos($newuserlevel,' ') > 0) {

if($flash == "no") {

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newuserlevel contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

echo "&results=<P ALIGN='CENTER'><B>$newuserlevel contains spaces!</b></p>&";

 

exit;

 

}

}

 

 

if (strrpos($newsavefiles,' ') > 0) {

if($flash == "no") {

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newsavefiles contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

echo "&results=<P ALIGN='CENTER'><B>$newsavefiles contains spaces!</b></p>&";

 

exit;

 

}

}

 

 

if (strrpos($newbottombanner,' ') > 0) {

if($flash == "no") {

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newbottombanner contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

echo "&results=<P ALIGN='CENTER'><B>$newbottombanner contains spaces!</b></p>&";

 

exit;

 

}

}

 

if (strrpos($newtopbanner,' ') > 0) {

if($flash == "no") {

include('html/header_register.html');

echo "<br><font face=verdana,arial size=2>$newtopbanner contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back</a>";

include('html/footer_register.html');

exit;

} else {

echo "&results=<P ALIGN='CENTER'><B>$newtopbanner contains spaces!</b></p>&";

exit;

}

}

 

if($dbsql == "yes"){

 

include('connect.php');

$result=mysql_query("SELECT *

FROM $tablename");

 

while ($row=mysql_fetch_array($result)){

$id=$row['id'];

$name=$row['name'];

$pass=$row['pass'];

$email=$row['email'];

$userlevel=$row['userlevel'];

$savefiles=$row['savefiles'];

$topbanner=$row['topbanner'];

$bottombanner=$row['bottombanner'];

 

if($newloginID == $name){

 

if($flash == "no") {

include('html/header_register.html');

echo "<br><br><center><font face=verdana,arial size=2>The username you entered: $newloginID already exists!! Please <A HREF=\"javascript:history.go(-1)\">go back</a><br><br></center>";

include('html/footer_register.html');

exit;

} else {

 

echo "&results=<P ALIGN='CENTER'><B>The username you entered: $newloginID already exists!</b></p>";

exit;

}

}

 

$newloginID = strtolower(trim($newloginID));

$lastid=$id;

 

}

 

$nextid=$lastid+1;

 

$userlim=mysql_numrows($result);

 

$query = "INSERT INTO $tablename (id, name, pass, email, userlevel, savefiles, topbanner, bottombanner) VALUES ('$nextid', '$newloginID', '$newpass', '$newemail', '$newuserlevel', '$newsavefiles', '$newtopbanner', '$newbottombanner')";

 

if(!mysql_query($query)) {

    print "error";

exit;

}   

 

mysql_close();

 

} else {

 

$fp = fopen("$userdb","r");

flock($fp,2);

 

while($userinfo = fscanf($fp,"%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n")){

list($id,$name,$pass,$email,$userlevel,$savefiles,$topbanner,$bottombanner)=$userinfo;

 

if($newloginID == $name){

 

if($flash == "no") {

include('html/header_register.html');

echo "<br><br><center>The username you entered: $newloginID already exists!! Please <A HREF=\"javascript:history.go(-1)\">go back</a><br><br></center>";

include('html/footer_register.html');

exit;

 

} else {

 

echo "&results=<P ALIGN='CENTER'><B>The username you entered: $newloginID already exists!</b></p>";

 

exit;

}

}

 

 

$newloginID = strtolower(trim($newloginID));

 

$tmpuser="$id $name $pass $email $userlevel $savefiles $topbanner $bottombanner\n";

 

$x=$x.$tmpuser;

$lastid=$id;

}

$nextid=$lastid+1;

$tmpuser="$nextid $newloginID $newpass $newemail $newuserlevel $newsavefiles $newtopbanner $newbottombanner\n";

 

$x=$x.$tmpuser;

$fw = fopen("$userdb","w");

fclose($fp);

fputs($fw,$x);

 

}

 

 

 

if(!file_exists("$userdir/$newloginID")) {

 

 

 

mkdir("$userdir/$newloginID", 0777);

 

}

 

if(!file_exists("$usercontent/$newloginID")) {

 

mkdir("$usercontent/$newloginID", 0777);

 

 

 

 

$savehtmlfile = "<html><body topmargin=0 bottommargin=0 rightmargin=0 leftmargin=0 bgcolor=#000000>

<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=\"100%\" HEIGHT=\"100%\">

<PARAM NAME=FlashVars VALUE=\"subdomain=$subdomain&userurl=$userurl&userid=$newloginID\">

<PARAM NAME=movie VALUE=\"$webroot/under_construction.swf\"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000000>

<EMBED src=\"$webroot/under_construction.swf\" FlashVars=\"subdomain=$subdomain&userurl=$userurl&userid=$newloginID\" quality=high bgcolor=#000000  WIDTH=\"100%\" HEIGHT=\"100%\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>

</OBJECT>

</body></html>";

 

$file = "$userdir/$newloginID/index.html";

$fh = fopen($file, "w+");

$success = fwrite($fh, $savehtmlfile);

fclose($fh);

chmod ($file, 0777);

 

$savecontentfile = "topleveldomain=$topleveldomain&$newusercontentfile";

$file = "$usercontent/$newloginID/content.txt";

$fh = fopen($file, "w+");

$success = fwrite($fh, $savecontentfile);

fclose($fh);

chmod ($file, 0777);

 

$savechatfile = "";

$file = "$usercontent/$newloginID/chat.txt";

$fh = fopen($file, "w+");

$success = fwrite($fh, $savechatfile);

fclose($fh);

chmod ($file, 0777);

}

 

$EmailMessage2 = "$EmailMessage\n\n";

$EmailMessage2 .= "New Account Information:\n\n";

$EmailMessage2 .= "Username: $newloginID\n";

$EmailMessage2 .= "Password: $newpass\n\n";

 

if($subdomain) {

$EmailMessage2 .= "Your new website address is: http://$newloginID.$subdomain\n\n";

} else {

$EmailMessage2 .= "Your new website address is: $userurl/$newloginID\n\n";

}

 

$EmailMessage2 .= "You can login and edit your site here: $webroot\n\n";

$EmailMessage2 .= "$EmailMessageFooter\n\n";

 

mail("$newemail", "$EmailSubject", $EmailMessage2, "From: $EmailFromAddress");

 

$AdminMessage = "$EmailMessage2\n\n";

$AdminMessage .= "$_SERVER[HTTP_USER_AGENT]\n";

$AdminMessage .= "Remote IP Address: $remote_ip\n";

 

mail("$AdminEmailAddress", "$AdminEmailSubject", $AdminMessage, "From: $newemail");

 

 

if($flash == "no") {

 

include('html/header_register.html');

echo "<br><br><center>New WebSite Account Created!<br><form action=main.php METHOD=\"post\"><INPUT TYPE=\"hidden\" NAME=\"username\" VALUE=\"$newloginID\"><INPUT TYPE=\"hidden\" NAME=\"password\" VALUE=\"$newpass\"><INPUT TYPE=\"submit\" NAME=\"Submit\" VALUE=\"Click Here To Login >>\"><br><br><br></center>";

include('html/footer_register.html');

exit;

} else {

echo "&results=<P ALIGN='CENTER'><B>New account created! Logging you in...</b></p>&newuserlogin=yes&";

 

exit;

}

}

 

?>

 

Link to comment
Share on other sites

oops my bad  :D

 

<?php

$register = "";
$x = "";
$topleveldomain = "";



if(!empty($_GET)) extract($_GET);

if(!empty($_POST)) extract($_POST);


   include('config.php');

   if(!$register){

   include('html/header_register.html');


?>

<center>


<font size=2 face=verdana,arial color=#000000>
Please enter the information below to create a New WebSite Account.
</font>
<form  method="post" action="register_newaccount.php">
  <TABLE>

  <TBODY>


<? if ($domain == "yes") { ?>

<TR>

      <TD align="right"><font face=verdana,arial size=2>Top Level Domain Name: http://</font></TD>

      <TD>

      <INPUT size="20" type="text" name="topleveldomain">

      </TD>

    </TR>

<? } ?>


    <TR>

      <TD align="right"><font face=verdana,arial size=2>Username</font></TD>

      <TD>

      <INPUT size="20" type="text" name="newloginID">

      </TD>

    </TR>

    <TR>

      <TD align="right"><font face=verdana,arial size=2>Password</font></TD>

      <TD>

      <INPUT size="20" type="password" name="newpass">

      </TD>

    </TR>

   <TR>

      <TD align="right"><font face=verdana,arial size=2>Confirm Password</font></TD>

      <TD>

      <INPUT size="20" type="password" name="newpass2">

      </TD>

    </TR>

    <TR>

      <TD align="right"><font face=verdana,arial size=2>E-Mail Address</font></TD>

      <TD>

      <INPUT size="40" type="text" name="newemail">

      </TD>

    </TR>





    <TR>

      <TD colspan="2" align="center">

        <input type="hidden" name="register" value="ok">
        <input type="hidden" name="flash" value="no">
      <input type="hidden" name="registertype" value="html">

      <input type="hidden" name="newuserlevel" value="1">
        <input type="hidden" name="newsavefiles" value="no">
        <input type="hidden" name="newtopbanner" value="yes">
        <input type="hidden" name="newbottombanner" value="yes">

        <INPUT type="submit" name="Add User" value="New WebSite Account Signup">

      </TD>

    </TR>

  </TBODY>

</TABLE>

</FORM>










<?
   include('html/footer_register.html');
   exit;

   } else {




$remote_ip = getenv("REMOTE_ADDR");

include('config.php');

if(!$newloginID || !$newpass || !$newemail || !$newuserlevel || !$newsavefiles || !$newtopbanner || !$newbottombanner){

      
if($flash == "no") {

include('html/header_register.html');
echo "<center>

<font face=verdana,arial size=2>All fields are required!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]</center>

";
include('html/footer_register.html');
      exit;
} else {

   echo "&results=<P ALIGN='CENTER'><B>All fields are required!</p>&";

         exit;

      }

}


if (ereg("[^a-zA-Z0-9_-_.]",$newloginID)) {

if($flash == "no") {

include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newloginID contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {


   echo "&results=<P ALIGN='CENTER'><B>$newloginID contains special characters!</p>&";
   exit;
    }
}

if ($newloginID == "www") {

if($flash == "no") {

include('html/header_register.html');
echo "

<center><font face=verdana,arial size=2>The username you entered: $newloginID already exists!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]

</center>";
include('html/footer_register.html');
      exit;
} else {


   echo "&results=<P ALIGN='CENTER'><B>The username you entered: $newloginID already exists!</p>&";
   exit;
    }
}

if (ereg("[^a-zA-Z0-9_-]",$newpass)) {
       
if($flash == "no") {

include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newpass contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {

   echo "&results=<P ALIGN='CENTER'><B>$newpass contains special characters!</p>&";
   exit;
    }

}

if ($newpass != $newpass2) {
       
if($flash == "no") {

include('html/header_register.html');
echo "<center>

<font face=verdana,arial size=2>Passwords do not match,  Please <A HREF=\"javascript:history.go(-1)\">go back[/url] and re-enter your passwords.

</center>";
include('html/footer_register.html');
      exit;
} else {

   echo "&results=<P ALIGN='CENTER'><B>Passwords do not match, please go back and re-enter your passwords.</p>&";
   exit;
    }

}


if (ereg("[^a-zA-Z0-9_-]",$newuserlevel)) {
     
if($flash == "no") {

include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newuserlevel contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {

     echo "&results=<P ALIGN='CENTER'><B>$newuserlevel contains special characters!</p>&";
   exit;
    }
}


if (ereg("[^a-zA-Z0-9_-]",$newsavefiles)) {

if($flash == "no") {

include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newsavefiles contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {


          echo "&results=<P ALIGN='CENTER'><B>$newsavefiles contains special characters!</p>&";
   exit;
    }
}


if (ereg("[^a-zA-Z0-9_-]",$newtopbanner)) {

if($flash == "no") {

include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newtopbanner contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {

          echo "&results=<P ALIGN='CENTER'><B>$newtopbanner contains special characters!</p>&";
   exit;
    }
}


if (ereg("[^a-zA-Z0-9_-]",$newbottombanner)) {

if($flash == "no") {

include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newbottombanner contains special characters!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {
          echo "&results=<P ALIGN='CENTER'><B>$newbottombanner contains special characters!</p>&";
   exit;
    }
}


if (strrpos($newloginID,' ') > 0) {

if($flash == "no") {

include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newloginID contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {
    echo "&results=<P ALIGN='CENTER'><B>$newloginID contains spaces!</p>&";

exit;
}
}


if (strrpos($newpass,' ') > 0) {
if($flash == "no") {
include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newpass contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {
    echo "&results=<P ALIGN='CENTER'><B>$newpass contains spaces!</p>&";

exit;

}
}


if (strrpos($newemail,' ') > 0) {
if($flash == "no") {
include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newemail contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {
    echo "&results=<P ALIGN='CENTER'><B>$newemail contains spaces!</p>&";

exit;

}
}


if (strrpos($newuserlevel,' ') > 0) {
if($flash == "no") {
include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newuserlevel contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {
    echo "&results=<P ALIGN='CENTER'><B>$newuserlevel contains spaces!</p>&";

exit;

}
}


if (strrpos($newsavefiles,' ') > 0) {
if($flash == "no") {
include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newsavefiles contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {
    echo "&results=<P ALIGN='CENTER'><B>$newsavefiles contains spaces!</p>&";

exit;

}
}


if (strrpos($newbottombanner,' ') > 0) {
if($flash == "no") {
include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newbottombanner contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {
    echo "&results=<P ALIGN='CENTER'><B>$newbottombanner contains spaces!</p>&";

exit;

}
}

if (strrpos($newtopbanner,' ') > 0) {
if($flash == "no") {
include('html/header_register.html');
echo "
<font face=verdana,arial size=2>$newtopbanner contains spaces!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]";
include('html/footer_register.html');
      exit;
} else {
    echo "&results=<P ALIGN='CENTER'><B>$newtopbanner contains spaces!</p>&";
exit;
}
}

if($dbsql == "yes"){

include('connect.php');
$result=mysql_query("SELECT *
         FROM $tablename");

while ($row=mysql_fetch_array($result)){
   $id=$row['id'];
   $name=$row['name'];
   $pass=$row['pass'];
   $email=$row['email'];
   $userlevel=$row['userlevel'];
   $savefiles=$row['savefiles'];
   $topbanner=$row['topbanner'];
   $bottombanner=$row['bottombanner'];

if($newloginID == $name){

if($flash == "no") {
include('html/header_register.html');
echo "

<center><font face=verdana,arial size=2>The username you entered: $newloginID already exists!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]

</center>";
include('html/footer_register.html');
      exit;
} else {

            echo "&results=<P ALIGN='CENTER'><B>The username you entered: $newloginID already exists!</p>";
            exit;
         }
}

$newloginID = strtolower(trim($newloginID));
$lastid=$id;

}

$nextid=$lastid+1;

$userlim=mysql_numrows($result);

$query = "INSERT INTO $tablename (id, name, pass, email, userlevel, savefiles, topbanner, bottombanner) VALUES ('$nextid', '$newloginID', '$newpass', '$newemail', '$newuserlevel', '$newsavefiles', '$newtopbanner', '$newbottombanner')";

if(!mysql_query($query)) {
    print "error";
      exit;
}   

mysql_close();

} else {

$fp = fopen("$userdb","r");
flock($fp,2);

while($userinfo = fscanf($fp,"%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n")){
list($id,$name,$pass,$email,$userlevel,$savefiles,$topbanner,$bottombanner)=$userinfo;

if($newloginID == $name){

if($flash == "no") {
include('html/header_register.html');
echo "

<center>The username you entered: $newloginID already exists!! Please <A HREF=\"javascript:history.go(-1)\">go back[/url]

</center>";
include('html/footer_register.html');
exit;

} else {

            echo "&results=<P ALIGN='CENTER'><B>The username you entered: $newloginID already exists!</p>";

            exit;
      }
      }


$newloginID = strtolower(trim($newloginID));

         $tmpuser="$id $name $pass $email $userlevel $savefiles $topbanner $bottombanner\n";

         $x=$x.$tmpuser;
         $lastid=$id;
}
$nextid=$lastid+1;
   $tmpuser="$nextid $newloginID $newpass $newemail $newuserlevel $newsavefiles $newtopbanner $newbottombanner\n";

      $x=$x.$tmpuser;
      $fw = fopen("$userdb","w");
      fclose($fp);
      fputs($fw,$x);

}



if(!file_exists("$userdir/$newloginID")) {



mkdir("$userdir/$newloginID", 0777);

}

if(!file_exists("$usercontent/$newloginID")) {

mkdir("$usercontent/$newloginID", 0777);




$savehtmlfile = "<html><body topmargin=0 bottommargin=0 rightmargin=0 leftmargin=0 bgcolor=#000000>
<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=\"100%\" HEIGHT=\"100%\">
<PARAM NAME=FlashVars VALUE=\"subdomain=$subdomain&userurl=$userurl&userid=$newloginID\">
<PARAM NAME=movie VALUE=\"$webroot/under_construction.swf\"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000000>
<EMBED src=\"$webroot/under_construction.swf\" FlashVars=\"subdomain=$subdomain&userurl=$userurl&userid=$newloginID\" quality=high bgcolor=#000000  WIDTH=\"100%\" HEIGHT=\"100%\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>
</OBJECT>
</body></html>";

$file = "$userdir/$newloginID/index.html";
$fh = fopen($file, "w+");
$success = fwrite($fh, $savehtmlfile);
fclose($fh);
chmod ($file, 0777);

$savecontentfile = "topleveldomain=$topleveldomain&$newusercontentfile";
$file = "$usercontent/$newloginID/content.txt";
$fh = fopen($file, "w+");
$success = fwrite($fh, $savecontentfile);
fclose($fh);
chmod ($file, 0777);

$savechatfile = "";
$file = "$usercontent/$newloginID/chat.txt";
$fh = fopen($file, "w+");
$success = fwrite($fh, $savechatfile);
fclose($fh);
chmod ($file, 0777);
}

$EmailMessage2 = "$EmailMessage\n\n";
$EmailMessage2 .= "New Account Information:\n\n";
$EmailMessage2 .= "Username: $newloginID\n";
$EmailMessage2 .= "Password: $newpass\n\n";

if($subdomain) {
$EmailMessage2 .= "Your new website address is: http://$newloginID.$subdomain\n\n";
} else {
$EmailMessage2 .= "Your new website address is: $userurl/$newloginID\n\n";
}

$EmailMessage2 .= "You can login and edit your site here: $webroot\n\n";
$EmailMessage2 .= "$EmailMessageFooter\n\n";

mail("$newemail", "$EmailSubject", $EmailMessage2, "From: $EmailFromAddress");

$AdminMessage = "$EmailMessage2\n\n";
$AdminMessage .= "$_SERVER[HTTP_USER_AGENT]\n";
$AdminMessage .= "Remote IP Address: $remote_ip\n";

mail("$AdminEmailAddress", "$AdminEmailSubject", $AdminMessage, "From: $newemail");


if($flash == "no") {

include('html/header_register.html');
echo "

<center>New WebSite Account Created!
<form action=main.php METHOD=\"post\"><INPUT TYPE=\"hidden\" NAME=\"username\" VALUE=\"$newloginID\"><INPUT TYPE=\"hidden\" NAME=\"password\" VALUE=\"$newpass\"><INPUT TYPE=\"submit\" NAME=\"Submit\" VALUE=\"Click Here To Login >>\">


</center>";
include('html/footer_register.html');
      exit;
} else {
      echo "&results=<P ALIGN='CENTER'><B>New account created! Logging you in...</p>&newuserlogin=yes&";

      exit;
}
}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.