Jump to content

priti

Members
  • Posts

    461
  • Joined

  • Last visited

Posts posted by priti

  1. - Change your database and other  credentials first  and do not share with anyone. Please note you may need to change in on website configuration as well.

    - In case, you are have API, use API credentials

     

    Also, I think you can ask iphone app support and enquire about the owner of the app as everyone has to register on site before making it availabel on app store.

  2. There are some error I noticed

     

    $total = Donation::totalDonated;
    $count = Donation::numberOfDonors;
    

     

    Must be

     

    $total = Donation::$totalDonated; //static variables
    $count = Donation::$numberOfDonors; //static variables
    

     

    Second In Destructor

     

    Donation::$totalDonated = Donation::$totalDonated - $donation;
    //$donation is not a class property !
    Donation::$numberOfDonars--;    //variable name is wrong it must be "numberOfDonors" NOT numberOfDonars...check for "a"
    

     

    You fix these thing I think your code will work for sure.

  3. Hi All,

     

    I have a piece of code from php.net

     

    
    if (!ctype_alnum($username) || !preg_match('/^(?:[a-z0-9_-]|\.(?!\.))+$/iD', $userfile)) {
       die("Bad username/filename");
    }
    

     

    I do not understand "/D" ! I know of /g, /i OR /m for multi line..

     

    can someone please help me understanding this expression.

  4. Considering, you have your result set in $results.

     

    echo '<table>';

    foreach($results as $k=>$v)

    {

      echo '<tr>';

        foreach($v as $field)

      {

          if(trim($field['colname']) != '')

              echo '<td>'.$field['colname'].'</td>';

      }

      echo '</tr>';

    }

    echo '</table>';

     

    Hope it helps.

     

  5. The quick view list two problems

     

    1.$tester = $value / 25; to $tester = $value / 26; 

     

    This will resolve your problem after value 40

     

    secondly, you are calling recursively function letters() and in your function letters() there is not exit condition hence when the value reaches to 52.... it  recursively call letter() function and results in different character string. You need to control the execution of letter() function on some condition.

     

    Thanks.,

  6. well I have seen system implementing the same concept in PHP by writing the generalized class . If it is ONLY for one directory then you can think of  making the folder password protected by using Apache .The suggested solution is little graceful in comparison [As per my thoughts].

     

    Or else let wait for some other people to jump with more thoughts :).

  7. You can define ACL mechanism where in you specify which url  are private. Private pages do not need to be viewed by site users hence when ever site user come across such page you can always re-direct to index page or some error page.

  8. 1.

    You want all un-read mails?

    select * from mail where status=1

     

    2.

    unread email of some user

    select m.*

    From mail m,message ms

    where ms.mail_id=m.id and ms.user=userid and m.status=1

     

    [user id is in which table.... I don't find it in message ?]

     

    3.

    today's unread email

    select * from mails where status=1 and time_update=DATE_FORMAT(now(), '%Y-%m-%d %T')

     

  9. Also for the previous problem

    $common1=array_combine($sports,$location);

    function print_arr($common1)

    {

    $final_str='';

    $callback =function($value,$key) use (&$final_str)

    {

    $final_str .= $key.' in '.$value.',';

    };

    array_walk($common1,$callback);

    return $final_str;

    }

    $final_output=print_arr($common1);

    echo $final_output;

     

    you may need to tweak a little to append 'and'

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