[PHP] Premature end of script

2013-07-17 Thread R B
Hello,

5 years ago, y developed a php system and was working fine. But 20 days
ago, when y try to access to some pages (not all the pages), in the log
appears this message and the page is not displayed:

==> /usr/local/apache/logs/error_log <==
[Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of
script
headers: /home/capitale/public_html/miembros/myscript.php

Can you help me please with this error?

Thank you.


[PHP] Basic Statistics

2012-10-01 Thread George R Smith
Can anyone recommend a basic php stat package, easy to install and use.
Just basic stuff like mean, median, range std dev etc



thanks
george

[PHP] PHP Subroutine Call Blowing UP with Strings

2012-05-06 Thread George R Smith
All,

I am new to PHP (about 3 weeks) and am testing 
the return of strings from a external database
subroutine. This database is not relational, not
MySQL, MSSQL or others.

Thanks to all in advance for any help.

Some info which might be helpful:
phpinfo()
PHP Version => 5.3.3-7+squeeze8
System => Linux dellT710 2.6.32-5-amd64
#1 SMP Mon Mar 26 07:00:19 UTC 2012 x86_64

root@dellT710:/var/www#  php -i | grep extension_dir
extension_dir => /usr/lib/php5/20090626+lfs => /usr/lib/php5/20090626+lfs
root@dellT710:/usr/lib/php5/20090626+lfs# ls -la
total 812
drwxr-xr-x 2 root root   4096 May  3 20:28 .
drwxr-xr-x 5 root root   4096 May  2 07:35 ..
-rw-r--r-- 1 root root  62936 Feb 10 08:31 curl.so
-rw-r--r-- 1 root root  95596 Feb 10 08:31 gd.so
-rw-r--r-- 1 root root  38272 Feb 10 08:31 mcrypt.so
-rw-r--r-- 1 root root 109220 Feb 10 08:31 mysqli.so
-rw-r--r-- 1 root root  42352 Feb 10 08:31 mysql.so
-rw-r--r-- 1 root root  26116 Feb 10 08:31 pdo_mysql.so
-rw-r--r-- 1 root root  87588 Feb 10 08:31 pdo.so
-rwxr-xr-x 1 root root 173342 May  3 20:28 qmphp.so
-rw-r--r-- 1 root root 141336 Aug 19  2010 suhosin.so

The qmphp.so is the extension that is doing the call.
Written by someone else installed by me.

The subroutine returns 14 characters or less but
blows up when I increase the string to 15 characters.

Here is the successful return of two arguments
and with 14 characters in the second argument.
root@dellT710:/var/www# php test.php
errorMsg
ThereAre14Char

The test code:


Re: [PHP] Re: Script failing on extension_dir

2012-04-10 Thread George R Smith

Matijin and Shawn,

I added to /etc/php5/apache2/php.ini the line
extension_dir = "/usr/lib/php5/20090626+lfs"

but when I run qm_ext_build I still get
You need to create the php extensions directory:
/usr/lib/php5/20090626+lfs no

could the error be in the qm_ext_build script. Here is the
section of code producing the error.

echo ---
echo  get the directory where PHP extension are stored
echo ---
EXTDIR=`php -i 2> /dev/null | grep -i "extension_dir" | cut -d" " -f3`
if [ ! -d "$EXTDIR" ]; then
echo -n -e "\n"
echo 
echo You need to create the php extensions directory:
echo $EXTDIR
echo 
echo -n -e "\n"
exit
fi

When I run manually I get:
root@dell350:/usr/qmsys/qmphp# php -i 2> /dev/null | grep -i "extension_dir" 
|

cut -d" " -f3
/usr/lib/php5/20090626+lfs
no
root@dell350:/usr/qmsys/qmphp#

I am doing this so I can connect the database I use and have only been 
studying PHP

for 5 days.

I have attached a file with the results of php -I and the build script.

Thanks again
George



-Original Message- 
From: Matijn Woudt

Sent: Tuesday, April 10, 2012 11:05 AM
To: Shawn McKenzie
Cc: George R Smith ; php-general@lists.php.net
Subject: Re: [PHP] Re: Script failing on extension_dir

On Tue, Apr 10, 2012 at 5:18 PM, Shawn McKenzie  
wrote:

On 04/09/2012 03:16 PM, George R Smith wrote:

EXTDIR=`php -i 2> /dev/null | grep -i "extension_dir" | cut -d" " -f3`

Error message follows, what does the no mean ?
get the directory where PHP extension are stored

You need to create the php extensions directory:
/usr/lib/php5/20090626+lfs no



There is something wrong with the cut where it is getting a 'no' from
the next line.  No time to test fixing that now but the simple fix on
your machine is this:

EXTDIR="/usr/lib/php5/20090626+lfs"



While I agree that it will fix the problem, it does sound suspicious.
You can check what php -i returns, to check if there is any problem
with your PHP configuration. 



root@dell350:/# php -i
PHP Deprecated:  Comments starting with '#' are deprecated in
/etc/php5/cli/conf
.d/ming.ini on line 1 in Unknown on line 0
PHP Deprecated:  Comments starting with '#' are deprecated in
/etc/php5/cli/conf
.d/ps.ini on line 1 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'/usr/lib/php5/2009062
6+lfs/qmphp.so' - /usr/lib/php5/20090626+lfs/qmphp.so: cannot open shared
object
file: No such file or directory in Unknown on line 0
phpinfo()
PHP Version => 5.3.3-7+squeeze8

System => Linux dell350 2.6.32-5-686 #1 SMP Mon Mar 26 05:20:33 UTC 2012
i686
Build Date => Feb 10 2012 14:08:33
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d
Additional .ini files parsed => /etc/php5/cli/conf.d/curl.ini,
/etc/php5/cli/conf.d/gd.ini,
/etc/php5/cli/conf.d/idn.ini,
/etc/php5/cli/conf.d/imagick.ini,
/etc/php5/cli/conf.d/imap.ini,
/etc/php5/cli/conf.d/mcrypt.ini,
/etc/php5/cli/conf.d/memcache.ini,
/etc/php5/cli/conf.d/ming.ini,
/etc/php5/cli/conf.d/mysql.ini,
/etc/php5/cli/conf.d/mysqli.ini,
/etc/php5/cli/conf.d/pdo.ini,
/etc/php5/cli/conf.d/pdo_mysql.ini,
/etc/php5/cli/conf.d/pdo_sqlite.ini,
/etc/php5/cli/conf.d/ps.ini,
/etc/php5/cli/conf.d/pspell.ini,
/etc/php5/cli/conf.d/recode.ini,
/etc/php5/cli/conf.d/snmp.ini,
/etc/php5/cli/conf.d/sqlite.ini,
/etc/php5/cli/conf.d/sqlite3.ini,
/etc/php5/cli/conf.d/suhosin.ini,
/etc/php5/cli/conf.d/tidy.ini,
/etc/php5/cli/conf.d/xmlrpc.ini,
/etc/php5/cli/conf.d/xsl.ini

PHP API => 20090626
PHP Extension => 20090626
Zend Extension => 220090626
Zend Extension Build => API220090626,NTS
PHP Extension Build => API20090626,NTS
Debug Build => no
Thread Safety => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => disabled
IPv6 Support => enabled
Registered PHP Streams => https, ftps, compress.zlib, compress.bzip2, php,
file,
glob, data, http, ftp, phar, zip
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3,
sslv2, t
ls
Registered Stream Filters => zlib.*, bzip2.*, convert.iconv.*, string.rot13,
str
ing.toupper, string.tolower, string.strip_tags, convert.*, consumed,
dechunk, mc
rypt.*, mdecrypt.*


This server is protected with the Suhosin Patch 0.9.9.1
Copyright (c) 2006-2007 Hardened-PHP Project
Copyright (c) 2007-2009 SektionEins GmbH


This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologi

[PHP] Script failing on extension_dir

2012-04-09 Thread George R Smith
All,
I am tying to install php that will talk to the database I us (QM, a pick type 
database). As I 
am new to pdp don’t have much experience in figuring out what the qm_ext_build 
script is
failing.
Thanks for you help in advance.
george

I am trying to run following:
root@dell350:/usr/qmsys/qmphp# ./qm_ext_build
It is failing here with the message after the script.

echo ---
echo get the directory where PHP extension are stored
echo ---
EXTDIR=`php -i 2> /dev/null | grep -i "extension_dir" | cut -d" " -f3`
if [ ! -d "$EXTDIR" ]; then
echo -n -e "\n"
echo 
echo You need to create the php extensions directory:
echo $EXTDIR
echo 
echo -n -e "\n"
exit
fi

Error message follows, what does the no mean ?
get the directory where PHP extension are stored

You need to create the php extensions directory:
/usr/lib/php5/20090626+lfs no


There is a directory which contains (I think) the compiled extensions.
I am unsure where to go from here. Do I create a 
extension_dir and if so where do I put it and do I have
to copy the file currently in 20090626+lfs to it. Also
would have to, I believe, add the extension_dir to
the php.ini file.
Help would be appreciated.
root@dell350:/usr/lib/php5/20090626+lfs# ls -la
total 1688
drwxr-xr-x 2 root root 4096 Apr 9 08:33 .
drwxr-xr-x 5 root root 4096 Apr 8 08:20 ..
-rw-r--r-- 1 root root 62936 Feb 10 08:31 curl.so
-rw-r--r-- 1 root root 95596 Feb 10 08:31 gd.so
-rw-r--r-- 1 root root 20024 Feb 27 2010 idn.so
-rw-r--r-- 1 root root 335288 Jun 1 2010 imagick.so

[PHP] Need Part-time Coder

2011-12-27 Thread John R. Cornell II
Email PHP sample for consideration


Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-04 Thread Suyash R
On Tue, Nov 2, 2010 at 5:49 PM, Nathan Nobbe  wrote:

> On Tue, Nov 2, 2010 at 2:33 PM, Suyash R  wrote:
>
>> No, we didn't try it our dept.'s admin wants to know where is sockets.so
>> file on disk
>>
>
> lol, tell your dept.'s 'admin' to run
>
> locate sockets.so
>

yeah he couldn't find it either. He mentioned it's not in the php extensions
so I am looking for way to install it or add it.

>
>
>>  and why should we try this when the phpinfo() displays sockets being
>> enabled?
>>
>
> probly there is no need to, however you should understand the difference
> between adding support for and enabling an extension.
>
> compiling w/ --enable only makes the extension available.  the extension is
> not enabled unless you do what Nick has been saying.  (there are other
> options as well actually).  there may be other files aside from php.ini
> where this setting is made, depending on how the OS vendors package up the
> code.  for example using mac ports, i just installed sockets and now have a
> shiny new sockets.ini file.
>
> anyway if phpinfo() shows that sockets are enabled you probly don't have to
> worry about that, because it wouldn't be showing up otherwise (essentially).
>
> i'm wondering if you're trying to call socket_create() from the same place
> you're running phpinfo().  are you sure the socket_create() code isn't
> running from the cli perhaps?
>

yes to see the errors we ran it at cli. The browser page with sockets code
is just blank.

>
> if so, a quick test to see if sockets are enabled on the cli is
>
> php -i | grep 'Sockets Support'
>

Yeah, this gives no results. Hence, I think sockets are not enabled yet as
sockets.so is missing.

>
> if nothing comes back sockets aren't enabled for the cli.  if that's the
> case then you will have to head into the appropriate ini file to enable the
> extension for the cli.  or if that's too much for you admin you can always
> try
>
> dl('sockets.so');
>
> at the top of your script.  you can also try
>
> var_dump(extension_loaded('sockets'));
>
>
When I add this line (dl('sockets.so');) to the top of my script I get the
following error:


PHP Warning:  dl(): Unable to load dynamic library './sockets.so' - ld.so.1:
php: fatal: ./sockets.so: open failed: No such file or directory in
//r.php on line 2
PHP Fatal error:  Call to undefined function socket_create() in
/.r.php on line 24

When I add this line (var_dump(extension_loaded('sockets'));) to the top of
my script:
bool(false)
PHP Fatal error:  Call to undefined function socket_create() in
/../r.php on line 24

to see if sockets are actually enabled where you're trying to invoke them
> from.
>
> -nathan
>
Can I get any help on how to add or install sockets.so to the php
extensions...

-Suyash


Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-04 Thread Suyash R
We added the extension=sockets.so to php.ini but it didn't work. However,
the problem was there was no sockets.so extension anywhere to be found.

i searched if I could install or add sockets.so extension. Couldn't find
anything.

Still looking for it.

Thank you for all the help.

-Suyash


On Tue, Nov 2, 2010 at 5:30 PM, Nicholas Kell  wrote:

>
> On Nov 2, 2010, at 3:23 PM, Suyash R wrote:
>
> >
> > No, our dept.'s admin wants to know where is sockets.so file on disk and
> why should we try this when the phpinfo() displays sockets being enabled?
> >
> > Can help me find sockets.so file I don't know where it is It's a shared
> object right are they stored on disk as individual files or all together
> compiled into a binary
> >
> > Thank you
> >
> > Suyash Ramineni
> > On Tue, Nov 2, 2010 at 3:55 PM, Nicholas Kell 
> wrote:
> >
> > On Nov 2, 2010, at 2:50 PM, Suyash R wrote:
> >
> > > My admin disagrees and I have questions too.
> > >
> > > The phpinfo() fuction displays that sockets have been enabled. If
> > > extension=sockets.so is an alternate way to enable sockets, then why
> should
> > > this be done twice?
> > >
> > > Suyash Ramineni
> > > On Mon, Nov 1, 2010 at 2:35 PM, Nicholas Kell 
> wrote:
> > >
> > >>
> > >> On Nov 1, 2010, at 1:12 PM, Suyash R wrote:
> > >>
> > >>> No, sockets.so in not included in any of the machines php.ini file.
> > >> However, I found that Linux machine's php.ini doesn't include
> sockets.so and
> > >> sockets work fine on it but don't work on the Solaris machine.
> > >>>
> > >>> Is it required to be included only in Solaris?
> > >>>
> > >>> On Mon, Nov 1, 2010 at 1:41 PM, Nicholas Kell  >
> > >> wrote:
> > >>>
> > >>> On Nov 1, 2010, at 12:08 PM, crrr errr wrote:
> > >>>
> > >>>> Yes, the http ( Apache user) has rl ( read permission) on the php
> file
> > >> with
> > >>>> sockets code in it. I think write access is unnecessary for Apache
> > >> user.
> > >>>>
> > >>>> On Mon, Nov 1, 2010 at 12:50 PM, Nicholas Kell <
> n...@monkeyknight.com
> > >>> wrote:
> > >>>>
> > >>>>>
> > >>>>> On Nov 1, 2010, at 11:44 AM, crrr errr wrote:
> > >>>>>
> > >>>>>> Yes, the phpinfo() shows that sockets are enabled in both
> machines.
> > >>>>>> On Mon, Nov 1, 2010 at 12:43 PM, Bastien Koert  >
> > >>>>> wrote:
> > >>>>>>
> > >>>>>>> On Mon, Nov 1, 2010 at 12:40 PM, crrr errr <
> > >> r.suy...@gmail.com>
> > >>>>>>> wrote:
> > >>>>>>>> Hello,
> > >>>>>>>>
> > >>>>>>>> I was trying to create a socket connection from a Solaris
> machine
> > >> to a
> > >>>>>>> Red
> > >>>>>>>> Hat machine  to get the PATH in Red Hat machine remotely on
> Solaris
> > >>>>>>> machine
> > >>>>>>>> and display it to the user.
> > >>>>>>>>
> > >>>>>>>> We have a PHP 5.1.6 installation on a Linux server (Apache) and
> PHP
> > >>>>>>> 5.2.6.
> > >>>>>>>> on a Unix(Solaris) server(Apache) . The PHP version on Solaris
> is
> > >>>>>>> compiled
> > >>>>>>>> with --enable sockets and phpinfo() displays that the sockets
> are
> > >>>>>>> enabled.
> > >>>>>>>> In spite of this we get the following error when using this
> piece
> > >> of
> > >>>>> code
> > >>>>>>>> from the Solaris machine.
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>> The error:
> > >>>>>>>>
> > >>>>>>>> PHP Fatal error:  Call to undefined function socket_create() in
> > >> /XXX/
> > >>>>>>>> 5server.php<
> > >>>>>>>
> http://cad.njit.edu/u/d/x/dx8/public_html/clunk/swsearch5server.php
> > >>>
&

Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-02 Thread Suyash R
Sorry for the bad formatting and grammar in the previous mail.

No, we didn't try it our dept.'s admin wants to know where is sockets.so
file on disk and why should we try this when the phpinfo() displays sockets
being enabled?

Can you please help me find sockets.so file. I can't find it. It's a shared
object. Right? Are they stored on disk as individual files or all together
compiled into a binary. Thanks for the link I will request him again to try
it out.

Thank you.

Suyash Ramineni

On Tue, Nov 2, 2010 at 4:23 PM, Suyash R  wrote:

>
> No, our dept.'s admin wants to know where is sockets.so file on disk and
> why should we try this when the phpinfo() displays sockets being enabled?
>
> Can help me find sockets.so file I don't know where it is It's a shared
> object right are they stored on disk as individual files or all together
> compiled into a binary
>
> Thank you
>
> Suyash Ramineni
>
> On Tue, Nov 2, 2010 at 3:55 PM, Nicholas Kell wrote:
>
>>
>> On Nov 2, 2010, at 2:50 PM, Suyash R wrote:
>>
>> > My admin disagrees and I have questions too.
>> >
>> > The phpinfo() fuction displays that sockets have been enabled. If
>> > extension=sockets.so is an alternate way to enable sockets, then why
>> should
>> > this be done twice?
>> >
>> > Suyash Ramineni
>> > On Mon, Nov 1, 2010 at 2:35 PM, Nicholas Kell 
>> wrote:
>> >
>> >>
>> >> On Nov 1, 2010, at 1:12 PM, Suyash R wrote:
>> >>
>> >>> No, sockets.so in not included in any of the machines php.ini file.
>> >> However, I found that Linux machine's php.ini doesn't include
>> sockets.so and
>> >> sockets work fine on it but don't work on the Solaris machine.
>> >>>
>> >>> Is it required to be included only in Solaris?
>> >>>
>> >>> On Mon, Nov 1, 2010 at 1:41 PM, Nicholas Kell 
>> >> wrote:
>> >>>
>> >>> On Nov 1, 2010, at 12:08 PM, crrr errr wrote:
>> >>>
>> >>>> Yes, the http ( Apache user) has rl ( read permission) on the php
>> file
>> >> with
>> >>>> sockets code in it. I think write access is unnecessary for Apache
>> >> user.
>> >>>>
>> >>>> On Mon, Nov 1, 2010 at 12:50 PM, Nicholas Kell <
>> n...@monkeyknight.com
>> >>> wrote:
>> >>>>
>> >>>>>
>> >>>>> On Nov 1, 2010, at 11:44 AM, crrr errr wrote:
>> >>>>>
>> >>>>>> Yes, the phpinfo() shows that sockets are enabled in both machines.
>> >>>>>> On Mon, Nov 1, 2010 at 12:43 PM, Bastien Koert 
>> >>>>> wrote:
>> >>>>>>
>> >>>>>>> On Mon, Nov 1, 2010 at 12:40 PM, crrr errr <
>> >> r.suy...@gmail.com>
>> >>>>>>> wrote:
>> >>>>>>>> Hello,
>> >>>>>>>>
>> >>>>>>>> I was trying to create a socket connection from a Solaris machine
>> >> to a
>> >>>>>>> Red
>> >>>>>>>> Hat machine  to get the PATH in Red Hat machine remotely on
>> Solaris
>> >>>>>>> machine
>> >>>>>>>> and display it to the user.
>> >>>>>>>>
>> >>>>>>>> We have a PHP 5.1.6 installation on a Linux server (Apache) and
>> PHP
>> >>>>>>> 5.2.6.
>> >>>>>>>> on a Unix(Solaris) server(Apache) . The PHP version on Solaris is
>> >>>>>>> compiled
>> >>>>>>>> with --enable sockets and phpinfo() displays that the sockets are
>> >>>>>>> enabled.
>> >>>>>>>> In spite of this we get the following error when using this piece
>> >> of
>> >>>>> code
>> >>>>>>>> from the Solaris machine.
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>> The error:
>> >>>>>>>>
>> >>>>>>>> PHP Fatal error:  Call to undefined function socket_create() in
>> >> /XXX/
>> >>>>>>>> 5server.php<
>> >>>>>>>
>> http://cad.njit.edu/u/d/x/dx8/public_html/clunk/swsearch5se

Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-02 Thread Suyash R
No, our dept.'s admin wants to know where is sockets.so file on disk and why
should we try this when the phpinfo() displays sockets being enabled?

Can help me find sockets.so file I don't know where it is It's a shared
object right are they stored on disk as individual files or all together
compiled into a binary

Thank you

Suyash Ramineni
On Tue, Nov 2, 2010 at 3:55 PM, Nicholas Kell  wrote:

>
> On Nov 2, 2010, at 2:50 PM, Suyash R wrote:
>
> > My admin disagrees and I have questions too.
> >
> > The phpinfo() fuction displays that sockets have been enabled. If
> > extension=sockets.so is an alternate way to enable sockets, then why
> should
> > this be done twice?
> >
> > Suyash Ramineni
> > On Mon, Nov 1, 2010 at 2:35 PM, Nicholas Kell 
> wrote:
> >
> >>
> >> On Nov 1, 2010, at 1:12 PM, Suyash R wrote:
> >>
> >>> No, sockets.so in not included in any of the machines php.ini file.
> >> However, I found that Linux machine's php.ini doesn't include sockets.so
> and
> >> sockets work fine on it but don't work on the Solaris machine.
> >>>
> >>> Is it required to be included only in Solaris?
> >>>
> >>> On Mon, Nov 1, 2010 at 1:41 PM, Nicholas Kell 
> >> wrote:
> >>>
> >>> On Nov 1, 2010, at 12:08 PM, crrr errr wrote:
> >>>
> >>>> Yes, the http ( Apache user) has rl ( read permission) on the php file
> >> with
> >>>> sockets code in it. I think write access is unnecessary for Apache
> >> user.
> >>>>
> >>>> On Mon, Nov 1, 2010 at 12:50 PM, Nicholas Kell  >>> wrote:
> >>>>
> >>>>>
> >>>>> On Nov 1, 2010, at 11:44 AM, crrr errr wrote:
> >>>>>
> >>>>>> Yes, the phpinfo() shows that sockets are enabled in both machines.
> >>>>>> On Mon, Nov 1, 2010 at 12:43 PM, Bastien Koert 
> >>>>> wrote:
> >>>>>>
> >>>>>>> On Mon, Nov 1, 2010 at 12:40 PM, crrr errr <
> >> r.suy...@gmail.com>
> >>>>>>> wrote:
> >>>>>>>> Hello,
> >>>>>>>>
> >>>>>>>> I was trying to create a socket connection from a Solaris machine
> >> to a
> >>>>>>> Red
> >>>>>>>> Hat machine  to get the PATH in Red Hat machine remotely on
> Solaris
> >>>>>>> machine
> >>>>>>>> and display it to the user.
> >>>>>>>>
> >>>>>>>> We have a PHP 5.1.6 installation on a Linux server (Apache) and
> PHP
> >>>>>>> 5.2.6.
> >>>>>>>> on a Unix(Solaris) server(Apache) . The PHP version on Solaris is
> >>>>>>> compiled
> >>>>>>>> with --enable sockets and phpinfo() displays that the sockets are
> >>>>>>> enabled.
> >>>>>>>> In spite of this we get the following error when using this piece
> >> of
> >>>>> code
> >>>>>>>> from the Solaris machine.
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> The error:
> >>>>>>>>
> >>>>>>>> PHP Fatal error:  Call to undefined function socket_create() in
> >> /XXX/
> >>>>>>>> 5server.php<
> >>>>>>>
> http://cad.njit.edu/u/d/x/dx8/public_html/clunk/swsearch5server.php
> >>>
> >>>>>>>> on
> >>>>>>>> line 21
> >>>>>>>>
> >>>>>>>> The code;
> >>>>>>>>
> >>>>>>>>  >>>>>>>>
> >>>>>>>> set_time_limit(0);
> >>>>>>>>
> >>>>>>>> //ip of the server
> >>>>>>>> $addr = 'xxx.xxx.xxx.xxx';
> >>>>>>>>
> >>>>>>>> //port of the server
> >>>>>>>> $port = 2xxx;
> >>>>>>>>
> >>>>>>>> //create a socket
> >>>>>>>> $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);  /* This is
> >> line
> >>>>> no
> >>>>>>> 21
> >>>

Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-02 Thread Suyash R
My admin disagrees and I have questions too.

The phpinfo() fuction displays that sockets have been enabled. If
extension=sockets.so is an alternate way to enable sockets, then why should
this be done twice?

Suyash Ramineni
On Mon, Nov 1, 2010 at 2:35 PM, Nicholas Kell  wrote:

>
> On Nov 1, 2010, at 1:12 PM, Suyash R wrote:
>
> > No, sockets.so in not included in any of the machines php.ini file.
> However, I found that Linux machine's php.ini doesn't include sockets.so and
> sockets work fine on it but don't work on the Solaris machine.
> >
> > Is it required to be included only in Solaris?
> >
> > On Mon, Nov 1, 2010 at 1:41 PM, Nicholas Kell 
> wrote:
> >
> > On Nov 1, 2010, at 12:08 PM, crrr errr wrote:
> >
> > > Yes, the http ( Apache user) has rl ( read permission) on the php file
> with
> > > sockets code in it. I think write access is unnecessary for Apache
> user.
> > >
> > > On Mon, Nov 1, 2010 at 12:50 PM, Nicholas Kell  >wrote:
> > >
> > >>
> > >> On Nov 1, 2010, at 11:44 AM, crrr errr wrote:
> > >>
> > >>> Yes, the phpinfo() shows that sockets are enabled in both machines.
> > >>> On Mon, Nov 1, 2010 at 12:43 PM, Bastien Koert 
> > >> wrote:
> > >>>
> > >>>> On Mon, Nov 1, 2010 at 12:40 PM, crrr errr <
> r.suy...@gmail.com>
> > >>>> wrote:
> > >>>>> Hello,
> > >>>>>
> > >>>>> I was trying to create a socket connection from a Solaris machine
> to a
> > >>>> Red
> > >>>>> Hat machine  to get the PATH in Red Hat machine remotely on Solaris
> > >>>> machine
> > >>>>> and display it to the user.
> > >>>>>
> > >>>>> We have a PHP 5.1.6 installation on a Linux server (Apache) and PHP
> > >>>> 5.2.6.
> > >>>>> on a Unix(Solaris) server(Apache) . The PHP version on Solaris is
> > >>>> compiled
> > >>>>> with --enable sockets and phpinfo() displays that the sockets are
> > >>>> enabled.
> > >>>>> In spite of this we get the following error when using this piece
> of
> > >> code
> > >>>>> from the Solaris machine.
> > >>>>>
> > >>>>>
> > >>>>> The error:
> > >>>>>
> > >>>>> PHP Fatal error:  Call to undefined function socket_create() in
> /XXX/
> > >>>>> 5server.php<
> > >>>> http://cad.njit.edu/u/d/x/dx8/public_html/clunk/swsearch5server.php
> >
> > >>>>> on
> > >>>>> line 21
> > >>>>>
> > >>>>> The code;
> > >>>>>
> > >>>>>  > >>>>>
> > >>>>> set_time_limit(0);
> > >>>>>
> > >>>>> //ip of the server
> > >>>>> $addr = 'xxx.xxx.xxx.xxx';
> > >>>>>
> > >>>>> //port of the server
> > >>>>> $port = 2xxx;
> > >>>>>
> > >>>>> //create a socket
> > >>>>> $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);  /* This is
> line
> > >> no
> > >>>> 21
> > >>>>> in the code. i have ommitted a few header comments */
> > >>>>>
> > >>>>> //bind this socket with the above ip and port
> > >>>>> $ret = socket_bind($sock, $addr, $port);
> > >>>>>
> > >>>>> do {
> > >>>>>  $ret = socket_listen($sock, 10);
> > >>>>>  $msgSock = socket_accept($sock);
> > >>>>>  $buf = socket_read($msgSock, 1024);
> > >>>>>
> > >>>>>
> > >>>>> Please let me know if you need any further details I might have
> missed.
> > >>>>>
> > >>>>> Thank you.
> > >>>>>
> > >>>>> Suyash Ramineni
> > >>>>>
> > >>>>
> > >>>>
> > >>>> check phpinfo() to see if the sockets have been activated in the ini
> > >> file.
> > >>>> --
> > >>>>
> > >>>> Bastien
> > >>>>
> > >>>> Cat, the other other white meat
> > >>>>
> > >>
> > >>
> > >> I think that I messed up sending my last email, I apologize.
> > >>
> > >> Is the user that Apache is running under configured for the proper
> read
> > >> write access to the socket file?
> > >>
> > >>
> > >> --
> > >> PHP General Mailing List (http://www.php.net/)
> > >> To unsubscribe, visit: http://www.php.net/unsub.php
> > >>
> > >>
> >
> > Oops, included in php.ini, not the Apache config.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> Since you complied with --enable-sockets, you shouldn't even need
> sockets.so to be dynamically loaded. But at this point, it is something that
> I would try anyway.
>
> Add:
>
> extension=sockets.so
>
> in your php.ini file just to see if it brings the function to light.
>
> Your Linux installs I am sure were compiled with it in it. Especially if it
> is a dist package.
>
> The absence of the function is telling me that PHP is not compiled with
> --enable-sockets. If it was compiled in properly, you would be getting
> different errors. I am not saying that you didn't do it. Something may have
> happened in the process.
>
> By adding the sockets.so, you are adding the extension dynamically, incase
> you were mistaken by the compile or incase there was some sort of anomaly
> that the rest of PHP compiled but the sockets section was botched. Solaris
> is (I guess) known to be lacking when it comes to C compilers (at least
> according to the Unix geeks that I sit next to at work). But it seems to me
> that it would all have failed or it would have all worked.


Re: [PHP] PHP sockets enabled but socket_create() gives an error call to undefined function

2010-11-01 Thread Suyash R
No, sockets.so in not included in any of the machines php.ini file. However,
I found that Linux machine's php.ini doesn't include sockets.so and sockets
work fine on it but don't work on the Solaris machine.

Is it required to be included only in Solaris?

On Mon, Nov 1, 2010 at 1:41 PM, Nicholas Kell  wrote:

>
> On Nov 1, 2010, at 12:08 PM, crrr errr wrote:
>
> > Yes, the http ( Apache user) has rl ( read permission) on the php file
> with
> > sockets code in it. I think write access is unnecessary for Apache user.
> >
> > On Mon, Nov 1, 2010 at 12:50 PM, Nicholas Kell  >wrote:
> >
> >>
> >> On Nov 1, 2010, at 11:44 AM, crrr errr wrote:
> >>
> >>> Yes, the phpinfo() shows that sockets are enabled in both machines.
> >>> On Mon, Nov 1, 2010 at 12:43 PM, Bastien Koert 
> >> wrote:
> >>>
>  On Mon, Nov 1, 2010 at 12:40 PM, crrr errr <
> r.suy...@gmail.com>
>  wrote:
> > Hello,
> >
> > I was trying to create a socket connection from a Solaris machine to
> a
>  Red
> > Hat machine  to get the PATH in Red Hat machine remotely on Solaris
>  machine
> > and display it to the user.
> >
> > We have a PHP 5.1.6 installation on a Linux server (Apache) and PHP
>  5.2.6.
> > on a Unix(Solaris) server(Apache) . The PHP version on Solaris is
>  compiled
> > with --enable sockets and phpinfo() displays that the sockets are
>  enabled.
> > In spite of this we get the following error when using this piece of
> >> code
> > from the Solaris machine.
> >
> >
> > The error:
> >
> > PHP Fatal error:  Call to undefined function socket_create() in /XXX/
> > 5server.php<
>  http://cad.njit.edu/u/d/x/dx8/public_html/clunk/swsearch5server.php>
> > on
> > line 21
> >
> > The code;
> >
> >  >
> > set_time_limit(0);
> >
> > //ip of the server
> > $addr = 'xxx.xxx.xxx.xxx';
> >
> > //port of the server
> > $port = 2xxx;
> >
> > //create a socket
> > $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);  /* This is
> line
> >> no
>  21
> > in the code. i have ommitted a few header comments */
> >
> > //bind this socket with the above ip and port
> > $ret = socket_bind($sock, $addr, $port);
> >
> > do {
> >  $ret = socket_listen($sock, 10);
> >  $msgSock = socket_accept($sock);
> >  $buf = socket_read($msgSock, 1024);
> >
> >
> > Please let me know if you need any further details I might have
> missed.
> >
> > Thank you.
> >
> > Suyash Ramineni
> >
> 
> 
>  check phpinfo() to see if the sockets have been activated in the ini
> >> file.
>  --
> 
>  Bastien
> 
>  Cat, the other other white meat
> 
> >>
> >>
> >> I think that I messed up sending my last email, I apologize.
> >>
> >> Is the user that Apache is running under configured for the proper read
> >> write access to the socket file?
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
>
> Oops, included in php.ini, not the Apache config.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] simple WSDL client

2010-02-08 Thread Robert R
Hi,

I am writing a simple WSDL client in php as follow:

http://staff.um.edu.mt/cabe2/supervising/undergraduate/owlseditFYP/TemperatureService.wsdl
";
$client = new SoapClient("
http://staff.um.edu.mt/cabe2/supervising/undergraduate/owlseditFYP/TemperatureService.wsdl
");
echo("\nReturning value of getTemp() call: ". $client->getTemp("12345"));
?>

when running the script I am getting the following error:

Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host
in /var/www/phpsoap/client5.php:4
Stack trace:
#0 [internal function]: SoapClient->__doRequest('http://services...', '', 1, 0)
#1 [internal function]: SoapClient->__call('getTemp', Array)
#2 /var/www/phpsoap/client5.php(4): SoapClient->getTemp('12345')
#3 {main}
  thrown in /var/www/phpsoap/client5.php on line 4

Am I missing anything?

Thanks,
R


[PHP] ereg_replace to preg_replace translation

2009-08-11 Thread m a r k u s

Hi all,

I see that from PHP 5.3.0 ereg_replace() function is deprecated and throws a 
warning.
I would like to use the preg_replace() function as an alternative of ereg_replace() function but... 
can't undestand the "\n#[^\n]*\n" expression.


$sql = ereg_replace("\n#[^\n]*\n", "", $sql);

Any help for tranlation or alternative ?
Thanks

--
m a r k u s

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP as Server Side for a Web Database Application.

2009-06-09 Thread R. S. Patil
Hi,

We are in phase of evaluating PHP as Serverside technology for our first web
application.
We have finalized Flex for user interface and Birt as reporting engine. Now
the data services
are to be evaluated. Flex forums recommended us using PHP for this.

We would like to implement SOA for database access/Inserts/Updates/Queries
for report engine BIRT.
For SOA implementation we are considering XML-RPC and WSO2-WSF since we dont
have any past
experience on web development we are not position to make any decisions
about PHP serverside
technologies can somebody guide use which one we should select (May be
different than these two).
We will be using flex forms to insert and update data through web services
(mainly CRUD operations)
and PHP "Query" data services will be acting as Data Source to Birt for
reporting. Please suggest us
technolgy which is secure and prooven. The problem of integrating Birt in to
PHP has been solved
and successfully tested also.

Thanks and Best Regards

Raja


Re: [PHP] Amazon s3 and PHP

2009-06-03 Thread R B
To configure a AMI have some extra fee?

Do you have a link to read how to run php files in amazon s3?

Thanks.


On Wed, Jun 3, 2009 at 11:13 AM, Bastien Koert  wrote:

> On Wed, Jun 3, 2009 at 12:27 PM, R B  wrote:
> > Hi,
> >
> > Do you know if amazon s3 hosting support php files?
> >
> > Thanks.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> yep, depending on the AMI you use to set up the server. There are many
> supporting php5, but not many supporting mysql5
>
>
> --
>
> Bastien
>
> Cat, the other other white meat
>


[PHP] Amazon s3 and PHP

2009-06-03 Thread R B
Hi,

Do you know if amazon s3 hosting support php files?

Thanks.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multithreading in PHP

2009-03-18 Thread Alpár Török
2009/3/17 Manoj Singh :
> Hi Alpar,
>
> Thanks for reply.
>
> Actually the form is submitted through ajax request and the validation is
> checking on the server side. So if any error occurs on submission of form,
> then we are displaying the errors to the user. And is there is no error,
> then the submitted page started processing. So here client has to wait until
> the page process completed or not. What i want here if possible, after
> validating the user input server sends the thanks response to the client so
> that cleint doesn't has to wait, then the server starts the processing.
> Please suggest if it is possible.
>
> Regards,
> Manoj
>
>
>
> On Tue, Mar 17, 2009 at 7:01 PM, Alpár Török  wrote:
>>
>> 2009/3/17 Manoj Singh :
>> > Hi Guys,
>> >
>> > I am creating a page which submits the form through Ajax request & the
>> > submitted page is sending the mails to n number of users. Now until the
>> > mail
>> > sends or the page process completed the end user has to wait.
>> >
>> > Is it possible that server sends the response to the client & then start
>> > processing so that the client doesn't have to wait for the server
>> > response.
>> >
>> > Please suggest.
>> >
>> > Regards,
>> > Manoj
>> >
>> Since you are using Ajax requests, which by their nature are
>> asynchronous , your user won't have to wait. You can write some JS
>> code to let him know that the request was sent, and just let the ajax
>> call run in the background. On the server side make sure to ignore
>> user abort, just in case the user navigates away.
>>
>>
>> --
>> Alpar Torok
>
>

Let me be more specific. it goes like this:

front end:

   submit ajax,
   on server response check if the input didn't validate, or if the
task finished, offer fedback

on the server:
   ignore user intrerupt with ignore_user_abort();  and adjust max
execution time
   validate the input
   send back errors if the the input doesn't validate (at this point
the user won't have to wait for a long time)
   start the task that takes really long
   send a message that the task was done

The user will either be on the page  and get the message (if you want
to show one) or navigated away by this time, but your processing is
still done.
-- 
Alpar Torok

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multithreading in PHP

2009-03-17 Thread Alpár Török
2009/3/17 Manoj Singh :
> Hi Guys,
>
> I am creating a page which submits the form through Ajax request & the
> submitted page is sending the mails to n number of users. Now until the mail
> sends or the page process completed the end user has to wait.
>
> Is it possible that server sends the response to the client & then start
> processing so that the client doesn't have to wait for the server response.
>
> Please suggest.
>
> Regards,
> Manoj
>
Since you are using Ajax requests, which by their nature are
asynchronous , your user won't have to wait. You can write some JS
code to let him know that the request was sent, and just let the ajax
call run in the background. On the server side make sure to ignore
user abort, just in case the user navigates away.


-- 
Alpar Torok

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Execute flash files with PHP

2009-02-19 Thread R B
Hello.

I have two scripts in php that reads a .swf or .flv movie file, like this:

SCRIPT # 1



SCRIPT # 2



The script # 1 with the .swf file works fine: the video is executed with
streaming.
The script # 2 with the .flv file  is executed but without streaming.

If i execute the movie.flv directly (without the php script), then it´s
executed with streaming.

Do you know how can i do to execute the .flv file with php and with
straming?
I tried with fopen, readfile, but don´t works.

Thank you


Re: [PHP] Re: Extract result from a https remote server response

2009-02-13 Thread m a r k u s

Sorry all, I was testing in a Windows environment.
I feel like an idiot... :)

Thanks to all.

--
m a r k u s

Bruno Fajardo wrote:

Assigning the return of file_get_contents to a variable?
Didn't get your point...

2009/2/13 m a r k u s 

Shawn McKenzie wrote:

Shawn McKenzie wrote:

m a r k u s wrote:

Hi all,

Example : 
https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123
The MB server response displayed is : Illegal operation.
We would like to put the result below in a php variable and process it .
An idea ?

PS: The server is secured. The php functions like file(), file_get_contents(), 
readfile(), fopen() has been tested.
Regards

--

m a r  k u s



allow_url_fopen = On


We have no control of the MB remote server configuration.

--
m a r k u s

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Extract result from a https remote server response

2009-02-13 Thread m a r k u s

Shawn McKenzie wrote:

Shawn McKenzie wrote:

m a r k u s wrote:

Hi all,

Example : 
https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123

The MB server response displayed is : Illegal operation.
We would like to put the result below in a php variable and process it .
An idea ?

PS: The server is secured. The php functions like file(), 
file_get_contents(), readfile(), fopen() has been tested.

Regards

--

m a r  k u s




allow_url_fopen = On



We have no control of the MB remote server configuration.

--
m a r k u s

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Extract result from a https remote server response

2009-02-13 Thread m a r k u s

Shawn McKenzie wrote:

m a r k u s wrote:

Hi all,

Example : 
https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123

The MB server response displayed is : Illegal operation.
We would like to put the result below in a php variable and process it .
An idea ?

PS: The server is secured. The php functions like file(), 
file_get_contents(), readfile(), fopen() has been tested.

Regards

--

m a r  k u s




Well, I don't know how you tested, but if fopen_wrappers are enabled in
php.ini, then this:

echo
file_get_contents('https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123');

displays this:

Illegal operation


Seems to work for me.



The question is how to extract what is displayed to be processed by our script ?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Extract result from a https remote server response

2009-02-12 Thread m a r k u s

Hi all,

Example :
https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123
The MB server response displayed is : Illegal operation.
We would like to put the result below in a php variable and process it .
An idea ?

PS: The server is secured. The php functions like file(),
file_get_contents(), readfile(), fopen() has been tested.

Thanks,
Markus

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: mysql_query - CREATE DATABASE

2009-02-09 Thread R B
thank you.



On Mon, Feb 9, 2009 at 1:14 PM, Shawn McKenzie  wrote:

> R B wrote:
> > I´m looking that i have another problem:
> >
> > I´m making a software to install in any server.
> >
> > The software needs a database, so i want to create a script install.php
> > to create the database when this script is executed.
> >
> > At this point of the instalation, i don´t know none of the users that are
> > defined in mysql.
> >
> > If i use this command:
> >
> > mysql_query("CREATE DATABASE my_db",$con)
> >
> > first i need to connect to mysql with the command
> >
> > mysql_connect
> >
> > But at this point, i don´t know none of the users that are defined in
> mysql.
> >
> > So, what i do in this case?
> >
> > Thanks
> >
> >
>
> Well, obviously the user will have to supply the username and password.
>  There's no way around that.  So after you know the username you can
> create the db and then check if the db exists as you have named it
> (my_db), and if not check for ($username_my_db), if not that then one of
> the examples I gave you, or just skip right to listing the databases.
>
>
> --
>  Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Re: mysql_query - CREATE DATABASE

2009-02-09 Thread R B
I´m looking that i have another problem:

I´m making a software to install in any server.

The software needs a database, so i want to create a script install.php
to create the database when this script is executed.

At this point of the instalation, i don´t know none of the users that are
defined in mysql.

If i use this command:

mysql_query("CREATE DATABASE my_db",$con)

first i need to connect to mysql with the command

mysql_connect

But at this point, i don´t know none of the users that are defined in mysql.

So, what i do in this case?

Thanks


On Mon, Feb 9, 2009 at 12:31 PM, Shawn McKenzie wrote:

> Shawn McKenzie wrote:
> > R B wrote:
> >> Hello,
> >>
> >> When i create a mysql database with the next command:
> >>
> >> mysql_query("CREATE DATABASE my_db",$con)
> >>
> >> In the server is created the database, but usually the name is created
> with
> >> a prefix.
> >>
> >> In this case: someuser_my_db
> >>
> >> How can i detect with PHP the complete name of the new database created?
> >>
> >> Thanks
> >>
> >
> > There may be a better way, but off the top of my head, translate this to
> > PHP:
> >
> > use information_schema;
> > select SCHEMA_NAME from SCHEMATA where SCHEMA_NAME like '%_my_db';
> >
> > Now of course you could have multiples there, like user_my_db and
> > user2_my_db.  Not sure about that, maybe it would be the last one in the
> > returned records?
> >
>
> Using mysql_list_dbs() and mysql_db_name()  would acheive the same,
> however from the man page of mysql_db_name() there is a neat contib:
>
> $result = mysql_query("SELECT DATABASE()");
> $dbname = mysql_result($result, 0);
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Re: mysql_query - CREATE DATABASE

2009-02-09 Thread R B
I´m creating a software that use a database, and i want to include a
install.php file to install the database
of the software.

I can create the database in the install.php file with

mysql_query("CREATE DATABASE my_db",$con)
But when is created, i don´t know the complete name of the database, because
a prefix is added.




On Mon, Feb 9, 2009 at 12:17 PM, Shawn McKenzie wrote:

>  R B wrote:
> > Hello,
> >
> > When i create a mysql database with the next command:
> >
> > mysql_query("CREATE DATABASE my_db",$con)
> >
> > In the server is created the database, but usually the name is created
> with
> > a prefix.
> >
> > In this case: someuser_my_db
> >
> > How can i detect with PHP the complete name of the new database created?
> >
> > Thanks
> >
>
> There may be a better way, but off the top of my head, translate this to
> PHP:
>
> use information_schema;
> select SCHEMA_NAME from SCHEMATA where SCHEMA_NAME like '%_my_db';
>
> Now of course you could have multiples there, like user_my_db and
> user2_my_db.  Not sure about that, maybe it would be the last one in the
> returned records?
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] mysql_query - CREATE DATABASE

2009-02-09 Thread R B
Hello,

When i create a mysql database with the next command:

mysql_query("CREATE DATABASE my_db",$con)

In the server is created the database, but usually the name is created with
a prefix.

In this case: someuser_my_db

How can i detect with PHP the complete name of the new database created?

Thanks


[PHP] Include PHP library file in the .htaccess

2009-01-30 Thread R B
Hello.

Supose that i have this script:



I want to know if there is a way to call the lib.php library from the
.htaccess instead of the PHP script?
Thanks.


[PHP] Non-traditional software accessing my website

2009-01-26 Thread R B
Hello,

Is there a way to be sure that a website is going to be accessed only by
traditional browsers and not from another
software that send to the server the same headers of any of the traditional
browsers?
For example, supose that i only want to give access to my site users from
firefox, ie, chrome and safari, because
i know that the users can´t download the copyright information of the
website to the temporary files with anyone
of this browsers.

How can i be sure that someone that develop a mini-browser or a software
can´t access my site sending the same
header information of traditional browsers?

In this case, the validation of HTTP_USER_AGENT isn´t a solution.

Thanks.


Re: [PHP] PHP and Apache configuration

2009-01-19 Thread R B
I like this apache solution, but if i put

SetEnvIf Referer "^http://www.yourdomain.com"; local_referal

Then i can access the file putting this path in the URL:

 http://www.yourdomain.com/xyz/scriptfile.php
And i don´t want the script to be access by the url. That is the main
problem.

Thanks


On Mon, Jan 19, 2009 at 1:38 PM, Richard Heyes  wrote:

> > ...
>
> This may be of some help. It's from the Apache website and only allows
> access if the Referer header is sent by the browser and is
> www.yourdomain.com, ie. Direct access is not permitted:
>
> ###
> SetEnvIf Referer "^http://www.yourdomain.com"; local_referal
>
> Order Deny,Allow
> Deny from all
> Allow from env=local_referal
> ###
>
> --
> Richard Heyes
>
> HTML5 Graphing for Firefox, Chrome, Opera and Safari:
> http://www.rgraph.org (Updated January 17th)
>


[PHP] PHP and Apache configuration

2009-01-19 Thread R B
Hello,

I need that every time someone access one image file in my server, then
redirect to a php file.

I make this well with:

Redirect 301 imagefile.jpg scriptfile.php

But i need that the file scriptfile.php can only be accessed by this
redirect command.

If someone try to access directly from the url
http://www.mydomain.com/xyz/scriptfile.php, i want to send an error access.

I tried with:


Order allow,deny
Deny from all

But with this configuration, the redirect command cant access the
scriptfile.php

Do you have the solution for this?

thanks.


[PHP] Create PHP form from MySQL table structure

2008-12-21 Thread R B MacGregor
Hi folks

Anybody got any recommendations for a utility which would create a quick head 
start by creating the php/html code for a basic form using the field structure 
of a MySQL table ?

Thanks for any suggestions.

-- 
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] localization folder for web site

2008-09-14 Thread Alain R.



Jochem Maas wrote:

Alain R. schreef:

Hi,

mostly (90%) websites are designed to include localization (made in 
php) folder like following:

www.mywebsite.com/en/
www.mywebsite.com/de/
www.mywebsite.com/fr/

why do they not use only 1 folder and use dynamically PHP to change 
localization of website ?


who says the 'folders' (directories) en, de, fr et al actually exist?


has this something to do with search engine rating ?


amongst other things, it's also a way of passing along the
requested translation with requiring cookies


thanks a lot,
Al.




sorry but i miss the point here...
if we have http://ww.mywebsite.com/en/index.php, you mean that in fact 
it can be http://ww.mywebsite.com/index.php?lang=en.
but in this case why and how is it possible to see 
http://ww.mywebsite.com/en/index.php in the adress bar of my browser ?

i mean if i do not have access to apache :-)

thx.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] localization folder for web site

2008-09-13 Thread Alain R.



Maciek Sokolewicz wrote:

2. google "apache mod_rewrite", that way you can rewrite urls of the 
form www.example.org/de/whatever to www.example.org/whatever?lang=de or 
even stick the de part into an environment variable $_ENV['lang'] = 'de'


- Tul


the mod_rewrite is possible only if i own/manage the apache server but i 
my case, i have a provider for that so it is not possible.

can you explain a little bit more the $_ENV purpose ?
because for me it's like a simple session variable nothing more.
how do you use it ? i mean the concept...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] localization folder for web site

2008-09-13 Thread Alain R.

how can i do the same ?

Jochem Maas wrote:

Alain R. schreef:

Hi,

mostly (90%) websites are designed to include localization (made in 
php) folder like following:

www.mywebsite.com/en/
www.mywebsite.com/de/
www.mywebsite.com/fr/

why do they not use only 1 folder and use dynamically PHP to change 
localization of website ?


who says the 'folders' (directories) en, de, fr et al actually exist?


has this something to do with search engine rating ?


amongst other things, it's also a way of passing along the
requested translation with requiring cookies


thanks a lot,
Al.





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] localization folder for web site

2008-09-13 Thread Alain R.

so how can i do the same ?
i mean to have 1 single PHP page and to localize, but to have the URI 
with /en, or /fr or /de ?


i know how to localize the complete website i already done it, but what 
you told ?


 > One would hope that unless it's a pretty small static site those
"folders" actually map to the same place and generate pages in the 
required language.


The reason it's in the URI and not URI agnostic is indeed so that search 
engines can index multiple languages if they want to.


-Stut



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] localization folder for web site

2008-09-13 Thread Alain R.

Hi,

mostly (90%) websites are designed to include localization (made in php) 
folder like following:

www.mywebsite.com/en/
www.mywebsite.com/de/
www.mywebsite.com/fr/

why do they not use only 1 folder and use dynamically PHP to change 
localization of website ?

has this something to do with search engine rating ?

thanks a lot,
Al.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Sending POST variables without html code

2008-09-05 Thread R B
Hi,

I need to create a cron job PHP script to access every day the information
of a webpage that is out of my server. This webpage needs POST variables to
display the information.

How can i send this POST variables from my PHP script without having a html
form, and receive the required information?

Thanks,

RB


Re: [PHP] multiple question form creation

2008-08-26 Thread Alain R.
thanks a lot Dan, i already know this possibility with textarea but it 
is not so nice.

i would like to do something like under windows/linux.
to have a button and when user click on it it add a new field for a new 
answer... however i do not know if it is so nice step for customer...

any other idea ? :-)

Dan Shirah wrote:

Hi,

i have a web application in which some people should be able to create form
adding questions and possible answers.
basically user should:
1. type the question (which will be displayed to customer)
2. select type of answers (closed, open, list, multiple answer, and so
on...)
3. add possible answers (could be several answers for 1 questions)

what do i wonder it's how to do it in easy and nice way.
I mean:
1. should i have 1 page asking for question title, 1 page for answer type
and (for each possible answer) 1 page for each answer ?
2. should i have AJAX which will store data into session before storing
into DB ? in this case it could be a 3 div content: 1 for question, 1 for
new anwser type (a combobox for example) and 1 div for each new answer...
but in this case how can i allow user to tell to system "hey, i need to add
another answer for this question" ?

i really would appreciate some help as it is not so hard to do it but to do
it nice and well (userfriendly in fact) it is a little more complex.

thanks a lot for your help.




Alain,

I would make everything on a single page.

A text input for the Question Title
A dropdown list for the different types
A textarea for the answer section

Then below the form just put two buttons:

"Finished" which will save the last question and take them to your homepage
"Submit Another" which will save the current question and then blank our the
answer textarea

You can use AJAX to make it seemless as far as the submission of data goes,
or you could do  as your submit action.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] multiple question form creation

2008-08-26 Thread Alain R.

Hi,

i have a web application in which some people should be able to create 
form adding questions and possible answers.

basically user should:
1. type the question (which will be displayed to customer)
2. select type of answers (closed, open, list, multiple answer, and so 
on...)

3. add possible answers (could be several answers for 1 questions)

what do i wonder it's how to do it in easy and nice way.
I mean:
1. should i have 1 page asking for question title, 1 page for answer 
type and (for each possible answer) 1 page for each answer ?
2. should i have AJAX which will store data into session before storing 
into DB ? in this case it could be a 3 div content: 1 for question, 1 
for new anwser type (a combobox for example) and 1 div for each new 
answer... but in this case how can i allow user to tell to system "hey, 
i need to add another answer for this question" ?


i really would appreciate some help as it is not so hard to do it but to 
do it nice and well (userfriendly in fact) it is a little more complex.


thanks a lot for your help.

A.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] import XLS sheet into DB

2008-08-15 Thread Alain R.

Hi,

I would like to import content of an XLS sheet into a PostgreSQL DB (table).

How can i do that ?
thanks a lot,

A.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: News reader

2008-08-10 Thread Alain R.
it seems that news.php.net server is checking if address is real or a 
fake...
at least it is checking if user's address is registered into their 
mailing list or if there are some keywords from filter like: fake, 
noemail, nospam,...


now it works :-)

Alain R. wrote:

if i use a real email address and SMTP from my real server, it works.
but not with email address [EMAIL PROTECTED] :-(

Alain Roger wrote:

yes on port 119.
i do not want to use my professional email address (or SMTP settings) to
send message on newsgroups.

for MS, Borland, eclipse and other newsgroups servers, it works perfectly
without setting a SMTP server.
i do not use gmail to send message via thunderbird... i use gmail only 
for

mailing list as thunderbird does not work :-(


On Sun, Aug 10, 2008 at 9:01 PM, Al <[EMAIL PROTECTED]> wrote:


Port 119?

Try your ISP mail account directly. Maybe gmail is blocking you.

Can you access and other newsgroups?

You'd be better off working with the Thunderbird forum for this problem.
It's not a php problem.


Alain Roger wrote:

this is what i've done even at home but sending message fails 
everytime.

even if my SMTP server is well configured :-(

On Sun, Aug 10, 2008 at 8:33 PM, Al <[EMAIL PROTECTED]> wrote:



Alain Roger wrote:

 Hi,

i tried to configure Thunderbird to read and post news on PHP.net
forums.
I'm able to read messages but not to post some.

Does anyone already succeed in it ?
Do to security reasons at work, personal email usage is strictly
forbidden
now so i'm not able to use gmail, yahoo or hotmail anymore.

thanks a lot


 Create a new account

Select newsgroup
enter news.php.net

I used Thunderbird for this message.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: News reader

2008-08-10 Thread Alain R.

if i use a real email address and SMTP from my real server, it works.
but not with email address [EMAIL PROTECTED] :-(

Alain Roger wrote:

yes on port 119.
i do not want to use my professional email address (or SMTP settings) to
send message on newsgroups.

for MS, Borland, eclipse and other newsgroups servers, it works perfectly
without setting a SMTP server.
i do not use gmail to send message via thunderbird... i use gmail only for
mailing list as thunderbird does not work :-(


On Sun, Aug 10, 2008 at 9:01 PM, Al <[EMAIL PROTECTED]> wrote:


Port 119?

Try your ISP mail account directly. Maybe gmail is blocking you.

Can you access and other newsgroups?

You'd be better off working with the Thunderbird forum for this problem.
It's not a php problem.


Alain Roger wrote:


this is what i've done even at home but sending message fails everytime.
even if my SMTP server is well configured :-(

On Sun, Aug 10, 2008 at 8:33 PM, Al <[EMAIL PROTECTED]> wrote:



Alain Roger wrote:

 Hi,

i tried to configure Thunderbird to read and post news on PHP.net
forums.
I'm able to read messages but not to post some.

Does anyone already succeed in it ?
Do to security reasons at work, personal email usage is strictly
forbidden
now so i'm not able to use gmail, yahoo or hotmail anymore.

thanks a lot


 Create a new account

Select newsgroup
enter news.php.net

I used Thunderbird for this message.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and Apache

2008-06-23 Thread R B
The people that will install this system, don´t have programming knowledge.
They have a website, buy don´t have knowledge of configurations.

If i add all the lines, it don´t works, unless the last line is the correct
for that particular server.




>
>
> Why not just read the manual and add the appropriate line for your version
> of PHP ?
>
> Makes the most sense.
>
> Or add all the lines.
>
> Pretty much an Apache list question though.
>
> Wolf
>


[PHP] PHP and Apache

2008-06-23 Thread R B
Hello,

I´m developing a PHP system that needs one of these lines in the .htaccess,
depending of the server configuration:

AddHandler application/x-httpd-php .xyz
or

AddHandler application/x-httpd-php4 .xyz

or

AddHandler application/x-httpd-php5 .xyz

How can i detect "on the fly" which line i have to use?


Re: [PHP] Memory cache problem

2008-06-13 Thread R B
The video manual it´s not for me, it´s for a customer and he don´t want to
be cached in the client machine...

If you put in firefoxin the url area:   about:cache , firefox display the
Memory cache and the Disk cache...

I search in both caches, and the video appears in the memory cache.

On Fri, Jun 13, 2008 at 4:17 PM, Stut <[EMAIL PROTECTED]> wrote:

>  On 13 Jun 2008, at 23:12, R B wrote:
>
>> I´m making a video manual, but i don´t want to be cached in the client
>> machine.
>>
>> I make a script like this:
>>
>> > header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
>> header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
>> header("Cache-Control: no-store, no-cache, must-revalidate");
>> header("Cache-Control: post-check=0, pre-check=0", false);
>> header("Pragma: no-cache");
>>
>> readfile($video_name);
>> ?>
>>
>> With Internet explorer the script works fine. But Firefox have two types
>> of
>> cache: Memory cache and disk cache.
>> With firefox disk cache, the script works fine, because don´t appears in
>> the
>> disk cache, but i have problems with the Memory cache.
>>
>> How can i avoid to appears in the firefox memory cache?
>>
>
> Why don't you want it cached?
>
> What makes you think it's cached in memory on FF?
>
> -Stut
>
> --
> http://stut.net/


[PHP] Memory cache problem

2008-06-13 Thread R B
Hello,

I´m making a video manual, but i don´t want to be cached in the client
machine.

I make a script like this:



With Internet explorer the script works fine. But Firefox have two types of
cache: Memory cache and disk cache.
With firefox disk cache, the script works fine, because don´t appears in the
disk cache, but i have problems with the Memory cache.

How can i avoid to appears in the firefox memory cache?


[PHP] Another way to send variables

2008-06-13 Thread R B
Hello.

I have this script (script1.php):



I need to send the $a variable to script2.php, but i don´t want to send it
in the url.

Is there another method?

Maybe with another header instruction without putting in the url?

Thank you.


Re: [PHP] PHP with C++[Zend Engine?]

2008-06-09 Thread Павел aka [R-K]
You wrote:

> 4) Post questions here if you have problems but be sure you show that
> you've done 1-3 or we'll ignore you.
I read this book and some else,but nothing book helped me in writing Zend - 
Extension...
I'd like to wrote some similar but simplier them Zend Encoder... If you can, 
help me please.

PS.Sorry for my English.

-- 
===
С уважением, Манылов Павел aka [R-k]
icq: 949-388-0
mailto:[EMAIL PROTECTED]
===
А ещё говорят так:
A kid'll eat the middle of an Oreo, eventually.
[fortune]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP with C++[Zend Engine?]

2008-06-09 Thread Павел aka [R-K]
You wrote:

> 4) Post questions here if you have problems but be sure you show that
> you've done 1-3 or we'll ignore you.
I read this book and some else,but nothing book helped me in writing Zend - 
Extension...
I'd like to wrote some similar but simplier them Zend Encoder... If you can, 
help me please.

PS.Sorry for my English.

-- 
===
С уважением, Манылов Павел aka [R-k]
icq: 949-388-0
mailto:[EMAIL PROTECTED]
===
А ещё говорят так:
A kid'll eat the middle of an Oreo, eventually.
[fortune]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP with C++[Zend Engine?]

2008-06-09 Thread Павел aka [R-K]
You wrote:

> 4) Post questions here if you have problems but be sure you show that
> you've done 1-3 or we'll ignore you.
I read this book and some else,but nothing book helped me in writing Zend - 
Extension...
I'd like to wrote some similar but simplier them Zend Encoder... If you can, 
help me please.

PS.Sorry for my English.

-- 
===
С уважением, Манылов Павел aka [R-k]
icq: 949-388-0
mailto:[EMAIL PROTECTED]
===
А ещё говорят так:
A kid'll eat the middle of an Oreo, eventually.
[fortune]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP with C++

2008-06-09 Thread R B
Hi,
I have a C++ script containing the function hello(x, y, z)

I want to access this C++ function from PHP, and output with PHP the return
information.

How can i do this?

Thank you.


RE: [PHP] About MS SQL Connections...

2008-06-04 Thread Lic. Eduardo R. Hernández Osorio
I use ADOdb Recordset object to accomplish the connection. 
The error message is: 
mssql error: [: ] in EXECUTE("SELECT * FROM ")




Eduardo Ricardo Hernández Osorio

Técnico Telecomunicaciones Aeronáuticas

U.T.B Servicios Aeronáuticos, ECASA s.a.

Aeropuerto Internacional "Frank País García"

Tel: (53) (24) 474569

email: [EMAIL PROTECTED]

"...de buenas intenciones está empedrado el camino al infierno..."

-Mensaje original-
De: Dan Joseph [mailto:[EMAIL PROTECTED] 
Enviado el: 03 June 2008 13:47
Para: PHP
Asunto: Re: [PHP] About MS SQL Connections...

On Tue, Jun 3, 2008 at 1:43 PM, Lic. Eduardo R. Hernández Osorio <
[EMAIL PROTECTED]> wrote:

>  Hello.
>
> I have a problem with a Desktop Edition MS SQL Server servant, when I try
> to get connected to crosswise of PHP functions to this, it provokes an
> error and I can not achieve the connection. However when I try the same
> operation on an Standard Edition MS SQL Server servant I am able to
> accomplish the connection.  Would you help me to resolve this problem?
> Expecting for your help,
>
> Richard
>
> 
>
> Eduardo Ricardo Hernández Osorio
>
> Técnico Telecomunicaciones Aeronáuticas
>
> U.T.B Servicios Aeronáuticos, ECASA s.a.
>
> Aeropuerto Internacional "Frank País García"
>
> Tel: (53) (24) 474569
>
> email: [EMAIL PROTECTED]
>
> "...de buenas intenciones está empedrado el camino al infierno..."
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Can you post your code and error so we can take a look?

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] About MS SQL Connections...

2008-06-03 Thread Lic. Eduardo R. Hernández Osorio
Hello.
I have a problem with a Desktop Edition MS SQL Server servant, when I try to
get connected to crosswise of PHP functions to this, it provokes an error
and I can not achieve the connection. However when I try the same operation
on an Standard Edition MS SQL Server servant I am able to accomplish the
connection.  Would you help me to resolve this problem? Expecting for your
help,
Richard



Eduardo Ricardo Hernández Osorio

Técnico Telecomunicaciones Aeronáuticas

U.T.B Servicios Aeronáuticos, ECASA s.a.

Aeropuerto Internacional "Frank País García"

Tel: (53) (24) 474569

email: [EMAIL PROTECTED]

"...de buenas intenciones está empedrado el camino al infierno..."


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Complex escape string

2008-05-03 Thread Steven R. Ringwald
-Original Message-
From: cyaugin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, May 03, 2008 10:20 AM
To: php-general@lists.php.net
Subject: [PHP] Complex escape string

I have this line of code:

$q = "This is the string that will go into the query:
{${mysql_real_escape_string($_GET['searchstring'])}}";

What happens then is the user supplies 'foo' as the search string, and I get
a debug notice "Undefined variable: foo". Why is it treating the value as an
identifier and how do I make it do what I actually want it to do? This is on
PHP5, latest release.




---

It looks to me like what is happening is this piece:
${mysql_real_escape_string($_GET['searchstring'])}

Gets collapsed to $foo when mysql_real_escape_string($_GET['searchstring'])
== 'foo'. ${'a'} will expand to $a. I think that your problem is that you
need to drop that '$' before the brace around the function call.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] RE: XHTML Validation problem

2008-05-02 Thread Steven R. Ringwald
>>> I have a page that displays data entered by the user. There is one  
>>> user that entered the character "&" inside the text he typed. For  
>>> this case the xhtml validation fails and gives me the following  
>>> error:
>>> "character "&" is the first character of a delimiter but occurred  
>>> as data."
>>>
>>> I'm wondering if there is a way to avoid this error. The page  
>>> itself is valid and fails just in the case the user enters the &  
>>> character.

> Try replacing the '&' character with ' '. That is what I did to get rid
> of that warning in my xhtml documents.

Sorry y’all. I meant to say & rather than  . Ought to teach me to 
check email before eating dinner. ☺

Steve



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] XHTML Validation problem

2008-05-02 Thread Steven R. Ringwald

Begin forwarded message:

>> I have a page that displays data entered by the user. There is one  
>> user that entered the character "&" inside the text he typed. For  
>> this case the xhtml validation fails and gives me the following  
>> error:
>> "character "&" is the first character of a delimiter but occurred  
>> as data."
>>
>> I'm wondering if there is a way to avoid this error. The page  
>> itself is valid and fails just in the case the user enters the &  
>> character.





Try replacing the '&' character with ' '. That is what I did to get rid
of that warning in my xhtml documents.


Steve




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] avoid calling php script

2008-03-13 Thread H u g o H i r a m

HTTP_REFERER will do the job, thanks!

Hugo.
---

Steve Edberg escribió:

At 3:55 AM +0100 3/13/08, H u g o H i r a m wrote:

Hello

I have a swf that runs a PHP script that generates a XML, on the PHP 
is there any way to detect if the file is being called from the swf or 
from the browser? because I want to avoid the file being run directly 
from the browser or from any other file than the swf.


regards,
Hugo.



You might want to check the HTTP_REFERER value; test the program from a 
browser and the swf, and see what happens. Alternatively you could use a 
GET parameter like


   http://example.com/yourscript.php?calledby=swf

Be aware that anything sent back from the client can be spoofed - and 
HTTP_REFERER can be altered or disabled -  so it probably wouldn't be 
hard for someone to make it appear to your script that it is being 
called by your SWF.


If you're really concerned about restricting the communication between 
the Flash movie and your server, there might be some way to build a 
challenge-response mechanism into the flash; I don't know much about it.


If, on the other hand, you just don't want to confuse someone who might 
accidentally run the XML-generating script from the browser, checking a 
GET parameter as above is probably the safest. If it's not set properly, 
redirect the user, eg:


   if (!isset($_GET['calledby']) || $_GET['calledby'] != 'swf') {
  header('Location: http://example.com/thecorrectpage.html');
  exit();
   }
   ...

- steve



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] avoid calling php script

2008-03-12 Thread H u g o H i r a m

Hello

I have a swf that runs a PHP script that generates a XML, on the PHP is 
there any way to detect if the file is being called from the swf or from 
the browser? because I want to avoid the file being run directly from 
the browser or from any other file than the swf.


regards,
Hugo.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] unable to unset reference

2008-02-20 Thread Sylvain R.

"Stut" <[EMAIL PROTECTED]> a écrit dans le message de news: 
[EMAIL PROTECTED]
> Sylvain R. wrote:
>> "Chris" <[EMAIL PROTECTED]> a écrit dans le message de news: 
>> [EMAIL PROTECTED]
>>> Sylvain Rabot wrote:
>>>> Hello,
>>>>
>>>> First of all I would like to know if one day we will be able to unset
>>>> $this into a class in order to destroy the object. It could really be
>>>> useful to prevent big memory usage.
>>> I doubt the php-dev's will ever allow something like that, seems rather 
>>> dangerous to me.
>>
>> Why ? It would be nice to stop thinking PHP developpers are idiots who 
>> don't know how to code.
>
> I don't see how that reply implies that opinion.

I didn't mean to be rude but how a language structure could be dangerous ? 
You use it if you know how to otherwise you don't.

I don't understand why we should not implement something because it could be 
bad used by some persons as far it useful for others.

>> I don't mean unset($this) is the best wy to allow an object to destroy 
>> itself. I just say we miss something to auto destroy objects.
>> We could also think about a magic method like __destroy().
>
> An object that destroys itself is a really bad idea from an architectural 
> point of view. I, as a consumer of your class, need to have control over 
> the lifetime of any instances I create. In my opinion if you have a need 
> for a class to destroy itself then you have a fundamental design flaw.

I want the object to be destroyed when a specific method of this object is 
called because when it has been called, the object has no reason to exist 
anymore.

It's like a SQL resource, when you have freed it, you don't need it anymore.

>>>> As it can't be done I tried to unset an object by unsetting a reference
>>>> of this object but it has no effect on the object but only on the
>>>> reference.
>>>>
>>>> Should unset destroy the reference itself and the object ???
>>> No, it's not meant to (and I doubt it will change). Why do you want it 
>>> to do that?
>>>
>>> What is the original problem you're trying to solve?
>>>
>>
>> I put SQL resources into an objects and I would like to destroy objects 
>> when calling method free() but obviously I can't.
>
> I don't understand why you need to destroy the class instance to clear up 
> member variables. Or am I not understanding your diction?

I would like to implement it in order to delete automaticly from memory 
useless objects.
It can be really useful for example to make schedulers in PHP in order to 
avoid "max memory usage exceeded" errors.

> -Stut
>
> -- 
> http://stut.net/ 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] unable to unset reference

2008-02-20 Thread Sylvain R.

"Chris" <[EMAIL PROTECTED]> a écrit dans le message de news: 
[EMAIL PROTECTED]
> Sylvain Rabot wrote:
>> Hello,
>>
>> First of all I would like to know if one day we will be able to unset
>> $this into a class in order to destroy the object. It could really be
>> useful to prevent big memory usage.
>
> I doubt the php-dev's will ever allow something like that, seems rather 
> dangerous to me.

Why ? It would be nice to stop thinking PHP developpers are idiots who don't 
know how to code.

I don't mean unset($this) is the best wy to allow an object to destroy 
itself. I just say we miss something to auto destroy objects.
We could also think about a magic method like __destroy().

>> As it can't be done I tried to unset an object by unsetting a reference
>> of this object but it has no effect on the object but only on the
>> reference.
>>
>> Should unset destroy the reference itself and the object ???
>
> No, it's not meant to (and I doubt it will change). Why do you want it to 
> do that?
>
> What is the original problem you're trying to solve?
>

I put SQL resources into an objects and I would like to destroy objects when 
calling method free() but obviously I can't.

> -- 
> Postgresql & php tutorials
> http://www.designmagick.com/ 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] multiple curl and web service

2007-10-01 Thread H u g o H i r a m

Hi,

I am having this problem, I am retrieving some data from a MySQL DB, and 
using it to post a cURL, what I am calling is a web service, and I have 
3 options to do it: SOAP, GET and POST, I am not very familiar with 
SOAP, so I am using POST, in response I get a XML on each call to the 
web service.


If I call only one curl and web service each time, then everything works 
just perfect, but if I try to make multiple calls then I get weird 
results, I get some responses OK (an XML), but others are empty responses.


The first three responses are always empty, I don't get any errors, 
instead only those empty responses (no XML).


Ok, I'm posting the code right here:


$sql_aero = "SELECT
code
FROM
airports
ORDER BY
id ASC
limit 0, 10";

$result_aero = mysql_query($sql_aero);
$num_results_aero = mysql_num_rows($result_aero);
if (!empty($num_results_aero)) {
$i = 0;
$mh = curl_multi_init();
while($row_aero = mysql_fetch_array($result_aero)) {
$aero = $row_aero["code"];
$ws = 
"www.webservicex.com/airport.asmx/getAirportInformationByAirportCode";

$post = "airportCode=$aero";
print "$i = $aero, $post";
$conn[$i] = curl_init($ws);
curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, 1);
curl_setopt($conn[$i], CURLOPT_POSTFIELDS, $post);
curl_multi_add_handle ($mh, $conn[$i]);
$i++;
}
}

do {
$mrc = curl_multi_exec($mh, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);

for ($j=0; $j<$i; $j++) {
if (($err = curl_error($conn[$j])) == '') {
$res[$j] = curl_multi_getcontent($conn[$j]);
print "$j$newstr[$j]";
}
else {
print "Curl error on handle $j: $err\n";
}
curl_multi_remove_handle($mh, $conn[$j]);
curl_close($conn[$j]);
}
curl_multi_close($mh);


As you won't have the DB, if want to try the code, use this array with 
the proper change to the code:


$airports = ['LAX', 'ATL', 'JFK', 'SAN', 'CDG', 'MAD', 'BCN', 'GDL', 
'TIJ', 'SYD'];


I am working on Localhost: Windows, Apache 2.2.3, PHP 5.1.6 and MySQL 5.0.24

here's the original code: 
http://www.php.net/manual/en/function.curl-multi-exec.php


Regards!

hugo Hiram.
---

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] about SQL authentication on PHP

2007-07-19 Thread Lic. Eduardo R. Hernández Osorio
Hello:
I'm trying to connect to a SQL Server database with PHP using windows auth. 
To do that I modified the PHP.ini file changing the line above:
...
; Use NT authentication when connecting to the server
mssql.secure_connection = Off
...
putting mssql.secure_connection = On 
...
instead but when I tried to connect to SQL Server the function
mssql_connect('myserver', '', '') doesn't work.

What am I doing bad?
need I to do something else?

Help me please, waiting for your help,
Richard


Eduardo Ricardo Hernández Osorio

Técnico Telecomunicaciones Aeronáuticas

U.T.B Servicios Aeronáuticos, ECASA s.a.

Aeropuerto Internacional "Frank País García"

Tel: (53) (24) 474569

 

email: [EMAIL PROTECTED]

 

"...de buenas intenciones está empedrado el camino al infierno..."

-Mensaje original-
De: Jeff Taylor [mailto:[EMAIL PROTECTED] 
Enviado el: Tuesday, March 20, 2007 4:43 AM
Para: php-general@lists.php.net
Asunto: [PHP] working with class inheritance

Hey all, got a slight problem, where for some reasons my variables dont seem
to be getting stored in the child class:

e.g

class Parent
{
  $private type;

  public function __construct()
  {
  }

   public function GetType()
   {
  return $this->type;
  }
}

class Child implements Parent
{
$public function __construct()


  $this->type= 'Child';
  }
}

$Child= new Child();
echo $Child->getType;

Can u see any reason why the type would return null?

Thanks,

Jeff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] acerca de extensiones SQL Server

2007-07-16 Thread Lic. Eduardo R. Hernández Osorio
Exactly, I use Microsoft SQL Server as db Server and it i son another
machine. I need to configure my php to connect with that server. On Windows
with appserv that work fine but on Linux the php code doesn't work. Could
you help me to configure that?
I don't have internet.
Waiting for your help...



Eduardo Ricardo Hernández Osorio

Técnico Telecomunicaciones Aeronáuticas

U.T.B Servicios Aeronáuticos, ECASA s.a.

Aeropuerto Internacional "Frank País García"

Tel: (53) (24) 474569

 

email: [EMAIL PROTECTED]

 

"...de buenas intenciones está empedrado el camino al infierno..."


-Mensaje original-
De: Stut [mailto:[EMAIL PROTECTED] 
Enviado el: Saturday, July 14, 2007 7:01 PM
Para: Robert Degen
CC: php-general@lists.php.net
Asunto: Re: [PHP] acerca de extensiones SQL Server

Robert Degen wrote:
> I think you should install at least
> 
>   php5-mysql
> 
> and if you're using PEAR's db connection you'll need
> 
>   php-db
> 
> too.

"SQL Server" usually means "Microsoft SQL Server". There is plenty of 
documentation on the PHP website regarding getting the MSSQL extension 
installed.

-Stut

-- 
http://stut.net/

> On Sa, Jul 14, 2007 at 10:39:40 -0400, Lic. Eduardo R. Hern?ndez Osorio
wrote:
>>  
>>
>> Hi:
>>
>> I need use the SQL extension on PHP to connect to any SQL Server
database.
>> How I configure PHP on Linux to use that extension? I use debian with
>> apache2 and PHP5 installed on it.
>>
>> Waiting for your help,
>>
>> Richard
>>
>>  
>>
>> 
>>
>> Eduardo Ricardo Hernández Osorio
>>
>> Técnico Telecomunicaciones Aeronáuticas
>>
>> U.T.B Servicios Aeronáuticos, ECASA s.a.
>>
>> Aeropuerto Internacional "Frank País García"
>>
>> Tel: (53) (24) 474569
>>
>>  
>>
>> email: [EMAIL PROTECTED]
>>
>>  
>>
>> "...de buenas intenciones está empedrado el camino al infierno..."
>>
>>  
>>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] acerca de extensiones SQL Server

2007-07-14 Thread Lic. Eduardo R. Hernández Osorio
 

Hi:

I need use the SQL extension on PHP to connect to any SQL Server database.
How I configure PHP on Linux to use that extension? I use debian with
apache2 and PHP5 installed on it.

Waiting for your help,

Richard

 



Eduardo Ricardo Hernández Osorio

Técnico Telecomunicaciones Aeronáuticas

U.T.B Servicios Aeronáuticos, ECASA s.a.

Aeropuerto Internacional "Frank País García"

Tel: (53) (24) 474569

 

email: [EMAIL PROTECTED]

 

"...de buenas intenciones está empedrado el camino al infierno..."

 



[PHP] about graphs in php

2007-07-10 Thread Lic. Eduardo R. Hernández Osorio
 

Hello everybody:

I need work with some statistics graphs and show it in php and I don't know
how to make it.

How could I make some statistics graphs like histograms or Pie graphs using
php and information stored in any database?



Eduardo Ricardo Hernández Osorio

Técnico Telecomunicaciones Aeronáuticas

U.T.B Servicios Aeronáuticos, ECASA s.a.

Aeropuerto Internacional "Frank País García"

Tel: (53) (24) 474569

 

email: [EMAIL PROTECTED]

 

"...de buenas intenciones está empedrado el camino al infierno..."

 



Re: [PHP] Extracting Variables From URL

2007-05-16 Thread J R

http://www.php.net/reserved.variables

use $_SERVER['PHP_SELF'] or $_SERVER['REQUEST_URI']

just parse its value to get what you needed.


hth,

John
On 5/17/07, CK <[EMAIL PROTECTED]> wrote:


Hi All,

The following code works just fine for outputting links from an
array. The next goal, is parsing the $thisPage variable from the URL
(http://bushidodeep.com/contact.html/) so as , this variable could also be
assigned to the $links[] $key.

Moving to a dynamic link generator class, what PHP function(s) could
be used to parse the URL?


http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml";>


Generate Links




 \n";
foreach($links as $key){
if(strtolower($key)!= $thisPage){
echo ("$key\n");
$count ++;
 }else{
echo ("$key");
}
}
echo " \n";


/*prints key as tabindex..
$links=array("home","work","contact");
$count =0;
echo " \n";
foreach($links as $key){
echo ("$key\n");
$count ++;
}
echo " \n";
*/

?>






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


[PHP] Alternatives to PHPLib for authentication, session management, etc

2007-03-23 Thread Mark R. Cervarich

Hi.

Been using PHP since the 2.0 days, and been using PHPLib since 2000 as 
the main method of user authentication (logging in/out during same 
session), and simultaneously use it to give the users who are 
logged in different permissions.


Since PHPLib has long ago stopped (at least in my opinion) active 
development, I am wondering what other systems people use to deal with 
authentication and permission levels.


I'd love to hear about complete libraries/methods that I could use as 
a replacement for PHPLib with the minimum of fuss.




As an example, in the pages I do NOT want to protect, I merely need to 
create a variable: $AUTHENTICATION = "off";

and my global includes check for that:

if ($AUTHENTICATION != "off") {
   page_open(
  array("sess" => "Example_Session",
"auth" => "Example_Auth",
"perm" => "Example_Perm"));
}

Which causes PHPLib authentication to be ignored for that page.  Every 
other page authenticates via the page_open() function.  PHPLib does it 
all behind the sceneswhich makes it very easy.



So, basically I'm looking for a system that works better than what 
I've got w/ PHPLib, that will be fairly easy to maintain  -- as well 
as drop-in as a replacement in the 100s of websites that I've 
developed that use that authentication scheme.


Thanks in advance,
mark

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Filtering _REQUEST.. Why is this bad?

2007-02-13 Thread J R

i agree, no argument there.

Data coming from user should always be considered malicious. I'm just
pointing out one reason why not use _REQUEST. but there are intance _REQUEST
variable can be useful (just be very careful). Regarding _GET and _POST
using same name, there are instance this can be useful, not at the same time
in one page but rather interchangely. example in page submit you get data
from $_GET['sameName'] and on the next page submit you get it from
$_POST['sameName'] this is for dynamic purpose. There are situation, that
for example data on _GET needed to be passed but you need to pass your page
using POST.(like i said be careful and not over use because of lazyness)

(i hope i'm being clear)



On 2/14/07, Richard Lynch <[EMAIL PROTECTED]> wrote:


On Mon, February 12, 2007 8:41 pm, J R wrote:
> it is not adviced to do filtering on _REQUEST getting data in general
> from
> it actually. It is much better to specify where your data is coming
> from (
> e.g. _POST or _GET). This is because variable _REQUST contains all the
> data
> from the cookies, get and post. and if ever you have the same variable
> name
> on two or more of those variable you might get the wrong one.
>
> and as we all know there is a security risk with cookies. users can
> easily
> replace you data for example in post using cookies.

Or they could replace all the POST data using POST...

A Bad Guy would have to be incredibly naive, unskilled, and downright
dumb to be caught by your script differentiating between
GET/POST/COOKIE as the source of the data.

Spoofing a POST is a matter of saving the HTML locally and filling in
whatever you want for extra INPUT and the values you like.

If you intentionally have 2 (or more) inputs to your script of the
same name, one each from GET/POST/COOKIE, I'd have to say that's a
pretty confusing design from the get-go.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?





--
GMail Rocks!!!


Re: [PHP] Filtering _REQUEST.. Why is this bad?

2007-02-12 Thread J R

here's my opinion on the matter.

it is not adviced to do filtering on _REQUEST getting data in general from
it actually. It is much better to specify where your data is coming from (
e.g. _POST or _GET). This is because variable _REQUST contains all the data
from the cookies, get and post. and if ever you have the same variable name
on two or more of those variable you might get the wrong one.

and as we all know there is a security risk with cookies. users can easily
replace you data for example in post using cookies.


hth,
john
On 2/13/07, Travis Doherty <[EMAIL PROTECTED]> wrote:


Hello.

Came across some code that startled me.  Mostly because it goes against
the generally accepted idea of detecting and rejecting bad input instead
of trying to escape it, secondly because "it just feels wrong."

The only technical case I have so far is for inserting a double/single
quote into the database. It will get inserted as its htmlentities equiv
of '"' for example.  In the future if they wanted to display the
data in the database in a format other than html it will be messy.

So... the question is: What else is wrong with this? or.. Why is this so
bad?


 $val)
{
if (is_array($val))
{
$return[$key]= recursiveFilter($val);
} else {
$return[$key] = htmlentities($val,ENT_QUOTES);
}
}
return $return;
}
$_REQUEST= recursiveFilter($_REQUEST);

// queries directly inserting from $_REQUEST
// echo'ing of data directly from $_REQUEST

?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


Re: [PHP] Text Editor for Windows?

2007-02-07 Thread J R

if you want a very lightweight use notepad2[1]

i use php eclipse though :)

[1] http://www.flos-freeware.ch/notepad2.html

On 2/8/07, Ryan Fielding <[EMAIL PROTECTED]> wrote:


Stephen wrote:
> I am finding that notepad is lacking when correcting syntax errors in my
php code. No line numbers.
>
> What can people recommend for use under Windows?
>
> Thanks
> Stephen
>
>
I like UltraEdit. Has everything i need and then some. syntax
Highlighting, code folding, variable completion and FTP support.

http://www.ultraedit.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


[PHP] Problem with copy() function

2007-01-05 Thread R B

Hi,

I'm trying to copy a file like this:

copy("home/xxx/public_html/yyy/zzz/index.php",
"home/xxx/public_html/yyy/www/index.php")

and have this error:

*Warning*: Wrong parameter count for copy() in */home/.*

Someone can help me please?

Thanks,


RE: [PHP] Concerning SSL

2007-01-02 Thread R. Van Tassel
Thanks.

http://www.loudmerch.com/clientservices/
user: php
pass: list


-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 02, 2007 11:52 AM
To: R. Van Tassel
Cc: php-general@lists.php.net
Subject: Re: [PHP] Concerning SSL

R. Van Tassel wrote:
> How do you correct the image URLs? That's what I'm asking.

how I am supposed to know how to correct your URLs without being able to
see your code or the source of your pages???

PS - you domain name is not mywebsite.com AFAICT

> 
> I have a website that is secure. When you change the URL from
> http://www.mywebsite.com
> to
> https://www.mywebsite.com
> 
> the images disappear.
> 
> The images are codes as relative links:
> 
> http://www.mywebsite.com/images/myimage.jpg
> 
> is coded as  if a root file
> 
> is coded as  if in a directory
> 
> 
> 
> -Original Message-
> From: Jochem Maas [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, January 02, 2007 11:27 AM
> To: R. Van Tassel
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Concerning SSL
> 
> R. Van Tassel wrote:
>> Hello everyone, I hope you all had a great new year.
>>
>> I'm having an issue with a website where changing the URL from http:// to
>> https:// makes the images disappear. The images are all relative and not
>> absolute.
>>
>> How can I fix this?
> 
> correct the image URLs? clear your cache?
> 
> we gave up mind-reading on the list last year, please provide us with
> some actual info otherwise we can't help you.
> 
>> Thanks,
>> -Roy
>>
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Concerning SSL

2007-01-02 Thread R. Van Tassel
How do you correct the image URLs? That's what I'm asking.

I have a website that is secure. When you change the URL from
http://www.mywebsite.com
to
https://www.mywebsite.com

the images disappear.

The images are codes as relative links:

http://www.mywebsite.com/images/myimage.jpg

is coded as  if a root file

is coded as  if in a directory



-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 02, 2007 11:27 AM
To: R. Van Tassel
Cc: php-general@lists.php.net
Subject: Re: [PHP] Concerning SSL

R. Van Tassel wrote:
> Hello everyone, I hope you all had a great new year.
> 
> I'm having an issue with a website where changing the URL from http:// to
> https:// makes the images disappear. The images are all relative and not
> absolute.
> 
> How can I fix this?

correct the image URLs? clear your cache?

we gave up mind-reading on the list last year, please provide us with
some actual info otherwise we can't help you.

> 
> Thanks,
> -Roy
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Concerning SSL

2007-01-02 Thread R. Van Tassel
Hello everyone, I hope you all had a great new year.

I'm having an issue with a website where changing the URL from http:// to
https:// makes the images disappear. The images are all relative and not
absolute.

How can I fix this?

Thanks,
-Roy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Recomended host

2006-12-18 Thread R B

Hello.
I'm looking for a host to put my website.
I was looking godaddy.com, but i read in phplist forum that godaddy have
limitations in the number of mail to send per day.

Someone can recomend me a good host provider, with good stability, good
support, good features, and no limitation in the use of a list of
members...?

Thanks


[PHP] Re: Re: taking a one off payment

2006-12-07 Thread Mark R. Cervarich

On Thu, 7 Dec 2006, Lester Caine wrote:


Mark R. Cervarich wrote:

http://checkout.google.com -- Google's answer to PayPal.
Best part is, they are taking NO FEES from now through 12/31/2007.
So you can use them to receive credit card payments for just over a year 
for FREE.


At 2% + $20 per transaction they needed to do something to get take-up


Hmmm, your decimal is in the wrong place:

https://checkout.google.com/support/sell/bin/answer.py?answer=30724&ctx=sibling

"If you're not an AdWords advertiser, or if you've exceeded your free 
transaction processing amount for the month, you'll only be charged 
2.0% plus $0.20 per transaction."



Compare that to PayPal's Standard Rate of (2.9% + $0.30).

Either free, or at (2% + $0.20), google checkout would appear to be 
cheaper than paypal.


mark
(just a happy checkout customer)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: taking a one off payment

2006-12-06 Thread Mark R. Cervarich

http://checkout.google.com -- Google's answer to PayPal.
Best part is, they are taking NO FEES from now through 12/31/2007.
So you can use them to receive credit card payments for just over a 
year for FREE.


I've used it, and once account was setup, I was paid within 2-3 days.

Best part is, you can, from inside the webpage, click "Send Invoice" 
and it will ask you for an email addy, and a description of what you 
are billing 'em for.  You don't have to create a full shopping cart 
system!!!


mark


On Mon, 20 Nov 2006, Richard Lynch wrote:


On Thu, November 16, 2006 6:23 am, Jochem Maas wrote:
> Ross wrote:
>> Hi,
>>
>> What is the best way to take a one off payent (non-paypal).
>
> cash in a stable currency ;-)

Gold and Diamonds may also be worth considering. :-)

Sorry.

Now for some real suggestions:

If you really really do mean a one-off payment, Paypal may be the
simplest answer...

If you mean many one-off payments, any of the shopping carts should work.

You could also consider a MONEY ORDER or REGISTERED CHECK.

>>  I have used
>> oscommece but never attempted a one payment like a subscription
>> charge.

H.

Now it sounds like you want a recurring charge.

I dunno about oscommerce, but you should be able to set up a recurring
charge with the back-end just by flipping a button somewhere -- The
bank then hands you a "token" sort of deal which lets you cancel the
subscription payments, but not do much more with it, so you needn't
store the CC# to maintain state.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Mark R. Cervarich
Shelfspace.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How do you do the ? mark after a filename

2006-11-12 Thread J R

using "click me

in your php you can get its value by use of the $_GET variable.

hth,
john

On 11/13/06, Thomas Bonham <[EMAIL PROTECTED]> wrote:


Thank you for that, it was a big help.

Can I also call function that way?

Again thank you for your help.

Thomas

Tom Chubb wrote:
> On 12/11/06, Thomas Bonham <[EMAIL PROTECTED]> wrote:
>> Hi All,
>>
>> I keep seeing the ? mark after many file names index.php?id=234.
>>
>> So what I would like to know is how do you make them. I have heard that
>> they can make a programs life sampler when doing somethings with a
>> database.
>>
>> Thank you,
>>
>> Thomas
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> You can retrieve variables from the URL using the GET method. This is
> similar to using the POST method with data from forms.
> A typical url with something like
> www.domain.com/index.php?id=35&format=html would provide the page with
> two variables, id & format.
> It's the equivalent of putting the following in the page.
> $id = 35;
> $format = 'html';
>
> This is popular with simple CMS/Templating systems where you use a
> standard page and the id variable loads the relevant article text.
>
> Hope that helps.
>
> Tom

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


Re: [PHP] Month in a numeric form

2006-10-15 Thread J R

http://www.php.net/manual/en/function.strtotime.php

http://www.php.net/manual/en/function.date.php

On 10/16/06, Ron Piggott (PHP) <[EMAIL PROTECTED]> wrote:


Is there a way I am able to use the DATE command to convert January to
1, February to 2, etc.





--
GMail Rocks!!!


Re: [PHP] Apply the hyper link ( javascript functon ) with php

2006-10-08 Thread J R

echo ' Test ';

On 10/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


Dear All,

How to apply the following function with php ?
 Test 

Edward.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


Re: [PHP] Hotmail and junk mail

2006-10-02 Thread J R

if i get you right. your email to hotmail goes to junk/spam mail?

i think i encounter this way way back when our email domain got listed into
spam emailer :D

so better check if your domain is on that list. i forgot what was the URL.

anyway just an idea.


hth,
John

On 10/2/06, Stefan van der Linden <[EMAIL PROTECTED]> wrote:


>hello every one :)
>
>what ever i do emails i sent got in the junk mail
>
>i fixed the header
>add spf record to the domain
>using mail server with specific IP
>fix all dns error
>
>nothing work
>
>any one get it correct ?

Can you please be more specific by giving the headers you use?

Regards,
Stefan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


Re: [PHP] newbie php tutorial question

2006-10-01 Thread J R

run this bit of code to check if everything is working.



On 10/2/06, Stut <[EMAIL PROTECTED]> wrote:


srdaniel wrote:
> I setup Apache 2.2.3.0 and PHP 5.1.6.6.
>
> When I run this PHP file:
>
> 
> 
>  
>   PHP Test
>  
>  
>  Hello World'; ?>
>  
> 
> 
>
> Any ideas why I get this for output?
>
> 
> Hello World
>
> '; ?>
> 

Apache has not been set up correctly to run this file as PHP. Have a
look at the installation section of the PHP manual - odds are you'll
find the answer there: http://php.net/install

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


Re: [PHP] Affiliate system

2006-09-13 Thread J R

use session. or you can store it in a database but that will take speed. :)

using session is much better rather than using cookies for lots of reason
(just google) specially if you are concered with security.

just my 2cents.

hth,
john

p.s.

if the client cookies is disabled set to true the session.use_trans_id.

On 9/13/06, Robert Cummings <[EMAIL PROTECTED]> wrote:


On Wed, 2006-09-13 at 12:58 +0700, Peter Lauri wrote:
> Hi guys,
>
> I am reviewing an affiliate system that I created a while ago. I am
using a
> very simple method to do this, but I am curious if there is any better
> system (better I mean less missed affiliate purchases).
>
> 1. User click on affiliate link http://thedomain.com/?a=1234
> 2. The if $_GET['a'] is set, we check if that is an valid affiliate, and
> then set a cookie for that
> 3. At purchase, we check if that cookie still is there, if so, we
register
> it as a affiliate purchase and that info is stored in the purchase
database
>
> What should I do if they do not allow cookies? I could amend a=1234 onto
> every url that they pass, but that would not be a "beautiful" solution.
>
> Maybe I can also create a SESSION that stores the affiliate information
so
> that it at least get registered if the purchase is completed within the
> session?

Sessions and temporary cookies solve the same issue (even if sessions
are using trans sid). If a user has cookies disabled then you can rely
on the trans sid feature which already performs the propagation of the
session via URLs as you have suggested. Failing that, you don't really
have any alternatives :)

Cheers,
Rob.
--
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


Re: [PHP] copy, open, or manipulate an image hosted in a https server

2006-09-12 Thread J R

i'm just going to guess. check your settings if it allows to open external
files, especifically allowed to fopen url.

http://www.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen

hth,

john

On 9/13/06, R B <[EMAIL PROTECTED]> wrote:


I think it's a security https problem.

I was reading that with IIS, you can't use fopen in a https server... I
think i have this problem also with copy...

Some ideas?




On 9/12/06, R B <[EMAIL PROTECTED]> wrote:
>
> It's not a syntaxis problem.
>
>
> On 9/12/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >
> > On Tue, 2006-09-12 at 12:27 -0600, R B wrote:
> > > Hello,
> > >
> > > I need to copy, open or manipulate a gif images that is hosted in a
> > https
> > > server.
> > >
> > > But when i try to do this, i recive a warning like this:
> > >
> > > *Warning*: imagecreatefromgif(https:///aaa.gif): failed to open
> > stream:
> > > Invalid argument in .
> > >
> > > I recive a similar message if i use:
> > >
> > > copy(https:///aaa.gif,' bla bla bla ');
> > >
> > > fopen (https:///aaa.gif, );
> > >
> > > How can i resolve this problem and use this image?
> >
> > Ummm, you're missing quotes around the URL portion of the argument.
> >
> > Cheers,
> > Rob.
> > --
> > ..
> > | InterJinn Application Framework - http://www.interjinn.com |
> > ::
> > | An application and templating framework for PHP. Boasting  |
> > | a powerful, scalable system for accessing system services  |
> > | such as forms, properties, sessions, and caches. InterJinn |
> > | also provides an extremely flexible architecture for   |
> > | creating re-usable components quickly and easily.  |
> > `'
> >
> >
>





--
GMail Rocks!!!


Re: [PHP] copy, open, or manipulate an image hosted in a https server

2006-09-12 Thread R B

I think it's a security https problem.

I was reading that with IIS, you can't use fopen in a https server... I
think i have this problem also with copy...

Some ideas?




On 9/12/06, R B <[EMAIL PROTECTED]> wrote:


It's not a syntaxis problem.


On 9/12/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> On Tue, 2006-09-12 at 12:27 -0600, R B wrote:
> > Hello,
> >
> > I need to copy, open or manipulate a gif images that is hosted in a
> https
> > server.
> >
> > But when i try to do this, i recive a warning like this:
> >
> > *Warning*: imagecreatefromgif(https:///aaa.gif): failed to open
> stream:
> > Invalid argument in .
> >
> > I recive a similar message if i use:
> >
> > copy(https:///aaa.gif,' bla bla bla ');
> >
> > fopen (https:///aaa.gif, );
> >
> > How can i resolve this problem and use this image?
>
> Ummm, you're missing quotes around the URL portion of the argument.
>
> Cheers,
> Rob.
> --
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'
>
>



Re: [PHP] copy, open, or manipulate an image hosted in a https server

2006-09-12 Thread R B

It's not a syntaxis problem.

On 9/12/06, Robert Cummings <[EMAIL PROTECTED]> wrote:


On Tue, 2006-09-12 at 12:27 -0600, R B wrote:
> Hello,
>
> I need to copy, open or manipulate a gif images that is hosted in a
https
> server.
>
> But when i try to do this, i recive a warning like this:
>
> *Warning*: imagecreatefromgif(https:///aaa.gif): failed to open
stream:
> Invalid argument in .
>
> I recive a similar message if i use:
>
> copy(https:///aaa.gif,' bla bla bla ');
>
> fopen (https:///aaa.gif, );
>
> How can i resolve this problem and use this image?

Ummm, you're missing quotes around the URL portion of the argument.

Cheers,
Rob.
--
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'




[PHP] copy, open, or manipulate an image hosted in a https server

2006-09-12 Thread R B

Hello,

I need to copy, open or manipulate a gif images that is hosted in a https
server.

But when i try to do this, i recive a warning like this:

*Warning*: imagecreatefromgif(https:///aaa.gif): failed to open stream:
Invalid argument in .

I recive a similar message if i use:

copy(https:///aaa.gif,' bla bla bla ');

fopen (https:///aaa.gif, );

How can i resolve this problem and use this image?

Thanks,

RB


Re: [PHP] register globals on

2006-09-12 Thread J R

correction: $GLOBALS not $_GLOBAL

:)

cheers

On 9/12/06, J R <[EMAIL PROTECTED]> wrote:


there are many ways you can keep information.

now if you must really use global. you can still use global even if the
server is set to global off by using $_GLOBAL or using globals decleration.

example:
$test = 'i'm global';

function f1()
{
   echo $_GLOBAL['test']; // should display i'm global
}

function f2()
{
   global $test;
   echo $test; // should display i'm global
}


now for your forms. i'm not sure is the above will work (to lazy to verify
:)) use the other predefined variables like $_POST, $_GET, $_REQUEST thats
where data from your forms are stored when the page is submited. and if you
want to keep your data when your user move from one page to the other, store
it in a session "$_SESSION". remeber to always start session
"session_start()" on every page.

read more: http://php.net/reserved.variables

my advice, avoid using globals. It leads to lots of error that are hard to
debug and reproduce.


hth,
john


On 9/12/06, Zbigniew Szalbot <[EMAIL PROTECTED]> wrote:
>
> Hello again,
>
> On Tue, 12 Sep 2006, Chris wrote:
>
> > > I thought I would ask your opinion before we make any decision. Is
> it
> > > really so that without register globals, such things as displaying
> > > information from databases based on the initial choice of languages
> is not
> > > an option? I am not a programmer so I just need general guidance.
> >
> > Complete rubbish. He's being lazy.

Thanks a lot! Any hint what to use instead? I mean I will tell him to
> re-think things but with techi guys I would simply feel better saying we
>
> need to rework the website using...???
>
> Thank you again!
>
> --
> Zbigniew Szalbot
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
GMail Rocks!!!





--
GMail Rocks!!!


Re: [PHP] register globals on

2006-09-12 Thread J R

there are many ways you can keep information.

now if you must really use global. you can still use global even if the
server is set to global off by using $_GLOBAL or using globals decleration.

example:
$test = 'i'm global';

function f1()
{
  echo $_GLOBAL['test']; // should display i'm global
}

function f2()
{
  global $test;
  echo $test; // should display i'm global
}


now for your forms. i'm not sure is the above will work (to lazy to verify
:)) use the other predefined variables like $_POST, $_GET, $_REQUEST thats
where data from your forms are stored when the page is submited. and if you
want to keep your data when your user move from one page to the other, store
it in a session "$_SESSION". remeber to always start session
"session_start()" on every page.

read more: http://php.net/reserved.variables

my advice, avoid using globals. It leads to lots of error that are hard to
debug and reproduce.


hth,
john

On 9/12/06, Zbigniew Szalbot <[EMAIL PROTECTED]> wrote:


Hello again,

On Tue, 12 Sep 2006, Chris wrote:

> > I thought I would ask your opinion before we make any decision. Is it
> > really so that without register globals, such things as displaying
> > information from databases based on the initial choice of languages is
not
> > an option? I am not a programmer so I just need general guidance.
>
> Complete rubbish. He's being lazy.


Thanks a lot! Any hint what to use instead? I mean I will tell him to

re-think things but with techi guys I would simply feel better saying we
need to rework the website using...???

Thank you again!

--
Zbigniew Szalbot

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


Re: [PHP] Quotes?

2006-09-05 Thread J R

On 9/6/06, Gustav Wiberg <[EMAIL PROTECTED]> wrote:


I want to save this to a string...


var uri = 'http://impse.tradedoubler.com/imp/img/16352388/1122503?' + new
String (Math.random()).substring (2, 11);
document.write('http://clk.tradedoubler.com/click?p=48859&a=1122503&g=16352388";
target="_blank">');



How could i type?

I've tried with ' and ".. but can't get it to work.

tested diffrent types..
$str = '';


this should work.

$str = 'var uri = 'http://impse.tradedoubler.com/imp/js/16350344/1122503?' +
new String (Math.random()).substring (2, 11);';


$str .= 'var uri = \'http://impse.tradedoubler.com/imp/js/16350344/1122503?\'
+ new String (Math.random()).substring (2, 11);';

$str = ""document.write('
charset="ISO-8859-1">');"";


$str .= "\"document.write('');\"";

$str = ;


$str .= "\"\"";

Best regards

/Gustav Wiberg
Stammis Internet

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



* use (.) dot to add another value to a string:
e.g.
$var = 'hello';
$var .= ' world';
echo $var;
// hello world
$var = 'foo' . ' bar';
echo $var;
// foo bar

* learn to escape character.


hth,

john

--
GMail Rocks!!!


Re: [PHP] How to add user to linux using php


you have to understand that the adduser is a previledge command and a root
only command (unless you allowed other users) and normally php will and
should be running in a restricted access. normally it is running as user
apache/user/nobody (depends on your settings) now there are two ways you can
allow adduser(or any priviledge command for that matter).

1. give user apache the addusser priviledge (which is very unsecure), then
execute shell_exe as root would.
2. create a root process like a cron job which will start at boot of your
server, then on your shell_exe pass your command to that process and have
that root process execute that command (bit more secure).

hth,
john

On 9/5/06, Jon Anderson <[EMAIL PROTECTED]> wrote:


eqla3.com eqla3.com wrote:
> is there any way to add user and apply password by executing shell
> command
> through php?
Depending on the distribution, you should have a user addition command
that takes a password argument. In my case, useradd  -p
'' . Check the manual page for adduser , useradd or your
distribution's variant.

Worst case, you can even make a wrapper around the command with shell
script that'll do the multiline echo for you.

jon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


Re: [PHP] php generated javascript


put this at the top of your script "ob_start();" or before any output.

On 8/31/06, Shu Hung (Koala) <[EMAIL PROTECTED]> wrote:


On 8/31/06, Peter Lauri <[EMAIL PROTECTED]> wrote:
>
> Koala,
>
> There is no difference with the php generated javascript and javascript
on
> a
> static html page.
>
> Take a look at the source code of the page that has been generated in
the
> browser, and if that one looks as it should, it is probably your
> javascript
> that is not doing what it should :)
>
> And if that is the case you can join the [EMAIL PROTECTED] list for
> that
> purpose.
>
> /Peter
>
>
Petar,

Thanks for your reply.

I've used some server side cache for that javascript generation now.
It works a lot better. Seems to me that it takes too long to generate
the javascript. Sometimes browsers decided to ignores the javascript
and just run.

I used "document.write" in that javascript. When it isn't loaded
completely, nothing shows. I wonder if there is any better way.


Koala





--
GMail Rocks!!!


Re: [PHP] Re: Regex


http://www.php.net/manual/en/reference.pcre.pattern.syntax.php

On 8/22/06, Alex Turner <[EMAIL PROTECTED]> wrote:


If what you mean is a db table, then it would seem to me that you should
not be using a regex.  PHP has rawurlencode() for this sort of thing.

But - you should learn regex ;-)

Try something like (untested and late at night)

function urlme($location)
{
 $enc=rawurlencode($location);
 $spc=htmlspecialchars($location);
 return "$spc";
}

AJ

www.project-network.com
www.deployview.com
www.funkifunctions.blogspot.com

M. Sokolewicz wrote:
> Nadim Attari wrote:
>> Hello,
>>
>> I have some text in a table... the text contains hyperlinks (but not
>> html coded, i.e. plain "Some text...http://www.something.com";)
>>
>> When i retrieve these texts from the table, i want the hyperlinks to
>> become clickable, i.e. >
>> "Some text...> href="http://www.something.com";>http://www.something.com"
>>
>> I know this sould be done using Regex, but i don't know regex.
>>
>> Any help (links, examples, etc)
>>
>> Thanks
>> Nadim Attari
>
> You don't know Regex. Well, that's simple then, TRY to learn it. Noone
> will (or should) give you any answers if it's absolutely clear that
> you're not putting any effort into trying to find one yourself. "I know
> this should be done using Regex, but I don't know regex.", wouldn't you
> think it'd be a good idea to look up a tutorial somewhere or try to find
> out what this "regex" exactly is? Try to type regex in the php doc, see
> the notes for the various functions?
>
> really, a little more effort goes a long way.
> - tul

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


Re: [PHP] header lost session variables.


On 8/15/06, João Cândido de Souza Neto <[EMAIL PROTECTED]> wrote:


I´m in the follow location:

https://www2.../?modulo=seguro&acao=identifica

And in my script i use header("Location:
./?modulo=seguro&acao=novo_cadastro")



i normally do

header("Location: ?modulo=seguro&acao=novo_cadastro");

thats with out the "./" but i'm not sure if its has any effect. try it out
anyway. i could not think of any reason why your session variables
will disappear,
unless you don't do session start() :) hehehe...(in which of course you do)

if possible could you paste some of your codes so others can take a look at
it.

When it run, my system lost all session variables.


""BBC"" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
>> Hi guys.
>>
>> Anyone here know why in some cases when i use (header("Location: ???");
>> the
>> system lost the session variables?
>>
>> Any tips will be apreciated.
>> Thanks in advantge.
>
> Please tell me the cases you mean..!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


Re: [PHP] problem with quotes (single and double) in forms


here's an improvement jwith recursion:

function stripMagicQuotes(&$var)
{
   if (get_magic_quotes_gpc()) {
   if(!is_array($var)) {
   $var= stripslashes($var);
   } else {
   array_walk($var, stripMagicQuotes);
   }
   }
   return $var;
}

hth,

john
On 8/10/06, Chris <[EMAIL PROTECTED]> wrote:


Chris wrote:
> Chris wrote:
>> J R wrote:
>>> try to use this few lines of code.
>>>
>>> function stripMagicQuotes(&$var)
>>> {
>>>if (get_magic_quotes_gpc()) {
>>>$var= stripslashes($var);
>>>}
>>>return $var;
>>> }
>>>
>>> this way you don't really have to worry if magic quotes is on or off.
>>
>> Then he has to modify all the code to call that function ;)
>>
>
> Hmm actually:
>
> $_POST = stripMagicQuotes($_POST);
>
> should do it I guess.. not exactly ideal but would work quickly.
>

Argh, self-replying (*think before hitting send*) :(

Of course that function would need a bit more modification but should be
able to get it recursive without too many problems.

--
Postgresql & php tutorials
http://www.designmagick.com/





--
GMail Rocks!!!


Re: [PHP] problem with quotes (single and double) in forms


try to use this few lines of code.

function stripMagicQuotes(&$var)
{
   if (get_magic_quotes_gpc()) {
   $var= stripslashes($var);
   }
   return $var;
}

this way you don't really have to worry if magic quotes is on or off.
**

On 8/10/06, Chris <[EMAIL PROTECTED]> wrote:


[EMAIL PROTECTED] wrote:
> Hi to all.
>
> Have a web site on server where magic quote is turned On. Because of
> problems with quotes within forms, I was thinking to turn it Off. I
wonder
> how much work I'll have to change code to accept new setting? Are we
> talking about major changes or something that could be done in day or
two
> (the site has few couple-pages long forms and about 10 "regular" contact
> us/register/edit membership/edit account/... forms)?

Copy it to a server where magic quotes is off and see what breaks. That
will give you an idea of what needs fixing.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
GMail Rocks!!!


[PHP] PHP Forms

I am having an issue with a form, basically an order form, with 10 rows.
Each row is the same, the rows are being generated by a loop and I am
appending the counter of the loop to the name of the form elements (i.e.
quantity1, type1, next row = quantity2, type2, etc)

 

I can't seem to receive the variables without using sessions, which I'm
trying not to do. If only the first 2 rows are being filled out and
submitted I need to be able to loop through, grab all the variables and
print them out. Can anyone give any suggestion? 

 

 

 



RE: [PHP] Routing downloads through PHP - Thanks!

To develop locally try using the xampp package at www.apachefriends.org,
really easy to set up.

Thanks,
-Roy

http://www.myspace.com/GhostOrgy
http://www.myspace.com/SuitOfLights
Please add these artists as your friend on MySpace

-Original Message-
From: J_K9 [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 6:39 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Routing downloads through PHP - Thanks!

Thanks everyone, especially Barry for that great script which I've 
tested on a home server and _does_ work...

So, I'm going to wait for my external hosting company to get back to me 
and alter the files there so that it'll work on my website.

Thanks again! ;-)


J_K9

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   3   4   5   6   >