PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old June 30th, 2005, 12:08 AM
chasteencs chasteencs is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 chasteencs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Major Emergency Help needed with Website

Ive got a php website that im building. Heres my problem. People cant sign-up. My computer is connected to the Server with the site via Local Network. I have no problem Creating accounts, editing them, anything on the Network. But when I try to do it over the net It Wont register users. It gets to the end of the Registration and then Gives me the Following Error... "User Can Not be Registered."

If U can help that would be great. Here is the Link to the Website: http://www.dragonsofzion.com/phpsite/

Thanks for the Help.

If U have any Ideas Please Email me at dunkan@dragonsofzion.com or Post them Here.


Reply With Quote
  #2  
Old June 30th, 2005, 12:24 AM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
RE: Major Emergency Help needed with Website

you need to post the code for the last part of the registration process so we can see what is going on there. Looking at the site alone can not help us determine the problem.

Reply With Quote
  #3  
Old June 30th, 2005, 12:52 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
RE: RE: Major Emergency Help needed with Website


Quote:
you need to post the code for the last part of the registration process so we can see what is going on there. Looking at the site alone can not help us determine the problem.


How do i know what part is the Last part? Im very new to php.

Reply With Quote
  #4  
Old June 30th, 2005, 12:53 AM
chasteencs chasteencs is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 chasteencs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Major Emergency Help needed with Website

Sorry. Last last post was from Me. I forgot to login.

Reply With Quote
  #5  
Old June 30th, 2005, 05:16 AM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
RE: Major Emergency Help needed with Website

Just post all the code that is used to do the registration process.

Reply With Quote
  #6  
Old June 30th, 2005, 06:33 AM
chasteencs chasteencs is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 chasteencs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: RE: Major Emergency Help needed with Website


Quote:
Just post all the code that is used to do the registration process.


Here is the Code for the Entire Register.php File.

php Code:
Original - php Code
  1. $xoopsOption['pagetype'] = 'user';
  2.  
  3. include 'mainfile.php';
  4. $myts =& MyTextSanitizer::getInstance();
  5.  
  6. $config_handler =& xoops_gethandler('config');
  7. $xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
  8.  
  9. if (empty($xoopsConfigUser['allow_register'])) {
  10.     redirect_header('index.php', 6, _US_NOREGISTER);
  11.     exit();
  12. }
  13.  
  14. function userCheck($uname, $email, $pass, $vpass)
  15. {
  16.     global $xoopsConfigUser;
  17.     $xoopsDB =& Database::getInstance();
  18.     $myts =& MyTextSanitizer::getInstance();
  19.     $stop = '';
  20.     if (!checkEmail($email)) {
  21.         $stop .= _US_INVALIDMAIL.'<br />';
  22.     }
  23.     foreach ($xoopsConfigUser['bad_emails'] as $be) {
  24.         if (!empty($be) && preg_match("/".$be."/i", $email)) {
  25.             $stop .= _US_INVALIDMAIL.'<br />';
  26.             break;
  27.         }
  28.     }
  29.     if (strrpos($email,' ') > 0) {
  30.         $stop .= _US_EMAILNOSPACES.'<br />';
  31.     }
  32.     $uname = xoops_trim($uname);
  33.     switch ($xoopsConfigUser['uname_test_level']) {
  34.     case 0:
  35.         // strict
  36.         $restriction = '/[^a-zA-Z0-9_-]/';
  37.         break;
  38.     case 1:
  39.         // medium
  40.         $restriction = '/[^a-zA-Z0-9_-<>,.$%#@!\'"]/';
  41.         break;
  42.     case 2:
  43.         // loose
  44.         $restriction = '/[\000-\040]/';
  45.         break;
  46.     }
  47.     if (empty($uname) || preg_match($restriction, $uname)) {
  48.         $stop .= _US_INVALIDNICKNAME."<br />";
  49.     }
  50.     if (strlen($uname) > $xoopsConfigUser['maxuname']) {
  51.         $stop .= sprintf(_US_NICKNAMETOOLONG, $xoopsConfigUser['maxuname'])."<br />";
  52.     }
  53.     if (strlen($uname) < $xoopsConfigUser['minuname']) {
  54.         $stop .= sprintf(_US_NICKNAMETOOSHORT, $xoopsConfigUser['minuname'])."<br />";
  55.     }
  56.     foreach ($xoopsConfigUser['bad_unames'] as $bu) {
  57.         if (!empty($bu) && preg_match("/".$bu."/i", $uname)) {
  58.             $stop .= _US_NAMERESERVED."<br />";
  59.             break;
  60.         }
  61.     }
  62.     if (strrpos($uname, ' ') > 0) {
  63.         $stop .= _US_NICKNAMENOSPACES."<br />";
  64.     }
  65.     $sql = sprintf('SELECT COUNT(*) FROM %s WHERE uname = %s', $xoopsDB->prefix('users'), $xoopsDB->quoteString(addslashes($uname)));
  66.     $result = $xoopsDB->query($sql);
  67.     list($count) = $xoopsDB->fetchRow($result);
  68.     if ($count > 0) {
  69.         $stop .= _US_NICKNAMETAKEN."<br />";
  70.     }
  71.     $count = 0;
  72.     if ( $email ) {
  73.         $sql = sprintf('SELECT COUNT(*) FROM %s WHERE email = %s', $xoopsDB->prefix('users'), $xoopsDB->quoteString(addslashes($email)));
  74.         $result = $xoopsDB->query($sql);
  75.         list($count) = $xoopsDB->fetchRow($result);
  76.         if ( $count > 0 ) {
  77.             $stop .= _US_EMAILTAKEN."<br />";
  78.         }
  79.     }
  80.     if ( !isset($pass) || $pass == '' || !isset($vpass) || $vpass == '' ) {
  81.         $stop .= _US_ENTERPWD.'<br />';
  82.     }
  83.     if ( (isset($pass)) && ($pass != $vpass) ) {
  84.         $stop .= _US_PASSNOTSAME.'<br />';
  85.     } elseif ( ($pass != '') && (strlen($pass) < $xoopsConfigUser['minpass']) ) {
  86.         $stop .= sprintf(_US_PWDTOOSHORT,$xoopsConfigUser['minpass'])."<br />";
  87.     }
  88.     return $stop;
  89. }
  90. $op = !isset($_POST['op']) ? 'register' : $_POST['op'];
  91. $uname = isset($_POST['uname']) ? $myts->stripSlashesGPC($_POST['uname']) : '';
  92. $email = isset($_POST['email']) ? trim($myts->stripSlashesGPC($_POST['email'])) : '';
  93. $url = isset($_POST['url']) ? trim($myts->stripSlashesGPC($_POST['url'])) : '';
  94. $pass = isset($_POST['pass']) ? $myts->stripSlashesGPC($_POST['pass']) : '';
  95. $vpass = isset($_POST['vpass']) ? $myts->stripSlashesGPC($_POST['vpass']) : '';
  96. $timezone_offset = isset($_POST['timezone_offset']) ? intval($_POST['timezone_offset']) : $xoopsConfig['default_TZ'];
  97. $user_viewemail = (isset($_POST['user_viewemail']) && intval($_POST['user_viewemail'])) ? 1 : 0;
  98. $user_mailok = (isset($_POST['user_mailok']) && intval($_POST['user_mailok'])) ? 1 : 0;
  99. $agree_disc = (isset($_POST['agree_disc']) && intval($_POST['agree_disc'])) ? 1 : 0;
  100. switch ( $op ) {
  101. case 'newuser':
  102.     if (!$GLOBALS['xoopsSecurity']->check()) {
  103.         echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors());
  104.         exit();
  105.     }
  106.     include 'header.php';
  107.     $stop = '';
  108.     if ($xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') {
  109.         if (empty($agree_disc)) {
  110.             $stop .= _US_UNEEDAGREE.'<br />';
  111.         }
  112.     }
  113.     $stop .= userCheck($uname, $email, $pass, $vpass);
  114.     if (empty($stop)) {
  115.         echo _US_USERNAME.": ".$myts->htmlSpecialChars($uname)."<br />";
  116.         echo _US_EMAIL.": ".$myts->htmlSpecialChars($email)."<br />";
  117.         if ($url != '') {
  118.             $url = formatURL($url);
  119.             echo _US_WEBSITE.': '.$myts->htmlSpecialChars($url).'<br />';
  120.         }
  121.         $f_timezone = ($timezone_offset < 0) ? 'GMT '.$timezone_offset : 'GMT +'.$timezone_offset;
  122.         echo _US_TIMEZONE.": $f_timezone<br />";
  123.         echo "<form action='register.php' method='post'>
  124.         <input type='hidden' name='uname' value='".$myts->htmlSpecialChars($uname)."' />
  125.         <input type='hidden' name='email' value='".$myts->htmlSpecialChars($email)."' />";
  126.         echo "<input type='hidden' name='user_viewemail' value='".$user_viewemail."' />
  127.         <input type='hidden' name='timezone_offset' value='".(float)$timezone_offset."' />
  128.         <input type='hidden' name='url' value='".$myts->htmlSpecialChars($url)."' />
  129.         <input type='hidden' name='pass' value='".$myts->htmlSpecialChars($pass)."' />
  130.         <input type='hidden' name='vpass' value='".$myts->htmlSpecialChars($vpass)."' />
  131.         <input type='hidden' name='user_mailok' value='".$user_mailok."' />
  132.         <br /><br /><input type='hidden' name='op' value='finish' />".$GLOBALS['xoopsSecurity']->getTokenHTML()."<input type='submit' value='". _US_FINISH ."' /></form>";
  133.     } else {
  134.         echo "<span style='color:#ff0000;'>$stop</span>";
  135.         include 'include/registerform.php';
  136.         $reg_form->display();
  137.     }
  138.     include 'footer.php';
  139.     break;
  140. case 'finish':
  141.     if (!$GLOBALS['xoopsSecurity']->check()) {
  142.         echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors());
  143.         exit();
  144.     }
  145.     include 'header.php';
  146.     $stop = userCheck($uname, $email, $pass, $vpass);
  147.     if ( empty($stop) ) {
  148.         $member_handler =& xoops_gethandler('member');
  149.         $newuser =& $member_handler->createUser();
  150.         $newuser->setVar('user_viewemail',$user_viewemail, true);
  151.         $newuser->setVar('uname', $uname, true);
  152.         $newuser->setVar('email', $email, true);
  153.         if ($url != '') {
  154.             $newuser->setVar('url', formatURL($url), true);
  155.         }
  156.         $newuser->setVar('user_avatar','blank.gif', true);
  157.         $actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);
  158.         $newuser->setVar('actkey', $actkey, true);
  159.         $newuser->setVar('pass', md5($pass), true);
  160.         $newuser->setVar('timezone_offset', $timezone_offset, true);
  161.         $newuser->setVar('user_regdate', time(), true);
  162.         $newuser->setVar('uorder',$xoopsConfig['com_order'], true);
  163.         $newuser->setVar('umode',$xoopsConfig['com_mode'], true);
  164.         $newuser->setVar('user_mailok',$user_mailok, true);
  165.         if ($xoopsConfigUser['activation_type'] == 1) {
  166.             $newuser->setVar('level', 1, true);
  167.         }
  168.         if (!$member_handler->insertUser($newuser)) {
  169.             echo _US_REGISTERNG;
  170.             include 'footer.php';
  171.             exit();
  172.         }
  173.         $newid = $newuser->getVar('uid');
  174.         if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) {
  175.             echo _US_REGISTERNG;
  176.             include 'footer.php';
  177.             exit();
  178.         }
  179.         if ($xoopsConfigUser['activation_type'] == 1) {
  180.             redirect_header('index.php', 4, _US_ACTLOGIN);
  181.             exit();
  182.         }
  183.         if ($xoopsConfigUser['activation_type'] == 0) {
  184.             $xoopsMailer =& getMailer();
  185.             $xoopsMailer->useMail();
  186.             $xoopsMailer->setTemplate('register.tpl');
  187.             $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
  188.             $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
  189.             $xoopsMailer->assign('SITEURL', XOOPS_URL."/");
  190.             $xoopsMailer->setToUsers(new XoopsUser($newid));
  191.             $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
  192.             $xoopsMailer->setFromName($xoopsConfig['sitename']);
  193.             $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
  194.             if ( !$xoopsMailer->send() ) {
  195.                 echo _US_YOURREGMAILNG;
  196.             } else {
  197.                 echo _US_YOURREGISTERED;
  198.             }
  199.         } elseif ($xoopsConfigUser['activation_type'] == 2) {
  200.             $xoopsMailer =& getMailer();
  201.             $xoopsMailer->useMail();
  202.             $xoopsMailer->setTemplate('adminactivate.tpl');
  203.             $xoopsMailer->assign('USERNAME', $uname);
  204.             $xoopsMailer->assign('USEREMAIL', $email);
  205.             $xoopsMailer->assign('USERACTLINK', XOOPS_URL.'/user.php?op=actv&id='.$newid.'&actkey='.$actkey);
  206.             $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
  207.             $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
  208.             $xoopsMailer->assign('SITEURL', XOOPS_URL."/");
  209.             $member_handler =& xoops_gethandler('member');
  210.             $xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['activation_group']));
  211.             $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
  212.             $xoopsMailer->setFromName($xoopsConfig['sitename']);
  213.             $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
  214.             if ( !$xoopsMailer->send() ) {
  215.                 echo _US_YOURREGMAILNG;
  216.             } else {
  217.                 echo _US_YOURREGISTERED2;
  218.             }
  219.         }
  220.         if ($xoopsConfigUser['new_user_notify'] == 1 && !empty($xoopsConfigUser['new_user_notify_group'])) {
  221.             $xoopsMailer =& getMailer();
  222.             $xoopsMailer->useMail();
  223.             $member_handler =& xoops_gethandler('member');
  224.             $xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['new_user_notify_group']));
  225.             $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
  226.             $xoopsMailer->setFromName($xoopsConfig['sitename']);
  227.             $xoopsMailer->setSubject(sprintf(_US_NEWUSERREGAT,$xoopsConfig['sitename']));
  228.             $xoopsMailer->setBody(sprintf(_US_HASJUSTREG, $uname));
  229.             $xoopsMailer->send();
  230.         }
  231.     } else {
  232.         echo "<span style='color:#ff0000; font-weight:bold;'>$stop</span>";
  233.         include 'include/registerform.php';
  234.         $reg_form->display();
  235.     }
  236.     include 'footer.php';
  237.     break;
  238. case 'register':
  239. default:
  240.     include 'header.php';
  241.     include 'include/registerform.php';
  242.     $reg_form->display();
  243.     include 'footer.php';
  244.     break;
  245. }
  246. ?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > Major Emergenct Help needed with Website


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 8 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek