litebearer
Members-
Posts
2,356 -
Joined
-
Last visited
Everything posted by litebearer
-
Generally the default upload file size is 2mb. This can sometimes be changed in your php.ini file (if your host allows it). try running the phpinfo() on your host. then look for upload_max_filesize Lite...
-
May be an obvious question, but did you connect to the database AND execute the query? Perhaps a little more of your code would help. Lite...
-
ok, perhaps I may misunderstand exactly what you are looking for. My understanding of signed and unsigned is as follows: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]INT stands for integer. This is a normal sized number that can be signed or unsigned. A signed number can include negative numbers while an unsigned number includes only positive numbers. The maximum number, if signed, is &endash; 2147483648 to 2147483647. An unsigned number can max out at 4294967295.[/quote] I have an inkling that you are referring to positive whole numbers as opposed to positve numbers with decilmal/fractional values?? Lite...
-
change negative number to positive or unsigned
litebearer replied to swcarrel's topic in PHP Coding Help
Hmmm, how about [code] $x = (-1); // negative 1 $y = 123456; // another negative number $y = $y * $x;[/code]viola Lite... -
I didn't have time to test it, but this should find files whose names contain your search criteria. [code] <?php $needle = "12345"; // this is the stuff (string/name/etc) we are looking for if ($handle = opendir('/path/to/files')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $pos = strpos($file, $needle); if($pos === false) { // not found }else{ // you found a file now do what you want ) } } closedir($handle); } ?> [/code] Also you could modify the code to check if the first 5 character match the needle, by using the substr() function Lite...
-
Not 100% certain as I haven't tested it but you might look at this thread [a href=\"http://www.trap17.com/index.php/how-read-large-files-php_t28289.html\" target=\"_blank\"]http://www.trap17.com/index.php/how-read-l...php_t28289.html[/a] or [a href=\"http://archives.postgresql.org/pgsql-sql/2003-06/msg00213.php\" target=\"_blank\"]http://archives.postgresql.org/pgsql-sql/2...06/msg00213.php[/a] [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Generally you're gonna hit a limit with the max memory size set in the php.ini file, which defaults to 8 meg max process size before abort. You can crank this up so high your machine starts to swap out. I'd guess PHP is likely limited to some number internally, but I've messed around with a hundred or so megs before.[/quote] Lite...
-
Is there a way to pass a session into a new window?
litebearer replied to JustinK101's topic in PHP Coding Help
Just some comments that may help... 1. you CAN use sessions to pass values when opening a new broswer window. (ie target="_blank") 2. there is an easy way to gather all of your user defined variables into a session variable [code] // store all the user defined variables into an array $my_vars = get_defined_vars ( ); // store the array into the session $_SESSION['my_vars'] = $my_vars; // proceed to the next page [/code] 3. this one I really have not figured out yet, but it appears that you can also use the session id to access the variables contained in a particular session. (perhaps someone could elaborate on how to do this). Lite... -
May we see what you have coded thus far, so that we might be in a better position in which to help you. Lite...
-
Wellllll, he could by having his script adjust the server time by the offset of his computer OR using GMT he could remove all concern of the server time.
-
Check this tutorial on this forum [a href=\"http://www.phpfreaks.com/tutorials/36/0.php\" target=\"_blank\"]http://www.phpfreaks.com/tutorials/36/0.php[/a] Lite...
-
Check the last post on this thread [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=90480&hl=\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...topic=90480&hl=[/a] Lite...
-
Might look here... [a href=\"http://www.artfahrt.com/psp.html\" target=\"_blank\"]http://www.artfahrt.com/psp.html[/a] [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Using ffmpeg to Create Thumbnails Here is an example of how to use ffmpeg to extract a thumbnail image from a video. ffmpeg.exe -y -i cnn.mpg -f singlejpeg -ss 5 -vframes 1 -s 160x120 -an M4V10005.THM[/quote] [a href=\"http://ffmpeg.sourceforge.net/index.php\" target=\"_blank\"]http://ffmpeg.sourceforge.net/index.php[/a] Lite...
-
Look at the first two posts here [a href=\"http://us2.php.net/function.rsort\" target=\"_blank\"]http://us2.php.net/function.rsort[/a] Lite...
-
Try [code] $formatted = number_format($money,2);[/code] Lite...
-
Read the post from Tobias on July 5 2005, it may help [a href=\"http://forum.enarion.net/viewtopic.php?t=14\" target=\"_blank\"]http://forum.enarion.net/viewtopic.php?t=14[/a] Lite...
-
Look here [a href=\"http://us3.php.net/natsort\" target=\"_blank\"]http://us3.php.net/natsort[/a] Lite...
-
Might look here [a href=\"http://www.sim-php.info/users-online-script.php\" target=\"_blank\"]http://www.sim-php.info/users-online-script.php[/a] Lite...
-
Just an old coot's observation, and we know old guys can be wrong. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]i have my images location paths stored in my db as "/images/hftht.jpg" etc[/quote] that being the case. would not this [code] $img = $my_data['path']; echo "<img src='http://www.xxxxx.co.uk/images/$img'>"; [/code] result in this [code] <img src="http://www.xxx.co.uk/images//images/hftht.jpg"> [/code] presuming the image folder is just below the script folder, why not simply [code] $img = $my_data['path']; echo '<img src="' . $img . '">'; [/code] Lite...
-
Populating a database from a spreadsheet
litebearer replied to gerkintrigg's topic in PHP Coding Help
I love a challenge. I spent a few minutes (LOL) searching the web for different scripts/snippets/etc with which to cobble together a solution. I am NO guru, so you may need to do some tweaking. In the below zip file there are 4 files (excel2csv.php, reader.php, oleread.inc and sample.xls). The only file you need to edit is the excel2csv.php file --- there is a section where it displays the contents of the newly created csv file; simply replace the echo with a bit of code that (1) connects to your database (2) creates the appropriate sql query, and (3) emails you a message that your 'tykes' have done something. Note: all of the files go in the same folder, and be sure to make the folder reads writeable [a href=\"http://nstoia.com/excel2csv/excel2mysql.zip\" target=\"_blank\"]http://nstoia.com/excel2csv/excel2mysql.zip[/a] Hope this helps Lite... -
Can anyone help with this database query?
litebearer replied to roytheboy's topic in PHP Coding Help
Well as to the timestamp issue... this will create a timestamp equal to 3 months prior to the current date. [code] $old_date_ts = strtotime ("-3 month");[/code]you can use this in your sql query to select all records where the case date (timestamp) is greater than the $old_date_timestamp. Obviously you will also need to edit your code to remove any reference to the 20 case limit. Hope it helps. Lite... -
If 'for good' you mean forever and ever, use a mysql table or a text file. If you mean just while the visitor stays connected to you, then use session variables. Lite...
-
I could be wrong; however it appears that you never exit your while loops. This is may be due to the fact that the variable $colorNum has NOT been declared as a global. Hence in the function it has one value and outside the function it has a different value - might read up on declaring variables global. [a href=\"http://us3.php.net/global\" target=\"_blank\"]http://us3.php.net/global[/a] Lite... Oops! a day late and a dollar short
-
I found this script that appears to do what you want. You might peruse it to see how they accomplish that. [a href=\"http://www.powerweb99.at/index.php?modul=8\" target=\"_blank\"]http://www.powerweb99.at/index.php?modul=8[/a] Lite...
-
You could use PHPAdmin to 'backup' and 'restore'. Or if you wanted a script to do it here is one [a href=\"http://restkultur.ch/personal/wolf/scripts/db_backup/\" target=\"_blank\"]http://restkultur.ch/personal/wolf/scripts/db_backup/[/a] Lite...