PHP

salem | 2005-10-04 02:33

I use PHP embedded in my Drupal content. This can cause problems with mod_security ("Internal server error", number 500).

The problem is that Drupal sends Edit content back to the server via the POST method. If your content has <?php> in it then it will probably get flagged as a security error.

If your hosting provider allows .htaccess overides then you can add lines to get arround the default rules. However, the security considerations are considerable. And as I have been recently reminded, I am not a security expert. Therefore instead of giving recomendations, here is the authoritative reference for mod_security.

How do I encode a '#' symbol in a URL?
How do I encode a '<' symbol in a URL?
I hate looking these up, and I always forget... but PHP has a great builtin function to help you out: urlencode().

Run your own string through it:

Recent strings run through urlencode():
stringurlencod()'d string
hi, thanks for the hack <foo>hi%2C+thanks+for+the+hack+%3Cfoo%3E
#00ff00%2300ff00
http://www.niche-health-products.com/?affid=356http%3A%2F%2Fwww.niche-health-products.com%2F%3Faffid%3D356
?affid=356%3Faffid%3D356
%%25
+
' '%27+%27
º%C2%BA
ºC%C2%BAC
%01%2501
I like big butts and I cannot lie, you other brothers can't denyI+like+big+butts+and+I+cannot+lie%2C+you+other+brothers+can%27t+deny
How do I encode a '<' symbol in a URL?How+do+I+encode+a+%27%3C%27+symbol+in+a+URL%3F
lollol
#%#%%23%25%23%25
*%2A
taetae
gopal#gopal%23
@%40
asdfa3 3asdfa3++3
d+++d
pioveràpiover%C3%A0
%2C%252C
http://wild-type.com/tng/tng3/places-oneletter.php?offset=2&psearch=Calumet%2C+Wisconsinhttp%3A%2F%2Fwild-type.com%2Ftng%2Ftng3%2Fplaces-oneletter.php%3Foffset%3D2%26psearch%3DCalumet%252C%2BWisconsin
feeffeef
å%C3%A5
ö%C3%B6
ä%C3%A4
Å%C3%85
Ä%C3%84
Ö%C3%96
&option=com_cmsrealty&%26option%3Dcom_cmsrealty%26
<PESCXML:MeteorRsMsg xmlns:PESCXML=\"http://schemas.pescxml.org\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" PESCXMLVersion=\"1.0.0\" xsi:schemaLocation=\"http://schemas.pescxml.org Meteor_Schema_1-0-0.xsd\">%3CPESCXML%3AMeteorRsMsg+xmlns%3APESCXML%3D%5C%22http%3A%2F%2Fschemas.pescxml.org%5C%22+xmlns%3Axsi%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%5C%22+PESCXMLVersion%3D%5C%221.0.0%5C%22+xsi%3AschemaLocation%3D%5C%22http%3A%2F%2Fschemas.pescxml.org+Meteor_Schema_1-0-0.xsd%5C%22%3E
www.facebook.comwww.facebook.com
http://www.facebook.comhttp%3A%2F%2Fwww.facebook.com
På må og få viser vi æøåP%C3%A5+m%C3%A5+og+f%C3%A5+viser+vi+%C3%A6%C3%B8%C3%A5
hi is is howhi+is+is+how
http://www.transtrader.eu/nib/login/login_chartisteinitié.phphttp%3A%2F%2Fwww.transtrader.eu%2Fnib%2Flogin%2Flogin_chartisteiniti%C3%A9.php
login_chartisteinitié.phplogin_chartisteiniti%C3%A9.php
http://onet.pl/http%3A%2F%2Fonet.pl%2F
',%27%2C
we'rwe%27r
htt://www.yahoo.com?a=we'arehtt%3A%2F%2Fwww.yahoo.com%3Fa%3Dwe%27are
"%22
vaas'vaas%27
A&EA%26E
my cat say brrrrmy+cat+say+brrrr
+ test + %2B+test+%2B+
%3A%2F%2F%253A%252F%252F
file=http%3A%2F%2Fcdn.buzznet.com%2Fassets%2Fvideox%2F3%2F4%2F1%2F7%2F3%2F9%2F1%2Fvid-3417391.flv%3F1218133282file%3Dhttp%253A%252F%252Fcdn.buzznet.com%252Fassets%252Fvideox%252F3%252F4%252F1%252F7%252F3%252F9%252F1%252Fvid-3417391.flv%253F1218133282
Ã%C3%83
á%C3%83%C2%A1
/%2F
Very Nice Site! Thanx! Very+Nice+Site%21+Thanx%21%0D
http://excellent-credit-card.blogspot.comhttp%3A%2F%2Fexcellent-credit-card.blogspot.com
http://webact.symantec.com/webact-redirect.jsp?PCODE=AU&SO={98B9562C-8832-4381-8D34-694F2A0022F3}&VER=2&actreq=%2F24587007%2F18P6PMMD%2FYFSf%2F%2FA%2F4%2FQ19Q40UICnIl1j%2FEHBNj0Jt5%2b%2F%2Fd3ZGY1Q%2FADLcNsRCduANxAdwUEwAbnFHx%2FVGBUYVXBP7AKA68L%2F0069000310030http%3A%2F%2Fwebact.symantec.com%2Fwebact-redirect.jsp%3FPCODE%3DAU%26SO%3D%7B98B9562C-8832-4381-8D34-694F2A0022F3%7D%26VER%3D2%26actreq%3D%252F24587007%252F18P6PMMD%252FYFSf%252F%252FA%252F4%252FQ19Q40UICnIl1j%252FEHBNj0Jt5%252b%252F%252Fd3ZGY1Q%252FADLcNsRCduANxAdwUEwAbnFHx%252FVGBUYVXBP7AKA68L%252F0069000310030
%c3%96%25c3%2596
Ö%C3%96
/%2F
?%3F
%252F%25252F
?query=select%20distinct(p.products_id),%20p.manufacturers_id,p.web_only,p.products_gaming,p.free_shipping,p.award_winner,p.clearance,p.products_date_added,p.products_price,%20p.products_tax_class_id%20from%20products_description%20pd,%20products%20p%20left%20join%20manufacturers%20m%20on%20p.manufacturers_id%20=%20m.manufacturers_id,%20products_to_categories%20p2c%20where%20p.products_status%20=%20'1'%20and%20p.products_id%20=%20p2c.products_id%20and%20pd.products_id%20=%20p2c.products_id%20and%20pd.language_id%20=%20'1'%20and%20(p.products_model%20like%20'%750GB%'%20or%20pd.products_name%20like%20'%750GB%'%20or%20p.products_code%20like%20'%750GB%')%3Fquery%3Dselect%2520distinct%28p.products_id%29%2C%2520p.manufacturers_id%2Cp.web_only%2Cp.products_gaming%2Cp.free_shipping%2Cp.award_winner%2Cp.clearance%2Cp.products_date_added%2Cp.products_price%2C%2520p.products_tax_class_id%2520from%2520products_description%2520pd%2C%2520products%2520p%2520left%2520join%2520manufacturers%2520m%2520on%2520p.manufacturers_id%2520%3D%2520m.manufacturers_id%2C%2520products_to_categories%2520p2c%2520where%2520p.products_status%2520%3D%2520%271%27%2520and%2520p.products_id%2520%3D%2520p2c.products_id%2520and%2520pd.products_id%2520%3D%2520p2c.products_id%2520and%2520pd.language_id%2520%3D%2520%271%27%2520and%2520%28p.products_model%2520like%2520%27%25750GB%25%27%2520or%2520pd.products_name%2520like%2520%27%25750GB%25%27%2520or%2520p.products_code%2520like%2520%27%25750GB%25%27%29
name:natashaname%3Anatasha
name:natashaname%3Anatasha
natashanatasha
/%2F
%252F%25252F
mrxyz#whereareyou?mrxyz%23whereareyou%3F
http://webact.symantec.com/webact-redirect.jsp?PCODE=AU&SO={98B9562C-8832-4381-8D34-694F2A0022F3}&VER=2&actreq=%2F24587007%2F18P6PMMD%2FYFSf%2F%2FA%2F4%2FQ19Q40UICnIl1j%2FEHBNj0Jt5%2b%2F%2Fd3ZGY1Q%2FADLcNsRCduANxAdwUEwAbnFHx%2FVGBUYVXBP7AKA68L%2F0069000310030http%3A%2F%2Fwebact.symantec.com%2Fwebact-redirect.jsp%3FPCODE%3DAU%26SO%3D%7B98B9562C-8832-4381-8D34-694F2A0022F3%7D%26VER%3D2%26actreq%3D%252F24587007%252F18P6PMMD%252FYFSf%252F%252FA%252F4%252FQ19Q40UICnIl1j%252FEHBNj0Jt5%252b%252F%252Fd3ZGY1Q%252FADLcNsRCduANxAdwUEwAbnFHx%252FVGBUYVXBP7AKA68L%252F0069000310030
http://webact.symantec.com/webact-redirect.jsp?PCODE=AU&SO={98B9562C-8832-4381-8D34-694F2A0022F3}&VER=2&actreq=%2F24587007%2F18P6PMMD%2FYFSf%2F%2FA%2F4%2FQ19Q40UICnIl1j%2FEHBNj0Jt5%2b%2F%2Fd3ZGY1Q%2FADLcNsRCduANxAdwUEwAbnFHx%2FVGBUYVXBP7AKA68L%2F0069000310030http%3A%2F%2Fwebact.symantec.com%2Fwebact-redirect.jsp%3FPCODE%3DAU%26SO%3D%7B98B9562C-8832-4381-8D34-694F2A0022F3%7D%26VER%3D2%26actreq%3D%252F24587007%252F18P6PMMD%252FYFSf%252F%252FA%252F4%252FQ19Q40UICnIl1j%252FEHBNj0Jt5%252b%252F%252Fd3ZGY1Q%252FADLcNsRCduANxAdwUEwAbnFHx%252FVGBUYVXBP7AKA68L%252F0069000310030
@%40
j@bj%40b
aaaaaa
http://192.168.0.169:41952/geturl/203-cosmic_gate_feat._denise_rivera_-_body_of_conflict_cosmic_gate_club_radio_edit-mst.mp3.mp3%3ftype%3daudio%252fmpeg%26url%3dfile%253a%252f%252fc%253a%252fdocuments%2band%2bsettings%252fdaniel%2bolofsson%252fdesktop%252fmusic%252fva-trance_dance_2008.1-2cd-2008-mst%252f%26title%3dbody%2bof%2bconflict%2b(cosmic%2bgate%2bclub%2bradio%2bedit)%26ext%3d.mp3http%3A%2F%2F192.168.0.169%3A41952%2Fgeturl%2F203-cosmic_gate_feat._denise_rivera_-_body_of_conflict_cosmic_gate_club_radio_edit-mst.mp3.mp3%253ftype%253daudio%25252fmpeg%2526url%253dfile%25253a%25252f%25252fc%25253a%25252fdocuments%252band%252bsettings%25252fdaniel%252bolofsson%25252fdesktop%25252fmusic%25252fva-trance_dance_2008.1-2cd-2008-mst%25252f%2526title%253dbody%252bof%252bconflict%252b%28cosmic%252bgate%252bclub%252bradio%252bedit%29%2526ext%253d.mp3
%2520%252520
%252F%25252F
fdfdfdffdfdfdf
@#$%^&*()-%40%23%24%25%5E%26%2A%28%29-
`~!@#$%^&*()_+-=\][';/.,|}{":?><%60%7E%21%40%23%24%25%5E%26%2A%28%29_%2B-%3D%5C%5D%5B%27%3B%2F.%2C%7C%7D%7B%22%3A%3F%3E%3C
,%2C
@%40
@%40
P@55w0rd!P%4055w0rd%21
cart_paid_discount.phpcart_paid_discount.php
<hjh&%3Chjh%26
satyasatya
"-%20Account%20Hierarchy".%22Top%20Level%20Account%20Id%22%22-%2520Account%2520Hierarchy%22.%2522Top%2520Level%2520Account%2520Id%2522
%252b12K%25252b12K
+12K%2B12K
ö%C3%B6
#%23
salem | 2005-08-11 02:39

Oh my... another configuration/setup/compile issue.
Out of the box gentoo's default configuration for mod_php (Apache's method of using PHP as a module) does not support GD (the PHP graphics extensions).
This means you cannot use the PHP functions imagecreate() etc. PHP's GD interface is really very useful if you want to do any server side image manipulation.
You can tell if you're version of mod_php has GD support by putting the php command "phpinfo()" in a script and executing it through your webserver. If you see the following then you do not have GD support:

--without-gd

salem | 2005-08-11 02:11

I like basketball. I like playing it. I like watching it. It is just good fun!

I am lucky enough to work at a job where I can get out and shoot hoops at lunch. Over the years our circle of players has expanded and now we routinely have games of 5v5 with players from 5 or so different companies. Some days we have even filled up 2 courts! Organizing this is a major pain. Nobody has the time to do the coordination. So a couple of months ago I threw together rtphoops.com to help streamline the process.
It is built with PHP for the server side logic and MySql for the data storage.

salem | 2005-08-11 02:00

Gentoo is a strange beast... It seems like many things were done differently just to be different. Gentoo places the configuration files Apache2 reads on startup in:

/etc/apache2/conf

The configuration files are then setup with <IfDefine> directives for loading specific modules. You must edit /etc/conf/apache2 to set an environment variable (APACHE2_OPTS) to include the PHP4 directive:

APACHE2_OPTS="-D PHP4"

Note that the APACHE2_OPTS line already exists in /etc/conf/apache2, it just needs to be uncommented and modified to include "-D PHP4"

salem | 2005-08-11 01:53
salem | 2005-08-06 18:56
Bob Atkins was nice enough to put together a bit of info on how to decode Canon date codes.
However, I almost ran out of fingers and toes trying to count to 'S' so I threw together the following calculator based on Bob's wisdom. I only know the factory codes that where listed by Bob, if you know any please send them in and I will update the calculator. Also, if you have any tips on finding the date codes please send that in as well. Thanks! eyekode@yahoo.com
Enter Canon Date Code Here:

XML feed
Lfhex

Tonality

User login

Navigation

PHP

Kccmp

Java

Homestar

Slashdot


Advertisement