php-general Digest 11 Mar 2005 17:32:13 - Issue 3332
Topics (messages 210495 through 210522):
Re: Using javascript function from php
210495 by: b.rbz.biz
HELP TO GET OUT OF PHP MAILING LIST
210496 by: Abiodun Akala
Re: free php live chat with visitor/customer script
-Original Message-
From: p80 [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 1:17 AM
To: php-general@lists.php.net
Subject: [PHP] free php live chat with visitor/customer script
I was recently visiting a commercial site and suddunly a window chat
popped up and some assistant
-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 11:25 PM
To: php-general@lists.php.net
Subject: [PHP] Increase execution time
How do you increase the execution time in php?
Like You have done
I have set max_execution_time to 360
Jim Plush wrote:
here is a script I use to get jpg attachments with IMAP.. good luck
?php
[snip]
Thanx Jim,
Unfortunaly some e-mail clients send the headers in ways the
imap-functions can't read. So I figured something out using regular
expressions. If anyone needs this, mail me (in total
Greetings again,
Thanks to richard for pointing out a good way to
devle
into the source. It appears after browsing through the
source that the ' ' (space) is encoded to '+'. Also
the
characters '_', '-', '.' do get special treatment.
Obviously, this works great in the scenario where the
cookie
-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 10:14 PM
To: Ross Hulford
Cc: php-general@lists.php.net
Subject: Re: [PHP] incrementing a number from a text file
I want to read a number from an external (txt) file and increment it.then
Hi, everyone, I apologise if this posts twice; I'm having issues with
my outgoing email server.
I'm making 'teasers' of the first, say 200 to 250 characters of some
articles. This works great:
$content = strip_tags($article['content']);
$striptease = substr($content, 0, 275);
but cuts
[snip]
Hi, everyone, I apologise if this posts twice; I'm having issues with
my outgoing email server.
I'm making 'teasers' of the first, say 200 to 250 characters of some
articles. This works great:
$content = strip_tags($article['content']);
$striptease = substr($content, 0, 275);
At 03:14 PM 3/10/2005, Richard Lynch wrote:
I want to read a number from an external (txt) file and increment it.then
save the number back on the text file.
I know this is possible but want a simple amd economical way to do this.
That's what you *THINK* you want to do :-)
But what happens when
Thanks a lot for that, I am really grateful, now it sends along the link
properly, which is great, however it is now having trouble converting spaces
to %20 and it does it for some and not others, eg
It does this:
http://localhost/knewsl/NewsletterName.pdf
When it should be:
John Swartzentruber wrote:
I am running Fedora core3 with Apache 2.0.52 (from default RPMs), MySQL
4.1.10 (from RPMs from MySQL site), and PHP 5.0.3 built from source.
I'm going through the PHP manual and trying some of the mysqli examples.
The last one I tried didn't work. The problem appears
Hi, everyone,
I'm 'teasers' of the first, say 200 to 250 characters of some articles.
This works great:
$content = strip_tags($article['content']);
$striptease = substr($content, 0, 275);
but cuts off words right in the midd ...
I'd like to find a way to take $content, look at the first
Is it possible to let the OS handle the collisions?
For example:
$last_value = system('cat counter.txt', $retval);
$last_value++;
$result = system('echo $last_value counter.txt', $retval);
...just a suggestion!
Regards
/Luis
-Original Message-
From: Richard Lynch [mailto:[EMAIL
I want to asssign an image to a variable and show it if certain conditions
are met. E.g
If condition is met
{
$myimage= retrieve image (images/myimage.jpg)
echo $myimage
}
Have not used image creation before with php just dipping my toe in the
water.
Thanks
R.
--
PHP General Mailing
Sorry if this is too DB oriented.
PHP 4.3, MySQL 3.23
I've got a somewhat complex search of a MySQL database I'm trying to make.
(At least it's complex to me.) And I'm wondering if it's better to try to
handle it in MySQL or to split it up into multiple processes using PHP.
Essentially, I have
Dan wrote:
dan wrote:
...
Before we go through all of this, why isn't SQLite an option? It is in
by default as of PHP5.0.0 so if the server is / will be PHP5 soon then I
would go that route.
http://php.net/manual/en/ref.sqlite.php
--
Teach a man to fish...
NEW? |
Jackson Linux wrote:
Hi, everyone, I apologise if this posts twice; I'm having issues with my
outgoing email server.
I'm making 'teasers' of the first, say 200 to 250 characters of some
articles. This works great:
$content = strip_tags($article['content']);
$striptease =
I am just going to adda auto incrementing DB filed and get the numbers that
way. Seems the best way.
Kim Madsen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 10:14 PM
To: Ross
Ross Hulford wrote:
I want to asssign an image to a variable and show it if certain conditions
are met. E.g
Make it a little more clear what you want. Is this an already existing
image, or one you are trying to create? If it already exists then you
want to use an img tag.
?php echo 'img
Luis TQM Ariceaga wrote:
Is it possible to let the OS handle the collisions?
For example:
$last_value = system('cat counter.txt', $retval);
$last_value++;
$result = system('echo $last_value counter.txt', $retval);
just a suggestion!
Luis: if the OS handled the read/write collisions
Stg wrote:
Thanks a lot for that, I am really grateful, now it sends along the link
properly, which is great, however it is now having trouble converting spaces
to %20 and it does it for some and not others, eg
It does this:
http://localhost/knewsl/NewsletterName.pdf
When it should be:
On 3/11/2005 10:33 AM Burhan Khalid wrote:
John Swartzentruber wrote:
I am running Fedora core3 with Apache 2.0.52 (from default RPMs),
MySQL 4.1.10 (from RPMs from MySQL site), and PHP 5.0.3 built from
source.
I'm going through the PHP manual and trying some of the mysqli
examples. The last
Jason Barnett wrote:
Dan wrote:
dan wrote:
...
Before we go through all of this, why isn't SQLite an option? It is in
by default as of PHP5.0.0 so if the server is / will be PHP5 soon then I
would go that route.
http://php.net/manual/en/ref.sqlite.php
Jason -
Yea, I saw that, but for this I have
I want to asssign an image to a variable and show it if certain conditions
are met. E.g
If condition is met
{
$myimage= retrieve image (images/myimage.jpg)
echo $myimage
}
Have not used image creation before with php just dipping my toe in the
water.
Not sure you need to use image
Is it possible to let the OS handle the collisions?
For example:
$last_value = system('cat counter.txt', $retval);
$last_value++;
$result = system('echo $last_value counter.txt', $retval);
...just a suggestion!
Even if your OS guarantees locks on re-direct, you'd still have the
*WRONG*
Hi,
I've built this little regular expression to test wether an e-mail
address is valid or not:
if(eregi
([EMAIL PROTECTED],
$email))
print ('valid email)
else
print ('Invalid email');
--
ok, now i want to use this in a filling form web page scenario.
I have this forms with its fields to
Hi, everyone,
I'm 'teasers' of the first, say 200 to 250 characters of some articles.
This works great:
$content = strip_tags($article['content']);
$striptease = substr($content, 0, 275);
but cuts off words right in the midd ...
I'd like to find a way to take $content, look
Greetings again,
Thanks to richard for pointing out a good way to
devle
into the source. It appears after browsing through the
source that the ' ' (space) is encoded to '+'. Also
the
characters '_', '-', '.' do get special treatment.
Obviously, this works great in the scenario where the
I am just learning php, and am currently converting some jsp pages to php.
I used the follwing code in jsp to toggle between two images
Instead of driving yourself nuts with echo and quote and backslash and
semi-colon quote semi-colon, just do like this:
?php
//PHP code here
?
!-- Look ma!
Greetings.
My problem with permissions when running an external executable like 'ls'
under PHP, itself running under Apache on an Fedora Core 3 (FC3) machine has
been solved.
I disabled SELinux and everything is now working fine. SELinux prevents
apache to access some directories, notably NFS
Hi,
I probably have a stupid question... how can I add a node into an existing
simplexml object.
I create the object by
$xml = simplexml_load_file('test.xml');
the xml file shows like this:
?xml version='1.0'?
config
/config
Thanks for help...
--
PHP General Mailing List
On Wed, Mar 09, 2005 at 02:52:52PM -0800, Richard Lynch wrote:
Agreed, initially I thought of that but I also need to use
transactions
in my business logic and MySQL doesn't support nested transactions, so
I'd have to open a separate connection to the DB to handle the session
transaction
I was recently visiting a commercial site and suddunly a window chat
popped up
and some assistant asked me if I needed some help. I thought this was
pretty
cool
Ugh!
I'd say it was pretty ANNOYING, myself.
And it's gotta be pretty expensive on the back-end to have all these live
chat
php.net/dom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
http://evilcode.net/cgi-bin/viewsvn.cgi/exhibition/trunk/lib/php/xml/xmltree.php?rev=106view=auto
( http://tinyurl.com/5h47a )
I have been using the above to extend DOMDocument, as a quick workaround to
avoid a root document element. Now that I have started using namespaces, it
works
I've built this little regular expression to test wether an e-mail
address is valid or not:
if(eregi
([EMAIL PROTECTED],
$email))
First, you should be aware that your RegEx is wrong.
I know it's wrong, because the CORRECT Regex is 3 *PAGES* long in the
camel book.
That said, maybe this
http://evilcode.net/cgi-bin/viewsvn.cgi/exhibition/trunk/lib/php/xml/xmltree.php?rev=106view=auto
( http://tinyurl.com/5h47a )
I have been using the above to extend DOMDocument, as a quick workaround
to
avoid a root document element. Now that I have started using namespaces,
it
works
Richard Lynch mailto:[EMAIL PROTECTED]
on Friday, March 11, 2005 10:12 AM said:
I've built this little regular expression to test wether an e-mail
address is valid or not:
if(eregi
([EMAIL PROTECTED],
$email))
First, you should be aware that your RegEx is wrong.
I know it's
Hi! I'm trying to run PHP as a shell script but I got the error message...
Source code below is ...
--snip--
#/usr/local/bin/php
?
echo Hello World!!\n;
?
--snip--
Attempt to run the file below and got the error
--snip--
-=[/usr/local/bin]==./ecbi_inquiry_pull_experian.sh
Hello World!!\n
Richard Lynch wrote:
...
First, you should be aware that your RegEx is wrong.
I know it's wrong, because the CORRECT Regex is 3 *PAGES* long in the
camel book.
3 pages? does any one use it? is it even feasible to use it?
That said, maybe this will catch *some* invalid email addresses, and not
Try to put this at top.
!/usr/local/bin/php
so change the # for a !, becous thas is what is used to execute scripts etc..
:).
Hoop it will work.
Kind Regards,
BlackDex
Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
Hi! I'm trying to run PHP as a shell script but I
BlackDex wrote:
Try to put this at top.
!/usr/local/bin/php
so change the # for a !, becous thas is what is used to execute scripts etc..
:).
not quite right: the shebang line requires both those chars :-)
http://dictionary.reference.com/search?q=shebang
quote #! used in Unix to mark the
Scott Fletcher wrote:
Hi! I'm trying to run PHP as a shell script but I got the error message...
Source code below is ...
--snip--
#/usr/local/bin/php
?
echo Hello World!!\n;
?
--snip--
Your first line needs to have both the # and the ! (shebang)
#!/usr/local/bin/php
--
John C. Nichel
ÜberGeek
John Nichel mailto:[EMAIL PROTECTED]
on Friday, March 11, 2005 11:28 AM said:
Your first line needs to have both the # and the ! (shebang)
#!/usr/local/bin/php
Would this also work???
williamhung/usr/local/bin/php
:)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
Chris W. Parker wrote:
John Nichel mailto:[EMAIL PROTECTED]
Your first line needs to have both the # and the ! (shebang)
#!/usr/local/bin/php
Would this also work???
williamhung/usr/local/bin/php
:)
Maybe now, but 20 years or so ago, it would have been...
cyndilauper/usr/local/bin/php
--
John C.
Hi, everyone,
Thanks for the great suggestions! I've looked at all and found that the
one here:
http://www.php.net/explode
that Jay recommended was the easiest for me to wrap my brain around. I
wll tinker with the other ones as well - it's all really interesting.
The function was:
function
Has anyone successfully lused the PHP pspell functions with this
version of aspell ?
# aspell -v
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.2)
I am able to use aspell fromt he command line, but PHP gives me the
following error when I try to use pspell_new() to load a
I need a way to make sure an upload has been uploaded correctly to my
server.
I know version 4.2.0 has the $_FILE['userfile']['error'] directive but
unfortunately I'm stuck with verision 4.1.2 at the moment and upgrading
may be a way off for me.
Should I use
php.net/dom
??
Like this?
---
try {
$dom = new DOMDocument();
$config =
$dom-appendChild($dom-importNode(dom_import_simplexml($this-configXML),true));
$config-appendChild( $dom-createElement(($mode? 'softactive':'active')) );
$this-configXML = simplexml_import_dom($config);
}
Hi,
I'm trying to compile php with imap ssl support, I've downloaded imap
source and run
make lnp SSLTYPE=unix
then i run php configure file with
as
./configure --with-imap=/usr/src/php5/imap/ --with-openssl
--with-imap-ssl=/usr/src/php5/imap/
configuration, make and make install worked but I
I have a page that displays the contents of a folder. Right now,
each file has a little 'delete' button next to it that users can click
on, however with many files it gets cumbersome. I need to be able to
have them click on checkboxes and then hit one delete button which will
then get rid
hi
i need some advice on making a bulk emailer script more robust.
what i'm currently doing:
-using mysql_fetcharray() to loop through an array of query results
-for each iteration of the loop, get an email address from the current row in
the result set, and use it with the mail() function to
On Fri, 2005-03-11 at 13:12, Richard Lynch wrote:
I've built this little regular expression to test wether an e-mail
address is valid or not:
if(eregi
([EMAIL PROTECTED],
$email))
First, you should be aware that your RegEx is wrong.
I know it's wrong, because the CORRECT Regex is
Ashley M. Kirchner wrote:
I have a page that displays the contents of a folder. Right now,
each file has a little 'delete' button next to it that users can click
on, however with many files it gets cumbersome. I need to be able to
have them click on checkboxes and then hit one delete
Ashley M. Kirchner wrote:
I have a page that displays the contents of a folder. Right now,
each file has a little 'delete' button next to it that users can click
on, however with many files it gets cumbersome. I need to be able to
have them click on checkboxes and then hit one delete
I have a page that displays the contents of a folder. Right now,
each file has a little 'delete' button next to it that users can click
on, however with many files it gets cumbersome. I need to be able to
have them click on checkboxes and then hit one delete button which will
then get rid of
Currently I send data to another page by using
header("Location: http://" . $_SERVER['HTTP_HOST'] .
dirname($_SERVER['PHP_SELF']) .
"/" . $relative_url .
"?"
. $my_data);
My
client would like the data passed via a POST rather than in the URL.
Can this be done and if so, how?
Todd Cary wrote:
Currently I send data to another page by using
header(Location: http://; . |$_SERVER['HTTP_HOST'] .|
|dirname($_SERVER['PHP_SELF']) . |
|/ . $relative_url . |
|? . $my_data);|
||
||My client would like the data passed
hello php.general:
I want to send a file through an HTML form to my Linux server.
Newbie to PHP, but I have been patient in inverse proportion to my
knowledge. I have seen many confused people with similar problems and their
respective solutions in my quest (!), but still no avail towards my
This is from php.net:
Just change the $out to fill with your POST request
(instead of the GET). Works good, you can change ports. :)
$fp = fsockopen("www.example.com", 80,
$errno, $errstr, 30);if (!$fp) { echo
"$errstr ($errno)br /\n";}
else { $out = "GET / HTTP/1.1\r\n"; $out .= "Host:
Shawn -
Many thanks! I have a class I wrote that does that, but I thought I may
have overlooked something simplier.
Todd
Shawn Kelly wrote:
This is from php.net:
Just change the $out to fill with your POST request (instead of the
GET). Works good, you can change ports. :)
|$fp =
Here are my questions (first):
What sort of monster could possibly cause ini_get(file_uploads) to
return
Off even though php.ini has file_uploads = On?
First and foremost, confirm that the php.ini you changed is the same file
PHP is actually using.
Create a phpinfo.php file with: ?php
On Fri, 2005-03-11 at 13:12, Richard Lynch wrote:
I've built this little regular expression to test wether an e-mail
address is valid or not:
if(eregi
([EMAIL PROTECTED],
$email))
I can also say that the backslashes in here are maybe not doing what you
think...
Maybe \w has no
what i'm currently doing:
-using mysql_fetcharray() to loop through an array of query results
-for each iteration of the loop, get an email address from the current row
in the result set, and use it with the mail() function to send out an
individual email to that email address, then echo out
php.net/dom
??
Like this?
---
try {
$dom = new DOMDocument();
$config =
$dom-appendChild($dom-importNode(dom_import_simplexml($this-configXML),true));
$config-appendChild( $dom-createElement(($mode? 'softactive':'active'))
);
$this-configXML = simplexml_import_dom($config);
}
I need a way to make sure an upload has been uploaded correctly to my
server.
I know version 4.2.0 has the $_FILE['userfile']['error'] directive but
unfortunately I'm stuck with verision 4.1.2 at the moment and upgrading
may be a way off for me.
Should I use
Richard Lynch you are my new best friend! grep -n uploads
/etc/httpd/conf/httpd.conf tells me 279:php_admin_value file_uploads off.
I don't know how I could have missed it!
I changed httpd.conf to have php_admin_value file_uploads On and everything
worked like it was supposed to this morning
On Mar 11, 2005, at 2:34 PM, Richard Lynch wrote:
what i'm currently doing:
-using mysql_fetcharray() to loop through an array of query results
-for each iteration of the loop, get an email address from the
current row
in the result set, and use it with the mail() function to send out an
For those of you who might be interested I found this
http://www.craftysyntax.com/ , it's GPL and it looks pretty updated.
the web page says:
A multi-user, multi-operator, multi-department live help support chat system
that allows the operators of the websites to monitor their visitors as they
Shawn Kelly wrote:
hello php.general:
I want to send a file through an HTML form to my Linux server.
Newbie to PHP, but I have been patient in inverse proportion to my
knowledge. I have seen many confused people with similar problems and their
respective solutions in my quest (!), but still
Richard Lynch wrote:
...
} catch(Exception $e) {}
I dunno about that whole try/catch thing, but if you're not going to USE
it to catch the errors, then you might as well be old school and check the
return values of all these functions.
Agreed 100%. No sense in going through the overhead
Ross Becker wrote:
There's no output (besides the numeric return code) from SSH which I
care about- there shouldnt be anything coming back via stdout or stderr.
If there is, I'm happy to discard it. This SHOULD be a dead-nuts-simple
case of exec the command and wait for it to return.
And if
Hi,
In Portgal we have big names.
My complete name, for instance, is Mário Augusto Machado dos Reis Gamito.
Mário is the Christian name and Gamito - the last one - is always
the last name of the father.
I have a form where i want to let my users insert their full big name
like mine, but i want
Mário Gamito wrote:
Hi,
In Portgal we have big names.
My complete name, for instance, is Mário Augusto Machado dos Reis Gamito.
Mário is the Christian name and Gamito - the last one - is always
the last name of the father.
I have a form where i want to let my users insert their full big name
Cindy Reeves wrote:
Hi. I want to include an image on my home page that is dynamically created
from another website. The source code on a typical HTML page would be img
src=http://www.othersite.com/returnedimage.aspx;
I don't trust their server will always be up/respond, so I want to use a PHP
I think you're probably right. My gut is telling me that this has to do
with tty funkiness. I tried the batchmode option, but it didn't affect
the problem. My bet is that ssh is mucking around with ttys, and PHP is
loosing it's connection through apache. The php processing may actually
be
Hi Sokolewicz,
Thanks a lot.
It just working really fine :)
Thank you again.
Warm regards,
Mário Gamito
M. Sokolewicz wrote:
Mário Gamito wrote:
Hi,
In Portgal we have big names.
My complete name, for instance, is Mário Augusto Machado dos Reis
Gamito.
Mário is the Christian name and
Mário Gamito wrote:
Hi Sokolewicz,
Thanks a lot.
It just working really fine :)
M. Sokolewicz wrote:
Mário Gamito wrote:
For example, if i fill the form with Mário Augusto Machado dos
Reis Gamito, i want to change this string to only Mário Gamito.
The total number of names is not fix.
Could
I am trying to display information in an html table from a MySQL data base.
I can do this rather easily, however, I am trying to multiply that table
with as many entries there are in the database.
Can someone point me in the right direction or give me an example of how I
can accomplish this?
I
Hi,
I have a database table withe the next fields: category_id, parent_id,
category_name.
How can i display all the categories with their subcategories, like this
Category 1
Category 11
Category 12
Category121
Category 2
Category 21
Category 22
and so on
Ross Becker wrote:
I think you're probably right. My gut is telling me that this has to do
with tty funkiness. I tried the batchmode option, but it didn't affect
the problem. My bet is that ssh is mucking around with ttys, and PHP is
loosing it's connection through apache. The php processing
?php
/** Page 1 of the form (uniqid.php). Try to protect this page with your
server, mmmkay? Authentication is left as an exercise for the reader... */
$genkey = 'http://receiving_server.com/genkey.php?fname=';
define('TMP', './');
$key = KEY
admin's public key. In an optimal situation you
Hi,
Friday, March 11, 2005, 6:30:52 PM, you wrote:
KM -Original Message-
KM From: Richard Lynch [mailto:[EMAIL PROTECTED]
KM Sent: Thursday, March 10, 2005 10:14 PM
KM To: Ross Hulford
KM Cc: php-general@lists.php.net
KM Subject: Re: [PHP] incrementing a number from a text file
I want
Hi,
I have a database table withe the next fields: category_id, parent_id,
category_name.
How can i display all the categories with their subcategories, like this
Category 1
Category 11
Category 12
Category121
Category 2
Category 21
Category 22
--
PHP General Mailing List
Popescu Dan wrote:
Hi,
I have a database table withe the next fields: category_id, parent_id,
category_name.
How can i display all the categories with their subcategories, like this
Category 1
Category 11
Category 12
Category121
Category 2
Category 21
Category 22
You need to use a
A file system question for you folks.
We have a folder that contains the following structure of files for
each of our sales reps in the company:
$TOP_FOLDER$/
/$SalesRep1/
/$Client1/
/File1.ext
Mario,
Many ways to do it, most using regex. This is not as clean as it
can be but still shows the idea:
?php
$name = Mario Augusto Machado dos Reis Gamito;
preg_match (/^(\w+)(\W*)(\w+\W+)*(\w+)$/,$name,$matches);
$short_name = $matches[1] $matches[4];
?
This example works for any number of
Just a quick and dirty solution - but couldn't you explode the name
into an array and use the first and last array fields ?
On Mar 11, 2005, at 11:39 PM, Steve Slater wrote:
Mario,
Many ways to do it, most using regex. This is not as clean as it
can be but still shows the idea:
?php
$name =
88 matches
Mail list logo