php-general Digest 18 Apr 2010 12:59:40 -0000 Issue 6699

Topics (messages 304163 through 304170):

Re: How define if javascript is on with php
        304163 by: Paulo-WORK
        304166 by: Manuel Lemos

Re: PHP include security
        304164 by: Micky Hulse
        304165 by: Micky Hulse

compile php 5.3.2 with php-fpm error,HELP ME
        304167 by: Sharl.Jimh.Tsin
        304168 by: Daniel Egeberg
        304169 by: Sharl.Jimh.Tsin

Replacing a special character
        304170 by: Michael Stroh

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On 17/04/2010 23:13, tedd wrote:
At 11:43 AM +0200 4/17/10, Michiel Sikma wrote:
By having regular content and overriding it with Javascript

It's probably best that you use the term "progressive enhancement" rather than "overriding".

The point being is that you have a site that delivers it's content for those with javascript turned off and those who have javascript turned on, can enjoy an "enhanced" version of the presentation, but not have something provided that other's can't get.

Cheers,

tedd
I agree.
Now that i know what to do, the end result will be displaying exactlly the same content and look regardless if JS is on or off.


--- End Message ---
--- Begin Message ---
Hello,

on 04/16/2010 08:50 AM Paulo-WORK said the following:
> Hello and thanks for any replies that this message may get.
> I have a issue to solve regarding PHP.
> My website relies heavlly  on jquery and does not dowgrade properly.
> I use codeigniter framework as this website has a backend .
> Is it possible to detect if js is on with php?
> And if so can it be set into a variable?
> Paulo Carvalho

This class does exactly what you are asking:

http://www.phpclasses.org/package/5297-PHP-Check-whether-Javascript-is-enabled-in-the-browser.html

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
Hi Michiel! Thanks for the help, I really appreciate it. :)

> It depends. What's exactly do you want to prevent? It doesn't seem like a
> ...<snip>...
> include, say, additional HTML content, use file_get_contents() instead.

Very good points. My goal was to write a plugin that would allow me to
include some static HTML template file and get the <?php include...?>
tags out of my CMS template. With that said, I think the only people
using this code will be the developers of the templates, and not your
standard user.

I opted to use output buffering and readfile() for the speed, and
include() would be an option if developers want to execute the code in
the included file.

Would file_get_contents() be faster than readfile and output
buffering? Would using file_get_conents() and eval() be faster than
using include() and output buffering?

Without boring you all to death, I am mostly interested in learning
new stuff! I actually don't think anyone will use this code other than
myself. :D

But I definitely agree with all your points.

Thanks so much for you help!

Have a great day!
Cheers,
Micky

--- End Message ---
--- Begin Message ---
> What do ya'll think? Any suggestions?

Sorry for the duplicate posting... I had some problems signing-up for
the list. :(

Also, I moved my test code to sniplr:

<http://snipplr.com/view/32192/php-security-include-path-cleansing/>

TIA!

Cheers
M

--- End Message ---
--- Begin Message ---
Hi,everyone

i download the php source tarball from php.net.
and check out lastest version of php-fpm from SVN.

then,i run the
./configure --prefix=/usr/local/php --bindir=/usr/local/bin
--sbindir=/usr/local/sbin --sysconfdir=/etc/sysconfig
--enable-embed=shared --enable-fpm --enable-safe-mode
--enable-sigchild --enable-magic-quotes --enable-fd-setsize=100
--enable-calendar --enable-dba=shared --enable-exif --enable-ftp
--enable-gd-native-ttf --enable-intl --enable-mbstring
--enable-embedded-mysqli --enable-pcntl --disable-phar --enable-shmop
--enable-soap --enable-sockets --enable-wddx --enable-zip
--enable-zend-multibyte --with-libxml-dir
--with-libevent-dir=/usr/local/libevent --with-fpm-user=php
--with-fpm-group=php --with-config-file-path=/etc
--with-exec-dir=/usr/local/bin --with-openssl --with-kerberos
--with-pcre-regex --with-zlib --with-bz2 --with-curl --with-gd
--with-mhash --with-imap --with-imap-ssl --with-ldap --with-ldap-sasl
--with-mcrypt --with-mysql=/usr/local/mysql
--with-mysql-sock=/tmp/mysql.sock
--with-mysqli=/usr/local/bin/mysql_config
--with-pdo-mysql=/usr/local/bin/mysql_config --with-xmlrpc --with-pear

it seems to be ok,and run make command.it looks like NO error appears,too

but when i run the make install,it gives some information below:
[r...@powerpc php-5.3.2]# make install
/bin/sh /root/php-5.3.2/libtool --silent --preserve-dup-deps
--mode=install cp ext/dba/dba.la /root/php-5.3.2/modules
Installing PHP SAPI module:       fpm
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/php/man/man1/
Installing shared extensions:
/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
Installing PHP FPM binary:        /usr/local/sbin/
Installing PHP FPM config:        /etc/sysconfig/
Installing PHP FPM man page:      /usr/local/php/man/man1/
Installing build environment:     /usr/local/php/lib/php/build/
Installing header files:          /usr/local/php/include/php/
Installing helper programs:       /usr/local/bin/
 program: phpize
 program: php-config
Installing man pages:             /usr/local/php/man/man1/
 page: phpize.1
 page: php-config.1
Installing PEAR environment:      /usr/local/php/lib/php/
make[1]: *** [install-pear-installer] Segmentation fault
make: *** [install-pear] Error 2

I Do Not know what caused it..

and i run the php-fpm ,it returns "Segmentation fault"

Want your helps,my friends

Best regards,
Sharl.Jimh.Tsin

--- End Message ---
--- Begin Message ---
On Sun, Apr 18, 2010 at 09:47, Sharl.Jimh.Tsin <amoiz.sh...@gmail.com> wrote:
> Hi,everyone
>
> i download the php source tarball from php.net.
> and check out lastest version of php-fpm from SVN.
>
> then,i run the
> ./configure *snip*
>
> it seems to be ok,and run make command.it looks like NO error appears,too
>
> but when i run the make install,it gives some information below:
> [r...@powerpc php-5.3.2]# make install
> *snip*
>
> I Do Not know what caused it..
>
> and i run the php-fpm ,it returns "Segmentation fault"
>
> Want your helps,my friends
>
> Best regards,
> Sharl.Jimh.Tsin

Hi,

Could you possibly get a backtrace [1] and submit a PHP bug [2]?

[1] http://bugs.php.net/bugs-generating-backtrace.php
[2] http://bugs.php.net/report.php

-- 
Daniel Egeberg

--- End Message ---
--- Begin Message ---
all right,i submit it as a bug into the bugs.php.net

Best regards,
Sharl.Jimh.Tsin



2010/4/18 Daniel Egeberg <degeb...@php.net>:
> On Sun, Apr 18, 2010 at 09:47, Sharl.Jimh.Tsin <amoiz.sh...@gmail.com> wrote:
>> Hi,everyone
>>
>> i download the php source tarball from php.net.
>> and check out lastest version of php-fpm from SVN.
>>
>> then,i run the
>> ./configure *snip*
>>
>> it seems to be ok,and run make command.it looks like NO error appears,too
>>
>> but when i run the make install,it gives some information below:
>> [r...@powerpc php-5.3.2]# make install
>> *snip*
>>
>> I Do Not know what caused it..
>>
>> and i run the php-fpm ,it returns "Segmentation fault"
>>
>> Want your helps,my friends
>>
>> Best regards,
>> Sharl.Jimh.Tsin
>
> Hi,
>
> Could you possibly get a backtrace [1] and submit a PHP bug [2]?
>
> [1] http://bugs.php.net/bugs-generating-backtrace.php
> [2] http://bugs.php.net/report.php
>
> --
> Daniel Egeberg
>

--- End Message ---
--- Begin Message ---
I have this form that people use to add entries into a MySQL database. Recently 
I've had some users insert − in their entries instead of - which is causing 
some issues with scripts down the line. I'd like to replace the − character 
with -.

Originally I had something like 

$name = mysql_escape_string($_POST["name"]); 

which would convert the offending character to &#8722; before entering it into 
the database. It's this encoding that is causing the problems since some 
scripts send out emails with this entry in their subject line which looks messy.

I've tried adding the following line after the previous line to help fix this 
issue, however, I just got another entry with the same problem.

preg_replace('/&#8722;/','-',$name);

Any suggestions on how others would fix this problem? I'd just like to fix it 
before the entry hits the database instead of creating fixes on the other end 
of things.


Cheers,
Michael

--- End Message ---

Reply via email to