Jump to content

mushroom

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Posts posted by mushroom

  1. There is no need to hide your page if you do it like this

    <?php
    $allowed[]="xxx.xx.xx.xx";		# authorized ip's 1 per line
    # $allowed[]="xxx.xx.xx.xx";		# uncomment and/or add as many as you like
    
    $raddr=$_SERVER["REMOTE_ADDR"];
    if (in_array($raddr,$allowed))
    {					# your code here
    
    
    
    				# insert e-mail code if you need conformation
    }
    else {
    $myself="http://your_main_index.page"; 			# redirect page for all others
    header("Location: $myself");
    }
    ?>

  2. I've stored some values in an array, and they are in a mysql database. I get the array back and find a value from it, and I want to test if that value is equal to something.

    you may wish to incorporate this

    if (in_array($your_value,$array))

  3. yes, the table filled 600K of records already after 2 weeks.  It may look like a lot, but each record is only a few integers, with no text so it's pretty fast.  It will eventually overflow after about 4 billions records which is approx 20 years.  I intended to keep a 3 years history. 

    Fairly slow then....

    on the group I am tracking one particular IP generated 173M records in a month. ( a mail server)

    A thing to remember is that the larger a table gets the slower it works.

    I may be wise to only keep a month worth of data in a single table and create new table(s) for each month. this will minimize the slow down.

  4. Hope this question entertain you guys. 

    I got a table called packet_log.  As the name say it, it logs packets data in and out the gateway.

    If you have any amount of traffic I would suggest a total rethink of your table structure, it will get way to big way to fast, I know. I wrote a suite for my local ISP to track usage on 9 subnets.

  5. OK, there is no default php page in most Linux installs

     

    I haven't used Fedora is quite some time but have download the latest and plan on looking at it in the near future.

     

    For a development machine I recommend that you:

    1. edit apache, to follow symlinks

    2. edit php.ini to display all errors

    3. give each project a directory in /home/your_user_name/public_html/

    4. create a symlink to each project directory

  6. 2) the script will read the file and set each line to a numbered variable.. eg:

     

    the variable 1 would be set to the first line of text

    the variable 2 would be set to the second line of text

    and so on...

     

    thanx in advanced  :)

    Note: variables can not start with a number. but it can be done with code some thing like this

    $i=0;
    # open file
    # loop through file.
    {$var="varname".$i;
    $$var=$line;  # read each line 
    $i++;
    }
    

    I have use this in the past, but now prefer to use arrays they are much easier to work with later.

    # open file
    # loop through file.
    {
    $array_name[]=$line;  # read each line 
    }
    

  7. "mysqldump" is for making an sql

     

    mysql -u user_name -p password -h host_name_or_address data_base_name < /complete_path_and_name_file

     

    if you transfer the file to the server

     

    mysql -u user_name -p password  data_base_name < /complete_path_and_name_file

  8. Did you restart apache?  The php.ini file is only read when apache starts.

     

    I do not use phpmyadmin for very large db's, I prefer to use the command line utilities in mysql "mysql" and "mysqldump". Some the stuff I work with runs into gigs.

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