Jump to content

ddgdsailor

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

About ddgdsailor

  • Birthday 07/01/1961

Contact Methods

  • AIM
    zilakila
  • MSN
    ddg2sailor@live.com
  • ICQ
    14
  • Yahoo
    ddg2sailor@yahoo.com

Profile Information

  • Gender
    Male
  • Location
    Highlands Nj USA

ddgdsailor's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi People My real problem is that I dont know code. I can sort of edit it in a sloppy more or less works fashion. Any help would be great. This is the code Im having problems with: //Example// $id = 0 + $_GET["id"]; $md5 = $_GET["secret"]; $gig = 1; $giveupload = $gig*1024*1024*1024; $res = mysql_query("SELECT passhash, editsecret, status FROM users WHERE id = $id"); $row = mysql_fetch_array($res); $res = mysql_query("SELECT passhash, editsecret, status FROM users WHERE id = $id"); $row = mysql_fetch_array($res); mysql_query("UPDATE users SET status='confirmed', uploaded = $giveupload "); //send pm to new user { $msg = sqlesc("Hello and welcome to Cyber Drive In you have been given a 1gb head start to help your ratio. .we are a strict but fair site and our warning are based on the torrent ratio not the global just because you have a good ratio dont mean you can hit and run if you do hit and run your downloads maybe disabled even if your global ratio is fine..so enjoy our free 1gb gift rules are seed what you take or for 72 hours..plz read the rules and facts now you have joined our friendly community"); $added = sqlesc(get_date_time()); $subject = sqlesc("Welcome to Cyber Drive In"); mysql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES (0, $id, $subject, $msg, $added)"); echo $SQL; } //end example// This does confirm the user (without email , if you call it confirmed) It does add 1gig to the new account. However it dosent seem to want to insert into messages and by doing such send a pm to the user defined in $id. I know this is very basic.... But a friend of mine asked me to help him with his test site. Now I know a bit of html and Im learning a bit of php as I go.... But the MySQL is like maertian to me. Sailor P.S. Had to add some line feeds to make this look ok.. I hope.
  2. btw this is line 201: implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, (!$arr[0]?'confirmed':'pending')))).
  3. Hi People Ive been trying to help a friend with his site. Using google I managed to clear out the white block error... but everything on the web says i should look for a misplaced mark or aphospe or a missing semi colin. But I truth I cant find it. The error seems to be in line 201. Im very new to Php. Thanks for any help Sailor the error message: Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\takesignup.php on line 201 the Code: <? require_once("include/bittorrent.php"); dbconn(); $res = mysql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_row($res); if ($arr[0] >= $maxusers) stderr("Error", "Sorry, user limit reached. Please try again later."); if (!mkglobal("wantusername:wantpassword:passagain:email")) die(); function bark($msg) { stdhead(); stdmsg("Signup failed!", $msg); stdfoot(); exit; } function validusername($username) { if ($username == "") return false; // The following characters are allowed in user names $allowedchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; for ($i = 0; $i < strlen($username); ++$i) if (strpos($allowedchars, $username[$i]) === false) return false; return true; } function isportopen($port) { $sd = @fsockopen($_SERVER["REMOTE_ADDR"], $port, $errno, $errstr, 1); if ($sd) { fclose($sd); return true; } else return false; } /* function isproxy() { $ports = array(80, 88, 1075, 1080, 1180, 1182, 2282, 3128, 3332, 5490, 6588, 7033, 7441, 8000, 8080, 8085, 8090, 8095, 8100, 8105, 8110, 8888, 22788); for ($i = 0; $i < count($ports); ++$i) if (isportopen($ports[$i])) return true; return false; } */ if (empty($wantusername) || empty($wantpassword) || empty($email)) bark("Don't leave any fields blank."); if (strlen($wantusername) > 12) bark("Sorry, username is too long (max is 12 chars)"); if ($wantpassword != $passagain) bark("The passwords didn't match! Must've typoed. Try again."); if (strlen($wantpassword) < 6) bark("Sorry, password is too short (min is 6 chars)"); if (strlen($wantpassword) > 40) bark("Sorry, password is too long (max is 40 chars)"); if ($wantpassword == $wantusername) bark("Sorry, password cannot be same as user name."); if (!validemail($email)) bark("That doesn't look like a valid email address."); if (!validusername($wantusername)) bark("Invalid username."); // make sure user agrees to everything... if ($_POST["rulesverify"] != "yes" || $_POST["faqverify"] != "yes" || $_POST["ageverify"] != "yes") stderr("Signup failed", "Sorry, you're not qualified to become a member of this site."); // check if email addy is already in use $a = (@mysql_fetch_row(@mysql_query("select count(*) from users where email='$email'"))) or die(mysql_error()); if ($a[0] != 0) bark("The e-mail address $email is already in use."); /* // do simple proxy check if (isproxy()) bark("You appear to be connecting through a proxy server. Your organization or ISP may use a transparent caching HTTP proxy. Please try and access the site on <a href=http://torrentbits.org:81/signup.php>port 81</a> (this should bypass the proxy server). <p><b>Note:</b> if you run an Internet-accessible web server on the local machine you need to shut it down until the sign-up is complete."); */ $secret = mksecret(); $wantpasshash = md5($secret . $wantpassword . $secret); $editsecret = (!$arr[0]?"":mksecret()); $ret = mysql_query("INSERT INTO users (username, passhash, secret, editsecret, email, status, ". (!$arr[0]?"class, ":"") ."added) VALUES (" implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, (!$arr[0]?'confirmed':'pending')))). ", ". (!$arr[0]?UC_SYSOP.", ":""). "'". get_date_time() ."')"); if (!$ret) { if (mysql_errno() == 1062) bark("Username already exists!"); bark("borked"); } $id = mysql_insert_id(); //write_log("User account $id ($wantusername) was created"); $psecret = md5($editsecret); $body = <<<EOD You have requested a new user account on $SITENAME and you have specified this address ($email) as user contact. If you did not do this, please ignore this email. The person who entered your email address had the IP address {$_SERVER["REMOTE_ADDR"]}. Please do not reply. To confirm your user registration, you have to follow this link: $DEFAULTBASEURL/confirm.php?id=$id&secret=$psecret After you do this, you will be able to use your new account. If you fail to do this, you account will be deleted within a few days. We urge you to read the RULES and FAQ before you start using torrentbits. EOD; if($arr[0]) mail($email, "$SITENAME user registration confirmation", $body, "From: $SITEEMAIL", "-f$SITEEMAIL"); else logincookie($id, $wantpasshash); header("Refresh: 0; url=ok.php?type=". (!$arr[0]?"sysop""signup&email=" . urlencode($email)))); ?> ---------------------end code---------------------- Im sure this will just jump out at you.. but I have been staring at it all night and I dont have a clue.
×
×
  • 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.