|
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 23 Nov 2005 05:19:38 -0000 Issue 3810
php-general-digest-help
lists.php.net
Date: Tue Nov 22 2005 - 23:19:38 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 23 Nov 2005 05:19:38 -0000 Issue 3810
Topics (messages 226287 through 226327):
Re: Problems with PHP5 & phpMyAdmin
226287 by: Russ F
how to exist within the context?
226288 by: Bing Du
226289 by: David Grant
226290 by: Jay Blanchard
226292 by: Bing Du
226299 by: Bing Du
226302 by: Richard Lynch
Re: username format when binding to Active Directory?
226291 by: Bing Du
Assistance debugging php 5.x.x
226293 by: Eric
226294 by: Jay Blanchard
226297 by: Eric
226298 by: Jay Blanchard
226301 by: Richard Lynch
226303 by: Eric
226306 by: Jay Blanchard
226307 by: Eric
226315 by: Eric
226327 by: Curt Zirzow
Re: Zend + Eclipse + Standized Framework
226295 by: Roman Ivanov
Re: Can't execute external program
226296 by: Henry Castillo
226325 by: n.g.
Re: Trying to send data via POST
226300 by: Anders Norrbring
Re: PHP 5.0.5
226304 by: Ashley M. Kirchner
Re: readdir and mime types
226305 by: Richard Lynch
Re: cms type session - how to ?
226308 by: Richard Lynch
Re: Including classes
226309 by: Richard Lynch
syntax checking?
226310 by: Bing Du
226311 by: Jay Blanchard
226312 by: Jay Blanchard
226313 by: Bing Du
Sending Mail (newbie)
226314 by: schalk
226316 by: mwestern.sola.com.au
226317 by: schalk
Execute a program from PHP CLI and allow user interaction
226318 by: Jasper Bryant-Greene
226323 by: n.g.
Unclonable objects
226319 by: Matt Monaco
Is there an alternative for $_FILES['guildimage']['type'] == "image/jpeg"
226320 by: twistednetadmin
226321 by: Stephen Leaf
226324 by: Stephen Leaf
Re: Cookie problem with IE
226322 by: n.g.
NTLM, PHP and Apache
226326 by: Joe Wollard
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:
Curt Zirzow wrote:
> On Fri, Nov 18, 2005 at 12:07:00PM -0800, Russ F wrote:
>> I've reinstalled Apache2, PHP5, phpMyAdmin and MYSQl several times. I
>> still get the same error when i try to use phpmyadmin Can not load mysql
>> extensions. I checked the path it is correct, the extensions exist
>> in /etc/php5/extensions but they do not have a .so after them. The
>> php.ini file and config files appear correct from a server setup. I read
>> you need to put a loadmodule statement in httpd but am not sure when. The
>> script says not to modify this file, put mods in /etc/sisconfig. But I'm
>> not sure where as there are no loadmod commands in the scripts. My
>> authorities all appear correct.
>>
>> Can anyone poiny me to the right configuration file.
>
> How you install all of apache2, php5, phpMyAdmin and Mysql all
> matters on what file to edit. With your extension dir existing in
> /etc/php5/extension, i would assume you insalled via some package
> system.
>
> With out any of the information, it will be hard to help.
>
Sorry I forgot this error message:
Welcome to phpMyAdmin 2.6.3-pl1
Error
MySQL said: Documentation
#2002 - The server is not responding (or the local MySQL server's socket is
not correctly configured)
I 've tried most of the recommendations I could find by googling. Still get
this message.
--
Russ
attached mail follows:
Hi,
One webpage has its banner, left menu and footer ect that are controled
by the template. I want this php script to output the form and
processing result within the page structure. Without exit, if the
'yourname' field is empty, the script would output 'Please enter your
name!' fine within the page structure (that is, banner, menu and footer
are all there). But obviously the script does not terminate as it's
supposed to. With exit, the script terminates fine, but it outputs the
result in a page without banner, menu and footer. So what's the correct
way to get the script stop and output its results always in the page
structure.
<form method=post>
<input name="yourname" type="text" size="20">
<input name="submit" type="submit" value="submit">
</form>
<?php
$submit = $_POST['submit'];
$name = $_POST['yourname'];
if ($submit)
{
if ($name=="")
{
print "Please enter your name!";
//exit;
}
}
echo "Continue processing...";
?>
Thanks in advance,
Bing
attached mail follows:
Hi,
Try this:
<?php
$submit = $_POST['submit'];
$name = $_POST['yourname'];
if ($submit)
{
do {
if ($name=="")
{
print "Please enter your name!";
break;
}
} while (0);
}
echo "Continue processing...";
?>
It's a hack, but it works.
Cheers,
David Grant
Bing Du wrote:
> Hi,
>
> One webpage has its banner, left menu and footer ect that are controled
> by the template. I want this php script to output the form and
> processing result within the page structure. Without exit, if the
> 'yourname' field is empty, the script would output 'Please enter your
> name!' fine within the page structure (that is, banner, menu and footer
> are all there). But obviously the script does not terminate as it's
> supposed to. With exit, the script terminates fine, but it outputs the
> result in a page without banner, menu and footer. So what's the correct
> way to get the script stop and output its results always in the page
> structure.
>
> <form method=post>
> <input name="yourname" type="text" size="20">
> <input name="submit" type="submit" value="submit">
> </form>
>
> <?php
>
> $submit = $_POST['submit'];
> $name = $_POST['yourname'];
>
> if ($submit)
> {
> if ($name=="")
> {
> print "Please enter your name!";
> //exit;
> }
> }
>
> echo "Continue processing...";
> ?>
>
> Thanks in advance,
>
> Bing
>
attached mail follows:
[snip]
<form method=post>
<input name="yourname" type="text" size="20">
<input name="submit" type="submit" value="submit">
</form>
<?php
$submit = $_POST['submit'];
$name = $_POST['yourname'];
if ($submit)
{
if ($name=="")
{
print "Please enter your name!";
//exit;
}
}
echo "Continue processing...";
?>
[/snip]
You have to POST the value back to the form. This is one of the harder
concepts to grasp when programming in a stateless environment;
<?php
if(!isset($_POST['yourname'])){
$theNameValue = 'Please enter your name';
} else {
$theNameValue = $_POST['yourname'];
}
?>
<form action="<?php echo $PHP_SELF; ?>"method=post>
<input name="yourname" type="text" size="20" value="<?php echo
$_POST['yourname']; ?>">
<input name="submit" type="submit" value="submit">
</form>
attached mail follows:
Thanks for the help. But I still got:
Please enter your name! Continue processing...
What I want is if no name is entered, only 'Please enter your name!'
should be returned.
Bing
David Grant wrote:
> Hi,
>
> Try this:
>
> <?php
> $submit = $_POST['submit'];
> $name = $_POST['yourname'];
>
> if ($submit)
> {
> do {
> if ($name=="")
> {
> print "Please enter your name!";
> break;
> }
> } while (0);
> }
> echo "Continue processing...";
> ?>
>
> It's a hack, but it works.
>
> Cheers,
>
> David Grant
>
> Bing Du wrote:
>
>>Hi,
>>
>>One webpage has its banner, left menu and footer ect that are controled
>>by the template. I want this php script to output the form and
>>processing result within the page structure. Without exit, if the
>>'yourname' field is empty, the script would output 'Please enter your
>>name!' fine within the page structure (that is, banner, menu and footer
>>are all there). But obviously the script does not terminate as it's
>>supposed to. With exit, the script terminates fine, but it outputs the
>>result in a page without banner, menu and footer. So what's the correct
>>way to get the script stop and output its results always in the page
>>structure.
>>
>><form method=post>
>><input name="yourname" type="text" size="20">
>><input name="submit" type="submit" value="submit">
>></form>
>>
>><?php
>>
>>$submit = $_POST['submit'];
>>$name = $_POST['yourname'];
>>
>>if ($submit)
>>{
>> if ($name=="")
>> {
>> print "Please enter your name!";
>> //exit;
>> }
>>}
>>
>>echo "Continue processing...";
>>?>
>>
>>Thanks in advance,
>>
>>Bing
>>
attached mail follows:
Ummm... but I don't see how that is related to my exit problem. Any
pointers for me to learn more about it? Thanks much for the help.
Bing
Jay Blanchard wrote:
> [snip]
> <form method=post>
> <input name="yourname" type="text" size="20">
> <input name="submit" type="submit" value="submit">
> </form>
>
> <?php
>
> $submit = $_POST['submit'];
> $name = $_POST['yourname'];
>
> if ($submit)
> {
> if ($name=="")
> {
> print "Please enter your name!";
> //exit;
> }
> }
>
> echo "Continue processing...";
> ?>
> [/snip]
>
> You have to POST the value back to the form. This is one of the harder
> concepts to grasp when programming in a stateless environment;
>
> <?php
> if(!isset($_POST['yourname'])){
> $theNameValue = 'Please enter your name';
> } else {
> $theNameValue = $_POST['yourname'];
> }
> ?>
>
> <form action="<?php echo $PHP_SELF; ?>"method=post>
> <input name="yourname" type="text" size="20" value="<?php echo
> $_POST['yourname']; ?>">
> <input name="submit" type="submit" value="submit">
> </form>
attached mail follows:
Put all your footer html/code into a function called 'foot'
Then do:
if (must_die(...)){
foot();
exit;
}
On Tue, November 22, 2005 11:27 am, Bing Du wrote:
> Hi,
>
> One webpage has its banner, left menu and footer ect that are
> controled
> by the template. I want this php script to output the form and
> processing result within the page structure. Without exit, if the
> 'yourname' field is empty, the script would output 'Please enter your
> name!' fine within the page structure (that is, banner, menu and
> footer
> are all there). But obviously the script does not terminate as it's
> supposed to. With exit, the script terminates fine, but it outputs
> the
> result in a page without banner, menu and footer. So what's the
> correct
> way to get the script stop and output its results always in the page
> structure.
>
> <form method=post>
> <input name="yourname" type="text" size="20">
> <input name="submit" type="submit" value="submit">
> </form>
>
> <?php
>
> $submit = $_POST['submit'];
> $name = $_POST['yourname'];
>
> if ($submit)
> {
> if ($name=="")
> {
> print "Please enter your name!";
> //exit;
> }
> }
>
> echo "Continue processing...";
> ?>
>
> Thanks in advance,
>
> Bing
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Bing Du wrote:
> Hello,
>
> The following script returns 'LDAP bind failed...'.
>
> <?php
> echo "Connecting ...<br />";
>
> $ldaprdn = "jsmith\
dept.some.edu";
> $ldappass = "jsmithpass";
>
> $ds=ldap_connect("ad.dept.some.edu");
>
> if ($ds) {
> echo "Binding ...<br />";
> $r=ldap_bind($ds, $ldaprdn, $ldappass);
>
> if ($r) {
> echo "LDAP bind successful...<br />";
> } else {
> echo "LDAP bind failed...<br />";
> }
> } else {
> echo "LDAP connection failed...<br />";
> }
>
> ?>
>
> If I change $ldaprdn to be "CN=John
> Smith,OU=Users,OU=DEPT,DC=some,DC=edu", then bind returns 'LDAP bind
> successful...'.
>
> However AD supports username to be in jsmith
dept.some.edu format
> because querying from the command line works:
>
> % ldapsearch -h ad.dept.some.edu -s sub -b "dc=dept,dc=some,dc=edu" -x
> -D jsmith
dept.some.edu -W "samaccountname=jsmith"
>
> Our AD only allows authenicated bindings. We don't know user's DN
> before binding. So anybody know how to make PHP allow
> $ldaprdn="jsmith\
dept.some.edu"?
>
> Thanks in advance,
>
> Bing
Ok, I've figured it out again. Removing the '\' in
$ldaprdn="jsmith\
dept.some.edu' fixed the problem. I thought it should
be escaped. But looks like it's not necessary.
Bing
attached mail follows:
I would like to have some assistance in debugging php. It's about a bug in
php not a script of mine.
I can't post a bug report as I do not "exactly" know why my code is
suffering from a php bug. It's related to a "very" complex objects-model
where objects, cross-referenced, wake up from a session. (note, these are
cross-references, not circular, all circular (parent <-> child) references
are unset before the objects are serialized)
During the wake up sequence, somehow, a not directly related object
variable, gets unset. However, this only occurs under "very" specific
circumstances. While I do not know what exact variables contribute to this
bug, I can consistantly reproduce it.
Fun-fact: I installed "ZendPlatform" to debug my script in order to rule out
any mistakes of my making. With ZendPlatform the object variable doesn't get
unset anymore, however, a specific value of an other object, related to the
issue appears to leak into another variable. Now I started to debug the code
with ZendPlatform/-Studio to try to watch when the leak occured, however,
httpd segfaults on debugging the script. All scripts appear to debug just
fine, accept this one, under these specific circumstances
This is "globally" what happens. If you're insterested in this issue,
willing to help me and if you think yourself to be cappable of helping me.
Please contact me by responding to this post or contact me directly:
Email/MSN: ericvanblokland 'AT' gmail.com
Skype: footsteps_eric
Thank you in advance and kind regards,
Eric van Blokland
attached mail follows:
[snip]
This is "globally" what happens. If you're insterested in this issue,
willing to help me and if you think yourself to be cappable of helping me.
Please contact me by responding to this post or contact me directly:
[/snip]
There are several on this list who are willing and capable of helping. Put
it out here on the list, you'll get a better response. Let's see the code.
attached mail follows:
That's just one of the problems, it's about a project with over tens of
thousands lines of code. As I said before, I don't know whats the exact
cause. There are so many variables that contribute to this issue and of most
of them I don't understand why they contribute. However, I'm convinced the
php compiler screws up "really" bad. Now I have to find out why it screws
up, to be able to file a complete bug-report or to find a work around.
As posting code isn't an option I will try to explain the issue more
thoroughly, tomorrow, I'll discuss the possibility of access to one of our
development servers with my employer.
A more thorough explanation:
As I said before, I have a very complex model of objects. First, I will
describe the piece of the model thats involved and how it works.
We have object A, B and C, they are children of each other in this order
Also we have property objects P1, P2 and PX P1 handles textbased property
changes, P2 and PX represent other types of properties, which types is not
interesting, the way they handle input is the same as defined in the parent
class P, the only difference is how they visually represent theirselfs.
Object A has properties:
(int) status
(array) properties
(object) B
Object B has properties:
(string) title
(array) properties
(object) C
Object C has properties:
(array) properties
Each object as a "properties" array. These arrays contain the objects P1, P2
and/or PX. When object A and B wakeup (in reversed order ofcourse) they both
call a function, giving themselve ($this) as parameter. This function,
checks the P-objects in the properties array, for changed values. If a value
is changed, the function will change the value on the object.
For example:
Object B has a P1 property with the name "title" in it's properties array.
The P1 object get's on wakeup a new value from $_POST or whatever, puts this
value in it's "value" property and sets it's "changed" flag.
Now Object B wakes up and calls "the function", this functions loops through
the properties array and sees the P1 object with name "title" has it's
"changed" flag set. Now, the function copies the value from the P1 object to
the "title" property of Object B
So far so good, no errors there however, I'm doing some strange to the
model, call me stupid, but it just was de easiest way to fix this as Object
C handles to visual representation:
Object A has a PX object for it's state
Object B has a P1 object for it's title
Object C doesn't have any property objects (yet, perhaps future types of C
will)
Now Object B has set its "C" child and want C to have it's parental
properties so they can be displayed.
Object B creates references in the properties array of C to all the
properties of A and B, this is no problem as Object C doens't call "the
function" on wakeup so it won't do anything with the properties values and
even if it did, I really wouldn't care if C's nonexisting "state" or "title"
got set.
This all still works fine.
Now, Object B get's a new property of type P2, Object B doesn't care about
it's value, but has to initially set it. After it's set you might see P2 as
a "read-only" property object.
Still no issue, the P2 object is nicely, visually represented and we don't
care if it's value would change, Object B doesn't use a property with the P2
object name.
I repeated this trick and added another P2 object. Everything seemed fine
but then, when the P1 title object from Object B got it's value changed, an
error was generated: Object A noticed it's "state" property object PX
doens't exist and tries to add a new one to it's properties array. However,
this is no longer an array (which generated the error in the first place).
Objects B title get's changed correctly. My prove for php screwing up is the
following:
I "never", reset the properties array, I just don't (which is proven by
ZendPlatform)
seccond: my error handler, displays backtraces of errors, and the backtrace
just didn't make sense. I have a "helper function" to add property objects
to the properties array of objects, the error was generated in this
function. De backtrace gave me a correct line-number for the error, a
correct filename for the error, but an incorrect function name, it repeated
the Object A function instead of showing the name of "helper function".
Third: The issue seems only to occur when P1 changes and that magical third
property is of type P2 (that the 2nd property is also P2 doesn't seem to
mather also their order don't mather) and the name of this third property
contains something like "keyword". (original name "ssl_keywords" but
"keyword" and even "keywoord" caused an error while "key" didn't) (when
using ZendPlatform, the name of the key doesn't matter anymore, the new
value of the P1 object "title" seems to leak into another not related array
and everything else seems to work fine. However, this script, with these
parameters can't be debugged with ZendPlatform, as httpd will segfault, all
other scripts, even this, without that "title" parameter debug just fine)
The fourth reason is even more vague. In the beginning I solved the above
issue quite fast, by just "trying" something. I got bored and wasn't really
looking into the issue as I thought it was a stupid mistake by my own
making. I accidentally fixed the issue by letting "the function" (the one
that applies properties objects values to an object) work on references in
the foreach loop that looped through the properties array (
foreach($object->properties as $object) --> foreach($object->properties as
&$object) )
I did not thrust this fix, as it didn't seem related enough and even more
when you realize that objects in php5 always are references, zo putting that
& sign there seems a bogus to me.
Then again, at that time everything seemed to work.... not! Something else
began to screw, Object A again. In the real-life situation, Object A may
contain multiple Bs, during wakeup, it loops through it's Bs for
maintenance. The array for these B's is an associative one, where the keys
are the language that the Bs represent. Now the code looks like this:
$keys=array_keys($this->B);
foreach($keys as $key) {
// First statement
// Seccond statement
}
In the real-life situaties, there is just one B with key "Nederlands" which
is "Dutch" in dutch. In the first statement, Object A takes Object Bs title,
similiar to this:
$this->title=$this->B[$key]->title;
Works fine, now the secconds statement is executed, A tries to copy the path
to the icon of B, similiar to this:
$this->icon=$this->B[$key]->icon;
This statement fails telling me the element "Nederlancs" doesn't exists.
This is not a typo, the key mysterialy changed to "Nederlancs"! The "d"
became a "c".
Enough prove for me, however, there is still the problem of finding the
cause and a solution.
I'm going to double check if everything I said above is correct and I will
try to create simple reproduce code in order to pinpoint the cause, however,
if the problem is subject to specific "keynames" I think there is a lot more
to the issue than meets the eye. So other parts of my code may be involved.
If anyone is still interested in helping me, please let me know, tell me
what you need, what you intend to check, a guess about the cause of the
issue?
Thank you!
Eric van Blokland
"Jay Blanchard" <jay.blanchard
THERMON.com> wrote in message
news:0CEC8258A6E4D611BE5400306E1CC9270915AB01
smtmb.tmc.local...
> [snip]
> This is "globally" what happens. If you're insterested in this issue,
> willing to help me and if you think yourself to be cappable of helping me.
> Please contact me by responding to this post or contact me directly:
> [/snip]
>
> There are several on this list who are willing and capable of helping. Put
> it out here on the list, you'll get a better response. Let's see the code.
attached mail follows:
[snip]
If anyone is still interested in helping me, please let me know, tell me
what you need, what you intend to check, a guess about the cause of the
issue?
[/snip]
Give us an example of the code where it breaks and also any error messages.
That will give us a starting point.
attached mail follows:
On Tue, November 22, 2005 2:37 pm, Eric wrote:
> $this->title=$this->B[$key]->title;
While this is SUPPOSED to work in PHP 5, it would be my first suspect
of under-tested code.
Try this:
$temp = $this->B[$key];
$this->title = $temp->title;
> This is not a typo, the key mysterialy changed to "Nederlancs"! The
> "d"
> became a "c".
This sounds like you treated a STRING as if it were an ARRAY.
Keep in mind that PHP is quite happy to treat STRING variables is if
they were arrays of characters.
So it's entirely possible that your code is NOT altering array
elements but is altering string characters.
It sounds like you are storing an object property sometimes as a
string, and sometimes as an array.
Don't.
Or, if you must, then you had better type-check the data every time
you use it for anything.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
[snip]
Give us an example of the code where it breaks and also any error messages.
That will give us a starting point.
[/snip]
I think you don't understand completly, the project exists out of tens of
thousands lines of code.
- I don't have a short reproduce script
- I don't know if it's possible to create one, however, i'll try
My code may appear to be weird, but it's no broken. The php compiler is
broken though and I would like to have some assistance in finding out what's
broken. I'm talking about debugging the compiler, not my script.
attached mail follows:
[snip]
I think you don't understand completly, the project exists out of tens of
thousands lines of code.
- I don't have a short reproduce script
- I don't know if it's possible to create one, however, i'll try
My code may appear to be weird, but it's no broken. The php compiler is
broken though and I would like to have some assistance in finding out what's
broken. I'm talking about debugging the compiler, not my script.
[/snip]
No, I understand perfectly. There is a point at which the code breaks, is
there not? There are error messages, are there not? You cannot unequivocally
state that the PHP compiler is broken until the code has been evaluated. We
are trying to help you here, but you have to show us something. We cannot
take wild-ass guesses (well, actually, we could) based on your description.
It is not the scientific method.
attached mail follows:
[snip]
It sounds like you are storing an object property sometimes as a
string, and sometimes as an array.
[/snip]
I can assure you, this has nothing to do with this issue, the only
type-juggling I do once in a while is byte/int/long/double/string
attached mail follows:
[snip]
No, I understand perfectly. There is a point at which the code breaks, is
there not? There are error messages, are there not? You cannot unequivocally
state that the PHP compiler is broken until the code has been evaluated. We
are trying to help you here, but you have to show us something. We cannot
take wild-ass guesses (well, actually, we could) based on your description.
It is not the scientific method.
[/snip]
I understand your point, but I can't offer you the project as it's company
property. Again, I will try to make a reproduce/example script.
Meanwhile, try to believe my assumption that the PHP compiler is broken
because:
- At no point, it would be usefull to destroy that particular array, so,
there IS no specific code that does that.
- However, there could be, ofcourse, a bug involved in my code, accidentally
destroying the array, but I've searched my code for such a bug and I can't
find it.
- Still, to rule out any mistakes of mine, I tried the code at a
ZendPlatform enabled server and the bug seems to disappear. Not really,
though, because a value seem to leak to someplace else and even worse: while
ZendPlatform seems te work perfectly (I can debug everything, even this
specific piece of code) httpd segfaults when debugging this code with the
"evil" parameter
- Back to the error message: even the error message is corrupted, the
compiler doesn't seem to know what it's doing (what would explain de httpd
segfault with ZendPlatform: PHP does something it's not meant to do)
- Then again, maybe I told the compiler to something it isn't meant to do
(but if it isn't meant to do what I instruct it to do, it should give me an
error, so there would be a flaw in the compiler anyway, but in this case, a
minor one). Although I don't see the evil in what I'm doing. But perhaps you
could tell by my how-my-code-works-theory
- Finally, the strange behaviour is variables suddenly changing while there
is no reference or new assignment. This is most likely a symptom of a very
confused compiler.
So let's "assume" the PHP compiler is broken or my code is in theory
correct, but beyond the compilers capabillities. Wouldn't a shallow debug of
php shed more light on the issue? Memory leaks, a backtrace of the segfault
with ZendPlatform, php compiled with debug enabled and see what kind of
stuff pops up?
Some side information: At the beginning of this year, this project ran with
php4 however, it suddenly began to segfault. It also had to do with complex
object-architecture. Everybody said my code was the problem, however it ran
fine when it was modified for php5. Not very long ago, someone from the php
crew spotted a serieus problem in the way php4 handles object references
(very most likely the cause of my problem) which resulted in php 4.4.x
Some of the weird things that happen now (variables changing) seem somewhat
similliar to things happening now. It sure isn't the same problem (the php4
issue was solved by using php5 as example) Anyway I'm 99.99% sure the
compiler screws up, wether or not my code does something evil, so I think
the compiler is the best place to start looking instead of my code.
If you're not willing to make this assumption, I completly understand why,
but I can't and I won't post any code or links to code, here. Nonetheless, I
would like to thank you for the time you took, reading my posts. If you, or
anywone else would like to help me debug the compiler please let me know. If
so, we're probably doing this using something like a VNC terminal and we
will have a look at the code as well.
It's 11:45PM here so I'm off to bed, I'll be back in the morning.
Thanks again and goodnight,
Eric van Blokland
attached mail follows:
On Tue, Nov 22, 2005 at 07:41:10PM +0100, Eric wrote:
> I would like to have some assistance in debugging php. It's about a bug in
> php not a script of mine.
First off there is a big difference between 5.0.x and 5.1.x as well
as 5.0.1 and 5.0.5, what version are we talking about?
>
> I can't post a bug report as I do not "exactly" know why my code is
> suffering from a php bug. It's related to a "very" complex objects-model
...
If it isn't your code is there ever a known state at which it did
work?
...
> where objects, cross-referenced, wake up from a session. (note, these are
> cross-references, not circular, all circular (parent <-> child) references
> are unset before the objects are serialized)
This almost sounds like some douglas adams, story.. I'd wake up
dizzy with all those circular but not circular references.
Curt.
--
cat .signature: No such file or directory
attached mail follows:
Jochem Maas wrote:
> Roman Ivanov wrote:
>
>> Greg Donald wrote:
>>
>>> Maybe Zend will get it right where all the previous attempts I've
>>> seen/used are less than great.
>>
>>
>>
>> Personally, I would start creation of PHP framework by cleaning up PHP
>> sytax. It's freakin' impossible to make complex OOP clean:
>
>
> there is plenty wrong with php, but none of your comments are
> even vaguely relevant.
>
> btw you can 'clean up the syntax' - just don't expect it
> to ever make it into the official build.
This comment is irrelevant. If I can install recompiled PHP on the
machine, than I can install any other scripting engine with less hustle.
>> $this->output(array('dir', 'template'), &new BlaBla($this->bla));
>
>
> this is supposed to prove what exactly?
Examples illustrate, they do not have to prove anything.
> apart from the fact that OO in
> php is not something you are very familiar with for starters if you
> want to do OO in php these days you should be using php5 (assuming you
> don't have a mountain of existing php4 OO code you have to work with -
> if you do then moaning about syntax is completely pointless... php4 is
> is 'bugfix only')
This whole paragraph amounts to "OMG, you're lame, so STFU". It has
nothing to do with issues of PHP syntax.
> the '&' sign for passing objects around in php5 is unnecessary because
> objects are always passed around as references.
Fair enough.
$this->output(array('dir', 'template'), new BlaBla($this->bla));
So PHP 5 eliminates 1 (one) character from _this particular example_.
> and if you really know that you
> need a reference to a reference you skill level should at the very least
> be such that 'freakin' impossible' is not relevant at all.
Another personal attack, plus you take my words out of context. The
original statement was: "It's freakin' impossible to make complex OOP
clean". You did not disprove it in any way.
attached mail follows:
That was on of the first things I checked:
safe mode is set to off
Any ideas...
Henry
Voip tech said the following on 11/20/2005 10:31 PM:
> Hello,
> I cannot get exec(), system() or passthru() to run an extenal program.
> From the command line it runs perfectly:
<snip>
> I'm getting frustrated, Any help will be deeply appreciated
> Henry
The answer is probably in your php.ini. Look into whether you are
running in safe mode or not, and if you are whether you have your
program in the safe_mode_exec_dir or not. Also check disable_functions
to see if any of the ones you are having trouble with are listed.
- Ben
attached mail follows:
is /var/www/html your web root dir ?
maybe its the plobrem.
On 11/23/05, Henry Castillo <henryperu
gmail.com> wrote:
> That was on of the first things I checked:
> safe mode is set to off
> Any ideas...
> Henry
> Voip tech said the following on 11/20/2005 10:31 PM:
> > Hello,
> > I cannot get exec(), system() or passthru() to run an extenal program.
> > From the command line it runs perfectly:
>
> <snip>
>
> > I'm getting frustrated, Any help will be deeply appreciated
> > Henry
>
> The answer is probably in your php.ini. Look into whether you are
> running in safe mode or not, and if you are whether you have your
> program in the safe_mode_exec_dir or not. Also check disable_functions
> to see if any of the ones you are having trouble with are listed.
>
> - Ben
>
>
--
Tomorrow will be a good day :-)
attached mail follows:
On 2005-11-21 20:23 Richard Davey wrote:
> Hi Anders,
>
> Monday, November 21, 2005, 7:13:40 PM, you wrote:
>
>
>>I'm trying to set up a script that will post a picture file to a
>>hosting site. Normally, the site accepts uploads via a web form
>>using a POST action. How can I make this file transfer to the host
>>so it'll think it's posted by it's own web form? I just don't get
>>how to set it up..
>
>
> Start with something like cURL or Snoopy, to make life a little
> easier. Otherwise you can simulate this through standard socket
> commands.
>
> Cheers,
>
> Rich
Thanks to Rich and Jay who suggested cURL, it works perfectly fine, and
was really easy to implement!
--
Anders Norrbring
Norrbring Consulting
attached mail follows:
Curt Zirzow wrote:
>On Mon, Nov 21, 2005 at 09:41:40PM -0700, Ashley M. Kirchner wrote:
>
>
>>ext/ftp/ftp.lo(.text+0x76): In function `data_close':
>>/usr/local/src/apache/php-5.0.5/ext/ftp/ftp.c:1566: undefined reference
>>to `SSL_shutdown'
>>
>>
>
>This means basically that the header files (*.h) where found but
>none of the libraries were found.
>
Yeah, I wondered why. Found out that -lssl doesn't get passed down
to EXTRA_LIBS when it get to compiling the CLI. Once I added it to my
configure line, everything compiled fine.
( EXTRA_LIBS=-lssl ./configure ... )
--
W | It's not a bug - it's an undocumented feature.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:ashley
pcraft.com> . 303.442.6410 x130
IT Director / SysAdmin / Websmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
attached mail follows:
On Tue, November 22, 2005 8:23 am, Graham Cossey wrote:
> I'm attempting to read a list of files in a directory using readdir()
> but am having problems with mpeg files not seemingly being read.
>
> Cope snippet:
>
> $count = 0;
> while (false !== ($file = readdir($open_dir)))
> {
> if ($file != '.' && $file != '..')
> {
> if (file_exists("$VID_DIR/$file"))
What is $VID_DIR?
What directory is $open_dir pointing to?
Dollar gets you 10 that at least one of them is not what you think it is.
> {
> $count++;
>
> $count counts any 'avi' files but not 'mpg' files.
>
> Any suggestions much apreciated.
It's also remotely possible that your 'mpg' files are not readable by
the PHP user or something weird like that... Though I don't THINK you
can do this, it's possible that your OS allows it...
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Tue, November 22, 2005 3:24 am, Gregory Machin wrote:
> I'm looking for a how to , on creating sessions similar to those used
> my
> cms's
> that ref only a single page..
http://php.net/session_start
???
I don't understand what you mean by "that ref only a single page" and
suspect not many others understand that either.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Mon, November 21, 2005 5:14 pm, Philip Thompson wrote:
> Hi all.
>
> Here's what's going on. I have a page which calls itself in a <form>.
> On this page, I include two classes from other file I've created. On
> load, the page reads the class stuff just fine. If I submit the form
> (call the page again), then the class doesn't like to show any
> results.
>
> <code>
>
> <?
> require ("myclass1.php");
> require ("myclass2.php");
>
> if ($_POST["submitted"]) {
if (isset($_POST['submitted'])){
might be better...
But what you have shown as example code "should work" I think.
Try posting the REAL code.
> // do stuff which includes the class - this does not work
> } else {
> // do stuff which includes the class - this works fine
> }
> ?>
>
> <form action="thispage.php">
> <!-- stuff that uses the class info -->
> <input type="hidden" name="submitted" value="1" />
> </form>
>
> </code>
>
>
> Any thoughts on why the class is not working after the submit? I have
> tried using <code>require_once ("myclass1.php");</code>, but that
> does not work either. Any suggestions would be greatly appreciated!
>
> Thanks in advance.
> ~Philip
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Hi,
How should PHP syntax be checked before execution? Anything similar to
what option -c does in Perl?
% perl -c test.pl
Thanks,
Bing
attached mail follows:
[snip]
How should PHP syntax be checked before execution? Anything similar to
what option -c does in Perl?
% perl -c test.pl
[/snip]
from the command line
/usr/local/bin/php -i myScript.php
attached mail follows:
[snip]
How should PHP syntax be checked before execution? Anything similar to
what option -c does in Perl?
% perl -c test.pl
[/snip]
from the command line
/usr/local/bin/php -i myScript.php
[/snip]
Ooops, sorry, should be an ell "l"
/usr/local/bin/php -l myScript.php
attached mail follows:
Jay Blanchard wrote:
> [snip]
> How should PHP syntax be checked before execution? Anything similar to
> what option -c does in Perl?
>
> % perl -c test.pl
> [/snip]
>
> from the command line
>
> /usr/local/bin/php -i myScript.php
> [/snip]
>
> Ooops, sorry, should be an ell "l"
>
> /usr/local/bin/php -l myScript.php
Too late :). I've already tried -i. Boy, that returns tons of
information . My machine was choked.
Bing
attached mail follows:
Greetings All
I am using the following script to send mail via PHP. The script processes and
send the mail but the message is never displayed in the received email. Any
pointers will be much appreciated. Thank you.
<?php
// Handle POST method.
if ($_POST)
{
$name = $_POST['name'];
$phone = $_POST['phone'];
$comments = $_POST['comments'];
$to = 'schalk
volume4.com';
$subject = "Contact from OxfordPrice.com";
$headers = "MIME-Version: 1.0\r\n".
"Content-type: text/html; charset=iso-8859-1\r\n".
"From: ".$name."\r\n".
"Date: ".date("r")."\r\n";
// Compose message:
$message = "
<html>
<body>
<h1>Message From: " . $name .
"</h1>
</body>
</html>
";
// Send message
mail($to, $subject, $message, $headers);
// Thank the generous user
echo "<div id=\"message-response\"><h1>Thank You!</h1></div>\n";
}
--
Open WebMail Project (http://openwebmail.org)
attached mail follows:
Have you tried a very simple email example to make sure your server is
sending mail out. Is sendmail running and working?
http://au2.php.net/function.mail
> -----Original Message-----
> From: schalk [mailto:schalk
volume4.com]
> Sent: Wednesday, 23 November 2005 9:12 AM
> To: php-general
lists.php.net
> Subject: [PHP] Sending Mail (newbie)
>
> Greetings All
>
> I am using the following script to send mail via PHP. The
> script processes and send the mail but the message is never
> displayed in the received email. Any pointers will be much
> appreciated. Thank you.
>
> <?php
> // Handle POST method.
> if ($_POST)
> {
>
> $name = $_POST['name'];
> $phone = $_POST['phone'];
> $comments = $_POST['comments'];
>
> $to = 'schalk
volume4.com';
> $subject = "Contact from
> OxfordPrice.com";
> $headers = "MIME-Version: 1.0\r\n".
>
> "Content-type: text/html; charset=iso-8859-1\r\n".
> "From:
> ".$name."\r\n".
> "Date:
> ".date("r")."\r\n";
>
> // Compose message:
> $message = "
> <html>
> <body>
> <h1>Message From: " . $name .
> "</h1>
> </body>
> </html>
> ";
>
> // Send message
> mail($to, $subject, $message, $headers);
>
> // Thank the generous user
> echo "<div id=\"message-response\"><h1>Thank
> You!</h1></div>\n";
> }
>
> --
> Open WebMail Project (http://openwebmail.org)
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Thanks All. I have got this working.
--
Open WebMail Project (http://openwebmail.org)
attached mail follows:
Hi all
This one's got me stumped. I'm working on a PHP CLI interface, and I
need to allow the user to input a bit of HTML.
Rather than bandy around with readline() and the like, I thought it
would be nice to just create a temporary file, pop nano up, and read and
then delete the file once it's been edited. That way I get nano's syntax
highlighting and other useful features.
However, I can't for the life of me figure out how to allow the user to
interact with nano once the process has been launched. The usual culprits:
{exec,system,shell_exec}( "nano tmpfile.txt" );
all just hang (top shows nano is running, but it doesn't seem to be
attached to the terminal).
How can I launch a process and attach it to the terminal PHP CLI was
launched from so that the user can interact with it?
TIA
--
Jasper Bryant-Greene
General Manager
Album Limited
+64 21 708 334
jasper
album.co.nz
attached mail follows:
use proc_open , connect stdin/out of php cli to nano, i guess
On 11/23/05, Jasper Bryant-Greene <jasper
album.co.nz> wrote:
> Hi all
>
> This one's got me stumped. I'm working on a PHP CLI interface, and I
> need to allow the user to input a bit of HTML.
>
> Rather than bandy around with readline() and the like, I thought it
> would be nice to just create a temporary file, pop nano up, and read and
> then delete the file once it's been edited. That way I get nano's syntax
> highlighting and other useful features.
>
> However, I can't for the life of me figure out how to allow the user to
> interact with nano once the process has been launched. The usual culprits:
>
> {exec,system,shell_exec}( "nano tmpfile.txt" );
>
> all just hang (top shows nano is running, but it doesn't seem to be
> attached to the terminal).
>
> How can I launch a process and attach it to the terminal PHP CLI was
> launched from so that the user can interact with it?
>
> TIA
> --
> Jasper Bryant-Greene
> General Manager
> Album Limited
>
> +64 21 708 334
> jasper
album.co.nz
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Tomorrow will be a good day :-)
attached mail follows:
What situation would make a mysqli object unclonable? This is a problem
that occurs only on a linux machine with mysql4. I am simply trying to
declare a link resource and I get an error "Trying to clone unclonable
object of type mysqli" If I declare the link using a reference however, the
code seems to work fine. It still would be better not to use a reference
though.
Thanks in advance,
Matt
attached mail follows:
I use this line in a script for uploading pictures to a website:
$_FILES['guildimage']['type'] == "image/jpeg"
This works fine when using Mozilla, but it doesn't work with IE.
How should I do it to get it working with both/all browsers?
if (isset($_POST['submit'])) //If you
press submit
{
$sysfolder="/guildimages/";
$filename="".$_FILES['guildimage']['name']."";
if (file_exists($sysfolder . $filename)) //And the
file exists or there is no file chosen
{
echo "Filename exists or no file selected. Please rename the file or select
a file";
}
elseif ($_FILES['guildimage']['type'] == "image/jpeg") //If the
filetype is correct (this is where the change should be I think)
{
copy ($_FILES['guildimage']['tmp_name'],
"/guildimages/".$_FILES['guildimage']['name']) //Copy the file to
folder ("/guildimages")
or die("Could not copy file"); //Or
die
echo "Result:<br>\n";
echo "Filename: ".$_FILES['guildimage']['name']."<br>\n";
echo "Filesize: ".$_FILES['guildimage']['size']." byte<br>\n";
echo "Filtype: ".$_FILES['guildimage']['type']."<br>\n";
echo "Congrats! It worked!\n";
}
else
{
echo "Result:<br>\n";
echo "Now that didn't seem to work... <br>\n
Have you checked the size and filetype? <br>\n
File that failed--> (".$_FILES['guildimage']['name'].")<br>";
}
}
Does anyone know the answer to this?
attached mail follows:
I use the fileinfo pecl. http://pecl.php.net/Fileinfo
how to get a mime type:
$info = new finfo( FILEINFO_MIME );
$mime = $info->file($filename);
then my extention grabber:
function getExtention() {
switch ( $this->mimeType ) {
case "image/jpeg": return 'jpg'; break;
case "image/png": return 'png'; break;
case "image/gif": return 'gif'; break;
default: throw new ImageTypeNotSupportedException();
}
}
This is all done in a Image Object.
On Tuesday 22 November 2005 08:15 pm, twistednetadmin wrote:
> I use this line in a script for uploading pictures to a website:
>
> $_FILES['guildimage']['type'] == "image/jpeg"
>
> This works fine when using Mozilla, but it doesn't work with IE.
> How should I do it to get it working with both/all browsers?
>
>
>
> if (isset($_POST['submit'])) //If you
> press submit
> {
> $sysfolder="/guildimages/";
> $filename="".$_FILES['guildimage']['name']."";
>
> if (file_exists($sysfolder . $filename)) //And the
> file exists or there is no file chosen
> {
> echo "Filename exists or no file selected. Please rename the file or
> select a file";
>
> }
> elseif ($_FILES['guildimage']['type'] == "image/jpeg") //If
> the filetype is correct (this is where the change should be I think)
> {
>
> copy ($_FILES['guildimage']['tmp_name'],
> "/guildimages/".$_FILES['guildimage']['name']) //Copy the file
> to folder ("/guildimages")
> or die("Could not copy file"); //Or
> die
>
> echo "Result:<br>\n";
> echo "Filename: ".$_FILES['guildimage']['name']."<br>\n";
> echo "Filesize: ".$_FILES['guildimage']['size']." byte<br>\n";
> echo "Filtype: ".$_FILES['guildimage']['type']."<br>\n";
> echo "Congrats! It worked!\n";
> }
> else
> {
>
> echo "Result:<br>\n";
> echo "Now that didn't seem to work... <br>\n
> Have you checked the size and filetype? <br>\n
> File that failed--> (".$_FILES['guildimage']['name'].")<br>";
>
> }
> }
>
> Does anyone know the answer to this?
attached mail follows:
The reason why I suggested the fileinfo idea was because IE and mozilla report
the mime type differently.
image/x-jpeg vs image/jpeg I believe it is.
using fileinfo just standardizes what you need to check for.
On Tuesday 22 November 2005 09:56 pm, twistednetadmin wrote:
> I don't think that is quite what I'm after...
> I have restriction on only jpg images and filesize 300kb. The problem I
> have is that the IE browser doesn't recognize a <=300kb jpg mage as a valid
> file while Mozilla do. The switch statement though seems interesting. Not
> sure how I should use it in this case.
> The fileupload is just a simple form with a browsebutton. I am not trying
> to get more fileinfo or anything like that. Only to get IE to understand
> that it actually IS a valid file and then upload it.
attached mail follows:
did i say it? sorry, i mean load the page in your customer browser.
the code you give simple test stored cookie, which might be blocked by
browser. however browser blocks stored cookie might allow session
cookie, they are not stored so are less insecurity.
bad thing is your customer have some antivirus/firewall software
installed you even cant rely on http referer header, as well as
cookies.
and you have to do something before you can find out what is
happening, isn't it ?
On 11/22/05, n.g. <nyvsld
gmail.com> wrote:
> save below as testcookie.php, request it from your browser twice, what
> do you get at 2nd time?
> <?php
> setcookie('sessioncookie', 1);
> setcookie('storedcookie',1,time()+3600);
>
> var_dump($_COOKIE);
> ?>
>
> On 11/22/05, Kristen G. Thorson <kthorson
allegroconsultants.com> wrote:
> > Anyone have any suggestions? I'm still stuck.
> >
> >
> > thanks,
> > kgt
> >
> >
> >
> > Kristen G. Thorson wrote:
> >
> > > I'm having problems with a customer who can't login to a wholesaler
> > > application. To ensure the problem was that the cookie was not being
> > > set, I sent him to this script:
> > >
> > > if( !isset( $_REQUEST['page'] ) ) {
> > > setcookie('VATtest','Cookie has been set.',time()+50000, "/");
> > > echo '<a href="'.$_SERVER['PHP_SELF'].'?page=1">Test cookie.</a>';
> > > } else if( $_REQUEST['page'] == '1' ) {
> > > if( isset( $_COOKIE['VATtest'] ) ) {
> > > echo $_COOKIE['VATtest'];
> > > } else {
> > > echo 'Cookie NOT set.';
> > > }
> > > }
> > > ?>
> > >
> > >
> > > He got "Cookie NOT set." which means exactly what it says. He's using
> > > IE 6.0, and swears up and down that he's set it to always allow
> > > cookies from this domain. I can't verify that he's set it correctly,
> > > but he has been told twice how to do it. I also know his browser must
> > > be saving some cookies, as he is able to login to other sites. Has
> > > anyone run into other sources of cookie-blockage in the past? I
> > > cannot manage to duplicate this when I have IE set to always allow
> > > cookies from this domain.
> > >
> > > Thanks for any tips,
> > >
> > > kgt
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> Tomorrow will be a good day :-)
>
--
Tomorrow will be a good day :-)
attached mail follows:
Greetings all,
I'm running a rogue (the company knows about it but doesn't support it) web
server for my dept and I'd like to be able to authenticate users
transparently. The company is currently doing this on their own supported
Intranet servers via NTLM on IIS. All I'm really looking for here is a way
to extract the user name from the 'Authentication:' HTTP header using PHP on
Apache (FC4). It seems that some of the string can be extracted using
base64_decode(). Unfortunately it is not the part of the string that I need.
It's just the domain name, the computer's NET BIOS name and the Auth-type
which of course is NTLMSSP.
I found a mod_ntlm for Apache, but even if I could compile it on FC4 (yes, I
tried) I'm not sure I need/want the full functionality of NTLM - just a way
to extract the user name of the user logged into the client machine from the
HTTP header using apache.
It seems that there are many sites out there that do this in Java and Perl,
but none describe a way to do this in PHP......any ideas?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]