Jump to content

Zhadus

Members
  • Posts

    376
  • Joined

  • Last visited

    Never

Posts posted by Zhadus

  1. It is the input field, it's not actually a PHP related question - it's straight HTML.

     

    Don't you just LOVE HTML? :)

     

    By the way, here is a quick fix, use the HTML code for the double quotation:

    $var = "The length is 5' x 2" and blah blah";
    

    It will output correctly for you and show up right, just a pain to work with.

     

    EDIT:

    " might work in place of " and a bit easier to use.
    

  2. I say write one from scratch, they aren't extremely difficult to code correctly, and then you can add the features that you want. Avoid the cookie-cutter designs as much as possible and have something that again is just "yours."

     

    Anything I've personally incorporated into a site from a pre-made system has been more hassle than it's worth and I usually end up recoding half of it anyway, but I have not had personal experience with pre-made comment systems.

  3. $end error means you have a bracket that's left open.

     

    The { bracket at the beginning after you use <?php is not needed and is causing the problem from what I can tell, although I'm not sure what the whole switch() thing is about.

  4. You can use some javascript and when a link is clicked make it disappear until the page is loaded again.  Or if you are using buttons you can disable them.  Then they couldn't click on it again until the page is reloaded.

     

    This would work, but when working with people who have fun exploiting your games, they can and will disable javascript or bypass it completely with their own javascript scripts.

  5. It's caused because you're doing the check to see if a creature attacks after the player has a chance to move. If they continually click the move links, the page doesn't have enough time to load the creature encounter. You can have the movement links go through a different page, checking for a creature attack, and then redirecting to the movement page instead, then it wouldn't matter how fast they click it.

  6. Before your for loop of the records:

    for($i=0; $i<$number_to_display; $i++) {
    

    You can add this bit of code:

    $number_to_display = ($number_to_display > $total_files) ? $total_files : $number_to_display;
    

     

    That way if the number to display (In this case 9) is greater than the total number of files, the number to display is changed to the actual number of files.

  7. You got it, the 2nd is probably more of what you're looking for. Although from what I see, you could probably avoid most of the work.

     

    You already know what $cust_id is according to the query, I don't see why you'd need to draw the same data from the DB when it's the same info you passed into the query.

  8. Well you have this:

    $row = odbc_fetch_array( $rs );
    

    followed by

    while ( $row = odbc_fetch_array( $rs ) )
    

    Which would eliminate the first record. Unless you're refering to the first record of transaction, which would really be the 2nd record.

  9. process.php will contain variables that draw the posted variables, e.g.:

     

    <?php
    $firstname = $_POST['firstname'];
    $email = $_POST['email'];
    $location = $_POST['location'];
    $id = $_POST['id'];
    ?>
    

     

    And after getting the variables like that, you use the variables ($firstname, $email, etc.) to update using the code you posted for MySQL. For instance, if you were going to just update a location:

     

    mysql_select_db("roberts_work", $connect);
    
    mysql_query("UPDATE tblbasicform SET location = '" . $location . "'
    WHERE name = '". $firstname . "' AND email = '" . $email . "'");
    
    mysql_close($connect);
    

     

    Understand it now?

  10. Learn the awesome use of loops. And arrays are more friendly than you think.

     

    <?php
    function getNum($min, $max) {
        $num = rand($min, $max);
        return $num;
    }
    
    for ($x = 0; $x < 6; $x++) {
        $b[] = getNum(1, 49);
    }
    
    for ($x = 1; $x < 6; $x++) {
        while ($b[$x] == $b[($x-1)]) {
             $b[$x] = getNum(1, 49);
        }
    }
    
    sort($b);
    
    $output = implode(", ", $b);
    echo $output;
    ?>
    

     

    Ack, beat me to it. Same idea, just a little different route.

     

  11. I apologize for all the long delays, trying to help you out while at work here ;)

     

    I'm still having some difficulty with what you're incorporating this system into. It seems to me like you're not grasping the full concept of what functions are capable of and what is required of them. In order to maintain the same action, you'll have to pass it into the address bar. If it is possible it will have different actions, you'll need to pass the current action INTO the function. Therefore instead of what I had stated with:

     

    $prev = " <a href=\"$self?action=allsalestoday&page=$page&$strGet/\">[Prev]</a> ";
    

     

    You would want the function to be like this:

    $action = $_GET['action'];
    function allsales_Today($action) {
    // etc.
    

    and the link would be:

    $prev = " <a href=\"$self?action=$action&page=$page&$strGet/\">[Prev]</a> ";
    

     

    I hope my understanding was clear enough.

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