|
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: Mon Apr 21 2008 - 13:45:36 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 21 Apr 2008 18:45:36 -0000 Issue 5417
Topics (messages 273341 through 273368):
Re: AJAX and PHP
273341 by: Thijs Lensselink
273342 by: Alain Roger
273343 by: Thijs Lensselink
273344 by: Alain Roger
273345 by: Thijs Lensselink
273347 by: Nitsan Bin-Nun
mime_content_type and FileInfo
273346 by: Paul Scott
Re: Check RAW data
273348 by: Nitsan Bin-Nun
Re: function returns no value
273349 by: Ali Reza Sajedi
273350 by: Thijs Lensselink
273351 by: Ali Reza Sajedi
Security Concern?
273352 by: Jason Pruim
273356 by: Philip Thompson
Re: PHP Serialization Performance
273353 by: Waynn Lue
Cannot modify header information - headers already sent by ...
273354 by: Waynn Lue
273355 by: Daniel Brown
273357 by: paragasu
273358 by: mike
273359 by: Waynn Lue
273360 by: Waynn Lue
273365 by: Jim Lucas
Dear php-general
lists.php.net April 84% 0FF
273361 by: php-general.lists.php.net
Membership Management
273362 by: Jason Pruim
273366 by: Ken Kixmoeller.com
Denver PHP opportunity - Senior Software Engineers
273363 by: Nick Gasparro
273364 by: Richard Heyes
273367 by: Nick Gasparro
273368 by: David Giragosian
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:
Quoting Alain Roger <raf.news
gmail.com>:
> Hi,
>
> i'm playing around with AJAX and PHP to create something like a "small
> desktop" application.
> basically the first step is to log in the system.
> for that i have a log-in form where users can choose the interface language.
>
> here is my problem :
> when the log-in form runs, it is in English. user can click on some arrow to
> open another DIV and display all other languages available.
> a click on a particular flag, will call the PHP page where the log-in form
> (login field + password field) are stored with dynamic language interface.
>
> however, i make no sense for the title of this form to call a PHP page where
> will be just 1 dynamic text (changing on flag choice).
> so if you understand well, i have 2 divs (1 for form title, 1 for log-in
> form itself). and i load thanks AJAX php code into divs.
>
> my problem is that i do not want to write a PHP page just for 1 label... it
> makes sense for a complete form but not for a simple text line or label.
>
> So how can i do that without refreshing page. using AJAX and PHP only ?
> i guess you already faced such situation so i would really appreciate your
> help.
>
> thanks a lot,
>
> --
> Alain
Making an Ajax request for one little label maybe a bit overkill.
As i understand you request the whole form through an Ajax request.
And display this to the user? And every language generates a new form?
Why not just create the form dynamically with javascript and load the
data from PHP. So the form can stay the same for all calls. You just
fill it with data depending on the language selected. You can fill the
form for instance by sending a JSON encoded object from PHP to
javascript.
attached mail follows:
you understood right.
basically my problem is that the layout avoid it.
here is "something like" my layout :
<div#0>
<div#1>Lanague (label) : <img flag> <img arrow to show all languages from
div#2></div#1>
<div#2> all flags</div#2>
<div#3> login field + pwd field + submit button</div#3>
</div#0>
till now i only use AJAX to refresh the content of div#3
but it does not change the label from div#1 when user selects another
language from div#2.
if i place the whole form into a PHP i face several questions :
- how the ajax will reload this PHP page (reloading itself) in the parent
control div#0 ?
- when user will click on submit button, where will be loaded the content
return of checking if log+pwd are correct ?
- how to redirect to another PHP page, when user click on submit button ?
the redirection will happen only in the content div, so only in div#0 and
not into the browser :-(
Al.
On Mon, Apr 21, 2008 at 9:55 AM, Thijs Lensselink <dev
lenss.nl> wrote:
> Quoting Alain Roger <raf.news
gmail.com>:
>
> Hi,
> >
> > i'm playing around with AJAX and PHP to create something like a "small
> > desktop" application.
> > basically the first step is to log in the system.
> > for that i have a log-in form where users can choose the interface
> > language.
> >
> > here is my problem :
> > when the log-in form runs, it is in English. user can click on some
> > arrow to
> > open another DIV and display all other languages available.
> > a click on a particular flag, will call the PHP page where the log-in
> > form
> > (login field + password field) are stored with dynamic language
> > interface.
> >
> > however, i make no sense for the title of this form to call a PHP page
> > where
> > will be just 1 dynamic text (changing on flag choice).
> > so if you understand well, i have 2 divs (1 for form title, 1 for log-in
> > form itself). and i load thanks AJAX php code into divs.
> >
> > my problem is that i do not want to write a PHP page just for 1 label...
> > it
> > makes sense for a complete form but not for a simple text line or label.
> >
> > So how can i do that without refreshing page. using AJAX and PHP only ?
> > i guess you already faced such situation so i would really appreciate
> > your
> > help.
> >
> > thanks a lot,
> >
> > --
> > Alain
> >
>
> Making an Ajax request for one little label maybe a bit overkill.
> As i understand you request the whole form through an Ajax request. And
> display this to the user? And every language generates a new form?
>
> Why not just create the form dynamically with javascript and load the data
> from PHP. So the form can stay the same for all calls. You just fill it with
> data depending on the language selected. You can fill the form for instance
> by sending a JSON encoded object from PHP to javascript.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
attached mail follows:
Quoting Alain Roger <raf.news
gmail.com>:
> you understood right.
>
> basically my problem is that the layout avoid it.
> here is "something like" my layout :
>
> <div#0>
> <div#1>Lanague (label) : <img flag> <img arrow to show all languages from
> div#2></div#1>
> <div#2> all flags</div#2>
> <div#3> login field + pwd field + submit button</div#3>
> </div#0>
>
> till now i only use AJAX to refresh the content of div#3
> but it does not change the label from div#1 when user selects another
> language from div#2.
>
Well it looks like you need a extra Ajax call to the server.
Click a language flag sends a request to the server. The server
responds with an JSON object. Containing the content for <div#2>. With
javascript you can update the contents of <div#2>
> if i place the whole form into a PHP i face several questions :
> - how the ajax will reload this PHP page (reloading itself) in the parent
> control div#0 ?
If you would like to reload the whole of <div#0> You could send and
JSON object from PHP to javascript. And let javascript generate the
div structure and update the DOM.
> - when user will click on submit button, where will be loaded the content
> return of checking if log+pwd are correct ?
When a user logs in a Ajax request is send to the server. the server
responds with an JSON object containing the error message. With
javascript you could update the contents of <div#3> to display a
message.
> - how to redirect to another PHP page, when user click on submit button ?
> the redirection will happen only in the content div, so only in div#0 and
> not into the browser :-(
I have a hard time understanding this last issue. What exactly do you
mean by redirecting to another PHP page?
>
> Al.
>
> On Mon, Apr 21, 2008 at 9:55 AM, Thijs Lensselink <dev
lenss.nl> wrote:
>
>> Quoting Alain Roger <raf.news
gmail.com>:
>>
>> Hi,
>> >
>> > i'm playing around with AJAX and PHP to create something like a "small
>> > desktop" application.
>> > basically the first step is to log in the system.
>> > for that i have a log-in form where users can choose the interface
>> > language.
>> >
>> > here is my problem :
>> > when the log-in form runs, it is in English. user can click on some
>> > arrow to
>> > open another DIV and display all other languages available.
>> > a click on a particular flag, will call the PHP page where the log-in
>> > form
>> > (login field + password field) are stored with dynamic language
>> > interface.
>> >
>> > however, i make no sense for the title of this form to call a PHP page
>> > where
>> > will be just 1 dynamic text (changing on flag choice).
>> > so if you understand well, i have 2 divs (1 for form title, 1 for log-in
>> > form itself). and i load thanks AJAX php code into divs.
>> >
>> > my problem is that i do not want to write a PHP page just for 1 label...
>> > it
>> > makes sense for a complete form but not for a simple text line or label.
>> >
>> > So how can i do that without refreshing page. using AJAX and PHP only ?
>> > i guess you already faced such situation so i would really appreciate
>> > your
>> > help.
>> >
>> > thanks a lot,
>> >
>> > --
>> > Alain
>> >
>>
>> Making an Ajax request for one little label maybe a bit overkill.
>> As i understand you request the whole form through an Ajax request. And
>> display this to the user? And every language generates a new form?
>>
>> Why not just create the form dynamically with javascript and load the data
>> from PHP. So the form can stay the same for all calls. You just fill it with
>> data depending on the language selected. You can fill the form for instance
>> by sending a JSON encoded object from PHP to javascript.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> --
> Alain
> ------------------------------------
> Windows XP SP2
> PostgreSQL 8.2.4 / MS SQL server 2005
> Apache 2.2.4
> PHP 5.2.4
> C# 2005-2008
>
attached mail follows:
in fact i meant by redirecting the following thing :
- if user wrote a correct pwd and login, the system should redirect [using
header("Location .... ] syntax to launch the application.
but if i use such syntax it will be redirected only into the div#0, and not
in the browser itslef.
is it clearer now ?
On Mon, Apr 21, 2008 at 11:40 AM, Thijs Lensselink <dev
lenss.nl> wrote:
> Quoting Alain Roger <raf.news
gmail.com>:
>
> you understood right.
> >
> > basically my problem is that the layout avoid it.
> > here is "something like" my layout :
> >
> > <div#0>
> > <div#1>Lanague (label) : <img flag> <img arrow to show all languages
> > from
> > div#2></div#1>
> > <div#2> all flags</div#2>
> > <div#3> login field + pwd field + submit button</div#3>
> > </div#0>
> >
> > till now i only use AJAX to refresh the content of div#3
> > but it does not change the label from div#1 when user selects another
> > language from div#2.
> >
> >
> Well it looks like you need a extra Ajax call to the server.
>
> Click a language flag sends a request to the server. The server responds
> with an JSON object. Containing the content for <div#2>. With javascript you
> can update the contents of <div#2>
>
> if i place the whole form into a PHP i face several questions :
> > - how the ajax will reload this PHP page (reloading itself) in the
> > parent
> > control div#0 ?
> >
>
> If you would like to reload the whole of <div#0> You could send and JSON
> object from PHP to javascript. And let javascript generate the div structure
> and update the DOM.
>
> - when user will click on submit button, where will be loaded the content
> > return of checking if log+pwd are correct ?
> >
>
> When a user logs in a Ajax request is send to the server. the server
> responds with an JSON object containing the error message. With javascript
> you could update the contents of <div#3> to display a message.
>
> - how to redirect to another PHP page, when user click on submit button ?
> > the redirection will happen only in the content div, so only in div#0
> > and
> > not into the browser :-(
> >
>
> I have a hard time understanding this last issue. What exactly do you mean
> by redirecting to another PHP page?
>
>
>
> > Al.
> >
> > On Mon, Apr 21, 2008 at 9:55 AM, Thijs Lensselink <dev
lenss.nl> wrote:
> >
> > Quoting Alain Roger <raf.news
gmail.com>:
> > >
> > > Hi,
> > > >
> > > > i'm playing around with AJAX and PHP to create something like a
> > > "small
> > > > desktop" application.
> > > > basically the first step is to log in the system.
> > > > for that i have a log-in form where users can choose the interface
> > > > language.
> > > >
> > > > here is my problem :
> > > > when the log-in form runs, it is in English. user can click on some
> > > > arrow to
> > > > open another DIV and display all other languages available.
> > > > a click on a particular flag, will call the PHP page where the
> > > log-in
> > > > form
> > > > (login field + password field) are stored with dynamic language
> > > > interface.
> > > >
> > > > however, i make no sense for the title of this form to call a PHP
> > > page
> > > > where
> > > > will be just 1 dynamic text (changing on flag choice).
> > > > so if you understand well, i have 2 divs (1 for form title, 1 for
> > > log-in
> > > > form itself). and i load thanks AJAX php code into divs.
> > > >
> > > > my problem is that i do not want to write a PHP page just for 1
> > > label...
> > > > it
> > > > makes sense for a complete form but not for a simple text line or
> > > label.
> > > >
> > > > So how can i do that without refreshing page. using AJAX and PHP
> > > only ?
> > > > i guess you already faced such situation so i would really
> > > appreciate
> > > > your
> > > > help.
> > > >
> > > > thanks a lot,
> > > >
> > > > --
> > > > Alain
> > > >
> > >
> > > Making an Ajax request for one little label maybe a bit overkill.
> > > As i understand you request the whole form through an Ajax request.
> > > And
> > > display this to the user? And every language generates a new form?
> > >
> > > Why not just create the form dynamically with javascript and load the
> > > data
> > > from PHP. So the form can stay the same for all calls. You just fill
> > > it with
> > > data depending on the language selected. You can fill the form for
> > > instance
> > > by sending a JSON encoded object from PHP to javascript.
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
> >
> > --
> > Alain
> > ------------------------------------
> > Windows XP SP2
> > PostgreSQL 8.2.4 / MS SQL server 2005
> > Apache 2.2.4
> > PHP 5.2.4
> > C# 2005-2008
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
attached mail follows:
Quoting Alain Roger <raf.news
gmail.com>:
> in fact i meant by redirecting the following thing :
> - if user wrote a correct pwd and login, the system should redirect [using
> header("Location .... ] syntax to launch the application.
> but if i use such syntax it will be redirected only into the div#0, and not
> in the browser itslef.
>
> is it clearer now ?
It's crystal clear :)
I guess you could do it in two ways. Firstly without a redirect. You
could just use javascript and CSS to show some sort of error message.
Reload the form in the div. And give the user another try to login.
If you really want a reload. You have to do it with javascript. You
could let PHP send back a status to javascript. And based on that.
Either load a div with content. Or do a document.location = ''; Hope
it helps.
>
> On Mon, Apr 21, 2008 at 11:40 AM, Thijs Lensselink <dev
lenss.nl> wrote:
>
>> Quoting Alain Roger <raf.news
gmail.com>:
>>
>> you understood right.
>> >
>> > basically my problem is that the layout avoid it.
>> > here is "something like" my layout :
>> >
>> > <div#0>
>> > <div#1>Lanague (label) : <img flag> <img arrow to show all languages
>> > from
>> > div#2></div#1>
>> > <div#2> all flags</div#2>
>> > <div#3> login field + pwd field + submit button</div#3>
>> > </div#0>
>> >
>> > till now i only use AJAX to refresh the content of div#3
>> > but it does not change the label from div#1 when user selects another
>> > language from div#2.
>> >
>> >
>> Well it looks like you need a extra Ajax call to the server.
>>
>> Click a language flag sends a request to the server. The server responds
>> with an JSON object. Containing the content for <div#2>. With javascript you
>> can update the contents of <div#2>
>>
>> if i place the whole form into a PHP i face several questions :
>> > - how the ajax will reload this PHP page (reloading itself) in the
>> > parent
>> > control div#0 ?
>> >
>>
>> If you would like to reload the whole of <div#0> You could send and JSON
>> object from PHP to javascript. And let javascript generate the div structure
>> and update the DOM.
>>
>> - when user will click on submit button, where will be loaded the content
>> > return of checking if log+pwd are correct ?
>> >
>>
>> When a user logs in a Ajax request is send to the server. the server
>> responds with an JSON object containing the error message. With javascript
>> you could update the contents of <div#3> to display a message.
>>
>> - how to redirect to another PHP page, when user click on submit button ?
>> > the redirection will happen only in the content div, so only in div#0
>> > and
>> > not into the browser :-(
>> >
>>
>> I have a hard time understanding this last issue. What exactly do you mean
>> by redirecting to another PHP page?
>>
>>
>>
>> > Al.
>> >
>> > On Mon, Apr 21, 2008 at 9:55 AM, Thijs Lensselink <dev
lenss.nl> wrote:
>> >
>> > Quoting Alain Roger <raf.news
gmail.com>:
>> > >
>> > > Hi,
>> > > >
>> > > > i'm playing around with AJAX and PHP to create something like a
>> > > "small
>> > > > desktop" application.
>> > > > basically the first step is to log in the system.
>> > > > for that i have a log-in form where users can choose the interface
>> > > > language.
>> > > >
>> > > > here is my problem :
>> > > > when the log-in form runs, it is in English. user can click on some
>> > > > arrow to
>> > > > open another DIV and display all other languages available.
>> > > > a click on a particular flag, will call the PHP page where the
>> > > log-in
>> > > > form
>> > > > (login field + password field) are stored with dynamic language
>> > > > interface.
>> > > >
>> > > > however, i make no sense for the title of this form to call a PHP
>> > > page
>> > > > where
>> > > > will be just 1 dynamic text (changing on flag choice).
>> > > > so if you understand well, i have 2 divs (1 for form title, 1 for
>> > > log-in
>> > > > form itself). and i load thanks AJAX php code into divs.
>> > > >
>> > > > my problem is that i do not want to write a PHP page just for 1
>> > > label...
>> > > > it
>> > > > makes sense for a complete form but not for a simple text line or
>> > > label.
>> > > >
>> > > > So how can i do that without refreshing page. using AJAX and PHP
>> > > only ?
>> > > > i guess you already faced such situation so i would really
>> > > appreciate
>> > > > your
>> > > > help.
>> > > >
>> > > > thanks a lot,
>> > > >
>> > > > --
>> > > > Alain
>> > > >
>> > >
>> > > Making an Ajax request for one little label maybe a bit overkill.
>> > > As i understand you request the whole form through an Ajax request.
>> > > And
>> > > display this to the user? And every language generates a new form?
>> > >
>> > > Why not just create the form dynamically with javascript and load the
>> > > data
>> > > from PHP. So the form can stay the same for all calls. You just fill
>> > > it with
>> > > data depending on the language selected. You can fill the form for
>> > > instance
>> > > by sending a JSON encoded object from PHP to javascript.
>> > >
>> > > --
>> > > PHP General Mailing List (http://www.php.net/)
>> > > To unsubscribe, visit: http://www.php.net/unsub.php
>> > >
>> > >
>> > >
>> >
>> > --
>> > Alain
>> > ------------------------------------
>> > Windows XP SP2
>> > PostgreSQL 8.2.4 / MS SQL server 2005
>> > Apache 2.2.4
>> > PHP 5.2.4
>> > C# 2005-2008
>> >
>> >
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> --
> Alain
> ------------------------------------
> Windows XP SP2
> PostgreSQL 8.2.4 / MS SQL server 2005
> Apache 2.2.4
> PHP 5.2.4
> C# 2005-2008
>
attached mail follows:
Hi Alain,
You can create a mini-db with XML, that contains translations for each of
the words you need (if there are 10 words, 50 langs, you got 500 records..
small and useful).
HTH,
Nitsan
On 21/04/2008, Alain Roger <raf.news
gmail.com> wrote:
>
> Hi,
>
> i'm playing around with AJAX and PHP to create something like a "small
> desktop" application.
> basically the first step is to log in the system.
> for that i have a log-in form where users can choose the interface
> language.
>
> here is my problem :
> when the log-in form runs, it is in English. user can click on some arrow
> to
> open another DIV and display all other languages available.
> a click on a particular flag, will call the PHP page where the log-in form
> (login field + password field) are stored with dynamic language interface.
>
> however, i make no sense for the title of this form to call a PHP page
> where
> will be just 1 dynamic text (changing on flag choice).
> so if you understand well, i have 2 divs (1 for form title, 1 for log-in
> form itself). and i load thanks AJAX php code into divs.
>
> my problem is that i do not want to write a PHP page just for 1 label...
> it
> makes sense for a complete form but not for a simple text line or label.
>
> So how can i do that without refreshing page. using AJAX and PHP only ?
> i guess you already faced such situation so i would really appreciate your
> help.
>
> thanks a lot,
>
> --
> Alain
> ------------------------------------
> Windows XP SP2
> PostgreSQL 8.2.4 / MS SQL server 2005
> Apache 2.2.4
> PHP 5.2.4
> C# 2005-2008
>
attached mail follows:
I am in a bit of a pickle, or is that PECL?
I need to use either mime_content_type or FileInfo to get the mime type
of a file that is dumped into the system via email.
Now that is the easy part, where the hard part comes in is that a
commercial host that I use will do neither reason being that
mime_content_type is deprecated, and that FileInfo is "unstable" in PECL
only :/
Anyone got a workaround on this? I *really* don't feel like writing a
zillion lines of code to get arbitrary mimetypes out that will only be
used a little while and to replace 1 and 2 lines of code respectively.
--Paul
--
------------------------------------------------------------.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za |
:------------------------------------------------------------:
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
attached mail follows:
On IE 5.5 and 6.x you can inject JS through PNG's
As I remember, they patched it at 7.x
On 20/04/2008, Richard Heyes <richardh
phpguru.org> wrote:
>
> I mean, if you already specified it as a PNG image with header(), how
> > do you execute Javascript/malicious code, as the browser will render
> > it as a PNG?
> >
>
> Malicious code can still be embedded in images. The vulnerabilities ISTR
> are in Windows image handling libraries. I assume they've been fixed now
> though because it was some time ago. But that doesn't mean to say more won't
> be found.
>
> --
> Richard Heyes
>
> +----------------------------------------+
> | Access SSH with a Windows mapped drive |
> | http://www.phpguru.org/sftpdrive |
> +----------------------------------------+
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
I added var_dump($result); to the function.
As part of the output I get the following:
["fields"]=> array(1) { ["fa"]=> string(22) "ورود به سایت"}
which is the string which should be returned and printed.
The result is there, however, it couldn't be printed.
Any ideas?
Regards
Ali
----- Original Message -----
From: Nathan Nobbe
To: Ali Reza Sajedi
Cc: php-general
lists.php.net
Sent: Monday, April 21, 2008 12:42 AM
Subject: Re: [PHP] function returns no value
On Sun, Apr 20, 2008 at 4:51 PM, Ali Reza Sajedi <arsajedi
khanehjou.com>
wrote:
Hello,
with the following call I try to print a string out of DB
echo $allg->translate($db, $lang, 14, "auth/authCallback", 4);
function translate () should do a DB querry and returns the requested
string. Although the querry yields a positive result, the function returns
no value.
Here is the function:
function translate ($db, $lang, $MaiKey, $page, $pid) {
$statement = "SELECT fa FROM language WHERE MaiKey='$MaiKey' AND
page='$page' AND pid='$pid'";
$result = $db->Execute($statement);
if ($result=== false) die();
return $result->fields[0];
}
Could anybody see what is going wrong here?
its hard to say, since we cant see whats going on inside the Execute
function... you might try to add a
var_dump($result);
directly after the call to Execute, just for debugging purposes, then remove
it once you know whats going on.
-nathan
attached mail follows:
Quoting Ali Reza Sajedi <arsajedi
khanehjou.com>:
> I added var_dump($result); to the function.
>
> As part of the output I get the following:
>
> ["fields"]=> array(1) { ["fa"]=> string(22) "ورود به سایت"}
>
> which is the string which should be returned and printed.
>
> The result is there, however, it couldn't be printed.
>
> Any ideas?
>
> Regards
>
> Ali
>
> ----- Original Message ----- From: Nathan Nobbe
> To: Ali Reza Sajedi
> Cc: php-general
lists.php.net
> Sent: Monday, April 21, 2008 12:42 AM
> Subject: Re: [PHP] function returns no value
>
>
> On Sun, Apr 20, 2008 at 4:51 PM, Ali Reza Sajedi
> <arsajedi
khanehjou.com> wrote:
>
> Hello,
>
> with the following call I try to print a string out of DB
>
> echo $allg->translate($db, $lang, 14, "auth/authCallback", 4);
>
> function translate () should do a DB querry and returns the requested
> string. Although the querry yields a positive result, the function
> returns no value.
>
> Here is the function:
>
> function translate ($db, $lang, $MaiKey, $page, $pid) {
>
> $statement = "SELECT fa FROM language WHERE MaiKey='$MaiKey' AND
> page='$page' AND pid='$pid'";
>
> $result = $db->Execute($statement);
>
> if ($result=== false) die();
>
> return $result->fields[0];
Try $result->fields["fa"] instead.
> }
>
> Could anybody see what is going wrong here?
>
> its hard to say, since we cant see whats going on inside the Execute
> function... you might try to add a
> var_dump($result);
> directly after the call to Execute, just for debugging purposes, then
> remove it once you know whats going on.
>
> -nathan -- PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
using $result->fields["fa"] did solve the problem.
thanks very much Thijs
----- Original Message -----
From: "Thijs Lensselink" <dev
lenss.nl>
To: <php-general
lists.php.net>
Sent: Monday, April 21, 2008 2:48 PM
Subject: Re: [PHP] function returns no value
Quoting Ali Reza Sajedi <arsajedi
khanehjou.com>:
> I added var_dump($result); to the function.
>
> As part of the output I get the following:
>
> ["fields"]=> array(1) { ["fa"]=> string(22) "ورود به سایت"}
>
> which is the string which should be returned and printed.
>
> The result is there, however, it couldn't be printed.
>
> Any ideas?
>
> Regards
>
> Ali
>
> ----- Original Message ----- From: Nathan Nobbe
> To: Ali Reza Sajedi
> Cc: php-general
lists.php.net
> Sent: Monday, April 21, 2008 12:42 AM
> Subject: Re: [PHP] function returns no value
>
>
> On Sun, Apr 20, 2008 at 4:51 PM, Ali Reza Sajedi
> <arsajedi
khanehjou.com> wrote:
>
> Hello,
>
> with the following call I try to print a string out of DB
>
> echo $allg->translate($db, $lang, 14, "auth/authCallback", 4);
>
> function translate () should do a DB querry and returns the requested
> string. Although the querry yields a positive result, the function
> returns no value.
>
> Here is the function:
>
> function translate ($db, $lang, $MaiKey, $page, $pid) {
>
> $statement = "SELECT fa FROM language WHERE MaiKey='$MaiKey' AND
> page='$page' AND pid='$pid'";
>
> $result = $db->Execute($statement);
>
> if ($result=== false) die();
>
> return $result->fields[0];
Try $result->fields["fa"] instead.
> }
>
> Could anybody see what is going wrong here?
>
> its hard to say, since we cant see whats going on inside the Execute
> function... you might try to add a
> var_dump($result);
> directly after the call to Execute, just for debugging purposes, then
> remove it once you know whats going on.
>
> -nathan -- PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi Everyone,
Last week you all helped me with the code to pull the database field
names directly from the database rather then being hardcoded by me.
Now I got to thinking, that I have exposed my database layout to
anyone who can log in and see it. Is that a security issue? I've heard
that if an attacker has the field names of a database, it makes it
easier for them to try and inject code into it. All my queries to the
database are done through prepared statements, and
mysqli_real_escape_string. So I've taken care of at least part of it.
I'm thinking that sense you have to log into the website to see the
field names, it's okay as long as I trust and monitor my users. But I
thought I would pose the question to people who are ALOT more
knowledgeable then me :)
Any comments are welcome, if you want to see source let me know and I
can shoot you an e-mail off list (Don't really want to expose my code
to all the archives just yet :))
--
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 Apr 21, 2008, at 8:03 AM, Jason Pruim wrote:
> Hi Everyone,
>
> Last week you all helped me with the code to pull the database field
> names directly from the database rather then being hardcoded by me.
> Now I got to thinking, that I have exposed my database layout to
> anyone who can log in and see it. Is that a security issue? I've
> heard that if an attacker has the field names of a database, it
> makes it easier for them to try and inject code into it. All my
> queries to the database are done through prepared statements, and
> mysqli_real_escape_string. So I've taken care of at least part of it.
>
> I'm thinking that sense you have to log into the website to see the
> field names, it's okay as long as I trust and monitor my users. But
> I thought I would pose the question to people who are ALOT more
> knowledgeable then me :)
>
> Any comments are welcome, if you want to see source let me know and
> I can shoot you an e-mail off list (Don't really want to expose my
> code to all the archives just yet :))
As long as you're taking the necessary measures to ensure that your
database is not breakable/hackable, then us knowing your schema
shouldn't be an issue. I'd bet that one could guess part (or all?) of
many people's database schemas b/c they're so generic - and it doesn't
really matter to obfuscate them. I don't think it's as important to
create obscure database schemas as it is protect how you interact with
it.
However, just make sure of the following, and you should be good:
• Use mysql?_real_escape_string as you mentioned
• Use `backticks` around ALL your table and field names:
<?php
$user_id = mysql_real_escape_string ($_GET['user_id']);
$sql = "SELECT `first_name`, `last_name` FROM `user` WHERE (`user_id`
= '$user_id')";
?>
With those simple precautions, you should be well-protected.
HTH,
~Philip
attached mail follows:
Thanks very much, I ended up using seralize in the database.
On Thu, Apr 17, 2008 at 4:42 AM, Casey <heavyccasey
gmail.com> wrote:
>
> On Wed, Apr 16, 2008 at 4:04 AM, Waynn Lue <waynnlue
gmail.com> wrote:
> > I'm using PHP to cache files that are backed by the database. In the
> > course of writing these functions, I end up with a set of variables
> > that are needed by my application, returned in an array. I can either
> > directly generate the array in a .php file, then use require_once to
> > get that variable, or I can use PHP serialization, write that array
> > out to a file, then in my application read the array in, deserialize,
> > etc.
> >
> > I spent awhile trying to look at the performance of php serialization,
> > but except for one unsubstantiated comment on the php serialize() doc
> > page, I haven't found much. Does anyone have any knowledge of that,
> > and also of the two approaches in general? The pro of the
> > serialization is that I think it's slightly easier to write, but the
> > con is that it's harder to read.
> >
> > Thanks!
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> According to this
> (http://us2.php.net/manual/en/function.var-export.php#76099),
> serialize is faster than var_export.
>
> --
> -Casey
>
attached mail follows:
I fixed this last time by looking for white space both before and
after the opening and closing php tags, as a Google search had
revealed. But this time, I've spent an hour running down various
files and not seeing what the heck is wrong. Here's the essential
setup.
main.php
<?
require_once 'shared_style.php';
require_once 'something.php'
?>
shared_style.php
<style>
a.friend_selector_tabs:hover {
background: #E4E4F8 none repeat scroll 0%;
}
.title_msg {
font-size: 14px;
color: #444444;
font-weight:bold;
}
</style>
The something.php has a setcookie call on the line number that PHP is
complaining about for headers. What am I doing wrong that's causing
even mire headers to be generated? I tried moving the require_once
'something.php' above, but no luck there either.
Thanks for any help,
Waynn
attached mail follows:
On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <waynnlue
gmail.com> wrote:
> I fixed this last time by looking for white space both before and
> after the opening and closing php tags, as a Google search had
> revealed. But this time, I've spent an hour running down various
> files and not seeing what the heck is wrong. Here's the essential
> setup.
>
> main.php
> <?
>
> require_once 'shared_style.php';
> require_once 'something.php'
>
> ?>
If something.php is setting cookies and such, it has to be above
shared_style.php. If you've already tried that with no success, post
the code of something.php for us to view.
--
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.
attached mail follows:
On Mon, Apr 21, 2008 at 11:37 PM, Daniel Brown <parasane
gmail.com> wrote:
> On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <waynnlue
gmail.com> wrote:
> > I fixed this last time by looking for white space both before and
> > after the opening and closing php tags, as a Google search had
> > revealed. But this time, I've spent an hour running down various
> > files and not seeing what the heck is wrong. Here's the essential
> > setup.
> >
> > main.php
> > <?
> >
> > require_once 'shared_style.php';
> > require_once 'something.php'
> >
> > ?>
>
> If something.php is setting cookies and such, it has to be above
> shared_style.php. If you've already tried that with no success, post
> the code of something.php for us to view.
it is sometimes a good idea to put error_reporting(0);
just a suggestion ;)
attached mail follows:
this also should not be an issue if you have output buffering turned on.
PHP is great, it will make sure to send the headers *first* then.
but yes, whitespace sucks as well. it makes IE's CSS flake out weird
sometimes. there's multiple reasons to write clean code :)
> > On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <waynnlue
gmail.com> wrote:
> > > I fixed this last time by looking for white space both before and
> > > after the opening and closing php tags, as a Google search had
> > > revealed. But this time, I've spent an hour running down various
> > > files and not seeing what the heck is wrong. Here's the essential
> > > setup.
> > >
> > > main.php
> > > <?
> > >
> > > require_once 'shared_style.php';
> > > require_once 'something.php'
> > >
> > > ?>
attached mail follows:
This is for a facebook app, so it's just
public function set_user($user, $session_key, $expires=null) {
if (!$this->in_fb_canvas() && (!isset($_COOKIE[$this->api_key . '_user'])
|| $_COOKIE[$this->api_key .
'_user'] != $user)) {
$cookies = array();
$cookies['user'] = $user;
$cookies['session_key'] = $session_key;
$sig = self::generate_sig($cookies, $this->secret);
foreach ($cookies as $name => $val) {
setcookie($this->api_key . '_' . $name, $val, (int)$expires);
$_COOKIE[$this->api_key . '_' . $name] = $val;
}
setcookie($this->api_key, $sig, (int)$expires);
$_COOKIE[$this->api_key] = $sig;
}
$this->user = $user;
$this->api_client->session_key = $session_key;
}
But the problem is I can't tell where it's being called. Is there any
way to generate a stack trace from the error logs so I know what the
calling function is?
On Mon, Apr 21, 2008 at 4:37 PM, Daniel Brown <parasane
gmail.com> wrote:
> On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <waynnlue
gmail.com> wrote:
> > I fixed this last time by looking for white space both before and
> > after the opening and closing php tags, as a Google search had
> > revealed. But this time, I've spent an hour running down various
> > files and not seeing what the heck is wrong. Here's the essential
> > setup.
> >
> > main.php
> > <?
> >
> > require_once 'shared_style.php';
> > require_once 'something.php'
> >
> > ?>
>
> If something.php is setting cookies and such, it has to be above
> shared_style.php. If you've already tried that with no success, post
> the code of something.php for us to view.
>
> --
> </Daniel P. Brown>
> Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
> $59.99/mo. with no contract!
> Dedicated servers, VPS, and hosting from $2.50/mo.
>
attached mail follows:
Actually, I think I fixed it by moving the style sheets below the
instantiation of the facebook client, where I *think* set_user was
being called. I'm still curious if it's possible to get stack trace
information on errors, though. :)
Waynn
On Mon, Apr 21, 2008 at 5:39 PM, Waynn Lue <waynnlue
gmail.com> wrote:
> This is for a facebook app, so it's just
>
>
> public function set_user($user, $session_key, $expires=null) {
> if (!$this->in_fb_canvas() && (!isset($_COOKIE[$this->api_key . '_user'])
> || $_COOKIE[$this->api_key .
> '_user'] != $user)) {
> $cookies = array();
> $cookies['user'] = $user;
> $cookies['session_key'] = $session_key;
> $sig = self::generate_sig($cookies, $this->secret);
> foreach ($cookies as $name => $val) {
> setcookie($this->api_key . '_' . $name, $val, (int)$expires);
> $_COOKIE[$this->api_key . '_' . $name] = $val;
> }
> setcookie($this->api_key, $sig, (int)$expires);
> $_COOKIE[$this->api_key] = $sig;
> }
> $this->user = $user;
> $this->api_client->session_key = $session_key;
> }
>
> But the problem is I can't tell where it's being called. Is there any
> way to generate a stack trace from the error logs so I know what the
> calling function is?
>
>
>
> On Mon, Apr 21, 2008 at 4:37 PM, Daniel Brown <parasane
gmail.com> wrote:
> > On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <waynnlue
gmail.com> wrote:
> > > I fixed this last time by looking for white space both before and
> > > after the opening and closing php tags, as a Google search had
> > > revealed. But this time, I've spent an hour running down various
> > > files and not seeing what the heck is wrong. Here's the essential
> > > setup.
> > >
> > > main.php
> > > <?
> > >
> > > require_once 'shared_style.php';
> > > require_once 'something.php'
> > >
> > > ?>
> >
> > If something.php is setting cookies and such, it has to be above
> > shared_style.php. If you've already tried that with no success, post
> > the code of something.php for us to view.
> >
> > --
> > </Daniel P. Brown>
> > Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
> > $59.99/mo. with no contract!
> > Dedicated servers, VPS, and hosting from $2.50/mo.
> >
>
attached mail follows:
Waynn Lue wrote:
> Actually, I think I fixed it by moving the style sheets below the
> instantiation of the facebook client, where I *think* set_user was
> being called. I'm still curious if it's possible to get stack trace
> information on errors, though. :)
You are probably looking for something like this.
http://us2.php.net/manual/en/function.debug-backtrace.php
>
> Waynn
>
> On Mon, Apr 21, 2008 at 5:39 PM, Waynn Lue <waynnlue
gmail.com> wrote:
>> This is for a facebook app, so it's just
>>
>>
>> public function set_user($user, $session_key, $expires=null) {
>> if (!$this->in_fb_canvas() && (!isset($_COOKIE[$this->api_key . '_user'])
>> || $_COOKIE[$this->api_key .
>> '_user'] != $user)) {
>> $cookies = array();
>> $cookies['user'] = $user;
>> $cookies['session_key'] = $session_key;
>> $sig = self::generate_sig($cookies, $this->secret);
>> foreach ($cookies as $name => $val) {
>> setcookie($this->api_key . '_' . $name, $val, (int)$expires);
>> $_COOKIE[$this->api_key . '_' . $name] = $val;
>> }
>> setcookie($this->api_key, $sig, (int)$expires);
>> $_COOKIE[$this->api_key] = $sig;
>> }
>> $this->user = $user;
>> $this->api_client->session_key = $session_key;
>> }
>>
>> But the problem is I can't tell where it's being called. Is there any
>> way to generate a stack trace from the error logs so I know what the
>> calling function is?
>>
>>
>>
>> On Mon, Apr 21, 2008 at 4:37 PM, Daniel Brown <parasane
gmail.com> wrote:
>> > On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <waynnlue
gmail.com> wrote:
>> > > I fixed this last time by looking for white space both before and
>> > > after the opening and closing php tags, as a Google search had
>> > > revealed. But this time, I've spent an hour running down various
>> > > files and not seeing what the heck is wrong. Here's the essential
>> > > setup.
>> > >
>> > > main.php
>> > > <?
>> > >
>> > > require_once 'shared_style.php';
>> > > require_once 'something.php'
>> > >
>> > > ?>
>> >
>> > If something.php is setting cookies and such, it has to be above
>> > shared_style.php. If you've already tried that with no success, post
>> > the code of something.php for us to view.
>> >
>> > --
>> > </Daniel P. Brown>
>> > Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
>> > $59.99/mo. with no contract!
>> > Dedicated servers, VPS, and hosting from $2.50/mo.
>> >
>>
>
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
attached mail follows:
Canadian Doctor Hazel Best Price On Net
http://zxa.pharmstorez.com?liyws
attached mail follows:
Hi Everyone,
I have a client that wants me to fork a current project into a
membership management piece of software. Does anyone know of any open
source projects that I can look at?
The big things I need, are the ability to decide if the members will
receive a paper copy of a newsletter vs. a e-mail copy. Ability to
export addresses for paper mailing a newsletter.
Possibility to store seasonal addresses for the same person (Up here
in the Great white north we call them "Snow Birds")
PHP/MySQL based since that's what I know :)
I've done some googling but keep seeming to find club's where I can
become a member... Which is not what I want :)
Any ideas?
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
japruim
raoset.com
attached mail follows:
Jason -- - - -
There are many, many membership management programs out there, though
I doubt that there are any open source ones. It is a lucrative
business for many-a-folk.
I have always advised prospective clients to buy, not build, as the
commercial software choices out there are many and very good. There
are many tricks and traps to trying to build one from scratch, among
them building a combined cycle and on-demand billing system.
One place to look is the Society of Non-profit Executives, or improve
your google search thusly: http://tinyurl.com/4yt5ru
Ken
On Apr 21, 2008, at 12:08 PM, Jason Pruim wrote:
> I have a client that wants me to fork a current project into a
> membership management piece of software. Does anyone know of any
> open source projects that I can look at?
attached mail follows:
Hello Group,
I have an immediate need for a Sr. Developer; with one of Denver's Best
employers (relocation assistance available). They are a Web 2.0 company,
rapidly growing and very profitable.
4-Senior Software Engineers
Denver Metro Area
We are looking for a Senior Software Engineer to join our dynamic and
growing Internet-based company. The individual will be responsible for the
development, implementation, and maintenance of our scalable, reusable,
web/software based user interfaces. You must be familiar with design
patterns and be able to write abstract classes that adhere to standard OOP
methodologies. The qualified candidate will expand our web-based platform,
building new features and products. You will work with the leaders in
online media and advertising.
Requirements:
* 4-6 years of commercial application development experience with open
source technologies
* Expert knowledge of Linux, Apache, MySQL and PHP 4, PHP 5, Perl/Python a
bonus.
* BA/BS in Computer Science or equivalent experience
* Object-oriented design and distributed systems
* Open source development tools, languages and application servers.
* Competent with JavaScript, Prototype, Scriptaculous, Moo
* OOP, SQL, Linux, HTML
Nick Gasparro
Managing Partner, REMY Corp.
1637 Wazee Street
Denver, CO 80202
303-539-0448 Direct
303-547-7469 Cell
nick
remycorp.com
www.remycorp.com <http://www.remycorp.com/>
Nick Gasparro
Managing Partner, REMY Corp.
Denver, CO 80202
303-539-0448 Direct
303-547-7469 Cell
<mailto:nick
remycorp.com> nick
remycorp.com
<http://www.remycorp.com/> www.remycorp.com
Come visit our booth!!!
Web 2.0 Expo San Francisco 2008 <http://www.web2expo.com/sf>
http://www.web2expo.com/sf
San Francisco, CA April 22 - April 25, 2008
attached mail follows:
Web 2.0 *and* profitable? Surprising.
--
Richard Heyes
+----------------------------------------+
| Access SSH with a Windows mapped drive |
| http://www.phpguru.org/sftpdrive |
+----------------------------------------+
attached mail follows:
Hey Richard,
Not sure how to respond to your question other than to say yes they are
profitable. They are an established organization that has been around since
2003, they have upwards of 60 million users and tons of traffic. They are
the market leader in their space. Please let me know if you have some
interest and I would be happy to set up a time to talk.
Best,
Nick Gasparro
Managing Partner, REMY Corp.
Denver, CO 80202
303-539-0448 Direct
303-547-7469 Cell
nick
remycorp.com
www.remycorp.com
Come visit our booth!!!
Web 2.0 Expo San Francisco 2008 http://www.web2expo.com/sf
San Francisco, CA April 22 - April 25, 2008
-----Original Message-----
From: Richard Heyes [mailto:richardh
phpguru.org]
Sent: Monday, April 21, 2008 11:22 AM
To: Nick Gasparro
Cc: php-general
lists.php.net
Subject: Re: [PHP] Denver PHP opportunity - Senior Software Engineers
Web 2.0 *and* profitable? Surprising.
--
Richard Heyes
+----------------------------------------+
| Access SSH with a Windows mapped drive |
| http://www.phpguru.org/sftpdrive |
+----------------------------------------+
attached mail follows:
On 4/21/08, Nick Gasparro <nick
remycorp.com> wrote:
> Hey Richard,
>
> Not sure how to respond to your question other than to say yes they are
> profitable. They are an established organization that has been around since
> 2003, they have upwards of 60 million users and tons of traffic. They are
> the market leader in their space. Please let me know if you have some
> interest and I would be happy to set up a time to talk.
>
> Best,
>
> Nick Gasparro
> Managing Partner, REMY Corp.
> Denver, CO 80202
> 303-539-0448 Direct
> 303-547-7469 Cell
> nick
remycorp.com
> www.remycorp.com
>
> Come visit our booth!!!
> Web 2.0 Expo San Francisco 2008 http://www.web2expo.com/sf
> San Francisco, CA April 22 - April 25, 2008
>
> -----Original Message-----
> From: Richard Heyes [mailto:richardh
phpguru.org]
> Sent: Monday, April 21, 2008 11:22 AM
> To: Nick Gasparro
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] Denver PHP opportunity - Senior Software Engineers
>
> Web 2.0 *and* profitable? Surprising.
>
> --
> Richard Heyes
The commute would be a killer, Richard. LOL.
--
-David.
When the power of love
overcomes the love of power,
the world will know peace.
-Jimi Hendrix
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]