|
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 26 Jun 2006 12:12:41 -0000 Issue 4206
php-general-digest-help
lists.php.net
Date: Mon Jun 26 2006 - 07:12:41 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 26 Jun 2006 12:12:41 -0000 Issue 4206
Topics (messages 238599 through 238635):
Re: Problem Displaying Images
238599 by: Prathaban Mookiah
238600 by: Chris
238611 by: Prathaban Mookiah
238612 by: Chris
238615 by: Prathaban Mookiah
238616 by: Chris
CLI - php shell script worked under php4, breaks under php5
238601 by: weston.leary2.csoft.net
238606 by: David Tulloh
xmldoc issue
238602 by: weetat
238603 by: Chris
238608 by: weetat
238610 by: Chris
Array to String
238604 by: weetat
238605 by: Chris
238617 by: Jochem Maas
Sad PHP Poem
238607 by: Martin Alterisio
238609 by: Robert Cummings
238613 by: Ligaya Turmelle
238614 by: Martin Alterisio
Re: mail() returns false but e-mail is sent ?
238618 by: Leonidas Safran
mysql-* versus db-* statements
238619 by: j.kuehne.sign-tronic.ch
Only see class member variables, not parent class member variables
238620 by: Peter Lauri
238623 by: Jochem Maas
238625 by: Peter Lauri
Re: login problem
238621 by: kartikay malhotra
238622 by: Barry
XML
238624 by: weetat
238627 by: weetat
238628 by: weetat
mysql-* versus db_* statements
238626 by: j.kuehne.sign-tronic.ch
238629 by: David Tulloh
uploading...
238630 by: BBC
238631 by: cajbecu
238632 by: Jochem Maas
Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...
238633 by: j.kuehne.sign-tronic.ch
issue with Apache/PHP loadmodule
238634 by: Alain Roger
238635 by: David Powers
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:
Oh sorry. I use addslashes().
---------- Original Message -----------
From: Chris <dmagick
gmail.com>
To: Prathaban Mookiah <prathap
ee.pdn.ac.lk>
Cc: "php-general
lists.php.net" <php-general
lists.php.net>
Sent: Mon, 26 Jun 2006 07:14:42 +1000
Subject: Re: [PHP] Problem Displaying Images
> Prathaban Mookiah wrote:
> > I am trying to manage images with a web database application. It works
fine
> > with MySQL 5.0.17 and PHP 5.1.1.
> >
> > But when I port it to another machine that runs MySQL 3.23.54 and PHP 4.2.
2, I
> > have problems viewing the images retrieved from the database in the
browser.
> >
> > The relevant part of the code is:
> >
> > $Result = mysql_fetch_array($Resource);
> >
> > if (!empty($Result["data"]))
> > {
> > header("Content-Type: {$Result['mime']}");
> > echo $Result["data"];
> > }
> >
> > But I see that some binary data is being echoed on to the client. But I
guess
> > it is corrupted in some way such that the browser cannot display it as an
> > image. In fact I tried to save it as an image file, and the image viewer
> > reported it as invalid format.
>
> How are you putting it into the database? Are you using
> mysql_real_escape_string or mysql_escape_string, or are you using
> addslashes or something else?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
------- End of Original Message -------
attached mail follows:
Prathaban Mookiah wrote:
> Oh sorry. I use addslashes().
Then you'll probably need to use stripslashes before printing out the data.
echo stripslashes($Result["data"]);
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
I wish it would work. But id doesn't. But this time I do get a heavily
distorted image being displayed.
But as I said earlier, in combination of MySQL 5 and PHP 5 works good. The
problem is with PHP4 and MySQL 5.
Thanks.
Prathap
---------- Original Message -----------
From: Chris <dmagick
gmail.com>
To: Prathaban Mookiah <prathap
ee.pdn.ac.lk>
Cc: "php-general
lists.php.net" <php-general
lists.php.net>
Sent: Mon, 26 Jun 2006 11:56:31 +1000
Subject: Re: [PHP] Problem Displaying Images
> Prathaban Mookiah wrote:
> > Oh sorry. I use addslashes().
>
> Then you'll probably need to use stripslashes before printing out
> the data.
>
> echo stripslashes($Result["data"]);
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
------- End of Original Message -------
attached mail follows:
Prathaban Mookiah wrote:
> I wish it would work. But id doesn't. But this time I do get a heavily
> distorted image being displayed.
>
> But as I said earlier, in combination of MySQL 5 and PHP 5 works good. The
> problem is with PHP4 and MySQL 5.
I doubt the php5/php4 thing is an issue, I think it's a problem with
different settings on your servers.
I think any of the magic_quotes_* stuff will make a difference. Start
there I guess.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Yes, turning off the magic_quotes_runtime directive makes a difference. But
the image is still distorted. All three magic_quotes directives are now set to
the same value in both the servers.
Are there any other settings I should look out for?
Thanks.
Prathap
---------- Original Message -----------
From: Chris <dmagick
gmail.com>
To: Prathaban Mookiah <prathap
ee.pdn.ac.lk>
Cc: "php-general
lists.php.net" <php-general
lists.php.net>
Sent: Mon, 26 Jun 2006 14:52:39 +1000
Subject: Re: [PHP] Problem Displaying Images
> Prathaban Mookiah wrote:
> > I wish it would work. But id doesn't. But this time I do get a heavily
> > distorted image being displayed.
> >
> > But as I said earlier, in combination of MySQL 5 and PHP 5 works good. The
> > problem is with PHP4 and MySQL 5.
>
> I doubt the php5/php4 thing is an issue, I think it's a problem with
> different settings on your servers.
>
> I think any of the magic_quotes_* stuff will make a difference.
> Start there I guess.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
------- End of Original Message -------
attached mail follows:
Prathaban Mookiah wrote:
> Yes, turning off the magic_quotes_runtime directive makes a difference. But
> the image is still distorted. All three magic_quotes directives are now set to
> the same value in both the servers.
>
> Are there any other settings I should look out for?
Try a CTRL+F5 to make sure it's not the browser caching the bad image,
or alternatively clear your cache and try again or try on a different
computer.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
A while back I wrote a little read-eval-print loop that essentially constituted a very basic php shell:
http://weston.canncentral.org/misc/phpsh.txt
This has almost always run fine for me with the cgi versions of php 4, and often proves to be a great help in quickly testing various snippets of code.
However, I just recently tried to use this with PHP 5.1.2, and found that it doesn't work. Specifically, it seems to wait for input to be typed without issuing a prompt. Upon entering a line, there's no response, until one presses ctrl-d. At this point, it throws a parse error:
syntax error, unexpected ')' in phpsh5(23): eval()'d code on line 1
regardless of whether or not there are in fact any unmatched parenths (or any parenths at all) on the entered line. And it apparently doesn't execute any of the code at all until one enters "exit" as a command.
I've tried switching from /dev/stdin to php://stdin, tried adding -f or -a to the processing options.... nothing seems to make a difference. I also tried removing my "_readln()" function, and simple entering a default expression. This produces the expected (if repetetive and ultimately practically useless) results, so I assume it's something in my _readln() function that throws it off.
Any ideas how to get this to work with PHP 5?
attached mail follows:
weston
leary2.csoft.net wrote:
> A while back I wrote a little read-eval-print loop that essentially constituted a very basic php shell:
>
> http://weston.canncentral.org/misc/phpsh.txt
>
> This has almost always run fine for me with the cgi versions of php 4, and often proves to be a great help in quickly testing various snippets of code.
>
> However, I just recently tried to use this with PHP 5.1.2, and found that it doesn't work. Specifically, it seems to wait for input to be typed without issuing a prompt. Upon entering a line, there's no response, until one presses ctrl-d. At this point, it throws a parse error:
>
> syntax error, unexpected ')' in phpsh5(23): eval()'d code on line 1
>
> regardless of whether or not there are in fact any unmatched parenths (or any parenths at all) on the entered line. And it apparently doesn't execute any of the code at all until one enters "exit" as a command.
>
> I've tried switching from /dev/stdin to php://stdin, tried adding -f or -a to the processing options.... nothing seems to make a difference. I also tried removing my "_readln()" function, and simple entering a default expression. This produces the expected (if repetetive and ultimately practically useless) results, so I assume it's something in my _readln() function that throws it off.
>
> Any ideas how to get this to work with PHP 5?
>
Works for me, PHP 5.1.4. Prehaps you have some kind of output buffering
enabled. Using the -n command line switch will disable your php.ini
which should stop anything like that.
The syntax error you are getting is caused by not entering any input.
Your line 23 becomes:
$returnval = eval("return();");
Return expects some value to be provided, hence the syntax error.
David
attached mail follows:
Hi all ,
I have two server .
In first server , which PHP version 4.3.2, the code below is ok :
function validatexmlfile($xmlfilename)
{
$_logger = new Log4jLogger();
$_logger->logdebug("starting validate xml");
$_logger->logdebug("starting validate xml
xmlfilename:",$xmlfilename);
if (!$doc = xmldocfile($xmlfilename)) {
die("Error in XML");
$this->xml_error = TRUE;
}
// version check
else if ($doc->version > 1.0) {
die("Unsupported XML version");
$this->xml_error = TRUE;
} else {
$this->xml_error = FALSE;
}
However in second server , it did not get past the xmldocfile() at all.
Anybody have any ideas what is happening ? I have set the
error_reporting to E_ALL , but it did not display any error at all.
Thanks
attached mail follows:
weetat wrote:
> Hi all ,
>
> I have two server .
>
> In first server , which PHP version 4.3.2, the code below is ok :
>
> function validatexmlfile($xmlfilename)
> {
> $_logger = new Log4jLogger();
> $_logger->logdebug("starting validate xml");
> $_logger->logdebug("starting validate xml
> xmlfilename:",$xmlfilename);
>
> if (!$doc = xmldocfile($xmlfilename)) {
> die("Error in XML");
> $this->xml_error = TRUE;
> }
> // version check
> else if ($doc->version > 1.0) {
> die("Unsupported XML version");
> $this->xml_error = TRUE;
> } else {
> $this->xml_error = FALSE;
> }
>
>
> However in second server , it did not get past the xmldocfile() at all.
> Anybody have any ideas what is happening ? I have set the
> error_reporting to E_ALL , but it did not display any error at all.
xmldocfile probably isn't a valid function because you don't have the
xml extensions installed.
try:
<?php
$exists = function_exists('xmldocfile');
if ($exists) {
echo "xmldocfile exists!";
} else {
echo "xmldocfile doesn't exist!";
}
?>
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Thanks you are right.
Btw, I have another question:
How to modified value in xml file using php ?
Thanks.
Yeo Wee Tat
Tel: +65-62730049 Fax: +65-62734934
Cxrus Solutions Pte Ltd (Singapore . Thailand)
1003 Bukit Merah Central #05-20 Singapore 159836
System Integration . Business Solutions . Linux Simplified
-----Original Message-----
From: Chris [mailto:dmagick
gmail.com]
Sent: Monday, June 26, 2006 10:52 AM
To: weetat
Cc: php-general
lists.php.net
Subject: Re: [PHP] xmldoc issue
weetat wrote:
> Hi all ,
>
> I have two server .
>
> In first server , which PHP version 4.3.2, the code below is ok :
>
> function validatexmlfile($xmlfilename)
> {
> $_logger = new Log4jLogger();
> $_logger->logdebug("starting validate xml");
> $_logger->logdebug("starting validate xml
> xmlfilename:",$xmlfilename);
>
> if (!$doc = xmldocfile($xmlfilename)) {
> die("Error in XML");
> $this->xml_error = TRUE;
> }
> // version check
> else if ($doc->version > 1.0) {
> die("Unsupported XML version");
> $this->xml_error = TRUE;
> } else {
> $this->xml_error = FALSE;
> }
>
>
> However in second server , it did not get past the xmldocfile() at all.
> Anybody have any ideas what is happening ? I have set the
> error_reporting to E_ALL , but it did not display any error at all.
xmldocfile probably isn't a valid function because you don't have the
xml extensions installed.
try:
<?php
$exists = function_exists('xmldocfile');
if ($exists) {
echo "xmldocfile exists!";
} else {
echo "xmldocfile doesn't exist!";
}
?>
--
Postgresql & php tutorials
http://www.designmagick.com/
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.4/375 - Release Date: 6/25/2006
attached mail follows:
Yeo Wee Tat wrote:
> Thanks you are right.
>
> Btw, I have another question:
>
> How to modified value in xml file using php ?
http://www.php.net/manual/en/ref.xmlwriter.php
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Hi all,
I have the error below in my PHP version 4.3.2:
PHP Notice: Array to string conversion in /data/html/library/config.php
on line 45
If i have turned "on" the magic_quotes in php.ini, it is ok .
Any ideas?
It cause by the code below:
if (!get_magic_quotes_gpc()) {
if (isset($_POST)) {
foreach ($_POST as $key => $value) {
$_POST[$key] = trim(addslashes($value));
}
}
if (isset($_GET)) {
foreach ($_GET as $key => $value) {
$_GET[$key] = trim(addslashes($value));
}
}
}
attached mail follows:
You are probably passing some variables into POST or GET using the array
notation:
/mypage.php?var[]=fred&var[]=wilma
$_GET['var'] will be an array inside mypage.php, You should probably
check to see if it's an array then, if it is, loop through each element
of the var array
Chris
weetat wrote:
> Hi all,
>
> I have the error below in my PHP version 4.3.2:
>
> PHP Notice: Array to string conversion in
> /data/html/library/config.php on line 45
>
> If i have turned "on" the magic_quotes in php.ini, it is ok .
> Any ideas?
>
> It cause by the code below:
>
> if (!get_magic_quotes_gpc()) {
> if (isset($_POST)) {
> foreach ($_POST as $key => $value) {
> $_POST[$key] = trim(addslashes($value));
> }
> }
>
> if (isset($_GET)) {
> foreach ($_GET as $key => $value) {
> $_GET[$key] = trim(addslashes($value));
> }
> }
> }
>
attached mail follows:
weetat wrote:
> Hi all,
>
> I have the error below in my PHP version 4.3.2:
>
> PHP Notice: Array to string conversion in /data/html/library/config.php
> on line 45
>
> If i have turned "on" the magic_quotes in php.ini, it is ok .
> Any ideas?
>
> It cause by the code below:
>
> if (!get_magic_quotes_gpc()) {
> if (isset($_POST)) {
> foreach ($_POST as $key => $value) {
> $_POST[$key] = trim(addslashes($value));
> }
> }
>
> if (isset($_GET)) {
> foreach ($_GET as $key => $value) {
> $_GET[$key] = trim(addslashes($value));
> }
> }
> }
// you might find something *like* this to be more flexible:
function arrayStripSlashes($v)
{
if (is_array($v)) {
foreach ($v as $key => $value) {
$v[$key] = arrayStripSlashes($value);
}
} else if (is_scalar($v)) {
$v = trim(addslashes($v));
} else {
$v = null;
}
return $v;
}
if (!get_magic_quotes_gpc()) {
$_POST = arrayStripSlashes($_POST);
$_GET = arrayStripSlashes($_GET);
}
>
attached mail follows:
<offtopic type="slightly offtopic" class="poetic literary">
A sad poem of an algorithm where solitude brought excessive use of cpu
cycles and memory allocation for redundant data (it copied over and over
again the same image till all memory was filled with it)
------------------------------
$timeWaiting = 0;
while (!$you->near($me)) {
$me->thinkAbout($you);
switch (true) {
case $timeWaiting < 5:
$me->wait($you);
break;
case $timeWaiting < 10:
$me->worry();
break;
case $timeWaiting < 20:
$me->lookFor($you);
break;
case $timeWaiting < 40:
$me->worry();
$me->lookFor($you);
break;
case $timeWaiting < 80:
$me->worry();
$me->cry();
$me->lookFor($you);
$me->lookFor($you);
$me->lookFor($you);
break;
case $timeWaiting < 160:
$me->worry();
$me->cry();
$me->drink();
$me->lookFor($you);
$me->lookFor($you);
$me->lookFor($you);
$me->thinkAbout($you);
$me->thinkAbout($you);
$me->cry();
$me->lookFor($you);
$me->lookFor($you);
$me->drink();
$me->drink();
break;
default:
throw new CantLiveWithoutYou();
die("alone");
}
$timeWaiting++;
}
$me->happy = true;
------------------------------
I hope you enjoyed the poem and the fact that I didn't ask you to fix it or
find the bug in it =D
PD: Run in your web server at your own risk.
</offtopic>
attached mail follows:
On Mon, 2006-06-26 at 00:25, Martin Alterisio wrote:
>
> I hope you enjoyed the poem and the fact that I didn't ask you to fix it or
> find the bug in it =D
That's great, thanks for the laugh.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Martin Alterisio wrote:
> <offtopic type="slightly offtopic" class="poetic literary">
>
> A sad poem of an algorithm where solitude brought excessive use of cpu
> cycles and memory allocation for redundant data (it copied over and over
> again the same image till all memory was filled with it)
>
> ------------------------------
>
> $timeWaiting = 0;
> while (!$you->near($me)) {
> $me->thinkAbout($you);
>
> switch (true) {
> case $timeWaiting < 5:
> $me->wait($you);
> break;
>
> case $timeWaiting < 10:
> $me->worry();
> break;
>
> case $timeWaiting < 20:
> $me->lookFor($you);
> break;
>
> case $timeWaiting < 40:
> $me->worry();
> $me->lookFor($you);
> break;
>
> case $timeWaiting < 80:
> $me->worry();
> $me->cry();
> $me->lookFor($you);
> $me->lookFor($you);
> $me->lookFor($you);
> break;
>
> case $timeWaiting < 160:
> $me->worry();
> $me->cry();
> $me->drink();
> $me->lookFor($you);
> $me->lookFor($you);
> $me->lookFor($you);
> $me->thinkAbout($you);
> $me->thinkAbout($you);
> $me->cry();
> $me->lookFor($you);
> $me->lookFor($you);
> $me->drink();
> $me->drink();
> break;
>
> default:
> throw new CantLiveWithoutYou();
> die("alone");
> }
>
> $timeWaiting++;
> }
>
> $me->happy = true;
>
> ------------------------------
>
> I hope you enjoyed the poem and the fact that I didn't ask you to fix it or
> find the bug in it =D
>
> PD: Run in your web server at your own risk.
>
> </offtopic>
>
See we do have a softer side. Outstanding!
--
life is a game... so have fun.
attached mail follows:
2006/6/26, Ligaya Turmelle <lig
maolek.com>:
>
> Martin Alterisio wrote:
> > <offtopic type="slightly offtopic" class="poetic literary">
> >
> > A sad poem of an algorithm where solitude brought excessive use of cpu
> > cycles and memory allocation for redundant data (it copied over and over
> > again the same image till all memory was filled with it)
> >
> > ------------------------------
> >
> > $timeWaiting = 0;
> > while (!$you->near($me)) {
> > $me->thinkAbout($you);
> >
> > switch (true) {
> > case $timeWaiting < 5:
> > $me->wait($you);
> > break;
> >
> > case $timeWaiting < 10:
> > $me->worry();
> > break;
> >
> > case $timeWaiting < 20:
> > $me->lookFor($you);
> > break;
> >
> > case $timeWaiting < 40:
> > $me->worry();
> > $me->lookFor($you);
> > break;
> >
> > case $timeWaiting < 80:
> > $me->worry();
> > $me->cry();
> > $me->lookFor($you);
> > $me->lookFor($you);
> > $me->lookFor($you);
> > break;
> >
> > case $timeWaiting < 160:
> > $me->worry();
> > $me->cry();
> > $me->drink();
> > $me->lookFor($you);
> > $me->lookFor($you);
> > $me->lookFor($you);
> > $me->thinkAbout($you);
> > $me->thinkAbout($you);
> > $me->cry();
> > $me->lookFor($you);
> > $me->lookFor($you);
> > $me->drink();
> > $me->drink();
> > break;
> >
> > default:
> > throw new CantLiveWithoutYou();
> > die("alone");
> > }
> >
> > $timeWaiting++;
> > }
> >
> > $me->happy = true;
> >
> > ------------------------------
> >
> > I hope you enjoyed the poem and the fact that I didn't ask you to fix it
> or
> > find the bug in it =D
> >
> > PD: Run in your web server at your own risk.
> >
> > </offtopic>
> >
> See we do have a softer side. Outstanding!
I was a hard man till she threw me a ImNotSoSureAnymore exception =S
PD: I'm on fire today, maybe AJAX and the greek muses are behind my
inspiration
--
>
> life is a game... so have fun.
>
>
>
attached mail follows:
Hello,
> Show us the full context of the code. The example you give us will work fine but that doesn't tell us what's really going on in your code.
Here is the function I use to allow french special characters in the subject line (copied from german university tutorial http://www-cgi.uni-regensburg.de/~mim09509/PHP/list.phtml//www-cgi/home/mim09509/public_html/PHP/mail-quote.phtml?datei=%2Fwww-cgi%2Fhome%2Fmim09509%2Fpublic_html%2FPHP%2Fmail-quote.phtml%2Crfc822-syntax.txt):
function quote_printable($text, $max=75){
/* $text ist ein String (mit neue Zeilen drin), $max ist die max. Zielenlaenge
Ergebnis ist auch ein String, der nach rfc1521 als Content-Transfer-Encoding: quoted-printable verschluesselt ist.*/
$t = explode("\n", ($text=str_replace("\r", "", $text)));
for ($i = 0; $i < sizeof($t); $i++){
$t1 = "";
for ($j = 0; $j < strlen($t[$i]); $j++){
$c = ord($t[$i][$j]);
if ( $c < 0x20 || $c > 0x7e || $c == ord("="))
$t1 .= sprintf("=%02X", $c);
else $t1 .= chr($c);
}
while (strlen($t1) > $max+ 1){
$tt[] = substr($t1, 0, $max)."=";
$t1 = substr($t1, $max);
}
$tt[] = $t1;
}
return join("\r\n", $tt);
}
function qp_header($text){
$quote = quote_printable($text, 255);
if ($quote != $text)
$quote = str_replace(" ", "_","=?ISO-8859-1?Q?" . $quote . "?=");
return $quote;
}
So, before I enter:
$sent = mail($destination, $subject, $content, $headers);
I have:
$subject = qp_header($subject);
That's all... As said before, the e-mail is sent, but the mail() function returns false !
Thank you for your help
LS
--
Echte DSL-Flatrate dauerhaft fr 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
attached mail follows:
-------- Original Message --------
Subject: Re: [PHP-DEV] mysql-* versus db_* statements (26-Jun-2006 9:21)
From: antony
zend.com
To: j.kuehne
sign-tronic.ch
Please user php-general
lists.php.net for such questions.
Thank you.
On 26.06.2006 11:10, j.kuehne
sign-tronic.ch wrote:
> require_once "DB.php";
> require_once "knowledge.inc";
> require_once "template-new.inc";
>
>
> function setupQuery($search_eb)
> {
> // Show the wines stocked at the winestore that match
> // the search criteria
>
> $query = "SELECT *
> FROM knowledge_db
> WHERE MATCH (autor,problem) AGAINST ('$search_eb')
> OR id = ('$search_eb')
> OR autor = ('$search_eb')
> OR stichwort = ('$search_eb')
> OR date_new = ('$search_eb')
> OR anlage = ('$search_eb')";
>
> // Add region_name restriction if they've selected anything
>
> //$query .= "ORDER BY data_new";
> return ($query);
> }
>
> error_reporting(E_ALL);
>
>
> // Show the user the knowledge that match their query
> function showKnowledges($connection, &$template)
> {
>
>
> // Produce a heading for the top of the page
>
> global $dsn;
>
>
> $template->setCurrentBlock();
>
> $template->setVariable("SUCH-KRITERIUM","Such-Kriterium: {$_SESSION["searchFormVars"]["search_eb"]}");
>
> $browseString = "search_eb=" . urlencode($_SESSION["searchFormVars"]["search_eb"]);
>
> $search = ($_SESSION["searchFormVars"]["search_eb"]);
>
> $link = mysql_connect("localhost", "root", "040573");
>
> $template->parseCurrentBlock();
>
>
>
> mysql_select_db("knowledge", $link);
>
> // Encode the search parameters for embedding in links to other pages
> // $connection = DB::connect($dsn, true);
> $query = setupQuery($_SESSION["searchFormVars"]["search_eb"]);
> //$result = $connection->query($query);
> //var_dump ($query);
> $result=
mysql_query($query);
>
> ...
>
>
> why I could not use the DB statement $result = $connection->query($query) instead of the mysql statement $result=
mysql_query($query); Further on, the same situation appears in the code, which looks like:
>
>
> for ( $rowCounter = 0;
> ($rowCounter < SEARCH_ROWS) &&
> (( $rowCounter + $_SESSION["searchFormVars"]["offset"]) < mysql_num_rows($result)) &&
> ($row = mysql_fetch_array($result));
> //($row =mysql_fetch_row($_SESSION["searchFormVars"]["offset"]+$rowCounter));
> // ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter));
> $rowCounter++)
>
>
> I could not use the DB statement ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter));
> instead of the mysql code ($row = mysql_fetch_array($result)). But in that case, there is not the same meaning between the msyql and DB statement. However, I need the DB assignation for faultless work. What can I do?
>
> best reagards, Georg
>
>
--
Wbr,
Antony Dovgal
attached mail follows:
Hi,
I have a class B that extends A. When I do print_r($object_b) it outputs all
member variables from A and B. I just want to see the variables from B
excluding the one that B inherits from A, how can I do that? This is just
for development; I will of course need to use the variables from A to
actually use the object B.
Best regards,
Peter Lauri
attached mail follows:
Peter Lauri wrote:
> Hi,
>
> I have a class B that extends A. When I do print_r($object_b) it outputs all
> member variables from A and B. I just want to see the variables from B
> excluding the one that B inherits from A, how can I do that? This is just
> for development; I will of course need to use the variables from A to
> actually use the object B.
the short answer is you can't.
the longer answer is you can but writing the code that will extract this info
is probably gonig to taking alot more time than it's worth.
btw you didn't mention what version of php you're using
but here is some php5 code that relates to your problem:
class One { public $one = 1; protected $_one = 1; function myprops() {return get_object_vars($this);} }
class Two extends One { public $two = 2; protected $_two = 2; }
$t = new Two; $o = new One;
var_dump($t, (array)$t, get_object_vars($t), $t->myprops(), $o->myprops(), get_class_vars("Two"));
also read this page for more info:
http://php.net/manual/en/function.get-class-vars.php
>
> Best regards,
> Peter Lauri
>
attached mail follows:
Thanks. I will ignore it, it is not a big deal in my Development. Was more
curious if where was an easy way :)
I am using PHP4
-----Original Message-----
From: Jochem Maas [mailto:jochem
iamjochem.com]
Sent: Monday, June 26, 2006 3:50 PM
To: Peter Lauri
Cc: php-general
lists.php.net
Subject: Re: [PHP] Only see class member variables, not parent class member
variables
Peter Lauri wrote:
> Hi,
>
> I have a class B that extends A. When I do print_r($object_b) it outputs
all
> member variables from A and B. I just want to see the variables from B
> excluding the one that B inherits from A, how can I do that? This is just
> for development; I will of course need to use the variables from A to
> actually use the object B.
the short answer is you can't.
the longer answer is you can but writing the code that will extract this
info
is probably gonig to taking alot more time than it's worth.
btw you didn't mention what version of php you're using
but here is some php5 code that relates to your problem:
class One { public $one = 1; protected $_one = 1; function myprops() {return
get_object_vars($this);} }
class Two extends One { public $two = 2; protected $_two = 2; }
$t = new Two; $o = new One;
var_dump($t, (array)$t, get_object_vars($t), $t->myprops(), $o->myprops(),
get_class_vars("Two"));
also read this page for more info:
http://php.net/manual/en/function.get-class-vars.php
>
> Best regards,
> Peter Lauri
>
attached mail follows:
Dear SK,
alternately, close previously opened A/C and allow current one. this is
similar to wat yahoo messenger does and is a good safety measure.
1. If u use this technique, ur problem of shutdown would be solved.
2. Alternately, maintain sessions (using session ID) in PHP.
2a. Or just monitor user activity periodically. If no activity for x
minutes, log the user off. Keep an activity counter, and run a script in the
background, to reduce the counter ever y minutes. On activities like click,
mouse movement, page request, etc, increment the counter. Think semaphores
in Linux...
3. Try AJAX. You can keep sessions alive from server side. When no feedback
is received, log the user off.
KM
P.S. Pls send mails to the group rather than to me.
On 6/26/06, suresh kumar <asureshkumar_1983
yahoo.co.in> wrote:
>
> Tnxs for ur reply,i am very happy to receive response from u.I am storing
> all the user account in my database.I am facing one problem.Suppose i am
> setting a flag fot that login user.suddenly if there is any power shutdown
> or user forgot to logout.then the flag always be set.In MySQL is there any
> query is available for automatic update.I am waiting for ur reponse
>
> A.suresh
>
> *kartikay malhotra <kartikay.malhotra
gmail.com>* wrote:
>
> strange problem, but very similar to links in linux.
>
> you must be maintaining a database or a record file. u can maintain all
> links ('users' as u put it) for a given user. if a user logs in through
> any
> of his accounts, check if he/she is logged in another A/C and stop this
> one.
> else, allow log-in and set a flag.
>
> alternately, close previously opened A/C and allow current one. this is
> similar to wat yahoo messenger does and is a good safety measure.
>
> Q. why do you want to assign more than one A/C anyway? and if its an
> invitation to someone else, then you MUST not stop that new person. he
> would
> be a valid subscriber, won't he?
>
> No PHP here :(, guys would frown...
>
>
> KM
>
>
> On 6/24/06, suresh kumar wrote:
> >
> > Hi,
> > I am facing one problem.i previously mailed ,but there is no
> > response,its running out of time.i want to implement that logic as soon
> as
> > possible.This is my problem
> >
> > We are developing an online software for displaying ads
> > in big mall.I want to restrict only one user can login to his own
> account
> > at that particular time.suppose "users1" created a new user "users2" for
> > another user.If "user1" login to the "users2" account and at that same
> > time i want to restrict "user2 " for log in to his account.i want at a
> > time only one user can access his account.I am waiting reponse from u
> >
> >
> > A.suresh
> >
> >
> > ---------------------------------
> > Yahoo! India Answers: Share what you know. Learn something new Click
> here
> > Catch all the FIFA World Cup 2006 action on Yahoo! India Click here
> >
>
> ------------------------------
> Yahoo! India Answers: Share what you know. Learn something new Click here<http://us.rd.yahoo.com/mail/in/mailanswersshare/*http://in.answers.yahoo.com/>
> Catch all the FIFA World Cup 2006 action on Yahoo! India Click here<http://us.rd.yahoo.com/mail/in/mailfifa/*http://in.sports.yahoo.com/football/football_fifa.html>
>
>
attached mail follows:
suresh kumar schrieb:
> Hi,
> I am facing one problem.i previously mailed ,but there is no response,its running out of time.
There are responses. You should read them!
And we are here not for coding stuff for you, you totally misunderstand
what this mailing list is for.
I told you last time.
PHP don't have functions specialized for that, and you have to use your
brain to think about a way around that.
And ppl told you that this can lead you into problems.
I don't know where this here gets but you will doing you good to do some
"own" research.
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
attached mail follows:
Hi all,
I am using PHP 4.3.2 in Red Hat Entreprise.
I have xml file which have tags as show below:
<HardwareVersion><![CDATA[?"<??Z4]]></HardwareVersion>
I need to lookup for Hardware Version tag in php ,and edit the value
to empty string and save the modified xml file.
Any one have any ideas how to do this?
attached mail follows:
Add on :
I got this error when i using xmldocfile() function to read the xml
file ,
Warning: xmldocfile():
/home/gvintranet/datacraft/htdocs/uploads/test_cdata.xml:99: in
/home/gvintranet/datacraft/htdocs/admin/test_writexml.php on line 6
Warning: xmldocfile(): error: in
/home/gvintranet/datacraft/htdocs/admin/test_writexml.php on line 6
Warning: xmldocfile(): CData section not finished ù?¸ü÷ú"<ù?àù?Ø
in /home/gvintranet/datacraft/htdocs/admin/test_writexml.php on line 6
Warning: xmldocfile():
<InstanceName><![CDATA[ù?¸ü÷ú"<ù?àù?ØZ4ÀÏ]]></I in
/home/gvintranet/datacraft/htdocs/admin/test_writexml.php on line 6
Warning: xmldocfile(): ^ in
/home/gvintranet/datacraft/htdocs/admin/test_writexml.php on line 6
weetat wrote:
> Hi all,
>
> I am using PHP 4.3.2 in Red Hat Entreprise.
>
> I have xml file which have tags as show below:
>
>
> <HardwareVersion><![CDATA[ù?¸€ü÷Œú"<ù?àù?Ø€Z4À„Ï]]></HardwareVersion>
>
>
> I need to lookup for Hardware Version tag in php ,and edit the value
> to empty string and save the modified xml file.
>
> Any one have any ideas how to do this?
attached mail follows:
Hi all ,
Can I edit the xml file before doing xml parsing ?
My xml file is around 16MB size.
Anyone have any ideas how to do that?
Thanks
weetat wrote:
> Add on :
>
> I got this error when i using xmldocfile() function to read the xml file ,
>
> Warning: xmldocfile():
> /home/gvintranet/datacraft/htdocs/uploads/test_cdata.xml:99: in
> /home/gvintranet/datacraft/htdocs/admin/test_writexml.php on line 6
>
> Warning: xmldocfile(): error: in
> /home/gvintranet/datacraft/htdocs/admin/test_writexml.php on line 6
>
> Warning: xmldocfile(): CData section not finished ù?¸ü÷ú"<ù?àù?Ø
> in /home/gvintranet/datacraft/htdocs/admin/test_writexml.php on line 6
>
> Warning: xmldocfile():
> <InstanceName><![CDATA[ù?¸ü÷ú"<ù?àù?ØZ4ÀÏ]]></I in
> /home/gvintranet/datacraft/htdocs/admin/test_writexml.php on line 6
>
> Warning: xmldocfile(): ^ in
> /home/gvintranet/datacraft/htdocs/admin/test_writexml.php on line 6
>
>
> weetat wrote:
>> Hi all,
>>
>> I am using PHP 4.3.2 in Red Hat Entreprise.
>>
>> I have xml file which have tags as show below:
>>
>>
>> <HardwareVersion><![CDATA[ù?¸€ü÷Œú"<ù?àù?Ø€Z4À„Ï]]></HardwareVersion>
>>
>>
>> I need to lookup for Hardware Version tag in php ,and edit the value
>> to empty string and save the modified xml file.
>>
>> Any one have any ideas how to do this?
attached mail follows:
Could someone explain the behaviour of the following code fragments. I have a serious problem with db-statements.
##############################################################################################
##############################################################################################
> require_once "DB.php";
> require_once "knowledge.inc";
> require_once "template-new.inc";
>
>
> function setupQuery($search_eb)
> {
> // Show the wines stocked at the winestore that match
> // the search criteria
>
> $query = "SELECT *
> FROM knowledge_db
> WHERE MATCH (autor,problem) AGAINST ('$search_eb')
> OR id = ('$search_eb')
> OR autor = ('$search_eb')
> OR stichwort = ('$search_eb')
> OR date_new = ('$search_eb')
> OR anlage = ('$search_eb')";
>
> // Add region_name restriction if they've selected anything
>
> //$query .= "ORDER BY data_new";
> return ($query);
> }
>
> error_reporting(E_ALL);
>
>
> // Show the user the knowledge that match their query
> function showKnowledges($connection, &$template)
> {
>
>
> // Produce a heading for the top of the page
>
> global $dsn;
>
>
> $template->setCurrentBlock();
>
> $template->setVariable("SUCH-KRITERIUM","Such-Kriterium: {$_SESSION["searchFormVars"]["search_eb"]}");
>
> $browseString = "search_eb=" . urlencode($_SESSION["searchFormVars"]["search_eb"]);
>
> $search = ($_SESSION["searchFormVars"]["search_eb"]);
>
> $link = mysql_connect("localhost", "root", "040573");
>
> $template->parseCurrentBlock();
>
>
>
> mysql_select_db("knowledge", $link);
>
> // Encode the search parameters for embedding in links to other pages
> // $connection = DB::connect($dsn, true);
> $query = setupQuery($_SESSION["searchFormVars"]["search_eb"]);
> //$result = $connection->query($query);
> //var_dump ($query);
> $result=
mysql_query($query);
>
> ...
>
###########################################################################################################
##
##why I could not use the DB statement $result = $connection->query($query) instead of the mysql statement $result=
mysql_query($query); Further on, the same situation appears in the code, which ##looks like:
>
>
> for ( $rowCounter = 0;
> ($rowCounter < SEARCH_ROWS) &&
> (( $rowCounter + $_SESSION["searchFormVars"]["offset"]) < mysql_num_rows($result)) &&
> ($row = mysql_fetch_array($result));
> //($row =mysql_fetch_row($_SESSION["searchFormVars"]["offset"]+$rowCounter));
> // ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter));
> $rowCounter++)
>
#############################################################################################################
##
##
## I could not use the DB statement ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter));
## instead of the mysql code ($row = mysql_fetch_array($result)). But in that case, there is not the same meaning between the msyql and DB statement. However, I need the DB assignation for ## faultless work. What can I do?
>
> best reagards, Georg
>
>
--
Wbr,
Antony Dovgal
attached mail follows:
It's currently a little bit late in the US and you only waited 2 hours
since your last post. While this is an international list the majority
of the posters are US based. Not getting a response within two hours at
this time is not unusual and you should probably be more patient.
As for your problem, what is DB.php? Is it the pear DB class?
You can't mix mysql functions and pear DB functions like you are doing.
You should choose one or the other and stick with it, mixing them is
just trouble.
As for your final statement, you can do everything with the built in
mysql functions that you can using DB.php. DB.php simply wraps the
mysql calls.
If you choose to go the DB route, you should probably try the pear list,
and try waiting more than two hours before complaining.
David
j.kuehne
sign-tronic.ch wrote:
> Could someone explain the behaviour of the following code fragments. I have a serious problem with db-statements.
>
> ##############################################################################################
> ##############################################################################################
>
>
>>require_once "DB.php";
>>require_once "knowledge.inc";
>>require_once "template-new.inc";
>>
>>
>>function setupQuery($search_eb)
>>{
>> // Show the wines stocked at the winestore that match
>> // the search criteria
>>
>> $query = "SELECT *
>> FROM knowledge_db
>> WHERE MATCH (autor,problem) AGAINST ('$search_eb')
>> OR id = ('$search_eb')
>> OR autor = ('$search_eb')
>> OR stichwort = ('$search_eb')
>> OR date_new = ('$search_eb')
>> OR anlage = ('$search_eb')";
>>
>> // Add region_name restriction if they've selected anything
>>
>> //$query .= "ORDER BY data_new";
>> return ($query);
>>}
>>
>>error_reporting(E_ALL);
>>
>>
>>// Show the user the knowledge that match their query
>>function showKnowledges($connection, &$template)
>>{
>>
>>
>> // Produce a heading for the top of the page
>>
>> global $dsn;
>>
>>
>> $template->setCurrentBlock();
>>
>> $template->setVariable("SUCH-KRITERIUM","Such-Kriterium: {$_SESSION["searchFormVars"]["search_eb"]}");
>>
>> $browseString = "search_eb=" . urlencode($_SESSION["searchFormVars"]["search_eb"]);
>>
>> $search = ($_SESSION["searchFormVars"]["search_eb"]);
>>
>> $link = mysql_connect("localhost", "root", "040573");
>>
>> $template->parseCurrentBlock();
>>
>>
>>
>>mysql_select_db("knowledge", $link);
>>
>>// Encode the search parameters for embedding in links to other pages
>>// $connection = DB::connect($dsn, true);
>>$query = setupQuery($_SESSION["searchFormVars"]["search_eb"]);
>>//$result = $connection->query($query);
>>//var_dump ($query);
>>$result=
mysql_query($query);
>>
>>...
>>
>
> ###########################################################################################################
> ##
> ##why I could not use the DB statement $result = $connection->query($query) instead of the mysql statement $result=
mysql_query($query); Further on, the same situation appears in the code, which ##looks like:
>
>>
>> for ( $rowCounter = 0;
>> ($rowCounter < SEARCH_ROWS) &&
>> (( $rowCounter + $_SESSION["searchFormVars"]["offset"]) < mysql_num_rows($result)) &&
>> ($row = mysql_fetch_array($result));
>> //($row =mysql_fetch_row($_SESSION["searchFormVars"]["offset"]+$rowCounter));
>> // ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter));
>> $rowCounter++)
>>
>
> #############################################################################################################
> ##
> ##
> ## I could not use the DB statement ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter));
> ## instead of the mysql code ($row = mysql_fetch_array($result)). But in that case, there is not the same meaning between the msyql and DB statement. However, I need the DB assignation for ## faultless work. What can I do?
>
>
>
>>best reagards, Georg
>>
>>
>
>
>
attached mail follows:
hi all...
I have the problem about this syntax:
$db->query("INSERT INTO `products`
(`code`,`size`,`description`,`material`,`ads`,`price`,`new`,`categorynr`)
VALUES
('$code',
'$size',
'$description',
'$material',
'$ads',
'$price',
'$new',
'$categorynr')");
the syntax above could work properly in my computer which using PHP 4.1.1
but the problem is when I publish it the server where I hosted couldn't run such syntax (server uses PHP 4.4.2
I don't know why. is any one can help me?
please tell me the right syntax...
Best Regard
-------------BBC---------------
attached mail follows:
Please give us output of the error that mysql returns.
cheers,
BBC wrote:
> hi all...
> I have the problem about this syntax:
>
> $db->query("INSERT INTO `products`
> (`code`,`size`,`description`,`material`,`ads`,`price`,`new`,`categorynr`)
> VALUES
> ('$code',
> '$size',
> '$description',
> '$material',
> '$ads',
> '$price',
> '$new',
> '$categorynr')");
>
> the syntax above could work properly in my computer which using PHP 4.1.1
> but the problem is when I publish it the server where I hosted couldn't run such syntax (server uses PHP 4.4.2
> I don't know why. is any one can help me?
> please tell me the right syntax...
>
> Best Regard
> -------------BBC---------------
attached mail follows:
BBC wrote:
> hi all...
> I have the problem about this syntax:
>
> $db->query("INSERT INTO `products`
> (`code`,`size`,`description`,`material`,`ads`,`price`,`new`,`categorynr`)
> VALUES
> ('$code',
> '$size',
> '$description',
> '$material',
> '$ads',
> '$price',
> '$new',
> '$categorynr')");
>
> the syntax above could work properly in my computer which using PHP 4.1.1
> but the problem is when I publish it the server where I hosted couldn't run such syntax (server uses PHP 4.4.2
> I don't know why. is any one can help me?
I doubt it - for instance you don't bother to tell us what the error is.
I'd guess your production server has register_globals turned off.
go STW for what register_globals is and what it means for you.
> please tell me the right syntax...
>
> Best Regard
> -------------BBC---------------
attached mail follows:
Hello
I am pleased if someone could explain me since is wrong the following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter));
as you will find them on the bottom of the email. By the way, fetchRow() is an object from class DB(.php). However mysql_fetch_row() should have same functionality but the argument resp. the identity is different. I hardly try to do not mix up functionality from mysql- with db- members.
$search = ($_SESSION["searchFormVars"]["search_eb"]);
$link = mysql_connect("localhost", "root", "040573");
mysql_select_db("knowledge", $link);
$query = setupQuery($_SESSION["searchFormVars"]["search"]);
$result=
mysql_query($query);
for ( $rowCounter = 0;
($rowCounter < SEARCH_ROWS) &&
(( $rowCounter + $_SESSION["searchFormVars"]["offset"]) < mysql_num_rows($result)) &&
($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, $_SESSION["searchFormVars"]["offset"]+$rowCounter));
$rowCounter++)
{
Error message:
Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line
best regards, Georg
attached mail follows:
Hi,
I did this installation i do not know how many times...it worked till now.
But it seems that today, i forget something and i'm lost :-(
I have the following lines in my http.conf from apache 2.2 configuration
file.
# ----- for PHP ----
LoadModule php5_module "c:\PHP\php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "c:\PHP\"
# ------------------
therefore, apache serve does not start. If i comment loadmodule and PHPdir
lines, Apache starts ...
could you help me to understand where is this stupid mistake ?
thanks a lot,
Alain
attached mail follows:
Alain Roger wrote:
> I have the following lines in my http.conf from apache 2.2 configuration
> file.
>
> # ----- for PHP ----
> LoadModule php5_module "c:\PHP\php5apache2.dll"
php5apache2.dll doesn't support Apache 2.2. Use Apache 2.0.
--
David Powers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]