Jump to content

mushroom

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Everything posted by mushroom

  1. If "cat_id" is "AUTO_INCREMENT" there is no need to include in your second query at all, the field and value will fill in automatically.
  2. 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"); } ?>
  3. If you look at the line I quoted, there is a built in php function to do what you are asking. http://ca.php.net/manual/en/function.in-array.php
  4. you may wish to incorporate this if (in_array($your_value,$array))
  5. I do a lot of php/mysql and find openSUSE the easiest to set up and manage.
  6. gmdate() returns Greenwich Mean Time. if you want local time use date()
  7. 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.
  8. 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.
  9. I do not see any "{}" with your if ,else statements if (....) { code ; } else { code ; }
  10. I don't think you can avoid that, but you can finish the page. after "</html>" and before sleep(x); add ob_flush(); flush();
  11. 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
  12. I didn't know browsers had the ability to build arrays the same way php can ??? if they do, try designating each array value when[0], when[1], when[2], etc.
  13. I have found that some functions do not work with compound variables....... solution give the function a simple variable $files=$files."/"; $total = total_size('$files');
  14. If you have 4 elements in your array they are numbered by default 0,1,2,3 not 1,2,3,4
  15. 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 }
  16. If a table gets corrupted it may go into a locked state. Some back up programs will lock tables while they do their work. and ??
  17. if ($submit_button=="other_option") { include("other_php_page"); # code for that button } elseif ($submit_button=="normal_option") { # code for that button } else { # code for no button }
  18. I sounds like the job will have to be killed manually, apache restarted, or the server rebooted.
  19. I most cases you can't "decrypt". What is normally done is to encrypt the "word" with the same algorithm and compare it to the stored encrypted "word".
  20. I would use while($file = readdir($dir_handle)) {if($file[0] !=".") { $fileCount++; echo "$fileCount - $file<br />"; } }
  21. "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
  22. irish21 is trying to use php variables outside of php
  23. 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.
  24. Have a look http://www.htmlite.com/mysql002a.php
  25. "NULL" is a reserved word and can not be used as a field name!
×
×
  • 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.