|
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-help
lists.php.net
Date: Tue Apr 08 2008 - 11:02:35 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 8 Apr 2008 16:02:35 -0000 Issue 5393
Topics (messages 272681 through 272719):
Re: php local application send mouse click
272681 by: Wolf
Re: Array pointer to a function
272682 by: Nathan Nobbe
272683 by: Robert Cummings
Recommended PHP Editors?
272684 by: Nitsan Bin-Nun
272685 by: Robert Cummings
272695 by: Wolf
272707 by: Daniel Brown
272710 by: Jochem Maas
272711 by: Andrew Ballard
272713 by: Daniel Brown
272714 by: Robert Cummings
272716 by: Jason Pruim
272717 by: Andrew Ballard
272718 by: Daniel Brown
Re: Include fails when "./" is in front of file name
272686 by: Noah Spitzer-Williams
Re: Conditional popup driven from server-side
272687 by: Arno Kuhl
Re: objects stored in sessions
272688 by: Julien Pauli
dynamic boxes problem... JS and PHP
272689 by: Ryan S
272701 by: Mark Weaver
272705 by: Andrew Ballard
272706 by: Peter Ford
272708 by: Daniel Brown
Could someone tell me what a tilde(~) in PHP does ?
272690 by: Tony Collings
272697 by: Mark J. Reed
272699 by: Tony Collings
272700 by: Mark J. Reed
Can someone tell me what a tilde means ?
272691 by: Tony Collings
272694 by: Németh Zoltán
272704 by: Andrew Ballard
Re: included file var scope
272692 by: Németh Zoltán
joins issues again
272693 by: Steven Macintyre
272703 by: Andrew Ballard
272715 by: Daniel Brown
272719 by: Wolf
Using Googles SSO for GApps
272696 by: Ian
Re: [PHP-INSTALL] Can't enable use_trans_sid
272698 by: Thiago Pojda
New Ajax search component
272702 by: Jeremy O'Connor
272709 by: Jay Blanchard
LOGIN Endless Loop Problem - Newbie
272712 by: revDAVE
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:
Daniel Kolbo wrote:
> Hello,
>
> I am mostly familiar with php for serving up web pages; however,
> recently I have been writing a local command line script on my WinXP
> machine. I have spent the better part of this last week and all of
> today trying to figure out a way to send a mouse click to a particular
> window on the screen.
>
> I first saw w32api.dll on the php.net site. However, I cannot find this
> dll, but this searching took me to winbinder and php-gtk2. It seems
> that I can only get winbinder to get (not send) mouse information: event
> type and x,y positions. I am not too familiar with php-gtk nor creating
> dlls.
>
> I want to use my local php command line script on my winXP machine to
> send mouse events (click) to a window. I am open to any ideas on how to
> do this.
>
> For C++ and VB there seems to be the SendMessage() function. Is there a
> way to tap into that function from my php script?
>
> winbinder has a function that wraps the SendMessage() function called
> wb_send_message, but after literally 9 hours i quit.
>
> on the MSDN.microsoft site, I saw the functions mouse_event() and
> SendInput() of the "user32.dll"
>
> http://msdn2.microsoft.com/en-us/library/ms646310.aspx
> http://msdn2.microsoft.com/en-us/library/aa932376.aspx
>
> I copied the "user32.dll" to my php/ext folder and tried loading the
> "user32.dll" both as an extension directive in php.ini and by using the
> dl() function in my script (dl() is enabled). However, both methods
> gave me a PHP warning:
>
> as an extension in php.ini it gives the following error:
>
> PHP Warning: PHP Startup: Invalid library (maybe not a PHP library)
> 'user32.dll
> ' in Unknown on line 0
>
> get_loaded_extensions() confirms user32.dll never gets loaded.
>
> invoking dl("user32.dll") yields the warning:
>
> PHP Warning: dl(): Invalid library (maybe not a PHP library)
> 'user32.dll' in [my script]
>
> Possible ideas:
> -Load a dll with the dl() function? (Write the dll with VB or C++)
> -use the w32api_register_function() in php somehow to 'tap' into windows
> api functions.
> -use a project that can assist me in this like php-gtk2 or winbinder
> -maybe someone has a copy of w32api.dll
> -something about COM objects, though i am really not familiar
>
> It seems as though the C languages and VB languages can do this. Perhaps
> I could write and compile a dll in that language, somehow load it up in
> php (even though i am having errors doing that currently), then I can
> use those functions in my dll to send my mouse clicks through php.
>
>
> I am throwing out this question to the community and wondering what your
> suggestions would be for how to go about sending a mouse click event to
> my windows api from a php script.
>
> I am not interested in writing javascript as this is not a web application.
>
> Any thoughts, comments, suggestions, about how to do send mouse events
> from a php script will be much appreciated.
>
> Thanks in advance,
Trying to send one TO a screen? Good luck with that. But you really
should wait at least for a few days for a response from the list before
reposting the same question with no further information...
What code have you tried? What code works to a point but fails?
Wolf
attached mail follows:
On Tue, Apr 8, 2008 at 12:00 AM, hce <webmail.hce
gmail.com> wrote:
> Hi,
>
> Is it possible for an array to point a function:
>
> Asignmanet
>
> $ArrayPointer = $this->MyFunction;
>
> Invoke:
>
> $ArraryPointer();
i would recommend you investigate variable functions
1. http://www.php.net/manual/en/functions.variable-functions.php
so you dont exactly get functional language behavior; but you can 'pass
around a function'. so for example; if you have
<?php
function someFunc() {}
/**
* then you can pass around strings that refer to it; as in
*/
$someFuncPointer = 'someFunc';
/**
* then you can call it using the variable function construct; as in
*/
$someFuncPointer(); // invoking someFunc()
?>
you can pass parameters to such an invocation; as in
<?php
$someFuncPointer(1, $b, $yaddaYadda);
?>
and it works for object instances
<?php
class MyClass { function doStuff() {} }
$b = new MyClass();
$b->doStuff();
?>
and it works for static object method calls
<?php
class OtherClass { static function doMoreStuff() {} }
$b = 'doMoreStuff';
?>
you can also store the class name or instance in variables and it still
works. here the output of a little php -a session
<?php
class M { static function b() {} function n() {} }
$m = 'M';
$b = 'b';
$m::$b();
$n = new M();
$n->b();
$n->$b();
?>
and thats just the tip of the iceberg! there is also the php psuedo type
callback; and there are some other functions that are pertinent.
call_user_func(); // very similar to variable functions
call_user_func_array()
-nathan
attached mail follows:
On Tue, 2008-04-08 at 14:00 +1000, hce wrote:
> Hi,
>
> Is it possible for an array to point a function:
>
> Asignmanet
>
> $ArrayPointer = $this->MyFunction;
>
> Invoke:
>
> $ArraryPointer();
No, you can't do what you've done above. What you can do is...
<?php
$ptr = array( 'obj' => &$this, 'method' => 'MyFunction' );
$ptr['obj']->$ptr['method']();
?>
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
Hi,
I'm working with serveral PHP editors, each has it own restrictions.
So umm, What editors do you recommend and what special functions and
dis/adventages they have (maybe im overkilling my own back).
Thanks In Advance,
Nitsan
attached mail follows:
On Tue, 2008-04-08 at 07:21 +0200, Nitsan Bin-Nun wrote:
> Hi,
> I'm working with serveral PHP editors, each has it own restrictions.
> So umm, What editors do you recommend and what special functions and
> dis/adventages they have (maybe im overkilling my own back).
This comes up almost once a week. Read the archives.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
Editpad circa 95
Notepad
VI
Nedit
Or the text editor that is the defauklt on ubuntu, which will do color specific coding for you once it knows the file type...
Wolf
-----Original Message-----
From: Nitsan Bin-Nun <nitsanbn
gmail.com>
Sent: Tuesday, April 08, 2008 1:21 AM
To: php-general
lists.php.net
Subject: [PHP] Recommended PHP Editors?
Hi,
I'm working with serveral PHP editors, each has it own restrictions.
So umm, What editors do you recommend and what special functions and
dis/adventages they have (maybe im overkilling my own back).
Thanks In Advance,
Nitsan
attached mail follows:
On Tue, Apr 8, 2008 at 1:21 AM, Nitsan Bin-Nun <nitsanbn
gmail.com> wrote:
> Hi,
> I'm working with serveral PHP editors, each has it own restrictions.
> So umm, What editors do you recommend and what special functions and
> dis/adventages they have (maybe im overkilling my own back).
RTFA: http://www.google.com/search?q=site%3Amarc.info+php+editors
--
</Daniel P. Brown>
Ask me about:
Dedicated servers starting
$59.99/mo., VPS starting
$19.99/mo.,
and shared hosting starting
$2.50/mo.
Unmanaged, managed, and fully-managed!
attached mail follows:
Robert Cummings schreef:
> On Tue, 2008-04-08 at 07:21 +0200, Nitsan Bin-Nun wrote:
>> Hi,
>> I'm working with serveral PHP editors, each has it own restrictions.
>> So umm, What editors do you recommend and what special functions and
>> dis/adventages they have (maybe im overkilling my own back).
>
> This comes up almost once a week. Read the archives.
indeed, although the proper answer never comes up. the proper answer is
ofcourse 'me' - as in I'm a highly recommended php editor - I have integrated
code generation and refactoring functionality that is lightyears ahead of any IDE
:-P
>
> Cheers,
> Rob.
attached mail follows:
On Tue, Apr 8, 2008 at 10:56 AM, Jochem Maas <jochem
iamjochem.com> wrote:
> Robert Cummings schreef:
>
> > On Tue, 2008-04-08 at 07:21 +0200, Nitsan Bin-Nun wrote:
> >
> > > Hi,
> > > I'm working with serveral PHP editors, each has it own restrictions.
> > > So umm, What editors do you recommend and what special functions and
> > > dis/adventages they have (maybe im overkilling my own back).
> > >
> >
> > This comes up almost once a week. Read the archives.
> >
>
> indeed, although the proper answer never comes up. the proper answer is
> ofcourse 'me' - as in I'm a highly recommended php editor - I have
> integrated
> code generation and refactoring functionality that is lightyears ahead of
> any IDE
>
> :-P
Perhaps, but I'm sure I can't afford the license -- especially the
multi-user version! :-)
Andrew
attached mail follows:
On Tue, Apr 8, 2008 at 10:56 AM, Jochem Maas <jochem
iamjochem.com> wrote:
> Robert Cummings schreef:
> >
> > This comes up almost once a week. Read the archives.
> >
>
> indeed, although the proper answer never comes up. the proper answer is
> ofcourse 'me' - as in I'm a highly recommended php editor - I have
> integrated
> code generation and refactoring functionality that is lightyears ahead of
> any IDE
>
> :-P
Welcome back, there, stranger!
--
</Daniel P. Brown>
Ask me about:
Dedicated servers starting
$59.99/mo., VPS starting
$19.99/mo.,
and shared hosting starting
$2.50/mo.
Unmanaged, managed, and fully-managed!
attached mail follows:
On Tue, 2008-04-08 at 11:02 -0400, Andrew Ballard wrote:
> On Tue, Apr 8, 2008 at 10:56 AM, Jochem Maas <jochem
iamjochem.com> wrote:
> > Robert Cummings schreef:
> >
> > > On Tue, 2008-04-08 at 07:21 +0200, Nitsan Bin-Nun wrote:
> > >
> > > > Hi,
> > > > I'm working with serveral PHP editors, each has it own restrictions.
> > > > So umm, What editors do you recommend and what special functions and
> > > > dis/adventages they have (maybe im overkilling my own back).
> > > >
> > >
> > > This comes up almost once a week. Read the archives.
> > >
> >
> > indeed, although the proper answer never comes up. the proper answer is
> > ofcourse 'me' - as in I'm a highly recommended php editor - I have
> > integrated
> > code generation and refactoring functionality that is lightyears ahead of
> > any IDE
> >
> > :-P
>
> Perhaps, but I'm sure I can't afford the license -- especially the
> multi-user version! :-)
Have you tried it out? Worst user friendliness EVER!
;)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
attached mail follows:
On Apr 8, 2008, at 11:02 AM, Andrew Ballard wrote:
> On Tue, Apr 8, 2008 at 10:56 AM, Jochem Maas <jochem
iamjochem.com>
> wrote:
>> Robert Cummings schreef:
>>
>>> On Tue, 2008-04-08 at 07:21 +0200, Nitsan Bin-Nun wrote:
>>>
>>>> Hi,
>>>> I'm working with serveral PHP editors, each has it own
>>>> restrictions.
>>>> So umm, What editors do you recommend and what special functions
>>>> and
>>>> dis/adventages they have (maybe im overkilling my own back).
>>>>
>>>
>>> This comes up almost once a week. Read the archives.
>>>
>>
>> indeed, although the proper answer never comes up. the proper
>> answer is
>> ofcourse 'me' - as in I'm a highly recommended php editor - I have
>> integrated
>> code generation and refactoring functionality that is lightyears
>> ahead of
>> any IDE
>>
>> :-P
>
> Perhaps, but I'm sure I can't afford the license -- especially the
> multi-user version! :-)
If you're going to license a multi-user version... I'd look into the
AI interface one of the list members was working on earlier...
Although I can't find the e-mail right now about it :)
>
>
> Andrew
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
japruim
raoset.com
attached mail follows:
On Tue, Apr 8, 2008 at 11:42 AM, Jason Pruim <japruim
raoset.com> wrote:
> On Apr 8, 2008, at 11:02 AM, Andrew Ballard wrote:
>
> > On Tue, Apr 8, 2008 at 10:56 AM, Jochem Maas <jochem
iamjochem.com> wrote:
> >
> > > indeed, although the proper answer never comes up. the proper answer is
> > > ofcourse 'me' - as in I'm a highly recommended php editor - I have
> > > integrated
> > > code generation and refactoring functionality that is lightyears ahead
> of
> > > any IDE
> > >
> > > :-P
> > >
> >
> > Perhaps, but I'm sure I can't afford the license -- especially the
> > multi-user version! :-)
> >
>
> If you're going to license a multi-user version... I'd look into the AI
> interface one of the list members was working on earlier... Although I can't
> find the e-mail right now about it :)
No thanks. I already have enough software installed on my computer
that tries to think for itself thanks go M$. I don't need anymore
artificial UN-intelligence.
Andrew
attached mail follows:
On Tue, Apr 8, 2008 at 11:46 AM, Andrew Ballard <aballard
gmail.com> wrote:
>
> No thanks. I already have enough software installed on my computer
> that tries to think for itself thanks go M$. I don't need anymore
> artificial UN-intelligence.
Why I'm A Linux User - Reason #3127: No God damned paperclip
telling me what to do.
--
</Daniel P. Brown>
Ask me about:
Dedicated servers starting
$59.99/mo., VPS starting
$19.99/mo.,
and shared hosting starting
$2.50/mo.
Unmanaged, managed, and fully-managed!
attached mail follows:
I appreciate the help guys. I don't understand what's going on. Here's
what I've tried since posting:
Copied over the PHP binaries and php.ini from my old server to my new one.
No luck.
Copied over the phpMyAdmin from my old server to my new one. No luck.
I've double-checked all permissions. Seriously, what else could there be?!
I repeat:
on old server, include('./file.inc.php') works FINE
on new server, include('./file.inc.php') BREAKS
I'm about to do a replace of "./" with "" but I know that's giving up!
""Daniel Brown"" <parasane
gmail.com> wrote in message
news:ab5568160804071010l3eff856evdc25409a4a46028a
mail.gmail.com...
> On Mon, Apr 7, 2008 at 1:05 PM, Lester Caine <lester
lsces.co.uk> wrote:
>>
>> People seem to be missing the point here. These are PUBLIC applications
>> that are failing to work for Noah. He should not need to re-write
>> PHPMyAdmin
>> in order to get it to work?
>>
>> Next people will be saying that we should re-write PHP if it does not
>> work
>> for us.
>
> Oh, did I say that? Must not have been paying attention as I
> typed in words to that effect. Sorry.
>
> I'm giving steps to debug and recreate the issue, not to rewrite
> anyone else's code. You may have noticed where I mentioned
> cross-platform portability.
>
> --
> </Daniel P. Brown>
> Ask me about:
> Dedicated servers starting
$59.99/mo., VPS starting
$19.99/mo.,
> and shared hosting starting
$2.50/mo.
> Unmanaged, managed, and fully-managed!
attached mail follows:
---- Arno Kuhl <akuhl
telkomsa.net> wrote:
> I know popup windows are a client-side issue, but I can't figure how
> to create and close a popup window from the server side only on
> condition, otherwise display normal browser page.
>
> What I want is to accept a form, check the input, if there are errors
> return them to the browser, if there aren't errors then popup a modal
> window and start processing (a possibly long process) while displaying
> results in the popup window, then automatically close the popup after
> processing is complete and redirect to normal browser page with the
> final results. I want to use the popup to (a) feedback ongoing
> progress to the user, and (b) keep the browser side alive because the
process could take several minutes.
>
> Googling for +php +popup is getting me nowhere, all the results are
> for javascript. I know how to create a link or button that when
> clicked will create a popup that will display the results of a php
> script, but I need to do it the other way round. Can anyone please
> suggest some pointers on how to generate a conditional popup from the
> server, and then get the server to close it when done.
>
> Thanks
> Arno
That's because it is a CLIENT side issue, the server isn't able to do it.
If you want to provide feedback on the form, then look into Ajax or use
output buffering and flushing to push out a status message as the form is
processed. You could do this in a javascripted pop-up window or on the
window they submitted the form.
If it takes your script minutes to process a form you need to look into
your processes. I'd suggest verifying the form had all the pieces and then
advising them you will email them when the registration or what-not is
complete.
HTH,
Wolf
===============================
I fully understand this is a client side issue, but figured there may be a
way for the server to drive it using smoke and mirrors. For instance if the
input is ok I thought of redisplaying the completed form with an onload to
popup a modal window, then output progress to the window until the process
was finished, then send something to the window to close itself. But after
that I get stuck because I don't know how to make the underlying browser
page request the final results from the server, or have some way for the php
script to push the results to the page without a request. Or maybe it's all
javascript, with the browser page waiting for the window to close before
requesting the results? (though I see some timing issues with that solution,
unless I create a temp results page waiting for the browser's request). Has
anyone on the list done anything like this, or have any pointers, examples
or ideas? (BTW Wolf's suggestion of sending the results via email is not an
option in this case)
Thanks
Arno
attached mail follows:
Just a customer of mine who said that he'll be running PHP 4 and 5 on the
same server, and that he would share session data ;-)
Bye.
Julien.P
2008/4/7 Richard Heyes <richardh
phpguru.org>:
> Have you seen how PHP makes difference between private, protected and
> > public
> > attributes of an object, into the session file ?
> > There are special caracters before them to recognize them.
> >
> > So the question is : is PHP4 able to read such a session file ?
> > And how will it interpret them when we ask him to unserialize data ?
> >
>
> The question(s) should be "Why would you want PHP4 to read a PHP5
> session?" and "Why would you expect it to work?". If you want to transfer
> data between versions you may want to investigate XMLRPC. Or perhaps the
> somewhat more verbose SOAP.
>
> --
> Richard Heyes
> Employ me:
> http://www.phpguru.org/cv
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hey everyone,
A bit of a puzzle here, dont know if this is a JS problem or PHP or FF or .... just me.
(My money is on the last one :p )
Here's what I am trying to do:
In a form I have a listbox with the values 1-5, and under the listbox i have a <TD> with the id of "recips" (like so: <TD id='recips">
I have a onChange event linked to the list box and depending on what number the client picks it should dynamically put the number of text boxes there, here is the JS code:
///// ############### Start JS code ############
function change_no_of_recipients()
{
var nr=document.mainform.no_of_friends.options[document.mainform.no_of_friends.selectedIndex].value;
if(nr>5){nr=5;} // max number of recipients
var msg = "";
for (var x = 1; x <= nr; x++)
{
msg += '<table width="50%" border="0" cellspacing="2" cellpadding="2">' +
'<tr>' +
'<td nowrap="nowrap">'+ x +'. Recipient\'s name:</td>' +
'<td><input type="text" name="rec_name[]" id="rec_name[]" /></td>' +
'<td nowrap="nowrap">Recipient\'s email:</td>' +
'<td><input type="text" name="rec_email[]" id="rec_email[]" /></td>' +
'</tr>' +
'<tr>' +
'</table>';
}
document.getElementById('recips').innerHTML=msg;
}
///// ##################### End JS code ################
So far on the page everything is working, but when I click the submit button this is my PHP processing script:
<?php
print_r($_REQUEST);
?>
It shows me everything that has been submitted but NOT any of the above dynamically made boxes values... but get this, it DOES show me all values... in IE7 _not_ in FF (am using 2.0.0.13)
Anybody else face anything like this?
Is this a bug in FF? Is $_REQUEST wrong to catch this?
Dont know what the
#$
to do... ANY help even a link to a site which can shed a little light would be appreciated.
Thanks in advance.
/Ryan
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
attached mail follows:
Ryan S wrote:
> Hey everyone,
>
> A bit of a puzzle here, dont know if this is a JS problem or PHP or FF or .... just me.
>
> (My money is on the last one :p )
>
>
> Here's what I am trying to do:
> In a form I have a listbox with the values 1-5, and under the listbox i have a <TD> with the id of "recips" (like so: <TD id='recips">
>
> I have a onChange event linked to the list box and depending on what number the client picks it should dynamically put the number of text boxes there, here is the JS code:
>
> ///// ############### Start JS code ############
> function change_no_of_recipients()
> {
> var nr=document.mainform.no_of_friends.options[document.mainform.no_of_friends.selectedIndex].value;
>
> if(nr>5){nr=5;} // max number of recipients
> var msg = "";
>
> for (var x = 1; x <= nr; x++)
> {
> msg += '<table width="50%" border="0" cellspacing="2" cellpadding="2">' +
> '<tr>' +
> '<td nowrap="nowrap">'+ x +'. Recipient\'s name:</td>' +
> '<td><input type="text" name="rec_name[]" id="rec_name[]" /></td>' +
> '<td nowrap="nowrap">Recipient\'s email:</td>' +
> '<td><input type="text" name="rec_email[]" id="rec_email[]" /></td>' +
> '</tr>' +
> '<tr>' +
> '</table>';
> }
>
> document.getElementById('recips').innerHTML=msg;
> }
>
> ///// ##################### End JS code ################
>
> So far on the page everything is working, but when I click the submit button this is my PHP processing script:
>
> <?php
> print_r($_REQUEST);
> ?>
>
>
> It shows me everything that has been submitted but NOT any of the above dynamically made boxes values... but get this, it DOES show me all values... in IE7 _not_ in FF (am using 2.0.0.13)
>
> Anybody else face anything like this?
> Is this a bug in FF? Is $_REQUEST wrong to catch this?
> Dont know what the
#$
to do... ANY help even a link to a site which can shed a little light would be appreciated.
>
> Thanks in advance.
>
> /Ryan
>
Hi Ryan,
Since I'm relatively new to PHP I could be off on this, but I'd say yes,
$_REQUEST is wrong. I would think you'd want to use $_POST to receive
the incoming values from a form.
--
Mark
-------------------------
the rule of law is good, however the rule of tyrants just plain sucks!
Real Tax Reform begins with getting rid of the IRS.
==============================================
Powered by CentOS5 (RHEL5)
attached mail follows:
On Tue, Apr 8, 2008 at 9:30 AM, Mark Weaver <mdw1982
mdw1982.com> wrote:
> Ryan S wrote:
>
> > Hey everyone,
> >
> > A bit of a puzzle here, dont know if this is a JS problem or PHP or FF or
> .... just me.
> >
> > (My money is on the last one :p )
> >
> >
> > Here's what I am trying to do:
> > In a form I have a listbox with the values 1-5, and under the listbox i
> have a <TD> with the id of "recips" (like so: <TD id='recips">
> >
> > I have a onChange event linked to the list box and depending on what
> number the client picks it should dynamically put the number of text boxes
> there, here is the JS code:
> >
> > ///// ############### Start JS code ############
> > function change_no_of_recipients()
> > {
> > var
> nr=document.mainform.no_of_friends.options[document.mainform.no_of_friends.selectedIndex].value;
> > if(nr>5){nr=5;} // max number of recipients
> > var msg = "";
> >
> > for (var x = 1; x <= nr; x++)
> > {
> > msg += '<table width="50%" border="0" cellspacing="2" cellpadding="2">'
> +
> > '<tr>' +
> > '<td nowrap="nowrap">'+ x +'. Recipient\'s name:</td>' +
> > '<td><input type="text" name="rec_name[]" id="rec_name[]" /></td>' +
> > '<td nowrap="nowrap">Recipient\'s email:</td>' +
> > '<td><input type="text" name="rec_email[]" id="rec_email[]" /></td>' +
> > '</tr>' +
> > '<tr>' +
> > '</table>';
> > }
> > document.getElementById('recips').innerHTML=msg;
> > }
> >
> > ///// ##################### End JS code ################
> >
> > So far on the page everything is working, but when I click the submit
> button this is my PHP processing script:
> >
> > <?php
> > print_r($_REQUEST);
> > ?>
> >
> >
> > It shows me everything that has been submitted but NOT any of the above
> dynamically made boxes values... but get this, it DOES show me all values...
> in IE7 _not_ in FF (am using 2.0.0.13)
> >
> > Anybody else face anything like this?
> > Is this a bug in FF? Is $_REQUEST wrong to catch this? Dont know what the
>
#$
to do... ANY help even a link to a site which can shed a little light
> would be appreciated.
> >
> > Thanks in advance.
> >
> > /Ryan
> >
> >
>
> Hi Ryan,
>
> Since I'm relatively new to PHP I could be off on this, but I'd say yes,
> $_REQUEST is wrong. I would think you'd want to use $_POST to receive the
> incoming values from a form.
>
> --
>
> Mark
I think in this case $_REQUEST and $_POST should both get you what you
want. I'm wondering whether your javascript is inserting the form
fields within the correct <FORM></FORM> tags.
Also, FWIW, I doubt it has anything to do with your problem but you
are assigning the same value for ID each time through the loop. The ID
attribute is supposed to be unique for each element on the page.
Andrew
attached mail follows:
Mark Weaver wrote:
> Ryan S wrote:
>> Hey everyone,
>>
>> A bit of a puzzle here, dont know if this is a JS problem or PHP or FF
>> or .... just me.
>>
>> (My money is on the last one :p )
>>
>>
>> Here's what I am trying to do:
>> In a form I have a listbox with the values 1-5, and under the listbox
>> i have a <TD> with the id of "recips" (like so: <TD id='recips">
>>
>> I have a onChange event linked to the list box and depending on what
>> number the client picks it should dynamically put the number of text
>> boxes there, here is the JS code:
>>
>> ///// ############### Start JS code ############
>> function change_no_of_recipients()
>> {
>> var
>> nr=document.mainform.no_of_friends.options[document.mainform.no_of_friends.selectedIndex].value;
>>
>> if(nr>5){nr=5;} // max number of recipients
>> var msg = "";
>>
>> for (var x = 1; x <= nr; x++)
>> {
>> msg += '<table width="50%" border="0" cellspacing="2"
>> cellpadding="2">' +
>> '<tr>' +
>> '<td nowrap="nowrap">'+ x +'. Recipient\'s name:</td>' +
>> '<td><input type="text" name="rec_name[]" id="rec_name[]" /></td>' +
>> '<td nowrap="nowrap">Recipient\'s email:</td>' +
>> '<td><input type="text" name="rec_email[]" id="rec_email[]"
>> /></td>' +
>> '</tr>' +
>> '<tr>' +
>> '</table>';
>> }
>> document.getElementById('recips').innerHTML=msg;
>> }
>>
>> ///// ##################### End JS code ################
>>
>> So far on the page everything is working, but when I click the submit
>> button this is my PHP processing script:
>>
>> <?php
>> print_r($_REQUEST);
>> ?>
>>
>>
>> It shows me everything that has been submitted but NOT any of the
>> above dynamically made boxes values... but get this, it DOES show me
>> all values... in IE7 _not_ in FF (am using 2.0.0.13)
>>
>> Anybody else face anything like this?
>> Is this a bug in FF? Is $_REQUEST wrong to catch this? Dont know what
>> the
#$
to do... ANY help even a link to a site which can shed a
>> little light would be appreciated.
>>
>> Thanks in advance.
>>
>> /Ryan
>>
>
> Hi Ryan,
>
> Since I'm relatively new to PHP I could be off on this, but I'd say yes,
> $_REQUEST is wrong. I would think you'd want to use $_POST to receive
> the incoming values from a form.
>
That would depend on the method that the form is using: GET or POST.
I don't think that's the answer.
Two things I would suggest:
1. Check that the Javascript is doing what you expect: you *are* using Firebug
on Firefox, aren't you? Also the WebDeveloper toolbar plugin is useful - it has
a View Generated Source tool which will show you what Firefox thinks your page
actually looks like after the JS has run...
2. Check that the TD you are loading with content is actually inside the <FORM>
tags - otherwise the inputs won't be included in the request/post variables...
Cheers
Pete
--
Peter Ford phone: 01580 893333
Developer fax: 01580 893399
Justcroft International Ltd., Staplehurst, Kent
attached mail follows:
On Tue, Apr 8, 2008 at 6:17 AM, Ryan S <genphp
yahoo.com> wrote:
> Hey everyone,
>
> A bit of a puzzle here, dont know if this is a JS problem or PHP or FF or .... just me.
>
> (My money is on the last one :p )
[snip!]
Ryan, would it be possible for you to send an actual link to the
page in question? You'll probably wind up with some better feedback
with a real-world test in this particular case.
--
</Daniel P. Brown>
Ask me about:
Dedicated servers starting
$59.99/mo., VPS starting
$19.99/mo.,
and shared hosting starting
$2.50/mo.
Unmanaged, managed, and fully-managed!
attached mail follows:
The humble tilde (~). I came across it the other day in some PHP code
[code]~E_ERROR[/code]
I'm curious, can't find any documentation on it. In math it refers to
propostional logic, is it the same thing in PHP ?
attached mail follows:
On Tue, Apr 8, 2008 at 6:19 AM, Tony Collings <tony
tonycollings.com> wrote:
> The humble tilde (~). I came across it the other day in some PHP code
> [code]~E_ERROR[/code]
That comes from C, not postpositional math. It's bitwise negation.
That is, the number 47 in binary is 110001, with leading 0's out to
whatever the word size is, usually 32
or 64 bits. The ~ flips the bits, so on a 32-bit system ~47 is binary
11111111111111111111111111001110, which is -48 if you treat it as a
signed value and
429496248 as unsigned.
The tilde is most often seen in the company of flag values, where each bit
represents an option that is on or off. Typically, you have a bunch
of constants
defined as the individual bit values, like say E_DEBUG. Then ~E_DEBUG
means "turn on everything except E_DEBUG". Often used with bitwise
AND (&) as a mask to turn a particular bit off, as in <?php $flags &=
~E_DEBUG ?> which turns off
E_DEBUG while leaving the other bits in $flag unchanged.
--
Mark J. Reed <markjreed
mail.com>
attached mail follows:
Ah! excellent. Thanks for that.
-------------------------------------------------------------
e. tony
tonycollings.com
w. www.tonycollings.com
skype. supert3d
United States of America
t. 1-203-599-1604
m. 1-203-788-7787
United Kingdom
t. 020 8144 2453
m. 07763803980
-----Original Message-----
From: markjreed
gmail.com [mailto:markjreed
gmail.com] On Behalf Of
"Mark J. Reed"
Posted At: 08 April 2008 08:50
Posted To: php.general
Conversation: Could someone tell me what a tilde(~) in PHP does ?
Subject: Re: [PHP] Could someone tell me what a tilde(~) in PHP does ?
On Tue, Apr 8, 2008 at 6:19 AM, Tony Collings <tony
tonycollings.com>
wrote:
> The humble tilde (~). I came across it the other day in some PHP code
> [code]~E_ERROR[/code]
That comes from C, not postpositional math. It's bitwise negation.
That is, the number 47 in binary is 110001, with leading 0's out to
whatever the word size is, usually 32
or 64 bits. The ~ flips the bits, so on a 32-bit system ~47 is binary
11111111111111111111111111001110, which is -48 if you treat it as a
signed value and
429496248 as unsigned.
The tilde is most often seen in the company of flag values, where each
bit
represents an option that is on or off. Typically, you have a bunch
of constants
defined as the individual bit values, like say E_DEBUG. Then ~E_DEBUG
means "turn on everything except E_DEBUG". Often used with bitwise
AND (&) as a mask to turn a particular bit off, as in <?php $flags &=
~E_DEBUG ?> which turns off
E_DEBUG while leaving the other bits in $flag unchanged.
--
Mark J. Reed <markjreed
mail.com>
attached mail follows:
On Tue, Apr 8, 2008 at 8:50 AM, Mark J. Reed <markjreed
mail.com> wrote:
> That is, the number 47 in binary is 110001,
"
... or 101111, if you want to be technical. 110001 is 49. :)
"The important thing is to understand what you're doing, rather than
to get the right answer." --Tom Lehrer
--
Mark J. Reed <markjreed
mail.com>
attached mail follows:
The humble tilde (~). I came across it the other day in some PHP code
[code]~E_ERROR[/code]
I'm curious, can't find any documentation on it. In math it refers to
propostional logic, is it the same thing in PHP ?
attached mail follows:
> The humble tilde (~). I came across it the other day in some PHP code
> [code]~E_ERROR[/code]
>
> I'm curious, can't find any documentation on it. In math it refers to
> propostional logic, is it the same thing in PHP ?
~ $a Not Bits that are set in $a are not set, and vice versa.
http://hu.php.net/manual/en/language.operators.bitwise.php
greets,
Zoltán Németh
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
2008/4/8 Németh Zoltán <znemeth
alterationx.hu>:
> > The humble tilde (~). I came across it the other day in some PHP code
> > [code]~E_ERROR[/code]
> >
> > I'm curious, can't find any documentation on it. In math it refers to
> > propostional logic, is it the same thing in PHP ?
>
> ~ $a Not Bits that are set in $a are not set, and vice versa.
>
> http://hu.php.net/manual/en/language.operators.bitwise.php
>
> greets,
> Zoltán Németh
You are right, of course, but it is a good question of how one who is
totally unfamiliar with bitwise syntax in any language might ever find
that. For people learning the language, it's not like they can type a
tilde character into the documenation search and get results. Same for
the other operators. I suppose if one thinks to search for the word
'operators', one would get there eventually.
I remember how thrown I was years ago when I first tried ^ in PHP,
having first learned good ol' MS-DOS BASICA years ago, and thinking
that I was raising x to the power of y. :-)
Andrew
PS - For kicks, I just searched for the word 'tilde' and it returned
the delete() function. :-O
attached mail follows:
>
>> In index.php rather than declaring vars like so...
>>
>> $var = 'value';
>>
>> ...declare them in the $GLOBALS array like so...
>>
>> $GLOBALS['var'] = 'value';
>>
>> $var is then in the global scope regardless of where it was set.
>>
>> -Stut
>>
>
> That would work. However I'm looking for a more generic solution,
> independent of the system that is being included. So basically I want to
> be able to include a file in my function while stepping out of the
> context of the function itself.
>
> E
put all those variables in a singleton.
then just use MyGlobals::getInstance()->myvar all over the place and you
can do whatever you want with them. of course don't forget to include the
class definition everywhere you want to use it
greets,
Zoltán Németh
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi all,
I have the following SQL statement;
SELECT count( salesID ) AS count, branch_name, company_name, branch.branchID
FROM sales
LEFT JOIN IGuser ON sales.IGuid = IGuser.IGuid
LEFT JOIN branch ON IGuser.branchID = branch.branchID
LEFT JOIN company ON branch.companyID = '{$companyID}'
WHERE maincompanyid = '{$mcid}'
GROUP BY branch.branchID
ORDER BY branch_name ASC
However, i do not want those join records to be appended, only to return the count of records from sales.
Can someone assist me with this? I have tried differance variants of joins and none of the results are correct.
Sales tbl doesnt have the companyID, nor does IGuser
Regards,
Steven
attached mail follows:
On Tue, Apr 8, 2008 at 7:28 AM, Steven Macintyre
<steven
steven.macintyre.name> wrote:
> Hi all,
>
> I have the following SQL statement;
>
> SELECT count( salesID ) AS count, branch_name, company_name, branch.branchID
> FROM sales
> LEFT JOIN IGuser ON sales.IGuid = IGuser.IGuid
> LEFT JOIN branch ON IGuser.branchID = branch.branchID
> LEFT JOIN company ON branch.companyID = '{$companyID}'
> WHERE maincompanyid = '{$mcid}'
> GROUP BY branch.branchID
> ORDER BY branch_name ASC
>
> However, i do not want those join records to be appended, only to return the count of records from sales.
>
> Can someone assist me with this? I have tried differance variants of joins and none of the results are correct.
>
> Sales tbl doesnt have the companyID, nor does IGuser
>
> Regards,
>
> Steven
A couple things:
1) Are you looking for COUNT(DISTINCT salesID) rather than COUNT(salesID)?
2) Change your group clause to this: GROUP BY branch.branchID,
branch_name, company name
MySQL is pretty forgiving and will let you include fields in the
SELECT that are neither aggregated nor grouped, but it's bad practice.
Beyond that, a clearer explanation of what you expect to see in the
results would help a lot in building the query to get those results.
Andrew
attached mail follows:
On Tue, Apr 8, 2008 at 7:28 AM, Steven Macintyre
<steven
steven.macintyre.name> wrote:
> Hi all,
>
> I have the following SQL statement;
>
> SELECT count( salesID ) AS count, branch_name, company_name, branch.branchID
> FROM sales
> LEFT JOIN IGuser ON sales.IGuid = IGuser.IGuid
> LEFT JOIN branch ON IGuser.branchID = branch.branchID
> LEFT JOIN company ON branch.companyID = '{$companyID}'
> WHERE maincompanyid = '{$mcid}'
> GROUP BY branch.branchID
> ORDER BY branch_name ASC
>
> However, i do not want those join records to be appended, only to return the count of records from sales.
>
> Can someone assist me with this? I have tried differance variants of joins and none of the results are correct.
>
> Sales tbl doesnt have the companyID, nor does IGuser
Steven,
Since this isn't a PHP-specific question, you'll probably receive
better responses on either the MySQL list (you didn't mention which
database system you're using, but I'll blindly and ignorantly assume
that's it), or at least the PHP-DB list. I'm CC'ing both of those for
you.
--
</Daniel P. Brown>
Ask me about:
Dedicated servers starting
$59.99/mo., VPS starting
$19.99/mo.,
and shared hosting starting
$2.50/mo.
Unmanaged, managed, and fully-managed!
attached mail follows:
---- Steven Macintyre <steven
steven.macintyre.name> wrote:
> Hi all,
>
> I have the following SQL statement;
>
> SELECT count( salesID ) AS count, branch_name, company_name, branch.branchID
> FROM sales
> LEFT JOIN IGuser ON sales.IGuid = IGuser.IGuid
> LEFT JOIN branch ON IGuser.branchID = branch.branchID
> LEFT JOIN company ON branch.companyID = '{$companyID}'
> WHERE maincompanyid = '{$mcid}'
> GROUP BY branch.branchID
> ORDER BY branch_name ASC
>
> However, i do not want those join records to be appended, only to return the count of records from sales.
>
> Can someone assist me with this? I have tried differance variants of joins and none of the results are correct.
>
> Sales tbl doesnt have the companyID, nor does IGuser
>
> Regards,
>
> Steven
Joins don't exist in PHP. You probably mean an SQL list to talk with depending on your database taste.
Now, if you had some PHP code that was messing up, I'm all for checking it out and seeing if I can lend a hand ferreting out the issue.
Wolf
attached mail follows:
Hi,
I was wondering if anyone has set up SSO using googles api for apps.
http://code.google.com/apis/apps/sso/saml_reference_implementation.html
is their implementation guide but I was wondering if anyone has done
it, and if I could have a peak at the code you used, mainly for the
encrypting of the information being sent, also for the generation of
the xml.
I have done some googling and can find a few java implementaions, but
no php ones - maybe I cant search so if there are some examples around
please excuse my ignorance.
Thanks in advance,
Ian
attached mail follows:
De: Keith Roberts [mailto:keith
karsites.net]
>> Another question:
>>
>> Is there a way to make php use these fields [hidden sessid] instead of
cookies for
>> session control? I still want to let cookies enabled for other stuff,
>> but as it's messing up with multiple sessions because of poor cookie
>> handling.
>>
>As the browser cookies use a different mechanism for storing
>and retrieving cookies independently of PHP, I cannot see how
>browser cookies can be clashing with your PHP session_id cookies.
The problem I run into sometimes is:
A user opens a IE instance and logs in. The same user, on the same PC, opens
a new instance (not from "Open in new window..." but from iexplore.exe) and
logs in again.
Then he has two independent sessions until the data from both sessions get
mixed up, showing data from one session in another. I can't think of any
other problem but erroneous session_ids being sent.
> If you use a pre-built PHP application that also uses PHP
> session_id's, then that can cause a problem with your own
> website if that also wants to use PHP session_id cookies.
This is the only PHP app running, there are two more that sometimes run but
they're JSPs.
>I guess the obvious way would for PHP session_id's to allow
>multiple session_id_name(s), so each PHP application can choose
>it's own session_id to be know by. This would also imply that
>PHP has the capability to pass those multiple session_id's
>between the respective PHP applications that are running side
>by side on the same website. Maybe this is in the pipeline for
>a future release of PHP, or has it already been implemented?
Not sure what you mean, but I already can use two sessions for a while.
Perhaps I'm not getting through the language barrier, but I did not
understand you. :/
Thanks!
attached mail follows:
Hi
I have written a new component that can be included in your form, and allows
the user to search a data source by entering the search term(s) and using
Ajax to return a list of results in a dropdown control, from which the user
can select the desired item. It uses the prototype JavaScript library, which
you need to get from their website. You can view a demo and download the
source at: http://jeremywebdeveloper.co.za/code/ajaxsearch/
--
Jeremy O'Connor
attached mail follows:
[snip]
I have written a new component that can be included in your form, and
allows
the user to search a data source by entering the search term(s) and
using
Ajax to return a list of results in a dropdown control, from which the
user
can select the desired item. It uses the prototype JavaScript library,
which
you need to get from their website. You can view a demo and download the
source at: http://jeremywebdeveloper.co.za/code/ajaxsearch/
[/snip]
Cool...I'd have the 'submit' button hidden until results were returned
so as to avoid user confusion.
attached mail follows:
Hi folks - Newbie Question here...
I'm using php with filemaker and api from http://fmwebschool.com I am asking
them also for help (nothing yet) - but I thought that here would also be a
great place to ask:
Thread listed here for easier reading...
http://fmwebschool.com/frm/index.php?topic=2234.0
---
Start with question:
*Q: Can someone show me how to solve the endless loop problem that Only
Happens : *if you type a BAD LOGIN and it asks you to do it again - and then
you do a successful login*
---
Sorry for this verbose thread...
My Login Setup:
Normally: FMWS login is set so after a successful login - you will go to the
page you started from (that needed a login).....
Currently I have things set so: after a login - before it goes to the page
you started from - ** it will first go to VARS.PHP and set some session
variables *** - then go to the final destination....
*PROBLEM: Somehow it all works - EXCEPT if you type a BAD LOGIN and it asks
you to do it again - and then user types a successful login then:
*It gets STUCK in an *Endless Loop* and the browser says:
Too many redirects occurred trying to open ³http://127.0.0.1/nm/vars.php².
This might occur if you open a page that is redirected to open another page
which then is redirected to open the original page.
I'm still confused by this issue...
*Q: Can someone show me how to solve the endless loop problem that Only
Happens : *if you type a BAD LOGIN and it asks you to do it again - and then
you do a successful login*
1 ==========MY LOGIN PAGE:
<?php
$_SESSION['login_from'] = 'client.php';
require_once('FileMaker/FMStudio_Tools.php');
if(!session_id()) session_start();
if( isset($_SESSION['login_from']) && $_SESSION['login_from'] != 'vars.php'
) {
$_SESSION['orig_login_from'] = $_SESSION['login_from'];
}else{
//$_SESSION['orig_login_from'] = 'client.php';
}
$_SESSION['login_from'] = 'vars.php';
$_GET["errorMsg"] = fmsPerformLogin();
// FMStudio v1.0 - do not remove comment, needed for DreamWeaver support ?>
ALSO set like FMWS basic login - it goes to itself:
<form id="login_form" name="login_form" method="post" action="">
etc..........
2 =========== MY VARS.PHP PAGE
... code.... set some variables....
<?php
if(!session_id()) session_start();
if($_SESSION['orig_login_from'] != "vars.php")
{ fmsRedirect($_SESSION['orig_login_from']);}
else
{ fmsRedirect('client.php');}
?>
3 =============FMStudio_Tools.php... (UNTOUCHED BY ME)
function fmsPerformLogin() {
if(!session_id()) session_start();
fmsCheckLogout();
if(isset($_POST['login_user'])) {
$user = fmsPOST('login_user');
$pass = fmsPOST('login_pass');
if($user == '' || $pass == '') return 'User Name or Password cannot be
blank';
$conn = $_SESSION['login_conn'];
if(isset($_SESSION['login_from']) && $_SESSION['login_from'] != '') {
$from = $_SESSION['login_from'];
}else if(isset($_POST['defaultURL']) && $_POST['defaultURL'] != '') {
$from = $_POST['defaultURL'];
}else{
$from = 'index.php';
}
if(isset($_SESSION['login_type']) && $_SESSION['login_type'] ==
'table') {
$_SESSION[$conn.'_tableLogin'] =
array('user'=>$user,'pass'=>$pass,'first'=>true);
}else{
$_SESSION[$conn.'_login'] =
array('user'=>$user,'pass'=>$pass,'first'=>true);
}
session_write_close();
header('Location: '.$from);
exit();
}
if(isset($_GET["errorMsg"]) && $_GET["errorMsg"] != '') {
return $_GET["errorMsg"];
}else{
return '';
}
}
--
Thanks - RevDave
Cool
hosting4days . com
[db-lists]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]