Thanks to antville.org
php variables

It is highly recommended to increase the following limits in /etc/php.ini so that uploads through PHP will work as expected.

php -r"phpinfo();" | grep upload

file_uploads => On => On
max_file_uploads => 20 => 20
upload_max_filesize => 2M => 2M

Restart http deamon usually using the command:
/etc/init.d/httpd restart

... Link (0 comments) ... Comment


php cookies

The global array $_COOKIE is used to retrieve the cookie value for subsequent page requests. Like...

<?php
$visits = 1;
if (isset($_COOKIE["visits"])) {
$visits = (int)$_COOKIE["visits"];
}
setcookie("visits", $visits + 1, time() + (60 60 24 * 30));
echo "You have visited this page $visits time(s).";

... Link (0 comments) ... Comment


Curling PHP

CURL can be used very effectively using PHP. Here is an example.

cat curl.php

<?php
$ch = curl_init("www.google.com");
$fp = fopen("example.txt", "w");

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);
curl_close($ch);
fclose($fp);
?>

... Link (0 comments) ... Comment


Current Directory Listing

Here is the code to show the files from the current directory.

<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle)))
<!--av-code--> {
<!--av-code--> if ($file != "." && $file != "..")
{
<!--av-code--> $thelist .= '<a href="'.$file.'">'.$file.'</a> <p> ';
<!--av-code--> }
<!--av-code--> }
closedir($handle);
}
?>
<P>List of files:</p>
<P><?=$thelist?></p>

... Link (0 comments) ... Comment


Upgrade PEAR

I spent a lot of time figuring out how to upgrade my PEAR package.
The trick is to install the PEAR package with –force to make it go through

pear upgrade --force PEAR

... Link (1 comment) ... Comment


Export to Excel

Just create a regular .PHP file, where you output your data in a nice little html-table. Then place the following snippet in the top of that file:

header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=excel.xls");

And it’s just that easy. If you open the page, you’ll see a download-window asking you where to place the file.

... Link (0 comments) ... Comment


Show only PHP errors

Open /etc/php.ini file

vi /etc/php.ini

Set error_reporting as follows:

error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR

Alternately, you can show all errors, except for notices and coding standards warnings

error_reporting = E_ALL & ~E_NOTICE

Save and close the file. Restart apache web server:

/etc/init.d/httpd restart

tinyurl.com

... Link (0 comments) ... Comment


Online for 6367 days
Last modified: 1/29/20 11:15 AM
Status
Youre not logged in ... Login
Menu
... Home
... Tags

Search
Calendar
January 2020
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
262728293031
December
Recent updates
LibreOffice version conflict I am
not able to install latest version of Libre office. I...
by shantanuo (1/29/20 11:15 AM)
Amazing! Yeahh! you have an
informative blog so far. Thanks for sharing | roof repair...
by Danielperez123 (1/28/20 8:32 PM)
Great Work Thanks for sharing
the post. Microsoft toolkit
by talisasoto1989 (1/27/20 10:22 PM)
Farnham Carpet Cleaning Thanks Farnham
Carpet Cleaning
by Dubs@gl.com (1/27/20 10:13 PM)
Locksmith Guildford That's an interesting
point Locksmith in Guildford
by Dubs@gl.com (1/27/20 10:11 PM)
while loop This is
a sample shell script while loop while read mydb do echo...
by shantanuo (1/26/20 2:24 PM)
compare mysql schema And here
is poor man's schema compare using good old diff command......
by shantanuo (1/26/20 1:49 PM)
Selecting from error log grep
"error" error_log |awk -F[ {'print $4'} \ | sort |...
by shantanuo (1/26/20 12:40 PM)
Rank mysql records using variables
SET @rank = 0, @prev_val = NULL; SELECT rank, correct...
by shantanuo (1/26/20 11:45 AM)
Thanks for sharing this!!
commercial roofing huntsville al
by Mazikeen (1/24/20 6:37 PM)
Sophie Chciałbym więcej o tym
przeczytać. Szybka, jaka literatura ma studiować? texas colleges and universities
by panistefanin (1/24/20 3:45 PM)
Jack Lovely information thank you
very much decanters
by decanter2020 (1/24/20 1:20 PM)
I like it I like
that logic. interior painting
by LisaCook (1/23/20 10:11 PM)
Love it I like this!
Thanks for posting roll off canister
by LaurenHill (1/23/20 10:05 PM)
Thanks for the heads up!
Thank you for sharing this. Our website
by mozaic (1/23/20 2:32 PM)
Thank you for sharing
a really great piece of information. bubble shooter
by longjumper (1/21/20 11:05 AM)
Thanks Thanks for sharing these.
Sam H - Interior Painter Scaumburg Il
by Samh2019 (1/21/20 10:14 AM)
Fencing in Guildford thanks for
the information Fencing in Guildford Fencing in Surrey
by Dubs (1/20/20 9:26 PM)
satta matka matka boss satta
matka Visit our site for more information
by sattamatka3.net (1/20/20 7:52 PM)
Beebeetravvel Thanks for sharing your
valuable information. we are a tour & travel agency with...
by coolexusa (1/20/20 2:27 PM)
Access Control System Dubai Fingerprintdubai
Company is providing many types of Services like , card...
by coolexusa (1/20/20 12:19 PM)
Air Duct Cleaning This type
of Duct cleaning Miami is absolutely not a must have...
by coolexusa (1/20/20 11:26 AM)
Carpet Cleaning Oxford and Surrounding
Areas Interesting read. Carpet cleaning in Oxford and surrounding areas
by Murray Whelehan (1/19/20 8:18 PM)
Antares AutoTune Crack License
Key With Keygen ( MAC ) A Antares AutoTune Pro Crack...
by ijicrackgh (1/19/20 9:50 AM)
Waves Tune Real-Time Crack (Latest)
Free Download 2020! Visit my site and free crack full...
by ijicrackgh (1/19/20 9:45 AM)

RSS feed

Made with Antville
Helma Object Publisher