Jump to content

Lamez

Members
  • Posts

    1,686
  • Joined

  • Last visited

    Never

Everything posted by Lamez

  1. I think I found my answer in case anyone was wondering take a look here: http://www.c3scripts.com/amazon/docs-virtual.html
  2. the mod that I made a dupe thread, but it is ok, here is my code so far, it is not coming out the way I want it to you can have a look her: http://www.lamezz.info/register.php you can see the pw gate is on the register form it self, so here is my code, please help me out, thanks <?php $path = ""; $title = "Register"; $login = "no"; $ban = "no"; include ($path."main/include/cons/head.php"); echo '<p class="header">Register</p>'; //Check to see if admin wants to enable registration $r = mysql_query("SELECT * FROM `pgs`"); $row = mysql_fetch_array($r); if ($row['reg'] == (0)){ echo '<p class="maintext">Register is disabled at the moment.</p>'; }else{ //checks to see if admin wants to enable pw gate $date = date("l \\t\h\e jS"); $salt = md5($date); $salt2 = md5($salt); $getlink = $_GET[$salt]; $r = mysql_query("SELECT * FROM `site_status`"); $row = mysql_fetch_array($r); if($row['pass_on_reg'] == ('1')){ ?> <form action="" method="post" name="pw_gate"> <label> </label> <table width="336" border="0"> <tr> <td colspan="3">Please enter the password to continue</td> </tr> <tr> <td width="79">Password</td> <td width="156"><input name="password" type="password" id="password" maxlength="30"></td> <td width="87"><label> <input type="submit" name="register" id="register" value="Continue"> </label></td> </tr> </table> <label></label> </form> <?php } } if($row['pass_on_reg'] == ('1')){ if ($getlink == $salt2){ if (isset($_POST['register'])){ if ($_POST['password'] == ($row['reg_pass'])){ echo "correct"; }else{ echo "wrong password"; } } } ?> <SCRIPT TYPE="text/javascript"> function numbersonly(myfield, e, dec) { var key; var keychar; if (window.event) key = window.event.keyCode; else if (e) key = e.which; else return true; keychar = String.fromCharCode(key); // control keys if ((key==null) || (key==0) || (key== || (key==9) || (key==13) || (key==27) ) return true; // numbers else if ((("0123456789").indexOf(keychar) > -1)) return true; // decimal point jump else if (dec && (keychar == ".")) { myfield.form.elements[dec].focus(); return false; } else return false; } //--> </SCRIPT> <? if($session->isAdmin()){ ?> <p class="maintext">Please use the <a href=<?php echo $path; ?>_admin/admin.php>Admin Center</a></p> <? }else{ if($session->logged_in){ ?> <p class="maintext">Please Wait! You are loggin</p> <? } else if(isset($_SESSION['regsuccess'])){ /* Registration was successful */ if($_SESSION['regsuccess']){ ?> <p class="maintext">You are now registered, you may <a href="<?php echo $path; ?>index.php">Login</a>.</p> <? } /* Registration failed */ else{ ?> <p class="maintext">Regisration Error.<br /> <a href="register.php">Try Again</a>?</p> <? } unset($_SESSION['regsuccess']); unset($_SESSION['reguname']); } else{ ?> <p class="maintext"> <font color="#FF0000">All fields are required.</font> <form action="<?php echo $path; ?>main/include/process.php" method="POST"> <table width="100%" height="186" border="0"> <tr> <td width="149" height="24">Username</td> <td width="154"><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>" /></td> <td width="1066"><? echo $form->error("user"); ?></td> </tr> <tr> <td height="24">Password</td> <td><input name="pass" type="password" id="pass" value="<? echo $form->value("pass"); ?>" maxlength="30" /></td> <td rowspan="2"><? echo $form->error("pass"); ?></td> </tr> <tr> <td height="24">ReType Password</td> <td><input name="pass2" type="password" id="pass2" value="<? echo $form->value("pass"); ?>" maxlength="30" /></td> </tr> <tr> <td height="24">E-Mail</td> <td><input type="text" name="email" maxlength="50" value="<? echo $form->value("email"); ?>" /></td> <td><? echo $form->error("email"); ?></td> </tr> <tr> <td height="24">First Name</td> <td><input type="text" name="first" maxlength="50" value="<? echo $form->value("first"); ?>" /></td> <td><? echo $form->error("first"); ?></td> </tr> <tr> <td height="24">Last Name</td> <td><input type="text" name="last" maxlength="50" value="<? echo $form->value("last"); ?>" /></td> <td><? echo $form->error("last"); ?></td> </tr> <tr> <td height="24" colspan="3"><font color="#666666">This will not be shared with anyone, this will only be use if we need to contact you. Ex: 8775551234 (with area code)</font></td> </tr> <tr> <td height="24">Phone Number</td> <td><input name="phone" type="text" id="phone" onkeypress="return numbersonly(this, event)" value="<? echo $form->value("phone"); ?>" maxlength="10" /></td> <td><? echo $form->error("phone"); ?></td> </tr> <tr> <td> </td> <td><input type="hidden" name="subjoin" value="1" /> <input name="submit" type="submit" value="Signup!" /></td> <td align="right"><a href="<?php echo $path; ?>support/forgotpass.php">Forgot Password?</a></td> </tr> </table> </form> </p> </p> <?php if($row['pass_on_reg'] == ('1')){ } } } } include ($path."main/include/cons/foot.php"); ?>
  3. I thought about doing that, but I guess that is the only solution.
  4. what I want to do it make a password gate on my registration page, so you have to have the password to register, well this is not the problem what is, is tell the user the put in the wrong password, for example: user goes to register -> wrong password -> redirects them to password gate, gives them an error -> users tries again. so far here is some sample code I am working with: <?php include ("main/include/session.php"); $date = date("l \\t\h\e jS"); $salt = md5($date); $salt2 = md5($salt); $getlink = $_GET[$salt]; if ($getlink == $salt2) { $error = "yes"; header('Location: npage.php'); }else{ if ($error == ('yes')){ echo "Error Wrong Password<br>"; } echo "Password Gate<br>"; echo '<a href="?'.$salt.'='.$salt2.'">Password</a>'; } ?> but when I click on the link, it returns me like I want it to, but it does not pop up an error like I want, how do I go about doing this? -Thanks
  5. I post in the other form, but a mod gave me a link to this board so here is my question. What I want to do is have a virtual directory based on a user's name from the database, the directory will contain their profile. example: www.krazypicks.com/lamez actual dir: www.krazypicks.com/user/profile.php?user=lamez what will I need to do to make this possiable.
  6. try this: <?php echo "<div><ul id='$i'>"; echo "<li id='".$row[0]."'>".$row[4]."</li>"; echo "</ul></div>"; ?>
  7. lol I just said that so will mine you just have a / at the end, mine does not.
  8. just make a link like so <a href="mailto:<?php echo $email; ?>"><?php echo $email ?></a>
  9. eww I hate slashes lol mine will give you user/bob his will give you user/bob/ lol either way
  10. try this: <?php header("Location: http://(*actuall URL is Here, just hidden for this forum*)/remodesk/user/".$_values); ?>
  11. here you can see what I was trying to say here: http://lamezz.info/pg.php now try to goto http://lamezz.info/page.php first. here is the code: pg.php: <form id="form1" name="form1" method="post" action="page.php"> <label> <input type="submit" name="value" id="value" value="Continue" /> </label> </form> page.php <?php if(isset($_POST['value'])){ echo "Welcome to Page 2"; }else{ header('Location: pg.php'); } ?>
  12. wait I got it, you could have a hidden value, then do a if statement with a isset on the next page so somthing like this on page 3 if(isset($_POST['view'])){ echo "<a href=\"file.zip\">click here</a> to download"; }else{ Location: "index.php?page=2"; } man I think I got this
  13. but once a user figures this out, they could just type in the address bar: index.php?page=3 you need to encrypt the last part after the ? so you could get something like: index.php?a45dfa56f4a65d4d7 but then they could just copy the link and paste around forums across the internet. idk.
  14. wow that did it, it is in there as I signed up with. Thanks for all the help guys
  15. int(10) is what it is as in the database
  16. it is in there as a int I have no query to pull it out just yet, I am looking at it using Phpmyadmin
  17. --DB-- username password userid userlevel email first last phone paid setup rules about age avatar aim yahoo icq msn xfire ban timestamp ------ Here is the script that adds them: <?php /* Errors exist, have user correct them */ if($form->num_errors > 0){ return 1; //Errors with form } /* No errors, add the new account to the */ else{ if($database->addNewUser($subuser, md5($subpass), $subemail, $_POST['first'], $_POST['last'], $_POST['phone'])){ if(EMAIL_WELCOME){ $mailer->sendWelcome($subuser,$subemail,$subpass); } return 0; //New user added succesfully }else{ return 2; //Registration attempt failed } } } ?> here is the addNewUser function: <?php /** * addNewUser - Inserts the given (username, password, email) * info into the database. Appropriate user level is set. * Returns true on success, false otherwise. */ function addNewUser($username, $password, $email){ $time = time(); /* If admin sign up, give admin user level */ if(strcasecmp($username, ADMIN_NAME) == 0){ $ulevel = ADMIN_LEVEL; }else{ $ulevel = USER_LEVEL; } $first = $_POST['first']; $last = $_POST['last']; $phone = $_POST['phone']; $paid = '0'; $setup = '0'; $rules = '0'; $ban = '0'; $avatar = 'user/usrava/default.jpg'; $q = "INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '0', $ulevel, '$email', '$first', '$last', '$phone', '$paid', '$setup', '$rules', '$about', '$age', '$avatar', '$aim', '$yahoo', '$icq', '$msn', '$xfire', $ban, $time)"; $total = "0"; $rnd1 = "0"; $rnd2 = "0"; $rnd3 = "0"; $rnd4 = "0"; $rnd5 = "0"; $champ = "0"; $qu = "INSERT INTO `userpoints` VALUES ('$username', '$total', '$rnd1', '$rnd2', '$rnd3', '$rnd4', '$rnd5', '$champ')"; include ("mailadmin.php"); mysql_query($qu, $this->connection); return mysql_query($q, $this->connection); } ?> hope that helps you to help me
  18. thanks that helped, well now I looked in the database and it is not storing the phone numbers right. Example: 8775778990 Outcome: 2147483647 why?
  19. oh man I found out what was wrong, is there a way to check to see if it is numbers only?
  20. First you need to connect to the database, do you know how to do that? Then you need a action script here is a good example (I wrote this, but it has been a while since I have done this) $data = $_POST['textfield']; mysql_query("INSERT INTO table VALUES ('$data')");
  21. yes that is post data ($subphone) it is defined earlier. I could put this phone number 8065798990 in the field and it returns as it was too small, under 10 digits. Is there a way to fix that?
  22. My phone validation cannot read 0's here is my code : $field = "phone"; if(empty($_POST['phone'])){ $form->setError($field, "* Phone Number not entered"); } else{ $subphone = stripslashes($subphone); if(strlen($subphone) < 10){ $form->setError($field, "* Phone Number too short"); } }
  23. how would I do that? ???
×
×
  • 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.