Jump to content

Gath

Members
  • Posts

    39
  • Joined

  • Last visited

Posts posted by Gath

  1. Hi. I'm looking at this site i'm building for so long, i'm kind of blocked...

     

    Having a menu list, with several links (Link1, Link2, Link3), and then when certain conditions are met (server wise) Link 4 is visible, then eventually Link 5, and so on.

    I would prefer not to have the links already in the page (invisible), for security reasons, and make them "visible" only when the user achieved certain steps (server side).

    I would also like this to be "server resources friendly" as possible. This point is very important.

    What i got so far is updating the full menu list everytime the user does something, and check the conditions to see certain links. But this isnt cutting it.

     

    Any ideas?

     

    Not sure if this should be a JavaScript / jQuery question. Only started in jQuery a few days back, i'm still very green in it.

     

     

    Thanks.

  2. So, alghouth i know there are results in the db, i keep getting 0 as mysql_num_rows.

     

    $check = mysql_query("SELECT login FROM db_login WHERE login=\"$email\"");
    $check_rows = mysql_num_rows($check);
    
    if ($check_rows > 0)  blablabla
    
    

     

     

    The result from $check_rows is always 0. I'm lost. Any help?

    Using 5.3.9 php.

  3. Hi.

    Dunno if this is the correct section, but if it isnt, wich one is? :o

     

     

    Anyway, the question is:

     

    how can you know what kind of hosting will you need, so the follwing doenst happen:

    - your site uses too mutch resources on shared hosting, and hte company cancels your account,

    - your site uses 1% of resources on dedicated server, so you waste a pile of $$,

     

    I understand bandwith, amount of users, what i dont know is how mutch resources (RAM/CPU) does a site uses.

     

    I have a project that is in final stages, when it goes online it might, with some luck, and if the publicity works as intended, draw a big amount of users. I have no idea what kind of hosting i should get, sicne all projects i been in so far were somewhat small, shared host was fine. Now, knowing i can have a numbers, that goes from 1 000 up to 20 000 visitors by day, gets me completly lost on how mutch resources it takes...

     

    True, with those numbers my best bet would be dedicated host, but... money is a problem at the moment  :-X cant 'afford to waste', or else the project wont ever see the light of day :s

     

     

     

    So, any guides on how mutch 'power' one needs on hosting?

  4. Like above, i think that in that specific situation, it doenst really matter. Make it bigger, just so you dont have to think about it later.

    Having perfect sizes for column types, comes handy in big projects/db.

     

    But, dont exagerate, like i seen, to give bigint(30) to something that wont ever pass, ever, 6 digits!

  5. Altought i had some interest on Guitar Hero, i never actually played it, or even saw it.

     

    That said, this isnt the place to know if something is legal or not. Altought i'm starting to hate this sentence, but, 'google is your friend'.

     

    Also, after that said. Even if it's illegal... that doenst make it less profitable.

    Also, after saying this... if you actually make something 'illegal' you will be hated by a million people, and you better make sure your site is secure... to the extreme.

     

     

  6. Hi.

     

    So, was thinking about stuff, and so on, when i tryed to understand how the backend of something like the hi5 profile voting would work.

    Basically, we have a member, wich profile other members can vote on, once. How to keep track of that?

    I found someplace saying that the amount of members is 50 millions.

    So, i assume that having a 'pre-made' DB with yes/no for votes for each of the other members, is... not quite possible  :P

    But, making a record for each vote, also gets some quite large numbers. Assuming only 10% of the members vote, and they vote for 5 people, that's still 25 million records.

    Ok... some of you might not consider it that big, i do. Biggest DB i worked with had about 60k records only  ;)

     

    But, is that the way it works, or there might be other methods?

     

    Curiosity...

  7. Hi.

     

    I placed a simple counter in some of my pages. It works like it should... except, every now and then it... resets. And i cant figure out why. I dont know to what exact number it resets, sicne i dont know when it actually happens. First time i noticed it the counter should be at around 5000, but was at around 300. Second time, was over 1000, but it became at 200. And those are the ones i noticed, maybe some pages 'resetted' more often. Dunno.

     

    Code is placed in the very end of hte file, none variable is used before.

     

    <?php
    $fp = fopen("counter.txt", "r");
    $count = fread($fp, 8000);
    fclose($fp);
    $count = $count + 1;
    $fp = fopen("counter.txt", "w");
    fwrite($fp, $count);
    fclose($fp);
    ?>

     

    Any ideas?

  8. Hi.

     

    Any place i can get a listing of the Forums created with PHP?

    I got a list from wikipedia (comparison of internet forum software (php)), but i dotn find what i want  :-\

     

    Anyother place i can get a list like that? Yes, i tryed google, doenst get me there...

     

    Thanks.

     

    Look for open source php forum distributions. Probably the best place to look for them is on an open source repository such as SourceForge -

     

    http://www.sourceforge.net

     

    Aye, i had forgotten about sourceforge (actually, no... i just didnt had mutch results with it lately, so i hadnt used it...), but after i had post, i gone look in it, and i found exactaly (almost, very close) what i was looking for.

     

    Not wanting to make publicity, since i'm not using it fully, yet, but:

    http://www.usebb.net/

    Looks very good.

  9. Hi.

     

    Any place i can get a listing of the Forums created with PHP?

    I got a list from wikipedia (comparison of internet forum software (php)), but i dotn find what i want  :-\

     

    Anyother place i can get a list like that? Yes, i tryed google, doenst get me there...

     

    Thanks.

  10. Hi...

     

    I want to get a 'security' trigger on a loop based on the time it has run. What would be the best way to do this?

    With 'break'? The loop is opening a file, but the file is on a diferent network, what is the way i take to place the break?

    Check time before open, and check time 'after'? I dont understand if the second check would happen even if the loop would... halt or something.

    Hmm, i guess i'm confused...

     

    Thanks for any info.

     

  11. You will need to use a server side language to tell your server to download the file from the other server.

     

    That's the problem, i dont have access to the receiving server. I can do any code/change on the server that is 'sending' the file, but nothing on the other.

     

    Any 'trick' i could use? The page from where the form will leave is of restricted access, i dont need to worry about any security, it would just make sooooo mutch if people could send the file by the server, instead of using an upload.

  12. When you solve this - let me know - I have a multilingual site in progress and I am scared to death at how I am going to display and process chinese, japanese, hebrew and those ####### french letters with the dash on the top etc etc etc...

     

    Those are not french. Unless by dash you mean "á", and still, saying they are french, isnt accurate.

  13. Hi.

     

    I know i read something about this someplace, but i looked and cant find it again.

     

    The question is:

     

    using PHP, i have a piece of code that does:

    -query SELECT

    -3 lines of code manipulating the result i got

    -query UPDATE

     

    The entire code takes a few ms of time to run.

     

     

    Now, pretend two people are using the same file at the exact same time, is it possible for the user_B to have the SELECT in the middle of the SELECT-UPDATE of user_A?

     

    I think i read someplace that the connection to hte DB would "halt" untill the entire script as run. Yes/no?

     

     

    Thanks.

  14. Cron would be easier on your system. do you really wanna run an sql statement every time a person loads a page just to see if a certain amount of time has passed?  That would be less productive than a single cron job ever so often.

     

    I'd prefer not to have cron because every place i knew had a cron, and created similar "turns", would lag down everytime the turn would take place. Not very important when one has a small amount of users, but becomes kind of a drag when the community becomes big.

    Also, since i still have to make around 2-3 sql query per page, so, having some code checking the time isnt that big of a deal.

     

    But... i'll try both ways :) Then i'll check how it goes with one and hte other  ;)

    Thanks for the input.

  15. I'm kind of sleepy, so dont take my words as completly correct... it might not be :)

     

    But, yes, a DB instead of an array.

     

    And the DB, i' not sure i understood correctly the amount/relation of data, so i'll just trow some example:

     

    id(model number?), name, type, associated_1, associated_2, some_other_data

     

    So, 1 table should do it, as 300 isnt that mutch.

  16. Hi.

     

    What i want is to have a way for users to get a certain amount of "turns" every certain time (let's say 10 minutes = 1 turn). What are my options? So far i planned a way that checks the last time the user saw a page, and gives him the amount of "turns" depending on the time it passed.

    But i'm wondering if there might be other/better ideas.

    I could set somekind of cronjob, but i dont like that idea mutch. I'd rather have it update independently then in "batch".

     

    So, if you have any ideas that you'd like to share... i'm listening  :)

  17. Hi.

     

    I'm kind of lost. Trying to prevent that a subject from a message board to be created with only spaces, but cant manage to make it work.

     

    if (!empty($_POST['topic_title']))
    {
    $topic_title = ereg_replace ( "^[ \t]+|[ \t]+$", '', $topic_title );
    if (strlen ($topic_title) < 3)
    	{
    	$topic_title = '';
    	}
    	else mysql_query (INSERT ... ... ... );	
    };

     

    The only thing that might be working wrong is the ereg_replace, except, i copy/pasted it from another script i use and it works fine there.

     

    Any ideas?

  18. but when showing it on a page, it comes out exactaly like it was typed. (pretty mutch like this forums  ;) )

     

    try viewing the source of the online page.;)

     

    its pretty secure.. depends what of protection your after..

     

    Yes, i keep inputting all weird combinations of symbols and such, checked the page, and it comes out alright.

     

    What protection i'm after... hmm... well, to stop anything that could be done "against" the site/db, really  :)

    sql injection, and anykind of 'exploit' to the code/db.

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