Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by sqlnoob

  1. depends how many choices the user has.


    otherwise you could try it with a switch statement or an if-else construction




    $userpassword = $_POST["password"];


    if ($userpassword == something)

    echo "<a href='somelink.htm'>back</A>";


    echo "<a href='anotherlink.htm'>back</A>";


    to give you an example

  2. why are you so hellbend on doing that?


    just check if a session, or cookie for that matter is present at the start of the script, if it is not present, then just echo an error message, else show what you normally be showing on the page.


    It's php remember the server is only spitting out raw html, not the php in the source, so you should be relatively safe.

  3.    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";

       $insertGoTo .= $_SERVER['QUERY_STRING'];


    from w3school:


    Definition and Usage

    The stripos() function returns the position of the first occurrence of a string inside another string.


    If the string is not found, this function returns FALSE.


    so you're using the first line to see if there is a string am I right?

    and you use the second line to send a header so that the user goes there, am I right?



    so why not seperate the second line from the if construction and rename the variable like


    $thisinsertGoTo = $insertGoTo . $_SERVER['QUERY_STRING'];


    and then


    header(sprintf("Location: %s", $thisinsertGoTo));



    I'm too much of a noob to know wether this is valid or not



  4. ok so it's this bit that's causing the trouble for you right?


    $insertGoTo .= $_SERVER['QUERY_STRING'];


    what would happen if you defined it as a new variable and gave it another name


    and then place it after the } of the if part, but before this


    header(sprintf("Location: %s", $insertGoTo));[/b]



    would that work for you?



  5. I don't see your problem  ???


    you do this:


    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";

        $insertGoTo .= $_SERVER['QUERY_STRING'];


    do you want to do this?


    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?" . $_SERVER['QUERY_STRING'];



    I'm not sure what you're trying to do.

  6. I think it's because the rowumber for the date is wrong


    or it could be that you echo it too early


    anyway try to numrow it -1 instead of 0, maybe that helps.


    I'm a noob, so don't count your hopes up on my help. Afterall I could be wrong.

  7. I'm doing my site as a hobby, not as something I plan on making a living from, eventhough there's a support page that suggests otherwise.


    you can see it at www.shugo.nl (registration doesn't work yet) and I'm still busy debugging it


    but perhaps it will give you an idea on what you want to do for a project.



  8. all in all I have 4 css files, about 20 or so htm files and 12 php files. A php file containing no more than 200 lines of code and on average about 50 or 75 lines.


    My host allows me to have lots of megabytes on his server and use of 10 databases.


    I only use 1 database and the files total about 250KB in size.



    so you can say my site is very small for a game site  :D

  9. well I don't think my site does all the basics



    for instance I don't even use sessions, only cookies (I know bad practice). I don't do anything with headers.


    Basicly it only relies on use of 3 sql tables, 1 containing the data about the players, a 2nd containing data about the territories and a third that contains messages. The first 2 tables are only updated and I never insert anything in those two, only in the table containing the messages (which I don't even update).


    The attacked.php page is the biggest php page of all, with the most calculations, but the remainder is pretty basic. A simple cart site with sessions has more lines of code than what I have.


    I make use of mktime() and performs calculations on values I get from the sql tables and I make use of if-else constructions and switch , but that's about it.

  10. I myself am quite new at this too. I'm developing a small game website. You know like an mmo. Only my mmo, is more like mo. It's not massive. I'm doing it small, maximum of 32 players.


    OK so you want to develop a website. What is it that you want to develop?


    any thoughts?




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