Jump to content

corrupshun

Members
  • Posts

    80
  • Joined

  • Last visited

    Never

Posts posted by corrupshun

  1. I finally started a login script, currently doing a register script first..

    But everything works fine except preg_match

    isn't it supposed to return 1 if it finds a match?

    Well when i submit a username with a character that isn't allowed, it does the same thing as the correct username:

    invalid:#hello hello@hello.com 5d41402abc4b2a76b9719d911017c592 January 08, 2010

    valid:hello hello@hello.com 5d41402abc4b2a76b9719d911017c592 January 08, 2010

    preg_match isn't working, but everything else does.

    what did i do wrong? (Line 7 in functions.php)

    I suck at regex stuff :/

     

    register.php

    <?php
    include('functions.php');
    register();
    ?>
    <html>
    <form name="register" action="register.php" method="POST">
    Username<input type="text" name="username" maxlength="12" />max of 12 characters<br />
    Password<input type="password" name="password" maxlength="20" />max of 20 characters<br />
    Confirm Password<input type="password" name="passwordc" maxlength="20" /><br />
    Email-Address<input type="text" name="email" />for password recovery<br />
    <input type="submit" value="Register!" name="submit" />
    </form>
    </html>

    functions.php

    <?php
    function register() {
    if(isset($_POST['username']) && isset($_POST['password']) && isset($_POST['passwordc']) && isset($_POST['email'])) {
    if(!empty($_POST['username']) && !empty($_POST['password']) && !empty($_POST['passwordc']) && !empty($_POST['email'])) {
    if($_POST['password']==$_POST['passwordc']) {
    if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
    if(preg_match('~^[a-z0-9._-]$~iD', $_POST['username']) == 0) {
    //if(strlen("$_POST['username']<12&&>3)
    $password = md5("$_POST[password]");
    $date = date('F d, Y');
    $username = $_POST['username'];
    $email = $_POST['email'];
    echo "$username $email $password $date";
    }
    else { 
    echo "username contains invalid characters or is too long";
    }
    }
    else {
    echo "email not valid";
    }
    }
    else {
    echo "passwords do not match";
    }
    }
    else {
    echo "One or more fields are empty.";
    }
    }
    else {
    if(!isset($_POST['submit'])) {
    echo "Signup Here";
    }
    }
    }
    ?>

  2. just read an article on regex stuff, found out how to use it then realize it's depricated...

    I finally felt like i understood it!

    function validate_user() {
    if(eregi('^([a-zA-Z0-9._-]{4,12})$', $_POST['username'])) {
    echo "username legit";
    }
    else {
    echo "Username contains invalid characters.";
    }
    }

    how could I take this and make it into preg_match?

    Also tell me how you changed it :P

  3. So what i have so far on the login script checks to see if the information posted is even set, if it's empty, and if the password is the password confrimation.

    It's still very basic and has no login characteristics. I checked over the code for an hour at school (study hall) (irrelevant :P) and cannot find the problem. (the code is below)

    <?php
    if(isset($_POST['username']) && isset($_POST['password']) && isset($POST['password2']) && isset($_POST['email'])) {
    if(!empty($_POST['username']) && !empty($_POST['password']) && !empty($POST['password2']) && !empty($_POST['email'])) {
    if($_POST['password']==$_POST['password2']) {
    //&& (strlen($_POST['username'])<=20){
    $password = md5('$_POST[password]');
    $date = date('F d, Y');
    $username = $_POST['username'];
    $email = $_POST['email'];
    echo "$username $email $password $date";
    echo strlen("$username");
    }
    else {
    echo "passwords do not match";
    }
    }
    else {
    echo "One or more fields are empty.";
    }
    }
    else {
    if(!isset($_POST['submit'])) {
    echo "Signup Here";
    }
    }
    ?>
    <html>
    <form name="register" action="register.php" method="POST">
    Username<input type="text" name="username" /><br />
    Password<input type="password" name="password" /><br />
    Confirm Password<input type="password" name="password2" /><br />
    Email-Address<input type="text" name="email" /><br />
    <input type="submit" value="Register!" name="submit" />
    </form>
    </html>

     

     

    My second question is what I would like to add soon.

    I looked over the filter_var() function on w3schools and didn't see anything for what i wanted.

    for the username I only want to allow the following:

    (A-Z),(a-z),(0-9),dashes, underscores, periods, and spaces. How would I check to see that?

    I would do the regex stuff, which is probably the way to go, but i have NO clue how do use it :)

  4. to add to MrAdam,

    if a random visitor was to put that in the post box, they could inject javascript into the code, they could also add more css elements to completely destroy the page.

    i would make it so that the user cannot type a ' in the [/img] code

    also filter onclick, onblur, onload, onunload, onchange, onsubmit, onmouseover, and onmouseout

  5. alright, one thing i should say is that you should not put the ip address in the <input hidden> option, because people could edit this and pretend.. (although i didn't see the code, i just assume)

    oh also: the BBcode, looks good, i can't seem to xss it but i can make it looked fucked up (just a little)

    http://dannyluked.comze.com/forum/view_topic.php?id=38

    edit:

     

    I REALLY fucked it up

    [img=http://'/><img src='http://dannyluked.comze.com/inc/img/Bottom.png' height='9000' width='9000]

    put that in it :P

  6. I do not understand it.

    Whenever something is going to be replaced it looks like complete crap...

    Can someone explain what this means and explain how you deciphered it?

    <?php
    preg_replace("/(<\/?)(\w+)([^>]*>)/e", 
                 "'\\1'.strtoupper('\\2').'\\3'", 
                 $html_body);
    ?> 

    That is some random code I found on a tutorial for this.. I cannot read it..

    Thanks!

  7. in my honest opinion, and i know you won't want to hear it .. don't bother.

     

    unless you have something dramatically different than the big boys, and a team to implement these ideas faster than they can be stolen, you're just going to get squashed.

     

    the ideas you have will need thousands of development hours, and all for what?  to not even be a blip on the radar of Facebook, MySpace, etc.

     

    start it as a hobby (which as a part-time thing, that's all it really is), and see where it goes.  the worst it can do is make you better with PHP.

     

    instead, try and come up with a single idea that you can refine and make unique .. how twitter did.  they didn't bother to re-create Facebook, instead, they created something that was missing in Social Networking, and took off with it.

     

    you don't know me, and have no reason to trust me (in lieu of me saying, "trust me"), but i have seen similar attempts in doing what has fundamentally already been done, and let's just say, they're all back to the drawing board.

    'twas thinking the same thing

  8. Your social networking idea sounds good but the ads for money thing probably won't attract too many people. Your goal should be pure social networking then later on, if many members join, add in optional ads to make money.

    Other sites you should look at:

    gaminglagoon.com

    lockerz.com (doesn't do ads, will run out of business soon)

    swagbucks.com

    gaminglagoon and swagbucks make the owners of the site rich, but i'd say it's really the one of the most shady parts of the internet.

    I do not feel welcome to their sites, maybe YOU could perfect this

     

    Thank you for the links and advice, can you elaborate on what makes you not feel welcome to their sites? And how they're shady? I'd like for my site to be completely welcoming, giving users the best overall control, say, and experience. And with password recovery, thinking of using the system myspace has with the salute, only much faster service. I forgot my password last march, couldn't get back into my email because it was for my old web site :[, and did the salute, and they kept sending automated responses saying to read the faq, which then directed me to send a salute, etc.

     

    Also would you be interested in working on this project? Lol I only use my spare time, and I figure anyone else with some spare time, and interested in making such a site is more than welcome aboard. I pay for the hosting, and when/if the time comes where userbase requires a server I'll have the funds, plus I get discounts through my university. And I can provide many web development, 3d animation, etc. software :]. But please elaborate, as I'm very insterested in writing these notes down, and ways to solve.

     

    To attract people to your social networking site apposed to Facebook, MySpace and the many others you need something uniquely yours, something that no other social networking site has. That way you will attract people, then you attract advertisers, then you attract investors, then you make a team, then you MAY be rich.

     

    I'm hoping my plan to allow users to redeem money accrued from ads on their pages, and apges they've visited etc. for purchasing things from other users, and possibly even redeeming straight to their paypal/visa etc. In this way I figure, they'll want to be very active, to make real money, for doing nothing more than using the site really. And I'm also hoping by adding real time mmorpgs, and an arcade with literally thousands of games, and stuff, and the option in their settings to basically choose what applications and stuff to appear on their page. But most of all hoping the ringtone feature will attract many. I've just gotta figure out how to get the ringtone to be an attachment to sms from the site, in this way, people can get truly "Free" ringtones, from any songs they upload, and choose what clip from the song, but being an attachment to the message will completely eliminate the data charge :].

     

    Also, can you give any ideas, towards what would make you want to join a new social network site? What dot he others not offer, that you'd go crazy over pretty much, and what about them do you like the most? Thanks again guys for the help, I'm really trying to plan/code this and hopefully launch beta in June :]. Also trying to find people interested in working on the site in their spare time for fun, and if they're also looknig to improve their design skills, and learn. If the site makes money, other than costs of maintaining it, I'd split the money evenly between everyone involved. I've got a career outside of this so this is just a hobby I hope to succeed with. Anyone interested please post in here as well.

     

    What i mean when I say they're shady is that the owners:

    often don't give any support

    don't give a damn if you get to redeem your prize or not

    encourage you to click on ads that you do not have an actual interest in (which is ultimately just stealing money from the people paying for their ads to be viewed anyway)

    I think it's just very mean to for people to click ads they don't have an actual interest in, because someone's losing money somewhere.

    The sites I listed have personally stole from me..

    About 2 years ago i acummulated about $25.00 on the gaminglagoon.com site and when i went to redeem a domain and hosting (back when I was 14 ;))

    They said I cheated and gave me -$500.

    They steal from you stealing from ads.

    That's unethical on both parties; the user's and the sites.

    What I think would do good is to start off slowly not scaring the users away with ads.

    Give them a reason to visit your site and keep the user happy!

    Word of mouth is VERY powerful, keep that in mind as well.

    As for working with you, I'm not the most skilled php writer, but i'm still working on stuff when i have free time.

    Free ringtones, now THAT'S a good idea.

    Let the user upload an mp3 (make sure to make them agree they have rights to it) then allow them to cut the song up into the section they want, and send it to them.

    This is far beyond php, however.

  9. Your social networking idea sounds good but the ads for money thing probably won't attract too many people. Your goal should be pure social networking then later on, if many members join, add in optional ads to make money.

    Other sites you should look at:

    gaminglagoon.com

    lockerz.com (doesn't do ads, will run out of business soon)

    swagbucks.com

    gaminglagoon and swagbucks make the owners of the site rich, but i'd say it's really the one of the most shady parts of the internet.

    I do not feel welcome to their sites, maybe YOU could perfect this

  10. I have a couple of remarks:

    1. If you insert a invalid username you get a not that beautifull looking page

    2. You show weither the username or the password is wrong, hackers can make easy use of this.

        You should always show: Incorrect username or password

    3. There is nowhere an introduction page that gives you info about the game.

        A user will not sign up quickly if he does not know what the game is about

    Hey buddy you forgot the semi-colon in your statment in your sig ;)

    ANYWAY

    site looks secure, don't really know where to go though, like a tutorial would be nice..

  11. Okay first of all i dont disagree with them about the bad design but if im not mistaken this section is for website critique and not for discussing work dividing or other such things.

    As for the site i found the design to be bland i would recommend reconsidering the layout(identical links on both sides) and the looks of a lot of it for example maybe adding some depth or maybe a different font to the links which to me look vary standard and boring. also maybe giving the game a little more breathing room would help, also(kind of goes with layout) i would change some of the alignment so its not all centered

    -Thanks for the response! :)

  12. There is not point trying to be a designer and being a backend programmer of the site, just go to www.themeforest.net and get a template for $10.

    Well, designing websites isn't hard, but rather getting ideas for it is hard. Coding isn't like that (php)

    I like to do both so I'll just continue to work on both :)

    I hate not knowing every piece of code that is running on my website.

     

    You probably cannot  be a expert in both areas becuase of time. You have to pick one, focus your attention at that. The more things you try to expert at the more you divide your attention and time, becoming less of an expert at any given area.

    In team projects everyone is an expert at one thing, and it all comes to together, it can be hard being a solo developer and trying to wear all the hats, buying a template is the easiest way to least lay to rest one of those hats. It might take you awhile to realize this, but its true. :)

    I'm 16, i'm not trying to make money just yet, i'm doing all this for fun :)

    But yeah, eventually i'll prolly end up being a programmer

  13. There is not point trying to be a designer and being a backend programmer of the site, just go to www.themeforest.net and get a template for $10.

    Well, designing websites isn't hard, but rather getting ideas for it is hard. Coding isn't like that (php)

    I like to do both so I'll just continue to work on both :)

    I hate not knowing every piece of code that is running on my website.

×
×
  • 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.