User Profile

Collapse

Profile Sidebar

Collapse
bilibytes
bilibytes
Last Activity: May 10 '10, 08:25 PM
Joined: Jun 29 '08
Location: Europe
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • bilibytes
    started a topic Limit HTTP POST request data size (DoS Attack)
    in PHP

    Limit HTTP POST request data size (DoS Attack)

    Hi everyone,

    I have new questions for tonight.

    I would like to know the best ways to prevent Denial Of Service Attacks.
    Well my question is a bit more precise than that.

    I can see of three vectors of implementing a DoS attack (an attacker will certainly use a combination of the 3 ...) here they are:

    1. Iteration: using a program that will repeatedly make requests with GET/POST....
    See more | Go to post

  • bilibytes
    replied to What happens exactly when i do a db query?
    in PHP
    ok Thank's a lot !
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to What happens exactly when i do a db query?
    in PHP
    Thank you Dormilich!

    And you are sure that it is faster than querying without limit and then calling mysql_affected_ rows() ?

    If yes, how do I handle the resultset? Like with a normal query without the while?
    Code:
    $sql = "SELECT COUNT(*) AS numRows FROM ... JOIN ... GROUP ... ";
    $row = mysql_fetch_array($resultset));
    $numRecords = $row['numRows'];
    like that?
    See more | Go to post

    Leave a comment:


  • bilibytes
    started a topic What happens exactly when i do a db query?
    in PHP

    What happens exactly when i do a db query?

    Hello i'm intrigued by what happens behind the scenes when I do a DB query to a database from php.

    I would like to know what is the exact life cycle of a mysql_query()

    I ask this question because i need to know what is the best solution to count the number of rows from a query.

    My query is performed to fetch records from a mysqlDb that will be displayed as a list of let's say 10 rows. If i hadn't put a...
    See more | Go to post

  • bilibytes
    started a topic Group_concat()

    Group_concat()

    Hi,

    I'm wondering how to achieve the following:

    well i don't know if you guys like wine but I have to explain a very little on wine to explain my example: Wine is made from grape and a wine bottle may be made from different sorts of grape. So when you have a bottle it usually says: 10% of shyra, 50% of cabernet and 40% of merlot
    meaning that the wine in the bottle was made from that percent of each grape type....
    See more | Go to post

  • bilibytes
    replied to Syntax Error ORDER BY GROUP BY
    thanks for your answer, but the ';' is automatically appended to the query when using mysql_query() from php.

    I already solved the problem.

    Regards,

    bilibytes
    See more | Go to post

    Leave a comment:


  • bilibytes
    started a topic Syntax Error ORDER BY GROUP BY

    Syntax Error ORDER BY GROUP BY

    Hello, i need some help i am getting this error:

    Code:
    You have an error in your SQL syntax;
     check the manual that corresponds to your MySQL
     server version for the right syntax to use near 
    'GROUP BY w.location_id ORDER BY w.wine_id ASC' at line 1
    the entire query code is:

    Code:
    SELECT
    			w.wine_id AS wineId,
    		 	w.name AS wineName,
    		 	w.producer_id AS producerId,
    ...
    See more | Go to post

  • bilibytes
    replied to Recursion - Inventory System
    in PHP
    i don't understand really well what you want to achieve.

    maybe this helps you : Modified Preorder Tree Traversal

    good luck
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to Code produces blank page
    in PHP
    because you have not turned error reporting on, and your code contains errors, such as
    Code:
    isSet()
    which should be written
    Code:
    isset()
    lowercased.

    As mark suggested you in a previous post, read the posting guidelines of the forum.

    regards
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to mysql_num_rows error...
    in PHP
    put the $link as i told you... or a password
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to mysql_num_rows error...
    in PHP
    I suggest that you go step by step.

    first check that you get the data from the brower, and try to echo it.

    then try to connect to the db and make a query with data you write in your file, not from $_POST

    and try to output it.

    and so on, you have to narrow down the search until you know where the problem comes from.

    once you know where your code fails, come back and we will...
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to Check if Object implements interface
    in PHP
    I didn't know about that, why? :S...
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to mysql_num_rows error...
    in PHP
    right, i have answered too quickly......
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to Check if Object implements interface
    in PHP
    Mark, my problem is solved!! we can close this thread!! lol

    here is the explanation:

    I have created a class that handles the url params.

    this class is called Bb_Url_Sanitize

    it uses a filter, for the moment i use Zend_Filter_Inp ut, which is good for me.

    As i have created the Bb_Url_Sanitize class based on Zend_Filter_Inp ut, and i have used some of the methods of Zend_Filter_Inp ut....
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to mysql_num_rows error...
    in PHP
    You are not doing the query well.

    you should pass a mysql connection to the query so that it knows where to query.

    Code:
    $link = mysql_connect('hostName', 'userName', 'passWord');
    
    //then select the db
    
    mysql_select_db('databaseName', $link);
    
    //then you can make your queries passing the $link
    
    $resultSet = mysql_query('SELECT * FROM Table1', $link);
    
    //now
    ...
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to Check if Object implements interface
    in PHP
    Yes mark,

    i have the interface, however the problem i had was that i didn't know how to check if the user defined class implemented my interface without forcing him to use implements.
    I didn't want to force him to use implements because his class may be part of another framework such as Zend_Framework. And it's no good practice to change the code of existing classes (at least if you are not it's developer).
    But then i finally...
    See more | Go to post

    Leave a comment:


  • Did you find out ?...
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to Check if Object implements interface
    in PHP
    I am doing a reusable class that filters the url input. Let's call it Url_Sanitize.
    Url_Sanitize uses a filter which can be of any type. The only restriction for that filter object, is to implement one interface, so that the Url_Sanitize can fearlessly (of an exception) call the filter methods that are specified in the interface.

    Ok i have the solution, i think...

    If the person wants to pass a filter object,...
    See more | Go to post

    Leave a comment:


  • bilibytes
    replied to Check if Object implements interface
    in PHP
    Thanks for your reply.
    Your solution works well if i just want to check a few methods, but if i have an interface that is quite big, it will not be very efficient.

    What I would like is something like this:
    Code:
    <?php
    Interface Smoker_Interface
    {
        public function lightACigar($brand);
    }
    
    class BobMarley
    {
        protected $_cigarInMouth;
    
        public function
    ...
    See more | Go to post

    Leave a comment:


  • bilibytes
    started a topic Check if Object implements interface
    in PHP

    Check if Object implements interface

    Hello,

    I have a little question.

    I would like to know how to check if an object is compliant with an interface.

    I know that if the Class implements explicitly the Interface, like this:
    Code:
    Class RobertNestaMarley implements Smoker_Interface
    the operator instanceof will let me know. like this:

    Code:
    $bobMarley = new RobertNestaMarley()
    if ($bobMarley instanceof
    ...
    See more | Go to post
No activity results to display
Show More
Working...