|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 9 Dec 2005 17:35:14 -0000 Issue 3841
php-general-digest-help
lists.php.net
Date: Fri Dec 09 2005 - 11:35:14 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 9 Dec 2005 17:35:14 -0000 Issue 3841
Topics (messages 227169 through 227214):
pear/Horde_Block can optionally use PHP extension "gettext" ...
227169 by: Marc G. Fournier
paid help wanted for session management
227170 by: sunaram patir
Re: Mime-type handling
227171 by: Curt Zirzow
227172 by: Curt Zirzow
227176 by: Manuel Vacelet
Re: Does the extension php_printer.dll work with php version 5.1.1 on a XP System
227173 by: Curt Zirzow
Re: Just a quick regular expression question!
227174 by: Sjoerd
227177 by: bala
Re: href difference between OS's.
227175 by: Marco Kaiser
setlocale() : missing named constant in french doc
227178 by: Olivier BERAUD
Migration from MySQL to MS-SQL Server
227179 by: AmirBehzad Eslami
227183 by: Marco Kaiser
227187 by: Thomas
PKCS#5 padding
227180 by: Binay\(Local\)
227181 by: Binay\(Local\)
227190 by: Robin Vickery
227208 by: Robin Vickery
Re: Advanced search form
227182 by: Michelle Konzack
PHP/MySql noob falls at first hurdle
227184 by: Paul Jinks
227189 by: John Nichel
227193 by: Zareef Ahmed
227194 by: Brice
227195 by: Dan Parry
227196 by: Brice
227198 by: Paul Jinks
227199 by: Rory McKinley
227200 by: Dan Parry
227202 by: Brice
227203 by: Rory McKinley
227204 by: Dan McCullough
227205 by: Jim Moseby
PHP, MySQL and XML for IPodCasting
227185 by: Danny
227188 by: Michael Hulse
Re: array carrying from one php page to another
227186 by: Ford, Mike
227191 by: Jochem Maas
Problem on Instalation ~ several module unable to download
227192 by: Bagus Nugroho
227206 by: Bagus Nugroho
227207 by: Jay Blanchard
227209 by: Bagus Nugroho
227210 by: Jay Blanchard
227212 by: Bagus Nugroho
Re: broken code....
227197 by: Ben Blay
227201 by: Jochem Maas
get XSLT on server without Sablotron
227211 by: Gerben
227213 by: Stephen Leaf
Create Image From HTML
227214 by: Shaun
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
'k, I searched google, and the only thing I could find was a response from
someone telling someone else who asked to search the archives, the answer
is there ...
well, I searched both the php-general and pear-general archives, and I'm
not finding any threads that talk about this :(
gettext is installed ... php is php5 ... how do I get it to recognize, and
therefore silence, these warnings ... ? :(
Still searching, but if someone can point me to even the thread itself
that is being eluded to, that would be great :(
Thanks ...
----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy
hub.org Yahoo!: yscrappy ICQ: 7615664
attached mail follows:
hi guys,
anyone will like to help me out from some problem in dealing with
sessions in internet explorer for some $10-$30? please send me private
mail. no reply to this mailing list please. and sorry guys for sending
this mail on the list. i couldn't help myself! i am damn frustrated!
regards,
sunaram
attached mail follows:
On Thu, Dec 08, 2005 at 02:41:43PM -0500, Zack Bloom wrote:
> mime types are very unreliable and should never be used for file type
> authentication (they can also be faked by users). Instead you could try
> using the extension of the file or an identifying statement in the file.
He isn't using the mime-type, the fileinfo module detects the
content type based on a magic file that defines, as you said, a
paticular statment in the file and returns the mime-type associated
with the magic.
Assuming you ment the mime/type sent via a file upload, trying to
detect the file type by the extension is just as unreliable.
Even identifying contents of the file is not as reliable as one
would think; it can also be spoofed. For example with jpeg, there
are several tools out there that will take a file, wrap a jpeg
image around the file and embed the real contents inside of the
file, and if your app just detects the magic contents, it will pass
the test.
The only way to ensure a file is what it really is to open and
resave it with a trusted application. Using the jpeg example you
would need to do something like:
djpeg $file | cjpeg > testfile.jpg
Well, with jpeg, the files will always be differnt but a fuzzy match
based on filesize closeness and/or similar bit distribution.
> On 12/8/05, Manuel Vacelet <manuel.vacelet
gmail.com> wrote:
> >
> > Hi all,
> >
> > I'm facing a bad behaviour of 'file' command used by fileinfo PECL module
> > (recommanded for mime-type checking):
> > * Some Microsoft Excel documents are detected as Microsoft Word documents
> > * Some HTML files are just text/plain
> > * ...
> >
Curt.
--
cat .signature: No such file or directory
attached mail follows:
On Thu, Dec 08, 2005 at 12:31:52PM +0100, Manuel Vacelet wrote:
> Hi all,
>
> I'm facing a bad behaviour of 'file' command used by fileinfo PECL module
> (recommanded for mime-type checking):
> * Some Microsoft Excel documents are detected as Microsoft Word documents
> * Some HTML files are just text/plain
> * ...
>
> I tested on multiple machines (with different version of file) and I
> sometimes obtain a diffrent behaviour but never the one expected :/ I also
> looked for the latest version of file but it seems that the file used to
> detect the mime-type is out of date...
I'm not familiar to how fileinfo detects the contents, is the file
it is using a file like:
/usr/share/misc/magic
> ...
> * Where can I find an up-to-date version of magic number list usable with
> file for mime type checking ?
If the above is true, a updated version should be availble for the
OS you are using.
Curt.
--
cat .signature: No such file or directory
attached mail follows:
2005/12/9, Curt Zirzow <czirzow
gmail.com>:
>
> On Thu, Dec 08, 2005 at 12:31:52PM +0100, Manuel Vacelet wrote:
> > Hi all,
> >
> > I'm facing a bad behaviour of 'file' command used by fileinfo PECL
> module
> > (recommanded for mime-type checking):
> > * Some Microsoft Excel documents are detected as Microsoft Word
> documents
> > * Some HTML files are just text/plain
> > * ...
> >
> > I tested on multiple machines (with different version of file) and I
> > sometimes obtain a diffrent behaviour but never the one expected :/ I
> also
> > looked for the latest version of file but it seems that the file used to
> > detect the mime-type is out of date...
>
> I'm not familiar to how fileinfo detects the contents, is the file
> it is using a file like:
>
> /usr/share/misc/magic
Yes and some other path.
> ...
> > * Where can I find an up-to-date version of magic number list usable
> with
> > file for mime type checking ?
>
> If the above is true, a updated version should be availble for the
> OS you are using.
>
Unfortunatly, my OS do not provide an up-to-date magic file.
But I have found an efficient solution via freedesktop shared mime project:
http://www.freedesktop.org/wiki/Standards_2fshared_2dmime_2dinfo_2dspec
They provide an up-to-date database of magic numbers:
http://freedesktop.org/Software/shared-mime-info
And there is an PHP implementation of querying tool:
http://www.freedesktop.org/wiki/Standards_2fshared_2dmime_2dinfo_2dspec#head-978bef7f41fbdc4b40c2deacb294a386c82aae4d
I tested it and it works very well. All my test case was successfully
passed.
> Even identifying contents of the file is not as reliable as one
> would think; it can also be spoofed. For example with jpeg, there
> are several tools out there that will take a file, wrap a jpeg
> image around the file and embed the real contents inside of the
> file, and if your app just detects the magic contents, it will pass
> the test.
>
> The only way to ensure a file is what it really is to open and
> resave it with a trusted application. Using the jpeg example you
> would need to do something like:
>
> djpeg $file | cjpeg > testfile.jpg
>
> Well, with jpeg, the files will always be differnt but a fuzzy match
> based on filesize closeness and/or similar bit distribution.
Well your comment is very intresting, I keep it in mind. But for my current
usage, I think the "on server" mime-type detection as described above will
secure enough.
Thanks for all,
Manuel
attached mail follows:
On Wed, Dec 07, 2005 at 04:27:49PM -0800, james crooks wrote:
> I trying to get php_printer.dll extension to work on a xp system . I
> downloaded correct version of php_printer.dll to match php version 5.1.1 .
> The extension_dir is set correctly , because other extensions load and work
> perfectly.
You can't rely that because other extensions work that you are
actually puting the file in the correct place. create a page with:
phpinfo();
and check the directories that php is expecting things in.
Curt.
--
cat .signature: No such file or directory
attached mail follows:
Couldn't you find anything on Google, for example by searching on
"regex url"? If you want to append .com to links, try using
preg_replace.
attached mail follows:
Hi Gene...
Try this....if u have found any pbm ,mail me
$string ="This is a <a href='http://www.ur1.com'>Hyperlink</a> and this
is a <a href='http://www.ur2.com'> Hyperlink</a>";
echo 'Before => '.$string;
$string = ereg_replace('(.*)(http:\/\/www.ur1)(.*)',
'\\1javascript:\\2\\3', $string);
echo '<br>After => '.$string;
attached mail follows:
Hi,
just link directly to the specific file like
<a href="C:\path\to\your\file.exe">Link Local</a>
the browser knows then how to handle this link.
-- Marco
attached mail follows:
Hi
In french documentation of setlocale(), I'm searching for a named
constant using LC_ALL less LC_NUMERIC but I can't find it !
When I asked for the english version of this page, I've found
LC_MESSAGES but it's not in the french version... I've spent 2 hours to
search why doesn't that go !
Could you add "LC_MESSAGES" constant in the french documentation of
setlocale function ?
Thanks
Olivier
attached mail follows:
Hi List,
I want to re-implement a PHP-driven package named ATutor (http://atutor.ca)
to work with MS-SQL Server.
Currently, it works with MySQL.
Unfortunately, authors of "ATutor" have not defined a class for database
connectivity.
In other words, they call each mysql functions directly in their code.
It seems that I must change every line of code to make ATutor work with
MS-SQL Server.
1) Is it suffice to replace every "mysql_FUNCTION" with "mssql__FUNCTION"
in the code? I realized that most of MSSQL functions are very similar to
MySQL functions, but their prefixes are different.
(I should kindly thank the PHP Development Team for this)
2) I have not worked with MS-SQL Server before. Is there anything else which
I should keep in mind?
Thank you in advance,
Behzad
attached mail follows:
hi,
you should also check your sql statements because they are maybe not
compatible.
Mysql have many mysql specific functions and behaviors.
2) I have not worked with MS-SQL Server before. Is there anything else which
> I should keep in mind?
>
--
Marco Kaiser
attached mail follows:
Hi Behzad,
It's not as easy as simply replacing the names. I went through a cycle like
that myself. It is right to check your sql statements first (because 10 to
10 they will differ at some point).
Be also mindful that with mssql you don't have an _insert_id() function, you
would have create that first yourself, making a separate db call.
Another option is to use odbc_ instead of mssql. That way you are somewhat
independent of your db server (but it is more of a mission to convert).
Greatest pain I had was the connection to SQL Servers. We switched to odb_
functions for that reason (but then again, we might have been stupid :-)_
If you are rewriting the project, why don't you implement a DB abstract
layer, like PEAR:DB or adodb_lite? Will take you a while but will make your
code look so much better.
Cheers
Thomas
-----Original Message-----
From: AmirBehzad Eslami [mailto:behzad.eslami
gmail.com]
Sent: 09 December 2005 12:56 PM
To: php-general
lists.php.net
Subject: [PHP] Migration from MySQL to MS-SQL Server
Hi List,
I want to re-implement a PHP-driven package named ATutor (http://atutor.ca)
to work with MS-SQL Server.
Currently, it works with MySQL.
Unfortunately, authors of "ATutor" have not defined a class for database
connectivity.
In other words, they call each mysql functions directly in their code.
It seems that I must change every line of code to make ATutor work with
MS-SQL Server.
1) Is it suffice to replace every "mysql_FUNCTION" with "mssql__FUNCTION"
in the code? I realized that most of MSSQL functions are very similar to
MySQL functions, but their prefixes are different.
(I should kindly thank the PHP Development Team for this)
2) I have not worked with MS-SQL Server before. Is there anything else which
I should keep in mind?
Thank you in advance,
Behzad
attached mail follows:
Hi All
Has anybody got the working code to apply the PKCS#5 padding to the text for encryption. Please let me know as it seems PHP inbuilt functions do not support this padding at all. Been worried about from past 2 days. Help me out.
Thanks
Binay
attached mail follows:
Hi All
Has anybody got the working code to apply the PKCS#5 padding to the text for encryption. Please let me know as it seems PHP inbuilt functions do not support this padding at all. Been worried about from past 2 days. Help me out.
Thanks
Binay
attached mail follows:
On 12/9/05, Binay(Local) <binay
oliveinternet.com> wrote:
> Hi All
>
> Has anybody got the working code to apply the PKCS#5 padding to the text for encryption. Please let me know as it seems PHP inbuilt functions do not support this padding at all. Been worried about from past 2 days. Help me out.
The pad function simply returns the text padded to the blocksize.
The unpad function returns the unpadded text, or false if the padding
isn't valid.
function pkcs5_pad ($text, $blocksize)
{
$pad = $blocksize - (strlen($text) % $blocksize);
return $text . str_repeat(chr($pad), $pad);
}
function pkcs5_unpad ($text)
{
$pad = ord($text{strlen($text)-1});
if ($pad > strlen($text)) return false;
if (!strspn($text, chr($pad), strlen($text) - $pad)) return false;
return substr($text, 0, -1 * $pad);
}
attached mail follows:
Ummmm.... I made a mistake in the second test for validity in the
unpad function. It should be this:
function pkcs5_unpad ($text)
{
$pad = ord($text{strlen($text)-1});
if ($pad > strlen($text)) return false;
if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) return false;
return substr($text, 0, -1 * $pad);
}
attached mail follows:
Thanks,
I will try it out...
Am 2005-12-07 09:41:20, schrieb Brent Baisley:
> Here is some code that you can modify. It's design to convert a
> search string into a MySQL full text search string, not sure how
> different pgsql is. It adds * for word expansion where appropriate.
> It assume a space is the delimiter, but that's easy to change in the
> explode statement.
>
> Example:
> "this is a search" -XXX Test
>
> becomes
>
> +"this is a search" -XXX* +Test*
>
> Conversion function:
<snip>
--
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)
attached mail follows:
Hi all
I've been asked to put simple database interactivity on an academic
site. They want users to enter a few details of their projects so other
researchers can search and compare funding etc. How difficult can that
be, I thought....
I've built the database in MySQL and entered some dummy data, and I'm
now trying in the first place to get the data to display with a simple
select query to display the variable "projTitle" from the table
"project" thus:
<head>
<snip>
<?
$SQLquery = "SELECT projTitle FROM project";
$result = mysql_query($SQLquery)
or die ("couldn't execute query");
mysql_close($connect)
?>
<body>
<p>Result of <b><?=$SQLquery ?></b></p>
<p>
<?
while($ouput_row = mysql_fetch_array($result)) {
?>
<?=$output_row["projTitle"]?><br />
<?
}
?>
</p>
</body>
When I view the page I get this:
<p>Result of <b>SELECT projTitle FROM project</b></p>
<p>
<br />
<br />
<br />
<br />
</p>
There are indeed 4 entries in the database, but I can't figure out why
it's not displaying the data. It worked fine on my "PHP/Mysql-in-a-box"
course. No, we didn't study the syntax :(
Any help gratefully received.
Thanks
Paul
attached mail follows:
Paul Jinks wrote:
> Hi all
>
> I've been asked to put simple database interactivity on an academic
> site. They want users to enter a few details of their projects so other
> researchers can search and compare funding etc. How difficult can that
> be, I thought....
>
> I've built the database in MySQL and entered some dummy data, and I'm
> now trying in the first place to get the data to display with a simple
> select query to display the variable "projTitle" from the table
> "project" thus:
>
> <head>
> <snip>
> <?
>
> $SQLquery = "SELECT projTitle FROM project";
> $result = mysql_query($SQLquery)
> or die ("couldn't execute query");
> mysql_close($connect)
>
> ?>
>
> <body>
> <p>Result of <b><?=$SQLquery ?></b></p>
>
> <p>
> <?
> while($ouput_row = mysql_fetch_array($result)) {
> ?>
> <?=$output_row["projTitle"]?><br />
> <?
> }
> ?>
>
> </p>
> </body>
>
> When I view the page I get this:
>
> <p>Result of <b>SELECT projTitle FROM project</b></p>
>
> <p>
> <br />
> <br />
> <br />
> <br />
>
>
> </p>
>
> There are indeed 4 entries in the database, but I can't figure out why
> it's not displaying the data. It worked fine on my "PHP/Mysql-in-a-box"
> course. No, we didn't study the syntax :(
>
> Any help gratefully received.
Are short tags disabled? Change this line...
<?=$output_row["projTitle"]?><br />
To...
<?php echo ( $output_row["projTitle"] ) ?><br />
--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
attached mail follows:
Hi Paul,
Why you are closing your connection before finishing your work on
the database?
Zareef Ahmed
----- Original Message -----
From: "Paul Jinks" <paul
pauljinks.co.uk>
To: <php-general
lists.php.net>
Sent: Friday, December 09, 2005 6:50 AM
Subject: [PHP] PHP/MySql noob falls at first hurdle
> Hi all
>
> I've been asked to put simple database interactivity on an academic
> site. They want users to enter a few details of their projects so other
> researchers can search and compare funding etc. How difficult can that
> be, I thought....
>
> I've built the database in MySQL and entered some dummy data, and I'm
> now trying in the first place to get the data to display with a simple
> select query to display the variable "projTitle" from the table
> "project" thus:
>
> <head>
> <snip>
> <?
>
> $SQLquery = "SELECT projTitle FROM project";
> $result = mysql_query($SQLquery)
> or die ("couldn't execute query");
> mysql_close($connect)
>
> ?>
>
> <body>
> <p>Result of <b><?=$SQLquery ?></b></p>
>
> <p>
> <?
> while($ouput_row = mysql_fetch_array($result)) {
> ?>
> <?=$output_row["projTitle"]?><br />
> <?
> }
> ?>
>
> </p>
> </body>
>
> When I view the page I get this:
>
> <p>Result of <b>SELECT projTitle FROM project</b></p>
>
> <p>
> <br />
> <br />
> <br />
> <br />
>
>
> </p>
>
> There are indeed 4 entries in the database, but I can't figure out why
> it's not displaying the data. It worked fine on my "PHP/Mysql-in-a-box"
> course. No, we didn't study the syntax :(
>
> Any help gratefully received.
>
> Thanks
>
> Paul
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
On 12/9/05, Paul Jinks <paul
pauljinks.co.uk> wrote:
> Hi all
>
> I've been asked to put simple database interactivity on an academic
> site. They want users to enter a few details of their projects so other
> researchers can search and compare funding etc. How difficult can that
> be, I thought....
>
> I've built the database in MySQL and entered some dummy data, and I'm
> now trying in the first place to get the data to display with a simple
> select query to display the variable "projTitle" from the table
> "project" thus:
>
> <head>
> <snip>
> <?
>
> $SQLquery = "SELECT projTitle FROM project";
> $result = mysql_query($SQLquery)
> or die ("couldn't execute query");
> mysql_close($connect)
>
> ?>
>
> <body>
> <p>Result of <b><?=$SQLquery ?></b></p>
>
> <p>
> <?
> while($ouput_row = mysql_fetch_array($result)) {
> ?>
> <?=$output_row["projTitle"]?><br />
> <?
> }
> ?>
>
> </p>
> </body>
Try to check the key of your result row with a print_r or a var_dump command.
Brice Favre
http://pelmel.org/
attached mail follows:
Hi
[snip]
<?
while($ouput_row = mysql_fetch_array($result)) {
?>
[/snip]
Try:
while($ouput_row = mysql_fetch_array($result, MYSQL_ASSOC))
[snip]
<?=$output_row["projTitle"]?><br />
[/snip]
You have missed the ; (semicolon) after ["projTitle"] also
Dan
-----Original Message-----
From: Paul Jinks [mailto:paul
pauljinks.co.uk]
Sent: 09 December 2005 11:51
To: php-general
lists.php.net
Subject: [PHP] PHP/MySql noob falls at first hurdle
Hi all
I've been asked to put simple database interactivity on an academic
site. They want users to enter a few details of their projects so other
researchers can search and compare funding etc. How difficult can that
be, I thought....
I've built the database in MySQL and entered some dummy data, and I'm
now trying in the first place to get the data to display with a simple
select query to display the variable "projTitle" from the table
"project" thus:
<head>
<snip>
<?
$SQLquery = "SELECT projTitle FROM project";
$result = mysql_query($SQLquery)
or die ("couldn't execute query");
mysql_close($connect)
?>
<body>
<p>Result of <b><?=$SQLquery ?></b></p>
<p>
<?
while($ouput_row = mysql_fetch_array($result)) {
?>
<?=$output_row["projTitle"]?><br />
<?
}
?>
</p>
</body>
When I view the page I get this:
<p>Result of <b>SELECT projTitle FROM project</b></p>
<p>
<br />
<br />
<br />
<br />
</p>
There are indeed 4 entries in the database, but I can't figure out why
it's not displaying the data. It worked fine on my "PHP/Mysql-in-a-box"
course. No, we didn't study the syntax :(
Any help gratefully received.
Thanks
Paul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ NOD32 1.1316 (20051208) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
attached mail follows:
> Are short tags disabled? Change this line...
>
> <?=$output_row["projTitle"]?><br />
>
> To...
>
> <?php echo ( $output_row["projTitle"] ) ?><br />
This line seems to work :
<p>Result of <b><?=$SQLquery ?></b></p>
--
Brice Favre
http://pelmel.org/
attached mail follows:
Brice wrote:
>
> Try to check the key of your result row with a print_r or a var_dump command.
>
> Brice Favre
> http://pelmel.org/
>
Like this?
<?php
while($ouput_row = mysql_fetch_array($result))
print_r($output_row);
?>
Apologies if this is pathetically wrong. Like I said, I'm a total noob.
The above returned no data or errors, by the way.
Thanks
Paul
attached mail follows:
Paul Jinks wrote:
<snip>
>> <?
>> while($ouput_row = mysql_fetch_array($result)) {
>> ?>
>> <?=$output_row["projTitle"]?><br />
<snip>
Paul - is this the actual code that you are using? - because you have a
typo in your while statement - $ouput_row instead of $output_row - means
that when you try and echo $output_row it doesn't exist!
Rory
attached mail follows:
[snip]
Hi Paul,
Why you are closing your connection before finishing your work on
the database?
Zareef Ahmed
[/snip]
I think Zareef has spotted the most important problem here
Try removing the mysql_close() and trying it
Dan
-----Original Message-----
From: Paul Jinks [mailto:paul
pauljinks.co.uk]
Sent: 09 December 2005 15:05
To: php-general
lists.php.net
Subject: Re: [PHP] Re: PHP/MySql noob falls at first hurdle
Brice wrote:
>
> Try to check the key of your result row with a print_r or a var_dump
command.
>
> Brice Favre
> http://pelmel.org/
>
Like this?
<?php
while($ouput_row = mysql_fetch_array($result))
print_r($output_row);
?>
Apologies if this is pathetically wrong. Like I said, I'm a total noob.
The above returned no data or errors, by the way.
Thanks
Paul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ NOD32 1.1316 (20051208) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
attached mail follows:
On 12/9/05, Paul Jinks <paul
pauljinks.co.uk> wrote:
> Brice wrote:
> >
> > Try to check the key of your result row with a print_r or a var_dump
> command.
> >
> > Brice Favre
> > http://pelmel.org/
> >
>
> Like this?
>
> <?php
> while($ouput_row = mysql_fetch_array($result))
> print_r($output_row);
> ?>
>
Exactly but you had a difference between the variable you instanciate
and the one you print. If you can, try to modify the error reporting
level on you php.ini. It can help for problem like this.
--
Brice.
http://pelmel.org/
attached mail follows:
Paul Jinks wrote:
> Rory McKinley wrote:
>
>> Paul Jinks wrote:
>> <snip>
>>
>>> <?
>>> while($ouput_row = mysql_fetch_array($result)) {
>>> ?>
>>> <?=$output_row["projTitle"]?><br />
>>
>>
>> <snip>
>>
>>
>> Paul - is this the actual code that you are using? - because you have a
>> typo in your while statement - $ouput_row instead of $output_row - means
>> that when you try and echo $output_row it doesn't exist!
>>
>> Rory
>>
>>
> Oh no. I can't believe it. That was it. An idiotic typo.
<snip>
I wouldn't stress too much - happens to me all the time (sigh) and
(apparently) it happens to the best of us - but I am not qualified to
comment on the veracity of that statement :).
For future reference, during testing, you can set your error reporting
levels ( i think) in php.ini to output a notice regarding a variable
that does not exist - would have helped you spot the error! I normally
use the Zend debugger which does quite a good job of telling me that I
am an idiot :)
Rory
attached mail follows:
I would hate to see a time clock that tabulated how many hours I
wasted with typos and stupid things like that.
On 12/9/05, Rory McKinley <rorym
nebula.co.za> wrote:
> Paul Jinks wrote:
> > Rory McKinley wrote:
> >
> >> Paul Jinks wrote:
> >> <snip>
> >>
> >>> <?
> >>> while($ouput_row = mysql_fetch_array($result)) {
> >>> ?>
> >>> <?=$output_row["projTitle"]?><br />
> >>
> >>
> >> <snip>
> >>
> >>
> >> Paul - is this the actual code that you are using? - because you have a
> >> typo in your while statement - $ouput_row instead of $output_row - means
> >> that when you try and echo $output_row it doesn't exist!
> >>
> >> Rory
> >>
> >>
> > Oh no. I can't believe it. That was it. An idiotic typo.
> <snip>
>
> I wouldn't stress too much - happens to me all the time (sigh) and
> (apparently) it happens to the best of us - but I am not qualified to
> comment on the veracity of that statement :).
>
> For future reference, during testing, you can set your error reporting
> levels ( i think) in php.ini to output a notice regarding a variable
> that does not exist - would have helped you spot the error! I normally
> use the Zend debugger which does quite a good job of telling me that I
> am an idiot :)
>
> Rory
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
>
> For future reference, during testing, you can set your error reporting
> levels ( i think) in php.ini to output a notice regarding a variable
> that does not exist - would have helped you spot the error! I normally
> use the Zend debugger which does quite a good job of telling me that I
> am an idiot :)
Setting error reporting to its highest lever is always a good thing during
development.
He can set it in his script as well:
//from foggy memory
error_reporting(E_ALL);
JM
attached mail follows:
Hi,
I´ve got a web project that daily offers 4 o 5 mp3 files recorded by me.
From an web based interface I populate a database with titles, descripcion,
images and the path for the mp3 file in the server
The cuestion is I would like to offer the content for Ipod, using
ipodcasting. Then I have to produce a daily XML file in order the Ipods feed
from that file....
How to proceed....
Should I create a script to make the well-formed XML file? (echoing to a
file based into a template that I´ve got) or is there parser of something
like that? which can help me to produce that file....
The scenario would be PHP 5, MySQL 5.x and Apache 2.0
Thank you in advance
Rgards
attached mail follows:
On Dec 9, 2005, at 3:45 AM, Danny wrote:
> How to proceed....
I recently set-up my first Podcast... Every week I have a script that
grabs three MP3 files from a remote server and puts them on my own
server... Then I have another script that generates the Podcast XML.
I am using CRON jobs to do all the work for me... all I have to do is
open iTunes and everything starts downloading automatically.... is
nice.
The way I generate my XML is via output buffering and a simple
text-file template. Here is my template (template.txt):
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Put your title here [{_dateCheck_}]</title>
<link>Link to your site/the page that explains what this podcast is
all about.</link>
<description>This is the description... it will show-up in iTunes...
yadda yadda...</description>
<language>en-us</language>
<copyright>Copyright Info</copyright>
<lastBuildDate>{_dateLong_}</lastBuildDate>
<webMaster>Your name here</webMaster>
<ttl>1</ttl>
<item>
<title>Name of MP3 podcast - Hour 01, {_dateCheck_},
{_dateSlashes_}</title>
<description>Hour 01 ({_dateSlashes_}) of this particular
podcast.</description>
<pubDate>{_dateLong_}</pubDate>
<enclosure
url="http://www.yoursite.com/location_of_podcast_mp3/mp3_name-
{_dateShort_}.mp3" length="10800040" type="audio/mpeg"/>
<guid isPermaLink="false">{_randNumOne_}</guid>
</item>
<item>
<title>Name of MP3 podcast - Hour 02, {_dateCheck_},
{_dateSlashes_}</title>
<description>Hour 02 ({_dateSlashes_}) of this particular
podcast.</description>
<pubDate>{_dateLong_}</pubDate>
<enclosure
url="http://www.yoursite.com/location_of_podcast_mp3/mp3_name-
{_dateShort_}.mp3" length="10800040" type="audio/mpeg"/>
<guid isPermaLink="false">{_randNumTwo_}</guid>
</item>
<item>
<title>Name of MP3 podcast - Hour 03, {_dateCheck_},
{_dateSlashes_}</title>
<description>Hour 03 ({_dateSlashes_}) of this particular
podcast.</description>
<pubDate>{_dateLong_}</pubDate>
<enclosure
url="http://www.yoursite.com/location_of_podcast_mp3/mp3_name-
{_dateShort_}.mp3" length="10800040" type="audio/mpeg"/>
<guid isPermaLink="false">{_randNumThree_}</guid>
</item>
</channel>
</rss>
Here is my PHP (pod.php):
<?php
# Error checking:
if((isset($_REQUEST['pass'])) && ($_REQUEST['pass'] === 'let_me_in') &&
(!empty($_REQUEST['pass']))) {
# Begin date:
$date_long = date('r'); // Example output: Mon, 21 Nov 2005 05:20:18
-0500
$date_short = date('mdy'); // Example output: 051121
$date_slashes = date('m/d/y'); // Example output: 11/21/05
$date_check = date('l');
#End date.
function randNumb() {
# Begin random # generation:
srand ((double) microtime( )*1000000);
$random_number = rand( );
return $random_number;
# End random # generation.
}
$rand_num_one = randNumb();
$rand_num_two = randNumb();
$rand_num_three = randNumb();
// HTML to be written:
ob_start();
readfile($_SERVER['DOCUMENT_ROOT'].'/template.txt');
$contents = ob_get_clean();
ob_end_clean();
$contents = str_replace('{_dateLong_}',$date_long, $contents);
$contents = str_replace('{_dateSlashes_}',$date_slashes, $contents);
$contents = str_replace('{_dateShort_}',$date_short, $contents);
$contents = str_replace('{_randNumOne_}',$rand_num_one, $contents);
$contents = str_replace('{_randNumTwo_}',$rand_num_two, $contents);
$contents = str_replace('{_randNumThree_}',$rand_num_three, $contents);
$contents = str_replace('{_dateCheck_}',$date_check, $contents);
# Now open the file and write contents of template:
$fp =
fopen($_SERVER['DOCUMENT_ROOT'].'/
path_to_place_where_you_store_the_xml_file/
xml_file_name'.$date_check.'.xml','wb'); // Open for writing only; If
the file does not exist, attempt to create it.
fwrite($fp, $contents);
fclose($fp);
} else { echo "<h1>Please Leave Now!</h1>"; }
?>
I then use a cron to run the above script every week, like so:
GET http://www.your_site.com/pod.php?pass=let_me_in > /dev/null
Or, instead of using the CRON, you can just got to the script via your
browser like so:
http://www.your_site.com/pod.php?pass=let_me_in
And the XML file will generate itself.
Please keep in mind, I quickly slapped this script together... It gets
the job done for me... I am sure there are way better ways to do what I
am doing... also, the XML template could be more robust (more meta-tags
maybe?)... the PHP script could probably use something other than
output buffering... If anyone has ideas/thoughts/suggestions for
improvements please let me know.
HTH,
Cheers,
Micky
--
BCC for Privacy: http://www.cs.rutgers.edu/~watrous/bcc-for-privacy.html
My del.icio.us: http://del.icio.us/mhulse
attached mail follows:
On 08 December 2005 16:47, Sandy Keathley wrote:
> > I have an array $journal that I want to carry from a page (where it
> > was created) to another page (a popup that shows the variables
> > contents). Is this automatically available? or do I have to do
> > something special to php??
>
> One way:
> $serArray = serialize($array);
>
> <input type=hidden name=serArray value="<?php echo $serArray ?>">
>
> At other end:
>
> $array = unserialize($_POST['serArray']);
>
> ======================================
>
> OR
>
> session_start();
> .
> .
> .
> $_SESSION['array'] = serialize($array);
Why on earth would you want to serialize an array you're adding to the session? That's just a terrible waste of good machine cycles.
> Zend Certified Engineer
Really?? I think I just lost all faith in that "qualification".
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
attached mail follows:
Ford, Mike wrote:
> On 08 December 2005 16:47, Sandy Keathley wrote:
>
...
>>.
>>.
>>$_SESSION['array'] = serialize($array);
>
>
> Why on earth would you want to serialize an array you're adding to the session? That's just a terrible waste of good machine cycles.
<sarcasm>terrible, very. too many hits to the server and this little faux pas will
really bring the CPU to its knees</sarcasm>
Sandy, anything you stick in $_SESSION is automatically serialized by php when the
session is closed (or the request is complete - i.e. during script shutdown) .. which
means you don't have to do it!
>
>
>>Zend Certified Engineer
>
>
> Really?? I think I just lost all faith in that "qualification".
state provided 'educational' services are nothing more than highly
sophisticated indoctrination systems ... Zend is upfront about the
reasons for having a 'qualification' system but is Leeds Met?
Or lets look at that a totally different way ... Leeds Met is a
very prejudiced, dogmatic operation with a higgly judgemental cultural
background that is incapable of stimulating or encouraging open-minded,
critical thinking. I know this because you work there and you one comment
about losing faith tells me everything there is to know about Leeds Met and
all the people who work/study there; just like you are able to
judge the Zend Exam based on one slight mistake from one particular person who
advertises herself as having passed said exam....
over&out
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Headingley Campus, LEEDS, LS6 3QS, United Kingdom
> Email: m.ford
leedsmet.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
>
>
> To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
>
attached mail follows:
Hi All,
Previously I always succed to instalation PHP, but currently I have
strange problem as several module is unable to download(i.e :
php_mysql.dll, php_mysqli.dll), while several other are succesfully
download(i.e : mbstring, gd).
I have re-installed or copy PHP folder from my succeded instalation, but
it is not work.
I'm used WindowsXP, Apache2.0, PHP5
May be someone out there could help me to solve it.
Thanks in advance
attached mail follows:
here is my last list of module which bale to load and unable to load
excerpt php.ini
--------------------
extension=php_mbstring.dll
;extension=php_bz2.dll
extension=php_cpdf.dll
;extension=php_curl.dll
extension=php_dba.dll
extension=php_dbase.dll
extension=php_dbx.dll
;extension=php_exif.dll
;extension=php_fdf.dll
extension=php_filepro.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
extension=php_mime_magic.dll
extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
extension=php_pgsql.dll
extension=php_shmop.dll
extension=php_snmp.dll
extension=php_sockets.dll
;extension=php_sybase_ct.dll
extension=php_tidy.dll
;extension=php_w32api.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
;extension=php_yaz.dll
;extension=php_zip.dll
--------------------------
I was re-check that php_mysql.dll, php_mysqli.dll etc is on c:\php\ext as others.
Any idea how come
Thanks
________________________________
From: Bagus Nugroho [mailto:bnugroho
aitemail.com]
Sent: Fri 09-Dec-2005 21:06
To: php-general
lists.php.net
Subject: [PHP] Problem on Instalation ~ several module unable to download
Hi All,
Previously I always succed to instalation PHP, but currently I have
strange problem as several module is unable to download(i.e :
php_mysql.dll, php_mysqli.dll), while several other are succesfully
download(i.e : mbstring, gd).
I have re-installed or copy PHP folder from my succeded instalation, but
it is not work.
I'm used WindowsXP, Apache2.0, PHP5
May be someone out there could help me to solve it.
Thanks in advance
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
[snip]
here is my last list of module which bale to load and unable to load
excerpt php.ini
--------------------
extension=php_mbstring.dll
;extension=php_bz2.dll
extension=php_cpdf.dll
;extension=php_curl.dll
extension=php_dba.dll
extension=php_dbase.dll
extension=php_dbx.dll
;extension=php_exif.dll
;extension=php_fdf.dll
extension=php_filepro.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
extension=php_mime_magic.dll
extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
extension=php_pgsql.dll
extension=php_shmop.dll
extension=php_snmp.dll
extension=php_sockets.dll
;extension=php_sybase_ct.dll
extension=php_tidy.dll
;extension=php_w32api.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
;extension=php_yaz.dll
;extension=php_zip.dll
--------------------------
I was re-check that php_mysql.dll, php_mysqli.dll etc is on c:\php\ext as
others.
Any idea how come
[/snip]
Remove the semi-colons from in front of the ones you wish to load and then
restart. They should load then.
attached mail follows:
It's done ...
But it was create errror like this PHP Startup: unable to load dynamic library 'c:\php\ext\php_mysqli.dll' - The specified module could not found.
I was re-check to ensure php_mysqli.dll is on c:\php\ext and used from same source...
Thanks
________________________________
From: Jay Blanchard [mailto:jay.blanchard
THERMON.com]
Sent: Fri 09-Dec-2005 22:36
To: Bagus Nugroho; php-general
lists.php.net
Subject: RE: [PHP] Problem on Instalation ~ several module unable to download
[snip]
here is my last list of module which bale to load and unable to load
excerpt php.ini
--------------------
extension=php_mbstring.dll
;extension=php_bz2.dll
extension=php_cpdf.dll
;extension=php_curl.dll
extension=php_dba.dll
extension=php_dbase.dll
extension=php_dbx.dll
;extension=php_exif.dll
;extension=php_fdf.dll
extension=php_filepro.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
extension=php_mime_magic.dll
extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
extension=php_pgsql.dll
extension=php_shmop.dll
extension=php_snmp.dll
extension=php_sockets.dll
;extension=php_sybase_ct.dll
extension=php_tidy.dll
;extension=php_w32api.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
;extension=php_yaz.dll
;extension=php_zip.dll
--------------------------
I was re-check that php_mysql.dll, php_mysqli.dll etc is on c:\php\ext as
others.
Any idea how come
[/snip]
Remove the semi-colons from in front of the ones you wish to load and then
restart. They should load then.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
[snip]
It's done ...
But it was create errror like this PHP Startup: unable to load dynamic
library 'c:\php\ext\php_mysqli.dll' - The specified module could not found.
I was re-check to ensure php_mysqli.dll is on c:\php\ext and used from same
source...
[/snip]
Any of the modules that you want to load should be in that directory and the
php.ini should point to it.
attached mail follows:
Yes,
all requested module is put on same folder which module which succesfully load.
But, I don't understand why they say the module is not found?
I hope, you can help me
Thanks
________________________________
From: Jay Blanchard [mailto:jay.blanchard
THERMON.com]
Sent: Fri 09-Dec-2005 23:06
To: Bagus Nugroho; Jay Blanchard; php-general
lists.php.net
Subject: RE: [PHP] Problem on Instalation ~ several module unable to download
[snip]
It's done ...
But it was create errror like this PHP Startup: unable to load dynamic
library 'c:\php\ext\php_mysqli.dll' - The specified module could not found.
I was re-check to ensure php_mysqli.dll is on c:\php\ext and used from same
source...
[/snip]
Any of the modules that you want to load should be in that directory and the
php.ini should point to it.
attached mail follows:
I believe the difference between using =& and = is that the former
passes the value by reference, though I've never been clear about the
benefits of using one over the other when it comes to PEAR:DB (the
PEAR:DB documentation uses =& extensively, so presumably it is the
better method).
Ben
On 12/8/05, Mark Steudel <mark
netriver.net> wrote:
> Good catch:
>
> So I normally do
>
> $results =& $db->query ( "SELECT * FROM table" );
>
> What is the difference between using the & and not using the &.
>
> -----Original Message-----
> From: Ben Blay [mailto:benblay
gmail.com]
> Sent: Thursday, December 08, 2005 10:27 AM
> To: php-general
lists.php.net
> Subject: Re: [PHP] broken code....
>
> > $results->query('select * from eternityrecords.journal');
>
> Should this not be:
> $results = $db->query('select * from eternityrecords.journal');
>
> See:
> http://pear.php.net/manual/en/package.database.db.db-result.fetchinto.php
>
> Ben
>
> --
> 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
>
>
attached mail follows:
Ben Blay wrote:
> I believe the difference between using =& and = is that the former
> passes the value by reference, though I've never been clear about the
> benefits of using one over the other when it comes to PEAR:DB (the
> PEAR:DB documentation uses =& extensively, so presumably it is the
> better method).
>
if you don't pass objects around by reference then you are actually
creating a copy every time you assign it to a different variable or
pass it to a function - normally when you use objects you want all
code that uses an object to be talking to the same object and not copies
thereof.
> Ben
>
>
>
> On 12/8/05, Mark Steudel <mark
netriver.net> wrote:
>
>>Good catch:
>>
>>So I normally do
>>
>>$results =& $db->query ( "SELECT * FROM table" );
>>
>>What is the difference between using the & and not using the &.
>>
>>-----Original Message-----
>>From: Ben Blay [mailto:benblay
gmail.com]
>>Sent: Thursday, December 08, 2005 10:27 AM
>>To: php-general
lists.php.net
>>Subject: Re: [PHP] broken code....
>>
>>
>>>$results->query('select * from eternityrecords.journal');
>>
>>Should this not be:
>>$results = $db->query('select * from eternityrecords.journal');
>>
>>See:
>>http://pear.php.net/manual/en/package.database.db.db-result.fetchinto.php
>>
>>Ben
>>
>>--
>>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
>>
>>
>
>
attached mail follows:
Is there a way to get some sort of XSLT working on my server?
safe-mode is off
run under apache (php_sapi_mode=apache)
dl() is enabled
I only have FTP access
server runs under linux
Can I download "sablotron.so" somewhere an load it using dl() ???
Is there some PHP code that can transform XML using XSLT ???
(like http://www.dopscripts.com/doc/description.html)
attached mail follows:
should come default with PHP5
http://www.php.net/manual/en/ref.xsl.php
On Friday 09 December 2005 07:56, Gerben wrote:
> Is there a way to get some sort of XSLT working on my server?
>
> safe-mode is off
> run under apache (php_sapi_mode=apache)
> dl() is enabled
> I only have FTP access
> server runs under linux
>
> Can I download "sablotron.so" somewhere an load it using dl() ???
> Is there some PHP code that can transform XML using XSLT ???
> (like http://www.dopscripts.com/doc/description.html)
attached mail follows:
Hi,
I am trying to create a Content Management System where users can click on
various parts of a page and the content is displayed in a JavaScript text
editor. For each tag I intend to wrap a link (<a href>) around it. This
works fine for <p> tags but I cant put a link around a <table> tag because
it isnt allowed in HTML. My idea to get around this is make an image from
everything between the table tags with php so I can make it link to another
page, is this possible?
Thanks for your advice
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]