php-general Digest 20 Dec 2005 17:07:46 -0000 Issue 3861
Topics (messages 227695 through 227735):
Re: Random Images with no duplicates?
227695 by: Mike
Re: Access Headers Submitted by Browser
227696 by: Curt Zirzow
227703 by: Jochem Maas
Re: http curl to https is that a secure connection?
227697 by: Curt Zirzow
Re: MySQL - PHP's configure failed with error
227698 by: Curt Zirzow
pspell dictionary issue
227699 by: Adi
227716 by: John Nichel
227730 by: Adi
227735 by: John Nichel
ID--how to keep them in order
227700 by: Anasta
227702 by: Curt Zirzow
Re: Invalid argument supplied for foreach()
227701 by: Curt Zirzow
XML Parser set option
227704 by: Amol Hatwar
227705 by: ondrej
Problem with fopen and sending POST vars
227706 by: Barry
227707 by: Silvio Porcellana [tradeOver]
227728 by: Barry
227733 by: tg-php.gryffyndevelopment.com
can someone explain this query to me
227708 by: Ross
227709 by: David Grant
227710 by: Dan Parry
Re: Write a FIFO file
227711 by: Ruben Rubio Rey
227712 by: Robin Vickery
227731 by: Ray Hauge
Filtering URLs problem..
227713 by: Anders Norrbring
227726 by: Philip Hallstrom
227727 by: Silvio Porcellana [tradeOver]
227732 by: Anders Norrbring
227734 by: Jochem Maas
apache and PHP on win2k3 server error
227714 by: Peter Palermo
Re: [Bulk] Re: [PHP] PHP errors in Apache error logs
227715 by: Matt
227729 by: Georgi Ivanov
Re: asianwhiteskin beauty product
227717 by: Michelle Konzack
227718 by: John Nichel
227719 by: Dan McCullough
227720 by: George Pitcher
problem: pgsql (unicode) => php5 => HTML (iso-8859-1)
227721 by: Michelle Konzack
227722 by: David Grant
227723 by: Jochem Maas
Re: IE6 not returning POST data from a textarea
227724 by: chris
Re: When using foreach(), how to use &$value in php 4??
227725 by: chris
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
I'd just like to thank everyone who helped me our with this. I think it's
great that so many people would be so helpful and not expect anything in
return. This list is quite a storehouse of info and I'm learning just from
reading the posts since I joined last week!
Again, thanks all.
-Mike
""Kilbride, James"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Actually with this idea all you do is reduce $max after each successful
pull and 'increment' over pictures you already have. That way you never
have to pull another random number. You just may have to increment
through the entire set of pulled images if you pulled a high enough
number.
for($i = 0; $i < $want; $i++) {
$random = mt_rand(0,$max);
for($j = 0; $j < $i; $j++) {
if ($retrieved[$j] < $random) {
$random++;
}
}
$retrieved[] = $random;
sort($retrieved);
$max--;
}
Guarentees unique choices.
> > I'm still very green with PHP, but am working to fix that.
> >
> > I've searched high and low for an answer to this question
> and so far
> > no solution has presented itself. I have a script to
> populate my web
> > page with random images:
> >
> > <?php
> > #random images example
> > #this is your file
> > $file = "images.txt";
> > #open the file
> > $openFile = file($file);
> > #generate a random number
> > srand((double)microtime()*1000000);
> > #get one of the entries in the file
> > $random_image = $openFile[array_rand($openFile)]; #display
> the entry
> > echo "<img src='$random_image' height='170' width='100'></img>"; ?>
> >
> >
> > This works beautifully, but my problem is that sometimes,
> the same image
> > displays twice or more on the same page-load. My page
> requires 10 different
> > places where my images need to load, but I can't have any
> duplicate images
> > show up.
--- End Message ---
--- Begin Message ---
On Mon, Dec 19, 2005 at 11:28:07PM -0500, Michael B Allen wrote:
> I want to read headers submitted by the client. Are these available
> through some global array somewhere?
You will notice all the HTTP_* values in:
var_dump($_SERVER);
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
Curt Zirzow wrote:
On Mon, Dec 19, 2005 at 11:28:07PM -0500, Michael B Allen wrote:
I want to read headers submitted by the client. Are these available
through some global array somewhere?
You will notice all the HTTP_* values in:
var_dump($_SERVER);
hi Curt,
although there is lots of header info in the SERVER super global I don't
know if they [headers] are all accounted for there, I assume this because
of the existance of getallheaders().
<quote from="TM">
After PHP 4.3.0, getallheaders() is an alias for apache_request_headers().
</quote>
Curt.
--- End Message ---
--- Begin Message ---
On Mon, Dec 19, 2005 at 04:01:34PM -0800, Mark Steudel wrote:
> I was curious, if have a page at http and it initiates a curl session to a
> https, is the information sent secure or open because the the curl session
> is from a unecrypted page?
The data sent back and forth to the curl session will be secure,
the data between the client and the script that calls curl will be
insecure.
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
On Mon, Dec 19, 2005 at 02:56:37PM -0500, Scott Fletcher wrote:
> I don't know what is the problem. I'm using the GNU GCC and GNU Biutils.
>
> --snip--
> ./configure --with-mysqli=../../mysql/bin/mysql_config --with-apxs2=../../ap
> ache2/bin/apxs --with-unixODBC --with-openssl --with-curl --disable-libxml -
> -disable-dom --enable-track-vars --enable-ftp --enable-sockets
> --snip--
>
> --snip--
> checking for mcrypt support... no
> checking for mhash support... no
> checking whether to include mime_magic support... no
> checking for MING support... no
> checking for msession support... no
> checking for mSQL support... no
> checking for MSSQL support via FreeTDS... no
> checking for MySQL support... no
> checking for specified location of the MySQL UNIX socket... no
> checking for MySQLi support... yes
> checking whether to enable embedded MySQLi support... no
> checking for mysql_set_server_option in -lmysqlclient... no
> configure: error: wrong mysql library version or lib not found. Check
> config.log for more information.
> --snip--
What version of mysql is in the mysql directory? mysqli requires
4.1 or greater.
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
I am having a problem switching dictionaries from 'american', 'british' and
'canadian' English in pspell. Pspell seems to test everything against the
american dictionary for some reason. I tested aspell on command line and
worked fine if I supplied the dictionary I wanted to use with the –d option.
Below is some basic code I used to test this in php:
<?php
$string = "color";
$pspell_link = pspell_new("en", "canadian");
if (!pspell_check($pspell_link, $string)) {
$suggestions = pspell_suggest($pspell_link, $string);
foreach ($suggestions as $suggestion) {
echo "Possible spelling: $suggestion<br />";
}
} else {
echo "All good";
}
?>
The output was "All good" instead of a list of suggestions. Also, when I
tested the string "colour" with pspell_new("en", "american"); pspell
accepted the spelling…aspell on the other hand worked as expected in shell.
Any suggestions would be much appreciated.
--- End Message ---
--- Begin Message ---
Adi wrote:
I am having a problem switching dictionaries from 'american', 'british' and
'canadian' English in pspell. Pspell seems to test everything against the
american dictionary for some reason. I tested aspell on command line and
worked fine if I supplied the dictionary I wanted to use with the –d option.
Below is some basic code I used to test this in php:
<?php
$string = "color";
$pspell_link = pspell_new("en", "canadian");
if (!pspell_check($pspell_link, $string)) {
$suggestions = pspell_suggest($pspell_link, $string);
foreach ($suggestions as $suggestion) {
echo "Possible spelling: $suggestion<br />";
}
} else {
echo "All good";
}
?>
The output was "All good" instead of a list of suggestions. Also, when I
tested the string "colour" with pspell_new("en", "american"); pspell
accepted the spelling…aspell on the other hand worked as expected in shell.
Any suggestions would be much appreciated.
I had a problem similiar to this a couple of years ago; don't know if
this will help, but.... How is your version of php installed (from
source, RPM, another package?) If you installed php/aspell from source,
check to see if your system also has aspell installed as an RPM (or
other package).
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
All the installs are from source...and aspell works just fine from
shell...its almost like pspell if defaulting to use the american dictionary.
Adam.
--- End Message ---
--- Begin Message ---
Adi wrote:
All the installs are from source...and aspell works just fine from
shell...its almost like pspell if defaulting to use the american dictionary.
Adam.
Did you check to see if your system has any of the spelling tools
installed as a package also? If you're on a RPM based system :
rpm -qa | grep [a\|p]spell
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I have a script which outputs a movie title, rating and the ID number
(below).
The ID number is also used in the admin section as a select for update and
delete.
The problem i have is that as i delete certain entries then the number
sequence on the display page has missing numbers--is there a way to move all
rows down to the next number in the mysql DB so the ID remains there.
The easiest way is to not display the ID in the first place i am guessing,
but it would be good to know if there is another way.
There are 16 DVDs titles.
2 Monster in Law PG
3 Pulp Fiction MA
4 Bambi G
5 Shrek PG
6 Madagascar G
7 Grease II PG
8 Star Wars M
9 Harry Potter-Askaban PG
10 Lilo & Stitch G
11 Garfield G
13 Saw I MA
14 Saw II MA
15 Longest Yard R
16 Robots PG
17 Bewitched PG
20 Team America PG
--- End Message ---
--- Begin Message ---
On Tue, Dec 20, 2005 at 02:12:43PM +0800, Anasta wrote:
> I have a script which outputs a movie title, rating and the ID number
> (below).
> The ID number is also used in the admin section as a select for update and
> delete.
>
> The problem i have is that as i delete certain entries then the number
> sequence on the display page has missing numbers--is there a way to move all
> rows down to the next number in the mysql DB so the ID remains there.
> The easiest way is to not display the ID in the first place i am guessing,
> but it would be good to know if there is another way.
>
> There are 16 DVDs titles.
> 2 Monster in Law PG
> 3 Pulp Fiction MA
This is more of a db design issue, what your are looking at is the
issue with:
surrogate key vs. natural key
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
On Mon, Dec 19, 2005 at 03:48:53PM -0800, Jose Borquez wrote:
> I am getting the following errors when accessing a php page:
>
> /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php(299)
> : Warni
> ng - Invalid argument supplied for foreach()
> [Mon Dec 19 15:10:52 2005] [error] PHP Warning: Invalid argument
> supplied for f
> oreach() in
> /usr/local/www/groupoffice-com-2.14-FINAL-4/configuration/index.php
> on line 299
I would strongly suggest you seek the forum they have, You're odds
of someone actually using groupoffice there is a lot more likely
than here.
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
Hi,
The PHP Manual entry for xml_parser_set_option lists an option called:
XML_OPTION_SKIP_WHITE. I really couldn't decipher what this option
enables or disables.
The manual entry itself is a bit terse:
"Whether to skip values consisting of whitespace characters."
Doodling around with it in code got me no luck. Any ideas on what kind
of whitespaces it does supress?
Regards,
ah
--- End Message ---
--- Begin Message ---
Amol Hatwar wrote:
Hi,
The PHP Manual entry for xml_parser_set_option lists an option called:
XML_OPTION_SKIP_WHITE. I really couldn't decipher what this option
enables or disables.
The manual entry itself is a bit terse:
"Whether to skip values consisting of whitespace characters."
Doodling around with it in code got me no luck. Any ideas on what kind
of whitespaces it does supress?
Look at this script:
<?php
$simple = "<root>\n\t</root>";
$p = xml_parser_create();
xml_parser_set_option($p, XML_OPTION_SKIP_WHITE, $argv[1]);
xml_parse_into_struct($p, $simple, $vals);
xml_parser_free($p);
echo "\nVals array\n";
print_r($vals);
?>
// sets XML_OPTION_SKIP_WHITE to false
[EMAIL PROTECTED] ~/tmp $ php simple.php 0
Array
(
[0] => Array
(
[tag] => ROOT
[type] => complete
[level] => 1
[value] =>
)
)
// sets XML_OPTION_SKIP_WHITE to 1
[EMAIL PROTECTED] ~/tmp $ php simple.php 1
Array
(
[0] => Array
(
[tag] => ROOT
[type] => complete
[level] => 1
)
)
With XML_OPTION_SKIP_WHITE = 1 sets are whitespace chars discarded from
the result. In first output is index 'value' which contains only "\n\t"
- whitespace chars. Second output is without this index in array -
whitespace chars are ignored.
If you have node which contains text and whitespace chars "<node> some
text</node>" then whitespace chars are not discarded. Only content of
nodes with whitespace chars only are discarded (<node> </node> ->
<node></node>).
--
Ondrej Ivanic
([EMAIL PROTECTED])
--- End Message ---
--- Begin Message ---
Hello everyone!
I have a problem sending POST vars via fopen.
It was possible for me to send some xml data but that's all.
Anyone know how to send POST vars?
Big probleme here is also that i have to connect via SSL.
Many thanks for any help.
Greetings
Barry
Here is my code:
<?
# generating xml for testing
$request_data = "<xml><data>blablubb</data></xml>";
# array with the options to create stream context
$opts = Array();
# compose HTTP request header
$header .= "User-Agent: PHP Script\\r\\n";
$header .= "Content-Type: text/xml\\r\\n";
$header .= "Content-Length: ".strlen($request_data)."\\r\\n";
$header .= "Connection: close";
# define context options for HTTP request
$opts['http']['method'] = 'POST';
$opts['http']['header'] = $header;
$opts['http']['content'] = $request_data;
# create stream context
$context = stream_context_create($opts);
$fp = fopen
("https://easy-demo.tcinternet.de/hosting/servlet/Dispatcher","r",false,$context);
if (!$fp) echo "error";
else
{
$vars= explode ("&",stream_get_contents($fp));
foreach ($vars as $key => $value)
{
$var = explode ("=", $value);
$tcph[$var[0]] = urldecode($var[1]);
}
}
print_r($tcph);
?>
--- End Message ---
--- Begin Message ---
Barry wrote:
> Hello everyone!
>
> I have a problem sending POST vars via fopen.
> It was possible for me to send some xml data but that's all.
>
> Anyone know how to send POST vars?
> Big probleme here is also that i have to connect via SSL.
>
cURL can be your friend...
http://php.net/curl
http://www.zend.com/pecl/tutorials/curl.php
HTH, cheers
Silvio
--
tradeOver | http://www.tradeover.net
...ready to become the King of the World?
--- End Message ---
--- Begin Message ---
Silvio Porcellana [tradeOver] wrote:
Barry wrote:
I have a problem sending POST vars via fopen.
It was possible for me to send some xml data but that's all.
Anyone know how to send POST vars?
Big probleme here is also that i have to connect via SSL.
cURL can be your friend...
http://php.net/curl
http://www.zend.com/pecl/tutorials/curl.php
HTH, cheers
Silvio
Is there an other way?
Ensim is installed on the Webserver, and this Webserver-tool is quite
everywhere in the system.
cURL has SSL disabled.
I tried to install/update to a newer version but i get errors trying it
like:
# rpm -U curl-7.15.1-1.i386.rpm
error: failed dependencies:
libcurl.so.2 is needed by php-4.2.2-2ensim7
And i am a bit afraid if i now add/change that system too much that the
whole server breaks up...
See here, everything is connected to that ensim thing :(
# rpm -qa | grep ensim
vacation-1.2.6.1-ensim1
gettext-0.10.38-7ensim1
Zope-services-2.3.3-2ensim3
postgresql-contrib-7.1.3-4ensim3
apache-manual-1.3.27-ensim1
libsfio-1999-1ensim1
apache-mod_fastcgi-2.2.10-1ensim11
postgresql-7.1.3-4ensim4bp.2
postgresql-server-7.1.3-4ensim4bp.2
php-devel-4.2.2-2ensim7
php-ldap-4.2.2-2ensim7
php-snmp-4.2.2-2ensim7
python2-2.1.3-1ensim2
majordomo-1.94.5-2ensim6
cronolog-1.6.1-ensim4
Zope-zpublisher-2.3.3-2ensim3
tomcat4-4.0.3-ensim1
apache-devel-1.3.27-ensim1
proftpd-standalone-1.2.4-ensim2
apache-1.3.27-ensim1
postgresql-libs-7.1.3-4ensim4bp.2
postgresql-python-7.1.3-4ensim4bp.2
php-4.2.2-2ensim7
php-imap-4.2.2-2ensim7
php-pgsql-4.2.2-2ensim7
sendmail-doc-8.11.6-3ensim7
analog-5.1-1ensim2
mx-2.0.2-1ensim3
Zope-zserver-2.3.3-2ensim3
phpMyAdmin-2.2.0-ensim4
mod_jk-1.3-1.0-1.4.0.2ensim2
proftpd-1.2.4-ensim2
postgresql-devel-7.1.3-4ensim4bp.2
php-gettext-4.2.2-2ensim7
php-mysql-4.2.2-2ensim7
php-sysvshm-4.2.2-2ensim7
sendmail-cf-8.11.6-3ensim7
perl-Quota-1.4-ensim2
frontpage-5.0-ensim15
Zope-components-2.3.3-2ensim3
Zope-ztemplates-2.3.3-2ensim3
ensim-appliance-libs-3.1.0-25
MySQL-python21-0.3.5-1ensim3
mod_ssl-2.8.12-ensim1
ensim-appliance-l-3.1.4-1
php-ftp-4.2.2-2ensim7
php-manual-4.2.2-2ensim7
php-sysvsem-4.2.2-2ensim7
sendmail-8.11.6-3ensim7
Greetings
Barry
--- End Message ---
--- Begin Message ---
There are a couple examples of manually sending POST data via fsockopen() on:
http://us2.php.net/manual/en/function.fsockopen.php
Basically the stucture is the same as URL "GET" variables but you have to send
the header data manually and set content-type to
"application/x-www-form-urlencoded". But you still end up sneding data in this
form: "var1=value1&var2=value2&var3=value3" (hence the "urlencoded" part).
Good luck!
-TG
= = = Original message = = =
Hello everyone!
I have a problem sending POST vars via fopen.
It was possible for me to send some xml data but that's all.
Anyone know how to send POST vars?
Big probleme here is also that i have to connect via SSL.
Many thanks for any help.
Greetings
~Barry
Here is my code:
<?
# generating xml for testing
$request_data = "<xml><data>blablubb</data></xml>";
# array with the options to create stream context
$opts = Array();
# compose HTTP request header
$header .= "User-Agent: PHP Script\\r\\n";
$header .= "Content-Type: text/xml\\r\\n";
$header .= "Content-Length: ".strlen($request_data)."\\r\\n";
$header .= "Connection: close";
# define context options for HTTP request
$opts['http']['method'] = 'POST';
$opts['http']['header'] = $header;
$opts['http']['content'] = $request_data;
# create stream context
$context = stream_context_create($opts);
$fp = fopen
("https://easy-demo.tcinternet.de/hosting/servlet/Dispatcher","r",false,$context);
if (!$fp) echo "error";
else
$vars= explode ("&",stream_get_contents($fp));
foreach ($vars as $key => $value)
$var = explode ("=", $value);
$tcph[$var[0]] = urldecode($var[1]);
print_r($tcph);
?>
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
$query = "delete from meetings where id IN (".implode(",", $ids).")";
Just the end bit, ids is an array of values (1,2,3,4,5) what does the IN
do??
Ross
--- End Message ---
--- Begin Message ---
Ross,
Ross wrote:
> $query = "delete from meetings where id IN (".implode(",", $ids).")";
>
> Just the end bit, ids is an array of values (1,2,3,4,5) what does the IN
> do??
It's the equivalent of WHERE id = 1 OR id = 2 OR id = 3 OR id = 4 OR id = 5.
Cheers,
David
--
David Grant
http://www.grant.org.uk/
--- End Message ---
--- Begin Message ---
WHERE id IN (1,2,3)
Is the same as saying WHERE id = 1 OR id = 2 OR id = 3
Few more details in this link
http://www.w3schools.com/sql/sql_in.asp
HTH
Dan
-----Original Message-----
From: Ross [mailto:[EMAIL PROTECTED]
Sent: 20 December 2005 12:07
To: [email protected]
Subject: [PHP] can someone explain this query to me
$query = "delete from meetings where id IN (".implode(",", $ids).")";
Just the end bit, ids is an array of values (1,2,3,4,5) what does the IN
do??
Ross
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ NOD32 1.1328 (20051219) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
--- End Message ---
--- Begin Message ---
Ok, I tried it before, it didn't work:
For example,
<?php
$filename = "fifo" ;
$dataFile = fopen( $filename, "a" ) ;
if ( $dataFile )
{
fwrite($dataFile,"TEST IN FIFO FILE\n");
fclose($dataFile);
}
else
{
die( "fopen failed for $filename" ) ;
}
?>
fifo file created as root:
mkfifo fifo
chmod 777 fifo
Try to execute it and execution never ends... browser is waiting for
ever ...
No errors in error php error log.
Any ideas?
Jay Blanchard wrote:
[snip]
I have a problem. I have created a fifo file (under linux) and I m not
able to append some line from a php script. There is not output error,
php just is executing for ever ...
How can I write a fifo file?
[/snip]
Please have a look here; http://www.php.net/file as a starting point for
file operations. You can append to a file with the fopen() function...
http://www.php.net/fopen
--- End Message ---
--- Begin Message ---
On 12/20/05, Ruben Rubio Rey <[EMAIL PROTECTED]> wrote:
> Ok, I tried it before, it didn't work:
>
> [...]
>
> Try to execute it and execution never ends... browser is waiting for
> ever ...
> No errors in error php error log.
>
> Any ideas?
I bet your script will finish as soon as you read from the other end -
for example by doing 'cat fifo' from a shell.
-robin
--- End Message ---
--- Begin Message ---
I'm not sure, but it could have something to do with append mode instead
of write mode. All I know about FIFO files and named pipes is that you
cannot open them for read and write, only one or the other. The file
system could detect append as "reading" when it's positioning your
pointer at the end of the file.
Robin Vickery wrote:
On 12/20/05, Ruben Rubio Rey <[EMAIL PROTECTED]> wrote:
Ok, I tried it before, it didn't work:
[...]
Try to execute it and execution never ends... browser is waiting for
ever ...
No errors in error php error log.
Any ideas?
I bet your script will finish as soon as you read from the other end -
for example by doing 'cat fifo' from a shell.
-robin
--- End Message ---
--- Begin Message ---
I'm writing a filter/parsing function for texts entered by users, and
I've run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http,
mms, irc etc and format them as links, that part was real easy..
The hard part is when a user has already entered a complete link..
In short:
http://www.server.tld/page.html
should be converted to:
<a
href='http://www.server.tld/page.html'>http://www.server.tld/page.html</a>
That part works fine, but if the user enters:
<a href='http://www.server.tld/page.html'>click here</a>
it all becomes a mess... Can somebody please make a suggestion on this?
--
Anders Norrbring
Norrbring Consulting
--- End Message ---
--- Begin Message ---
I'm writing a filter/parsing function for texts entered by users, and I've
run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http, mms,
irc etc and format them as links, that part was real easy..
The hard part is when a user has already entered a complete link..
In short:
http://www.server.tld/page.html
should be converted to:
<a href='http://www.server.tld/page.html'>http://www.server.tld/page.html</a>
That part works fine, but if the user enters:
<a href='http://www.server.tld/page.html'>click here</a>
it all becomes a mess... Can somebody please make a suggestion on this?
Skip anything inside <> tags... then you're last line would come through
completely unchanged...
-philip
--- End Message ---
--- Begin Message ---
Anders Norrbring wrote:
>
> I'm writing a filter/parsing function for texts entered by users, and
> I've run into a problem...
> What I'm trying to do is to parse URLs of different sorts, ftp, http,
> mms, irc etc and format them as links, that part was real easy..
>
You might want to consider using vbCode, there is a nice class for PHP here:
http://www.phpclasses.org/browse/package/1379.html
HTH, cheers.
Silvio
--
tradeOver | http://www.tradeover.net
...ready to become the King of the World?
--- End Message ---
--- Begin Message ---
On 2005-12-20 16:16 Silvio Porcellana [tradeOver] wrote:
Anders Norrbring wrote:
I'm writing a filter/parsing function for texts entered by users, and
I've run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http,
mms, irc etc and format them as links, that part was real easy..
You might want to consider using vbCode, there is a nice class for PHP here:
http://www.phpclasses.org/browse/package/1379.html
HTH, cheers.
Silvio
Thanks, but I already use PEAR HTML_BBCodeParser for that part.. :)
I solved it by a lookbehind, if there isn't a whitespace before the URL,
just jump over it.
Thanks for the suggestion!
--
Anders Norrbring
Norrbring Consulting
--- End Message ---
--- Begin Message ---
Anders Norrbring wrote:
On 2005-12-20 16:16 Silvio Porcellana [tradeOver] wrote:
Anders Norrbring wrote:
I'm writing a filter/parsing function for texts entered by users, and
I've run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http,
mms, irc etc and format them as links, that part was real easy..
You might want to consider using vbCode, there is a nice class for PHP
here:
http://www.phpclasses.org/browse/package/1379.html
HTH, cheers.
Silvio
Thanks, but I already use PEAR HTML_BBCodeParser for that part.. :)
I solved it by a lookbehind, if there isn't a whitespace before the URL,
I answered your question stating that a regexp with a
negative-lookahead assertion would probably be a good way to go...
but it seems my post never arrived ... anyway I think a negative lookahead or
lookbehind assertion will cut it. I would just like to add that you might
consider
looking behind for something a little more specific that a white space
(or lack of it); consider what happens when you are given the following HTML
snippet:
<p>click this: <b>http://yourdomain.com/something</b>
depending on the processing you do to the text prior to linkifying
(made that word up!) this may not be relevant.
just jump over it.
Thanks for the suggestion!
--- End Message ---
--- Begin Message ---
Hello,
When I am trying to load PHP as a module (php4apache.dll), it gives me
error at the time of starting Apache Server. Error is like -
[Thu Jan 31 13:11:11 2002] [warn]
Loaded DSO D:/php/sapi/php4apache.dll uses plain Apache 1.3 API, this
module might crash under EAPI! (please recompile it with -DEAPI)
Do you know how I can fix this or where I can download a copy of PHP already
compiled with -DEAPI (i am using PHP 4.3.11)?
Thank you,
Peter Palermo
I.T. Coordinator
Venetor Group - Hamilton
420 Grays Road
Hamilton, ON L8E 4H6
Toll Free: 888.664.5007
Office: 905.664.5007 (ext. 5661)
Fax: 905.561.4062
Email: [EMAIL PROTECTED] <blocked::mailto:[EMAIL PROTECTED]>
<file:///C:/Documents%20and%20Settings/ppalermo/Application%20Data/Microsoft
/Signatures/www.venetor.com> www.venetor.com << <http://www.venetor.com/>
http://www.venetor.com>>
The information in this message (including its attachments) is CONFIDENTIAL
and may be legally privileged. It is intended solely for the addressee.
Access to this message by anyone else is unauthorized. If you are not the
intended recipient, notify the sender by return e-mail and delete this
message from your system. Any disclosure, copying, or distribution of the
message, or any action or omission taken by an unauthorized recipient in
reliance on it, is prohibited and may be unlawful. Our Company does not
guarantee that this communication is free of viruses, interceptions or
interference, and does not endorse the sender's personal opinions or similar
information, which may be contained in this message.
--- End Message ---
--- Begin Message ---
Install the "php5-session" port from your ports tree to enable
sessions. It's located in "/usr/ports/www/php5-session" on a default
install with the port tree.
On 12/19/05, John Nichel <[EMAIL PROTECTED]> wrote:
> Jose Borquez wrote:
> > John Nichel wrote:
> >
> >> Jose Borquez wrote:
> >> <snip>
> >>
> >>> The Makefile configuration did have "--disable-all" included. Here
> >>> is the link to my phpinfo page;
> >>> http://68.127.38.82/install/test.php
> >>
> >>
> >>
> >> You have no session support.
> >>
> > I am not sure what to do now. Do I need to uninstall and reinstall it
> > with session support? What is the configuration I need to specify?
>
> Check with your OS. They _might_ have a package (port) you need to
> install. Probably named something like php-session
>
> Or...
>
> ./config
> make
> make install ;)
>
> --
> John C. Nichel IV
> Programmer/System Admin (ÜberGeek)
> Dot Com Holdings of Buffalo
> 716.856.9675
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
You need to compile php4-extensions or php5-extensions
/usr/ports/lang/
Good luck.
On Monday December 19 2005 22:32, Jose Borquez wrote:
> John Nichel wrote:
> > Jose Borquez wrote:
> > <snip>
> >
> >> The Makefile configuration did have "--disable-all" included. Here
> >> is the link to my phpinfo page;
> >> http://68.127.38.82/install/test.php
> >
> > You have no session support.
>
> I am not sure what to do now. Do I need to uninstall and reinstall it
> with session support? What is the configuration I need to specify?
>
> Thanks in advance,
> Jose
--- End Message ---
--- Begin Message ---
Am 2005-12-15 15:00:41, schrieb Dan McCullough:
> Is this some sort of new Zend product? :)
Can this implemented? I have only 75A and do
not like become patched with plastic. ;-P
If men can increase 3-4 inches...
...why not me 3-4 cups? =8<O
Greetings
Michelle
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSM LinuxMichi
0033/3/88452356 67100 Strasbourg/France IRC #Debian (irc.icq.com)
--- End Message ---
--- Begin Message ---
Michelle Konzack wrote:
Am 2005-12-15 15:00:41, schrieb Dan McCullough:
Is this some sort of new Zend product? :)
Can this implemented? I have only 75A and do
not like become patched with plastic. ;-P
If men can increase 3-4 inches...
...why not me 3-4 cups? =8<O
You have to wait for PHP6 for that.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Maybe this is a disk space product, increases disk space on all types of drives.
On 12/20/05, Michelle Konzack <[EMAIL PROTECTED]> wrote:
> Am 2005-12-15 15:00:41, schrieb Dan McCullough:
> > Is this some sort of new Zend product? :)
>
> Can this implemented? I have only 75A and do
> not like become patched with plastic. ;-P
>
> If men can increase 3-4 inches...
> ...why not me 3-4 cups? =8<O
>
> Greetings
> Michelle
>
> --
> Linux-User #280138 with the Linux Counter, http://counter.li.org/
> ##################### Debian GNU/Linux Consultant #####################
> Michelle Konzack Apt. 917 ICQ #328449886
> 50, rue de Soultz MSM LinuxMichi
> 0033/3/88452356 67100 Strasbourg/France IRC #Debian (irc.icq.com)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Ah, Michelle, but think of the problems getting dressed
(http://spysports.net/blueshirt.wmv). No offense!
george
> -----Original Message-----
> From: Dan McCullough [mailto:[EMAIL PROTECTED]
> Sent: 20 December 2005 2:39 pm
> To: [email protected]
> Subject: Re: [PHP] Re: asianwhiteskin beauty product
>
>
> Maybe this is a disk space product, increases disk space on all
> types of drives.
>
> On 12/20/05, Michelle Konzack <[EMAIL PROTECTED]> wrote:
> > Am 2005-12-15 15:00:41, schrieb Dan McCullough:
> > > Is this some sort of new Zend product? :)
> >
> > Can this implemented? I have only 75A and do
> > not like become patched with plastic. ;-P
> >
> > If men can increase 3-4 inches...
> > ...why not me 3-4 cups? =8<O
> >
> > Greetings
> > Michelle
> >
> > --
> > Linux-User #280138 with the Linux Counter, http://counter.li.org/
> > ##################### Debian GNU/Linux Consultant #####################
> > Michelle Konzack Apt. 917 ICQ #328449886
> > 50, rue de Soultz MSM LinuxMichi
> > 0033/3/88452356 67100 Strasbourg/France IRC #Debian (irc.icq.com)
> >
> > --
> > 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
>
>
--- End Message ---
--- Begin Message ---
Hello,
my PostgreSQL stores all data in UNICODE and now if I connect via
Webbrowser to my Database my webpages are detected as ISO-8859-1.
For each Page I must select View->Character Encoding->Unicode (UTF8).
Please can anyone tell me the right <META> (???) Tag to get Motilla
right to UNICODE?
Thanks
Michelle
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSM LinuxMichi
0033/3/88452356 67100 Strasbourg/France IRC #Debian (irc.icq.com)
--- End Message ---
--- Begin Message ---
Michelle,
Michelle Konzack wrote:
> Please can anyone tell me the right <META> (???) Tag to get Motilla
> right to UNICODE?
Try:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Cheers,
David
--
David Grant
http://www.grant.org.uk/
--- End Message ---
--- Begin Message ---
Michelle Konzack wrote:
Hello,
my PostgreSQL stores all data in UNICODE and now if I connect via
Webbrowser to my Database my webpages are detected as ISO-8859-1.
For each Page I must select View->Character Encoding->Unicode (UTF8).
Please can anyone tell me the right <META> (???) Tag to get Motilla
right to UNICODE?
this will probably do it (make sure headers et al are not designating
a conflicting codepage elsewhere):
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
try here for more info:
http://www.utf-8.com/
Thanks
Michelle
--- End Message ---
--- Begin Message ---
..........
"Curt Zirzow" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> On Mon, Dec 12, 2005 at 08:33:40PM -0500, Al wrote:
>> Al wrote:
>> >Anyone know to get IE6 to return POST data from a textarea when the text
>> >is pasted in?
>> >
>> >Works fine for Mozilla, etc.
>> >
>> >print_r($_POST) shows several <input...> and <text ...> values just
>> >fine.
>> >
>> >Thanks....
>>
>>
>> For those interested, here is the answer...
>>
>> Text pasted into a textarea [e.g., from Word] can have characters not
>> defined in IE's textarea ISO-8859-1 charset.
>>
>> Appearently, IE6 has a bug such that it does not send the POST value for
>> the textarea name when some of these are present. [e.g., "" char [hex
>> 85]] I don't know how many.
>>
>> You can get it to work by right-mouse selecting Encoding UTF-8 on the
>> client browser or use in the html header:
>> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
>
> This is a good point. I would even go further and to have all php
> files output in charset utf-8 by setting the ini setting:
>
> default_charset=UTF-8
>
> Curt.
> --
> cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
.....
""Scott Fletcher"" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
>I have encountered a situation where I'm using the foreach() where I need
>to
> assign new data to the $value in the foreach loop, foreach($x as $key ==>
> $value). With PHP 5, you can do the ampersand to the $value but I'm using
> PHP 4? So, how do you guys do it? I tried this sample code but it only
> work
> in the child array but not the parent arrays... Food for Thought??
> Thanks...
>
> --code--
> function XmlTreeCDataAsciiLoopThrough(&$tree)
> {
> foreach($tree as $key => $value)
> {
> if (is_array($value)) {
> XmlTreeCDataAsciiLoopThrough($value);
> } else {
> if ($key == "VALUE") {
> echo $tree[$key]." ###<br>";
> $tree[$key] = "#############";
> echo $tree[$key]." @@@<br>";
> }
> }
> }
> }
> --code--
--- End Message ---