mushroom
Members-
Posts
41 -
Joined
-
Last visited
Never
Everything posted by mushroom
-
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.
-
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"); } ?>
-
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
-
you may wish to incorporate this if (in_array($your_value,$array))
-
I do a lot of php/mysql and find openSUSE the easiest to set up and manage.
-
gmdate() returns Greenwich Mean Time. if you want local time use date()
-
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.
-
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.
-
[SOLVED] Update Not Working For Some Reason. Probably Really Simple Issue.
mushroom replied to basement's topic in MySQL Help
I do not see any "{}" with your if ,else statements if (....) { code ; } else { code ; } -
Executing multiple scripts in the background...
mushroom replied to Jabop's topic in PHP Coding Help
I don't think you can avoid that, but you can finish the page. after "</html>" and before sleep(x); add ob_flush(); flush(); -
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
-
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.
-
[SOLVED] Put a variable in another variable somehow?
mushroom replied to anolan13's topic in PHP Coding Help
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'); -
If you have 4 elements in your array they are numbered by default 0,1,2,3 not 1,2,3,4
-
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 }
-
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 ??
-
[SOLVED] Form to kill two birds with one stone..
mushroom replied to ag3nt42's topic in PHP Coding Help
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 } -
I sounds like the job will have to be killed manually, apache restarted, or the server rebooted.
-
[SOLVED] Possible to decrypt without Mcrypt?
mushroom replied to four4swords's topic in PHP Coding Help
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". -
I would use while($file = readdir($dir_handle)) {if($file[0] !=".") { $fileCount++; echo "$fileCount - $file<br />"; } }
-
"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
-
assignment deadline in 24 hrs please help !!!
mushroom replied to andrew_biggart's topic in PHP Coding Help
irish21 is trying to use php variables outside of php -
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.
-
Have a look http://www.htmlite.com/mysql002a.php
-
"NULL" is a reserved word and can not be used as a field name!