[PHP] php, ajax and international application

2008-04-21 Thread Alain Roger
Hi,

Till now, i'm used to have a php file (for each language) to store all text
labels for my international application.
i tried with Ajax to improve it but it seems not so flexible at it promised.
my purpose was to limit the transfer data and especially to not load too
much the server with not important calculation as localization of
application.

therefore, i would like to know what do you do to have an international
application ?
1. do you use JSON : 1 javascript file for each language and for each
module. Code is not secured and everybody can read it.
2. do you use PHP like i wrote above.
3. you use another method

I would be glad to here from you the pros and cons of your experiences.

thx.

-- 
Alain

Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


[PHP] Humour in Hotmail :OT

2008-04-21 Thread Bastien Koert
Guys,

I switched to gmail since I was having so many issues getting my emails thru
the spam filter thanks to M$ adding ads to the bottom of the message. To
make it even better, the unsubcribe confirmation email is also being
rejected due to spammy urls in the message.

Anyway, this should work out much better,

Thanks,

-- 

Bastien

Cat, the other other white meat


Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Nathan Nobbe
On Mon, Apr 21, 2008 at 3:59 PM, Manuel Lemos <[EMAIL PROTECTED]> wrote:

> Hello,
>
> You may want to take a look here and find qualified PHP developers near
> your region. You may even search for developers that have relevant skills.
>
> http://www.phpclasses.org/professionals/country/us/


the zend yellow pages are decent too; here colorado;

http://www.zend.com/store/education/certification/yellow-pages.php?cid=1&sid=CO&submit=search&orderby=ID&form_name=Zend_VUE_Search_Form

-nathan


[Fwd: Re: [PHP] Alter Table newbie help needed ...]

2008-04-21 Thread Jason Norwood-Young
Darn forgot to hit "reply to all"

 Forwarded Message 
From: Jason Norwood-Young <[EMAIL PROTECTED]>
To: revDAVE <[EMAIL PROTECTED]>
Subject: Re: [PHP] Alter Table newbie help needed ...
Date: Mon, 21 Apr 2008 23:52:30 +0200

On Mon, 2008-04-21 at 14:04 -0700, revDAVE wrote:
> Jason & David,
> 
> Thanks so much for your help
> 
> BTW: to reiterate the problem: I guess it was not knowing to use the 'try1'
> connection ( try1.ztest) - and used 'connect2' connection instead...
> 
> Error said : Table 'connect2.ztest' doesn't exist
> (connect2 was some other one I set up for something else)
> 
> Q: Is there a way to insure that it uses the right connection ( try1 - not
> connect2 )?

Hi revDAVE

You'll simplify your life dramatically by using one database and one
connection per application. If you're not going to do that, you can make
sure the table is there in PHP with something like:

function check_table_exists($tablename) {
$sqlresult=mysql_query("SHOW TABLES LIKE $tablename");
if (mysql_num_rows($sqlresult)==1) {
return true;
}
return false;
}

J


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Manuel Lemos
Hello,

You may want to take a look here and find qualified PHP developers near
your region. You may even search for developers that have relevant skills.

http://www.phpclasses.org/professionals/country/us/


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Alter Table newbie help needed ...

2008-04-21 Thread revDAVE
On 4/21/2008 2:04 PM, "revDAVE" <[EMAIL PROTECTED]> wrote:

> : Is there a way to insure that it uses the right connection ( try1 - not
> connect2 )?



- seems to be ok now with this new db selector line...

mysql_select_db($database_try1, $try1); // this new line


New ...



Old - no



--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Alter Table newbie help needed ...

2008-04-21 Thread revDAVE
Jason & David,

Thanks so much for your help

BTW: to reiterate the problem: I guess it was not knowing to use the 'try1'
connection ( try1.ztest) - and used 'connect2' connection instead...

Error said : Table 'connect2.ztest' doesn't exist
(connect2 was some other one I set up for something else)

Q: Is there a way to insure that it uses the right connection ( try1 - not
connect2 )?


--



On 4/20/2008 1:41 PM, "Jason Norwood-Young" <[EMAIL PROTECTED]>
wrote:

> revDave - can we see a bit more of the code in one block and not broken
> up? Makes it a bit easier to see what you're doing.

Will do - check below...



On 4/20/2008 11:08 AM, "David Giragosian" <[EMAIL PROTECTED]> wrote:

> Is try1 the name of a database? The SQL syntax is
> databasename.tablename.fieldname.
Hmmm - looking below, maybe this is the DB name?

$database_try1

As you see below - I tried this, but it gave me errors

$result = mysql_query($sql,***$database_try1*** )

This also failed...

$sql = 'ALTER TABLE `test.ztest` ADD `new4` VARCHAR(50) NOT NULL;';
$result = mysql_query($sql)

>  
> When you issue a query using mysql_query() you can explicitly indicate the
> connection (returned by mysql_connect()) to use as the second parameter, e.g.,
> mysql_query($sql_Statement, $returnedConnectionObject);
>  
> HTH,
>  
> David



Here's the orig post with some mods:


Connection called 'try1'...





=




maybe it needs something like:?

$result = mysql_query($sql,***$database_try1*** ) - hmmm?

I get errors like this: Warning: mysql_query(): supplied argument is not a
valid MySQL-Link resource

--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Robert Cummings

On Mon, 2008-04-21 at 14:16 -0600, Nathan Nobbe wrote:
> On Mon, Apr 21, 2008 at 1:48 PM, Robert Cummings <[EMAIL PROTECTED]>
> wrote:
> 
> > On Mon, 2008-04-21 at 15:20 -0400, Daniel Brown wrote:
> > > On Mon, Apr 21, 2008 at 3:01 PM, Jason Pruim <[EMAIL PROTECTED]> wrote:
> > > >
> > > >  Just think about the frequent flyer miles you'd get! Vacation
> > anywhere you
> > > > want in the world! :)
> > >
> > > Like you'd want to fly to a vacation spot after two 10 hour, 15
> > > minute flights per day, five days per week.  ;-P
> >
> > Wow, you guys really don't know the shortest path to work. I don't think
> > I'd hire you. Everyone knows the quickest way is:
> >
> >ssh [EMAIL PROTECTED]
> >
> > Soemtimes though you need to make do with public transport:
> >
> >ftp [EMAIL PROTECTED]
> >
> > Now if they'd only offer frequent typer miles.
> 
> 
> i think they have it setup where you accrue miles per bandwidth consumption
> if u work from home :D  but seriously, my commute here in denver is only 2
> blocks; im enjoying it ;)  i know youve got me beat working in the basement
> or w/e rob, but ill take a little fresh air when i can get it :)

Hey! I've got a rubber tube that extends to the outside so I can get the
occasional breath of fresh air. I just wish spiders would stop making
nests in it. *makes sound like cat expunging furball*.

But seriously, with a 2 year old and a 4 year old, I get plenty of fresh
air at the park :)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Nathan Nobbe
On Mon, Apr 21, 2008 at 1:48 PM, Robert Cummings <[EMAIL PROTECTED]>
wrote:

> On Mon, 2008-04-21 at 15:20 -0400, Daniel Brown wrote:
> > On Mon, Apr 21, 2008 at 3:01 PM, Jason Pruim <[EMAIL PROTECTED]> wrote:
> > >
> > >  Just think about the frequent flyer miles you'd get! Vacation
> anywhere you
> > > want in the world! :)
> >
> > Like you'd want to fly to a vacation spot after two 10 hour, 15
> > minute flights per day, five days per week.  ;-P
>
> Wow, you guys really don't know the shortest path to work. I don't think
> I'd hire you. Everyone knows the quickest way is:
>
>ssh [EMAIL PROTECTED]
>
> Soemtimes though you need to make do with public transport:
>
>ftp [EMAIL PROTECTED]
>
> Now if they'd only offer frequent typer miles.


i think they have it setup where you accrue miles per bandwidth consumption
if u work from home :D  but seriously, my commute here in denver is only 2
blocks; im enjoying it ;)  i know youve got me beat working in the basement
or w/e rob, but ill take a little fresh air when i can get it :)

-nathan


Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Robert Cummings
On Mon, 2008-04-21 at 15:20 -0400, Daniel Brown wrote:
> On Mon, Apr 21, 2008 at 3:01 PM, Jason Pruim <[EMAIL PROTECTED]> wrote:
> >
> >  Just think about the frequent flyer miles you'd get! Vacation anywhere you
> > want in the world! :)
> 
> Like you'd want to fly to a vacation spot after two 10 hour, 15
> minute flights per day, five days per week.  ;-P

Wow, you guys really don't know the shortest path to work. I don't think
I'd hire you. Everyone knows the quickest way is:

ssh [EMAIL PROTECTED]

Soemtimes though you need to make do with public transport:

ftp [EMAIL PROTECTED]

Now if they'd only offer frequent typer miles.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Daniel Brown
On Mon, Apr 21, 2008 at 3:01 PM, Jason Pruim <[EMAIL PROTECTED]> wrote:
>
>  Just think about the frequent flyer miles you'd get! Vacation anywhere you
> want in the world! :)

Like you'd want to fly to a vacation spot after two 10 hour, 15
minute flights per day, five days per week.  ;-P

-- 

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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Jason Pruim


On Apr 21, 2008, at 2:57 PM, Richard Heyes wrote:


The commute would be a killer, Richard. LOL.


I think you're right. A 60 mile commute caused me to quit a job, so  
several thousand miles sounds excessive... :-)


Depends on the pay I'm looking at a job that's 30 minute drive  
away... But it doubles my salary ;)


Just think about the frequent flyer miles you'd get! Vacation anywhere  
you want in the world! :)



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
[EMAIL PROTECTED]




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cannot modify header information - headers already sentby ...

2008-04-21 Thread M. Sokolewicz

Jim Lucas wrote:

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



XDebug is a lot prettier here since it adds them _implicitly_ (assuming 
you've configured it correctly).
url: http://www.xdebug.org/ (it's an extension written by Derick, one of 
PHP's main devs)


- Tul

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Richard Heyes

The commute would be a killer, Richard. LOL.


I think you're right. A 60 mile commute caused me to quit a job, so 
several thousand miles sounds excessive... :-)


--
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



Re: [PHP] Security Concern?

2008-04-21 Thread Jason Pruim


On Apr 21, 2008, at 11:49 AM, Philip Thompson wrote:


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:

$sql = "SELECT `first_name`, `last_name` FROM `user` WHERE  
(`user_id` = '$user_id')";

?>

With those simple precautions, you should be well-protected.


Hey Phillip,

Thanks for the response, I'll have to double check if I have the back  
ticks around my field names...


And to complete the archives, I was recommend a couple of books by  
Chris Shiftlett Here's the link for anyone who is interested: http://shiflett.org/books


Thanks again for the response!

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
[EMAIL PROTECTED]




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread David Giragosian
On 4/21/08, Nick Gasparro <[EMAIL PROTECTED]> 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
> [EMAIL PROTECTED]
> 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:[EMAIL PROTECTED]
> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Nick Gasparro
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
[EMAIL PROTECTED]
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:[EMAIL PROTECTED] 
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|
++


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Membership Management

2008-04-21 Thread Ken Kixmoeller.com

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?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cannot modify header information - headers already sent by ...

2008-04-21 Thread Jim Lucas

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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> wrote:
 > On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <[EMAIL PROTECTED]> 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.
 >
 >  --
 >  
 >  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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Richard Heyes

Web 2.0 *and* profitable? Surprising.

--
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



[PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Nick Gasparro
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

[EMAIL PROTECTED] 

www.remycorp.com  

 

 

Nick Gasparro

Managing Partner, REMY Corp.

Denver, CO 80202

303-539-0448 Direct

303-547-7469 Cell

  [EMAIL PROTECTED] 

  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 

 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Membership Management

2008-04-21 Thread Jason Pruim

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
[EMAIL PROTECTED]




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Dear php-general@lists.php.net April 84% 0FF

2008-04-21 Thread php-general
Canadian Doctor Hazel Best Price On Net
http://zxa.pharmstorez.com?liyws


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cannot modify header information - headers already sent by ...

2008-04-21 Thread Waynn Lue
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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> wrote:
>  > On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <[EMAIL PROTECTED]> 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.
>  >
>  >  --
>  >  
>  >  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.
>  >
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cannot modify header information - headers already sent by ...

2008-04-21 Thread Waynn Lue
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 <[EMAIL PROTECTED]> wrote:
> On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <[EMAIL PROTECTED]> 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.
>
>  --
>  
>  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.
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cannot modify header information - headers already sent by ...

2008-04-21 Thread mike
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 <[EMAIL PROTECTED]> 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'
> > >
> > >  ?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cannot modify header information - headers already sent by ...

2008-04-21 Thread paragasu
On Mon, Apr 21, 2008 at 11:37 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:

> On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <[EMAIL PROTECTED]> 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 ;)


Re: [PHP] Security Concern?

2008-04-21 Thread Philip Thompson

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:

$sql = "SELECT `first_name`, `last_name` FROM `user` WHERE (`user_id`  
= '$user_id')";

?>

With those simple precautions, you should be well-protected.

HTH,
~Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cannot modify header information - headers already sent by ...

2008-04-21 Thread Daniel Brown
On Mon, Apr 21, 2008 at 11:33 AM, Waynn Lue <[EMAIL PROTECTED]> 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.

-- 

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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Cannot modify header information - headers already sent by ...

2008-04-21 Thread Waynn Lue
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


shared_style.php


a.friend_selector_tabs:hover {
background: #E4E4F8 none repeat scroll 0%;
}

.title_msg {
font-size: 14px;
color: #44;
font-weight:bold;
}





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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Serialization Performance

2008-04-21 Thread Waynn Lue
Thanks very much, I ended up using seralize in the database.

On Thu, Apr 17, 2008 at 4:42 AM, Casey <[EMAIL PROTECTED]> wrote:
>
> On Wed, Apr 16, 2008 at 4:04 AM, Waynn Lue <[EMAIL PROTECTED]> 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
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Security Concern?

2008-04-21 Thread Jason Pruim

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
[EMAIL PROTECTED]




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] function returns no value

2008-04-21 Thread Ali Reza Sajedi

using $result->fields["fa"]  did solve the problem.

thanks very much Thijs

- Original Message - 
From: "Thijs Lensselink" <[EMAIL PROTECTED]>

To: 
Sent: Monday, April 21, 2008 2:48 PM
Subject: Re: [PHP] function returns no value


Quoting Ali Reza Sajedi <[EMAIL PROTECTED]>:


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
<[EMAIL PROTECTED]> 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 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] function returns no value

2008-04-21 Thread Thijs Lensselink

Quoting Ali Reza Sajedi <[EMAIL PROTECTED]>:


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
<[EMAIL PROTECTED]> 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



Re: [PHP] function returns no value

2008-04-21 Thread Ali Reza Sajedi

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 <[EMAIL PROTECTED]> 
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 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Check RAW data

2008-04-21 Thread Nitsan Bin-Nun
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 <[EMAIL PROTECTED]> 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
>
>


Re: [PHP] AJAX and PHP

2008-04-21 Thread Nitsan Bin-Nun
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 <[EMAIL PROTECTED]> 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
>


[PHP] mime_content_type and FileInfo

2008-04-21 Thread Paul Scott

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 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] AJAX and PHP

2008-04-21 Thread Thijs Lensselink

Quoting Alain Roger <[EMAIL PROTECTED]>:


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 <[EMAIL PROTECTED]> wrote:


Quoting Alain Roger <[EMAIL PROTECTED]>:

 you understood right.
>
> basically my problem is that the layout avoid it.
> here is "something like" my layout :
>
> 
> Lanague (label) :   from
> div#2>
>  all flags
>  login field  + pwd field + submit button
> 
>
> 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 . With javascript you
can update the contents of 

 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  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  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 <[EMAIL PROTECTED]> wrote:
>
>  Quoting Alain Roger <[EMAIL PROTECTED]>:
> >
> >  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

Re: [PHP] AJAX and PHP

2008-04-21 Thread Alain Roger
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 <[EMAIL PROTECTED]> wrote:

> Quoting Alain Roger <[EMAIL PROTECTED]>:
>
>  you understood right.
> >
> > basically my problem is that the layout avoid it.
> > here is "something like" my layout :
> >
> > 
> > Lanague (label) :   > from
> > div#2>
> >  all flags
> >  login field  + pwd field + submit button
> > 
> >
> > 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 . With javascript you
> can update the contents of 
>
>  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  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  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 <[EMAIL PROTECTED]> wrote:
> >
> >  Quoting Alain Roger <[EMAIL PROTECTED]>:
> > >
> > >  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


Re: [PHP] AJAX and PHP

2008-04-21 Thread Thijs Lensselink

Quoting Alain Roger <[EMAIL PROTECTED]>:


you understood right.

basically my problem is that the layout avoid it.
here is "something like" my layout :


Lanague (label) :  
 all flags
 login field  + pwd field + submit button


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 . With  
javascript you can update the contents of 



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  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  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 <[EMAIL PROTECTED]> wrote:


Quoting Alain Roger <[EMAIL PROTECTED]>:

 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



Re: [PHP] AJAX and PHP

2008-04-21 Thread Alain Roger
you understood right.

basically my problem is that the layout avoid it.
here is "something like" my layout :


Lanague (label) :  
 all flags
 login field  + pwd field + submit button


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 <[EMAIL PROTECTED]> wrote:

> Quoting Alain Roger <[EMAIL PROTECTED]>:
>
>  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


Re: [PHP] AJAX and PHP

2008-04-21 Thread Thijs Lensselink

Quoting Alain Roger <[EMAIL PROTECTED]>:


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