Jump to content

Fadion

Members
  • Posts

    1,710
  • Joined

  • Last visited

Posts posted by Fadion

  1. When the user posts the flight, u can insert in a specific column (maybe in the users table in a column like lastPost) the actual date and time. When he tries to post another flight, compare the database time with the actual date and time and if it is more then one hour let him post. When he posts again, override the old date so the process starts all over.

  2. Hmm u need to know some stuff dude, as passing variables between pages with post, get or sessions and use the mail() function of php. Id suggest u to learn the basics and in just a few days we'll be able to start thinking of a logic for what u want.

  3. the key to mutiple selects is to assign it an array name, so php interprets it as an array.

     

    <select name="time[]" size="4" multiple="multiple">

     

    to use those values use this simple code

     

    $arr = $_POST['time'];
    foreach($arr as $time){
       echo $time . "<br />";
    }
    

  4. As noone has replied to this, im gonna give my 2 cents. Ive been using dreamweaver for ages making html/css sites and from some time also for php. In my opinion it is the best all around editor and especially for html. As far as php is concerned it isnt offering too much, just site managment, code coloring and some pretty basic code hinting. With some extensions one can make it a bit more advance but still it remains mediocre. While Zend Studio (ive used it just a couple of times) has some exeptional code hinting and coloring, real time code highlighting and very powerful debugger. The debug thing is pretty good because with dreamweaver u have to rely only on php error display which makes debugging complex scripts a pain in the a**. For long and complex scripts id suggest using zend studio, otherwise id stick to dreamweaver as it offers a very flexible environment allowing to easily insert html and css.

  5. Ok i just made a test and u can use count($_POST) to count the number of inputs u have, assuming u have only the input texts passed to post. So:

     

    $nrPpl = count($_POST);
    

     

    Also u may have a submit button which is also passed to post, so u can check:

    if(array_key_exists('submit', $_POST)){
       $nrPpl = count($_POST) - 1;
    } else{
       $nrPpl = count($_POST);
    }
    

  6. Dont know if i got it completely right but anyway. U can create a hidden input where u pass the number of people the user entered (or just use get for that). When u recieve them make a loop to get the data from post ex:

     

    $nrPpl = $_POST['nrpeople'];
    for($i=1; $i<=$nrPpl, $i++){
        echo $_POST['input$i'];
    }
    

     

    I assumed u named the input boxes as input1, input2 etc. Hope it helped.

  7. lol almightyegg. Guess that for your needs number_format() will work ok, but printf() is way more powerful. And yep 2 defines how many decimal space. If your number is ex. 23.456, using 2 as number of decimal spaces, it will print 23.457, rounding the last decimal digit.

  8. $new_pentotal = $result_getplayer_pens + $ahpm;

    that line returns u nothing, as $result_getplayer_pens is just the mysql_query. To retrieve the data u must use mysq_fetch_array within a loop. Smth like:

     

    while($values_player_pens = mysql_fetch_array($result_getplayer_pens)){
            $new_pentotal = $values_player_pens['columnValue'] + $ahpm;
            //update query and stuff
    }
    

  9. Id suggest using a target _blank in your link, as popups are annoying and at most cases blocked by anti popup software. Anyway the idea in your script is to open a new file, ex profile.php and pass a url variable that may be the id of the user. Im writing the sample without the popup call, but it would give u and idea:

     

    echo "<a href='profile.php?id={$qry['id']}'>{$qry['name']}</a>"
    

     

    U can have a profile.php with a standart template for the user (ex. full name, email, phone, description) and fill those values by getting the id of the selected users from the url variable using $_GET.

  10. If it was an extension then u'd have to compile it with php, but fortunately it is a class so u dont have to worry about the host. To use use it just upload it and include it in your page (from the examples in their website u have to include 'class.phpmailer.php'). About guides and tutorials, the documentation at

    http://phpmailer.sourceforge.net/docs/

    and their usage example

    http://phpmailer.sourceforge.net/extending.html

    should have u started.

  11. Barand posted a nice and simple approach, but as we're in strings manipulation:

     

    For counting all the characters in a text:

    $text = 'This is just some short text';
    echo count(explode(' ', $text)); //it will print => 6
    

     

    For printing how many times each character is used in a text:

    $text = 'This is just some other short text';
    foreach(count_chars($text, 1) as $key=>$val){
          echo "Character: " . chr($key) . " is used $val times<br />";
    }
    

  12. Guess u should ask this question to the drupal community forums or smth. Anyway, what do u mean 'to display it when enabled'? The if statement u wrote cant make it as ure checking '$block' without initializing it with 'module_invoke'.

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