Re: [PHP] Weird problem with T_gettext()

2009-04-04 Thread Per Jessen
Michelle Konzack wrote:

> Now selecting "de" as prefered language is  working,  but  if  I 
> select "de_DE" in  Firefox,  the  second  term  "About Us"  is 
> something like "Über Uns" insteed "Über Uns" because the Website is
> UTF-8. 

Indeed.  I'll venture a guess and say it's because your dictionary file
is bad or not actually UTF8.

> This is realy weird, since the MO file  is  the  same  for  both 
> locale versions.

Ah. Very weird, yes.  Are you doing a setlocale() anywhere? 

> Also it is weird, that "php-gettext" does not do a fallback, if  I 
> have only "de" and not "de_DE".

Fallback to what?  I only have 'de' in my browser language preferences,
and your site came up fine in German.


/Per


-- 
Per Jessen, Zürich (11.7°C)


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



Re: [PHP]scheduled task in php IN FIREFOX

2009-04-04 Thread Ashley Sheridan


On Fri, 2009-04-03 at 16:20 +0100, Stuart wrote:
> 2009/4/3 Andrew Williams :
> > That is a better idea but the program needs about five minutes to complete.
> > Would that not be a problem?
> 
> No more so that it would be in a browser.
> 
> -Stuart
> 
> > On Fri, Apr 3, 2009 at 2:44 PM, Stuart  wrote:
> >>
> >> Please include the list when replying.
> >>
> >> 2009/4/3 Andrew Williams :
> >> > interval update
> >>
> >> I'm sorry, and that means what exactly?
> >>
> >> Assuming you just need to hit a certain URL periodically you just need
> >> to use curl or similar. There's no need to get a browser involved.
> >>
> >> -Stuart
> >>
> >> > On Fri, Apr 3, 2009 at 2:05 PM, Stuart  wrote:
> >> >>
> >> >> 2009/4/3 Andrew Williams :
> >> >> > HOW DO YOU CONFIGURE scheduled task to use firefox instead of
> >> >> > Internet
> >> >> > Explorer
> >> >>
> >> >> Why is a scheduled task using a browser at all? What is the task doing?
> >> >>
> >> >> -Stuart
> >> >>
> >> >> --
> >> >> http://stut.net/
> >> >
> >> >
> >> >
> >> > --
> >> > Best Wishes
> >> > Andrew Williams
> >> >
> >> >
> >> >
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> >
> >
> > --
> > Best Wishes
> > Andrew Williams
> >
> >
> >
> 
What about using wget or its Windows equivalent? The tool is built for
requesting things from a command line, so is very easy to plug into a
bash or batch script.


Ash
www.ashleysheridan.co.uk


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



[PHP] Re: Weird problem with T_gettext()

2009-04-04 Thread Michelle Konzack
Am 2009-04-04 10:13:52, schrieb Per Jessen:
> Michelle Konzack wrote:
> 
> > Now selecting "de" as prefered language is  working,  but  if  I 
> > select "de_DE" in  Firefox,  the  second  term  "About Us"  is 
> > something like "Über Uns" insteed "Über Uns" because the Website is
> > UTF-8. 
> 
> Indeed.  I'll venture a guess and say it's because your dictionary file
> is bad or not actually UTF8.

Weird, since my whole system is UTF-8 and if I try to einter  iso-8859-1
charachters it complys that there is a error. Even xgettext tell me this

I have checkd it already with "iconv"

It seems the problem is if my "msgid" have strings like ü which are
not correctly converted to UTF-8 if I use "de_DE" since in  "de"  it  is
working.

Unfortunately the upstream of "php-gettext" is not responding to my mail

> > This is realy weird, since the MO file  is  the  same  for  both 
> > locale versions.
> 
> Ah. Very weird, yes.  Are you doing a setlocale() anywhere? 

The only setlocale() I have found in the whole system is in

/usr/share/php/php-gettext/gettext.inc

which a part of the php-gettext package.

> Fallback to what?  I only have 'de' in my browser language preferences,
> and your site came up fine in German.

If someone have in the browser only "de-de" and I have NO locale "de_DE"
but "de", php-gettext does not fallback to "de".

Normaly under Linux you can have 

/usr/share/locale/de_DE.UTF-8
/usr/share/locale/de...@euro

/usr/share/locale/de_DE
/usr/share/locale/de

So if your system is "de_DE.UTF-8" and there is no UTF-8 locale, gettext
try "de_DE" and if that fais it try "de".  Unfortunately this  does  not
work with "php-gettext".  For me it is a bug.

Thanks, Greetings and nice Day/Evening
Michelle Konzack


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
 Michelle Konzack
   Apt. 917
   50, rue de Soultz
Jabber linux4miche...@jabber.ccc.de   67100 Strasbourg/France
IRC #Debian (irc.icq.com) Tel. DE: +49 177 9351947
ICQ #328449886Tel. FR: +33  6  61925193


signature.pgp
Description: Digital signature


Re: [PHP] rft file problems

2009-04-04 Thread tedd

At 6:06 PM -0400 4/3/09, Paul M Foster wrote:

On Fri, Apr 03, 2009 at 01:18:08PM -0400, tedd wrote:


 Hi gang:

 I'm trying to provide an ".rft" file via a link on one of my sites, like
 so:


 > Mid Term


-snip-


Are you sure you don't mean ".rtf", as in Rich Text Format? If
misspelled that way, it could explain the problem.



Paul:

Bingo -- that was the problem. Sometimes we're tripped up by the 
simplest problems. I just couldn't see the difference between rft and 
rtf in my editor.


Considering it was the first time I was working with rtf files, I 
over-thought it might have been a php init issue.


Thanks,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] suhosin and sessions

2009-04-04 Thread Michael A. Peters

suhosin forum is currently down so I can't ask there.

I'm using https for login but the rest of the site is not https

www.domain.com is regular
secure.domain.com is https

I set the session cookie this way:

ini_set("session.cookie_domain",".domain.com");

Works beautifully w/o suhosin - the login can happen on secure server 
and then set the necessary session bits for the insecure server to know 
user is authenticated.


First issue was session data encryption, which is suppose to be 
transparent but doesn't appear to be if set in one domain and read in 
other. It looks configurable but since it is my server w/o no other 
users and I'm using database for sessions, I tries just turning it off via


ini_set('suhosin.session.encrypt','0');

in my include that starts the session.

However, that didn't solve the problem. So I also added

ini_set('suhosin.cookie.encrypt','0');

but still no joy - session data set in one domain is wiped as soon as 
the cookie is sent to another domain.


I'd really rather not remove the suhosin module, how can tell suhosin to 
just leave my sessions the smurf alone?


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



[PHP] I'm new

2009-04-04 Thread ®0L¥
Hello people, Is my first time that I try to do a web page with PHP and I
don't  have Idea how I can do, but I read something tutorial and I can see
that is not difficult, I hope that I can do, what I need to work ??? with
PHP and MYSQL ??? Where I can to get this software because I go to
www.mysql.com and I download mysql for win 32 MSI and I install in my pc but
I can't see nothing !!! only MYSQL 5.1 --> (mysql command line client)
(mysql manual) and (mysql server instance config wizard) and How I can work
with mysql ?? and I download the php for www.php.net and only install me in
my all programs PHP 5 and inside I just only see License and PHP.ini

O download and installer APACHE 2.11

1st- download APACHE and install it
2nd- download mysql and install it
3rd- donwload PHP and install it

It is correct this way ?? I read a tutorial with this ways, but when I
create a name.php page and put inside of apache server program
files-->apache-->htdocs if I try to open with firefox, it shows me the
source inside the page, and wioth internet explorer don't open me, it only
show me a blank page,

Anybody can help me please ?? I want to do web page and I have no idea.

Sorry for my english, I started to study this languaje too. lol.

-- 
salu2 ®0L¥


[PHP] PHP/MySQL ISP recommendation that lets one edit ft_min_word_len variable?

2009-04-04 Thread Rob Gould

Can anyone here recommend an ISP that will let me have a dedicated
server (not shared), and also allow me to adjust the ft_min_word_len
mySQL parameter?  I was originally thinking Dreamhost PS, but I
recently found out that they do not allow changes to mySQL
environmental variables.  I really need to adjust ft_min_word_len so
that I can do rapid text searches on words less than 4 chars.

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



RE: [PHP] I'm new

2009-04-04 Thread abdulazeez alugo

 

> Date: Sat, 4 Apr 2009 07:13:22 -0800
> From: rol...@gmail.com
> To: php-general@lists.php.net
> Subject: [PHP] I'm new
> 
> Hello people, Is my first time that I try to do a web page with PHP and I
> don't have Idea how I can do, but I read something tutorial and I can see
> that is not difficult, I hope that I can do, what I need to work ??? with
> PHP and MYSQL ??? Where I can to get this software because I go to
> www.mysql.com and I download mysql for win 32 MSI and I install in my pc but
> I can't see nothing !!! only MYSQL 5.1 --> (mysql command line client)
> (mysql manual) and (mysql server instance config wizard) and How I can work
> with mysql ?? and I download the php for www.php.net and only install me in
> my all programs PHP 5 and inside I just only see License and PHP.ini
> 
> O download and installer APACHE 2.11
> 
> 1st- download APACHE and install it
> 2nd- download mysql and install it
> 3rd- donwload PHP and install it
> 
> It is correct this way ?? I read a tutorial with this ways, but when I
> create a name.php page and put inside of apache server program
> files-->apache-->htdocs if I try to open with firefox, it shows me the
> source inside the page, and wioth internet explorer don't open me, it only
> show me a blank page,
> 
> Anybody can help me please ?? I want to do web page and I have no idea.
> 
> Sorry for my english, I started to study this languaje too. lol.
> 

 

Hi Roly,

You're definitely welcome to this mailing list full of incredibly intelligent 
people I never knew existed. However, I advice that you still read through the 
tutorials you have because I think you have not installed apache properly.

Ciao.

Alugo AbdulAzeez

With Love from Nigeria

www.frangeovic.com

 


_
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/

Re: [PHP] PHP/MySQL ISP recommendation that lets one edit ft_min_word_len variable?

2009-04-04 Thread Michael A. Peters

Rob Gould wrote:

Can anyone here recommend an ISP that will let me have a dedicated
server (not shared), and also allow me to adjust the ft_min_word_len
mySQL parameter?  I was originally thinking Dreamhost PS, but I
recently found out that they do not allow changes to mySQL
environmental variables.  I really need to adjust ft_min_word_len so
that I can do rapid text searches on words less than 4 chars.



http://www.linode.com/

You get root on your very own xen vm running the Linux distro of your 
choice (you can even upload an image if they don't have your favorite) - 
starting at I think around $20 a month for one IP.


You can set it up however you want.

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



Re: [PHP] I'm new

2009-04-04 Thread 9el
>> Hello people, Is my first time that I try to do a web page with PHP and I
>> don't have Idea how I can do, but I read something tutorial and I can see
>> that is not difficult, I hope that I can do, what I need to work ??? with
>> PHP and MYSQL ??? Where I can to get this software because I go to
>> www.mysql.com and I download mysql for win 32 MSI and I install in my pc but
>> I can't see nothing !!! only MYSQL 5.1 --> (mysql command line client)
>> (mysql manual) and (mysql server instance config wizard) and How I can work
>> with mysql ?? and I download the php for www.php.net and only install me in
>> my all programs PHP 5 and inside I just only see License and PHP.ini
>>
>> O download and installer APACHE 2.11
>>
>> 1st- download APACHE and install it
>> 2nd- download mysql and install it
>> 3rd- donwload PHP and install it
>>
>> It is correct this way ?? I read a tutorial with this ways, but when I
>> create a name.php page and put inside of apache server program
>> files-->apache-->htdocs if I try to open with firefox, it shows me the
>> source inside the page, and wioth internet explorer don't open me, it only
>> show me a blank page,
>>
>> Anybody can help me please ?? I want to do web page and I have no idea.

Download a full suite of PHP+MySQL+Apache and other tools bundled
together from www.apachefriends.de

watch the marvelous video tutorials from  www.nettuts.com

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



RE: [PHP] I'm new

2009-04-04 Thread Ernie Kemp
Good day,

I suggest going to an all in one package such as
"http://www.wampserver.com/";.
.../Ernie

-Original Message-
From: doctortomor...@gmail.com [mailto:doctortomor...@gmail.com] On Behalf
Of 9el
Sent: April-04-09 11:35 AM
To: abdulazeez alugo
Cc: rol...@gmail.com; php-general@lists.php.net
Subject: Re: [PHP] I'm new

>> Hello people, Is my first time that I try to do a web page with PHP and I
>> don't have Idea how I can do, but I read something tutorial and I can see
>> that is not difficult, I hope that I can do, what I need to work ??? with
>> PHP and MYSQL ??? Where I can to get this software because I go to
>> www.mysql.com and I download mysql for win 32 MSI and I install in my pc
but
>> I can't see nothing !!! only MYSQL 5.1 --> (mysql command line client)
>> (mysql manual) and (mysql server instance config wizard) and How I can
work
>> with mysql ?? and I download the php for www.php.net and only install me
in
>> my all programs PHP 5 and inside I just only see License and PHP.ini
>>
>> O download and installer APACHE 2.11
>>
>> 1st- download APACHE and install it
>> 2nd- download mysql and install it
>> 3rd- donwload PHP and install it
>>
>> It is correct this way ?? I read a tutorial with this ways, but when I
>> create a name.php page and put inside of apache server program
>> files-->apache-->htdocs if I try to open with firefox, it shows me the
>> source inside the page, and wioth internet explorer don't open me, it
only
>> show me a blank page,
>>
>> Anybody can help me please ?? I want to do web page and I have no idea.

Download a full suite of PHP+MySQL+Apache and other tools bundled
together from www.apachefriends.de

watch the marvelous video tutorials from  www.nettuts.com

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


No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.285 / Virus Database: 270.11.41/2040 - Release Date: 04/03/09
17:54:00


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



Re: [PHP] suhosin and sessions

2009-04-04 Thread Michael A. Peters

Michael A. Peters wrote:

suhosin forum is currently down so I can't ask there.

I'm using https for login but the rest of the site is not https

www.domain.com is regular
secure.domain.com is https

I set the session cookie this way:

ini_set("session.cookie_domain",".domain.com");

Works beautifully w/o suhosin - the login can happen on secure server 
and then set the necessary session bits for the insecure server to know 
user is authenticated.


First issue was session data encryption, which is suppose to be 
transparent but doesn't appear to be if set in one domain and read in 
other. It looks configurable but since it is my server w/o no other 
users and I'm using database for sessions, I tries just turning it off via


ini_set('suhosin.session.encrypt','0');

in my include that starts the session.

However, that didn't solve the problem. So I also added

ini_set('suhosin.cookie.encrypt','0');

but still no joy - session data set in one domain is wiped as soon as 
the cookie is sent to another domain.


I'd really rather not remove the suhosin module, how can tell suhosin to 
just leave my sessions the smurf alone?




OK - I seemed to have solved it.
The first issue - suhosin doesn't allow you to ini_set in a script - 
that actually makes sense.


The real issue in my case was not different domains but different 
document roots. Probably for shared server reasons, by default suhosin 
uses the document root as part of its session encryption.


suhosin.session.cryptdocroot = Off

in the php.ini fixed the issue - and lets me keep the suhosin 
transparent encryption (which has some session hijacking protection, so 
is a good thing to have).


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



Re: [PHP] PHP/MySQL ISP recommendation that lets one edit ft_min_word_len variable?

2009-04-04 Thread Richard Heyes
Hi,

> Can anyone here recommend an ISP that will let me have a dedicated
> server (not shared), and also allow me to adjust the ft_min_word_len
> mySQL parameter?  I was originally thinking Dreamhost PS, but I
> recently found out that they do not allow changes to mySQL
> environmental variables.  I really need to adjust ft_min_word_len so
> that I can do rapid text searches on words less than 4 chars.

Dan the man on this very mailing list. Or Rackspace.

-- 
Richard Heyes

HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.net (Updated March 28th)

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



Re: [PHP] I'm new

2009-04-04 Thread 9el

 Hi Roly,

 As previously advised, the best you can do to get started is to
install a bundle
 http://www.apachefriends.org/en/xampp-windows.html

 If you are a native Spanish speaker (I'm guessing, because of your "salu2")
 check the PHP-MySQL tutorials here http://www.illasaron.com/, you can find
 single lessons or full courses on the left sidebar here
 http://www.illasaron.com/html/ and a supporting forum here
 http://www.illasaron.com/phpBB2/viewforum.php?f=24. You'll need to register for
 accessing the direct downloads, registering is free (there are also .torrent
 downloads for the illasaron courses at thepiratebay.org)

 Regards,

 Rob



Rob, please keep the mail to the list. It came to me individually
only! where as I didn't ask for the solution :)\

Well, yes  ApacheFriend's XAMPP is one of the best suites ever with
lots of things in there.

And www.nettuts.com just last month released really nice tutorials for
beginners on PHP so thats really recommended if anyone wants to start
learning PHP + MySQL

Regards

Lenin
www.twitter.com/nine_L

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



[PHP] Submitting URLs in IE

2009-04-04 Thread Skip Evans

Hey all,

I have an application that uses AJAX to submit a page created 
in the FCKeditor. It builds a URL and then submits that to the 
server with a JavaScript call like this:


req.open('GET', url, false);

In Firefox it works great for just about any size page you 
could want, but IE just stops on even medium size pages.


Is this some kind of limitation in IE that can be increased 
with a registry setting or something?


Any suggestions would be helpful, as I am a bit perplexed.

Would using POST rather than get to submit the URL to the 
server handle more data?


--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

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



Re: [PHP] ms-word reading from PHP on linux O.S

2009-04-04 Thread 9el
On Tue, Feb 24, 2009 at 1:38 PM, Per Jessen  wrote:

> Srinivasa Rao D wrote:
>
> > Hi all,
> >   * How better, i can  read ms-word doc files  from PHP on LINUX
> >   OS*.
> [snip]
> >
> >   *Is there are any other softwares that can fetch text from MS-WORD
> >   file?.*
>

Word documents reading using COM in PHP have a look
http://drewd.com/2007/01/25/reading-from-a-word-document-with-com-in-php

Lenin
www.twitter.com/nine_L


[PHP] AJAX with POST

2009-04-04 Thread Skip Evans

Hey all,

At the risk of being told this is a PHP and not a JS list, but 
also knowing the discussions on this list, to the benefit of 
all I believe, very wildly, I'm posting this JS code snippet 
for some advice.


As I posted earlier, my AJAX app that uses a GET to post to 
the server (and get a response), fails on IE with larger data, 
so I thought I'd take a shot at writing a POST function, but 
so far I can get it to get the data back, but the problem is 
by the time the data has come back the function has already 
returned null back to the calling function. What I need this 
function to do is wait for the data to come back and then send 
it back to caller. Here's the function. Any advice would be 
greatly appreciated. (The code to get the appropriate object 
per browser has been omitted.)


http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type", 
"application/x-www-form-urlencoded");

http.setRequestHeader("Content-length", url.length);
http.setRequestHeader("Connection", "close");

http.send(url);

http.onreadystatechange = function() {//Call a function when 
the state changes.

if(http.readyState == 4 && http.status == 200) {
alert('['+http.responseText+']');
return (http.responseText);
}
}
--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

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



RE: [PHP] I'm new

2009-04-04 Thread Andrés Robinet
> -Original Message-
> From: doctortomor...@gmail.com [mailto:doctortomor...@gmail.com] On Behalf
> Of 9el
> Sent: Sábado, 04 de Abril de 2009 12:52 p.m.
> To: Andrés Robinet; php-general@lists.php.net
> Subject: Re: [PHP] I'm new
> 
> 
>  Hi Roly,
> 
>  As previously advised, the best you can do to get started is to
> install a bundle
>  http://www.apachefriends.org/en/xampp-windows.html
> 
>  If you are a native Spanish speaker (I'm guessing, because of your
> "salu2")
>  check the PHP-MySQL tutorials here http://www.illasaron.com/, you can find
>  single lessons or full courses on the left sidebar here
>  http://www.illasaron.com/html/ and a supporting forum here
>  http://www.illasaron.com/phpBB2/viewforum.php?f=24. You'll need to
> register for
>  accessing the direct downloads, registering is free (there are also
> .torrent
>  downloads for the illasaron courses at thepiratebay.org)
> 
>  Regards,
> 
>  Rob
> 
> 
> 
> Rob, please keep the mail to the list. It came to me individually
> only! where as I didn't ask for the solution :)\
> 
> Well, yes  ApacheFriend's XAMPP is one of the best suites ever with
> lots of things in there.
> 
> And www.nettuts.com just last month released really nice tutorials for
> beginners on PHP so thats really recommended if anyone wants to start
> learning PHP + MySQL
> 
> Regards
> 
> Lenin
> www.twitter.com/nine_L

Ooops! I forgot the "reply to all" trick ;)

I pointed out illasaron.com because it's Spanish and there's a Spanish community
around. I thought Roly is a Spanish speaker, because "salu2" is a short for
"saludos" (=greetings/regards) and he said he's also learning English.

Illasaron PHP+MySQL course starts from basic HTML all the way up to session
handling, OOP, XML Processing in PHP, building a shopping cart and creating a
small CMS. You can download single "lessons" (there are about 50 I think) or the
whole DVD as an ISO. I have nothing against nettuts.com, It's just that I prefer
facing one challenge at a time rather than three at once (learning English,
installing apache+php+mysql, learning PHP). By the time I started with English
PHP courses I could understand written and oral English already, and by the time
I learnt to install and set up a WAMP or LAMP suite from scratch, I already knew
enough PHP to do more than "hello world".

It's just that he can learn English by reading eBooks and listening to the BBC
(http://www.bbc.co.uk/worldservice/meta/tx/nb/live/www15.asx). He can learn to
manually install and set up a full Apache+PHP+MySQL suite later. One challenge
at a time avoids frustration, that's just my experience and point of view.

Regards,

Rob
 
Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 |
TEL 954-607-4296 | FAX 954-337-2695 | 
Email: i...@bestplace.net  | MSN Chat: b...@bestplace.net  |  SKYPE: bestplace |
Web: bestplace.biz  | Web: seo-diy.com


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



[PHP] Possible Server Infection?

2009-04-04 Thread sono-io

Hi all,

	I was wondering if someone might know about a problem I'm having on  
my server.  It appears that I've been infected by a rogue PHP  
script(?).  Something has gone through my server and placed .htaccess  
files in every directory that didn't have one with contents that look  
like this:


Options -MultiViews
ErrorDocument 404 //graphics/cc/52.php

	The path is different for each file and corresponds to the directory  
that it's in.  The php document name is a different number for each  
file I've found.


	Does this sound familiar to anyone?  What would be the purpose of  
placing files like these in the directories?  As far as I know, there  
isn't a file called "52.php" anywhere on my site, so this doesn't  
make any sense to me.


	I realize that this is a very general question, but I'm hoping that  
someone has seen or heard of this type of thing before and can help me  
eliminate the problem.


I'm using A2 Hosting and they don't know why this happened.

Thanks,
Frank

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



Re: [PHP] AJAX with POST

2009-04-04 Thread Phpster



On Apr 4, 2009, at 17:30, Skip Evans  wrote:


Hey all,

At the risk of being told this is a PHP and not a JS list, but also  
knowing the discussions on this list, to the benefit of all I  
believe, very wildly, I'm posting this JS code snippet for some  
advice.


As I posted earlier, my AJAX app that uses a GET to post to the  
server (and get a response), fails on IE with larger data, so I  
thought I'd take a shot at writing a POST function, but so far I can  
get it to get the data back, but the problem is by the time the data  
has come back the function has already returned null back to the  
calling function. What I need this function to do is wait for the  
data to come back and then send it back to caller. Here's the  
function. Any advice would be greatly appreciated. (The code to get  
the appropriate object per browser has been omitted.)


http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form- 
urlencoded");

http.setRequestHeader("Content-length", url.length);
http.setRequestHeader("Connection", "close");

http.send(url);

http.onreadystatechange = function() {//Call a function when the  
state changes.

if(http.readyState == 4 && http.status == 200) {
   alert('['+http.responseText+']');
   return (http.responseText);
   }
}
--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut

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



Skip,

You didn't show the code to build the url variable but I would assume  
that since you started with a get method you are tacking data onto the  
end of the URL that is the called Ajax page.


I had the same issue at work correcting the VP's mistake of mixing up  
post and get in his ajax call. The trick is to build the data  
separately from the URL and pass it.


I do an ajax.open(URL) then an Ajax. Send(data) to send just the data.

I can post my entire function set if you want.

Bastien 


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



Re: [PHP] ms-word reading from PHP on linux O.S

2009-04-04 Thread Phpster



On Apr 4, 2009, at 15:19, 9el  wrote:


On Tue, Feb 24, 2009 at 1:38 PM, Per Jessen  wrote:


Srinivasa Rao D wrote:


Hi all,
 * How better, i can  read ms-word doc files  from PHP on LINUX
 OS*.

[snip]


 *Is there are any other softwares that can fetch text from MS-WORD
 file?.*




Word documents reading using COM in PHP have a look
http://drewd.com/2007/01/25/reading-from-a-word-document-with-com-in-php

Lenin
www.twitter.com/nine_L


COM doesn't work on linux. Try using open office if available. What do  
you need to do with the doc file?


Bastien

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



Re: [PHP] Submitting URLs in IE

2009-04-04 Thread Phpster



On Apr 4, 2009, at 14:07, Skip Evans  wrote:


Hey all,

I have an application that uses AJAX to submit a page created in the  
FCKeditor. It builds a URL and then submits that to the server with  
a JavaScript call like this:


req.open('GET', url, false);

In Firefox it works great for just about any size page you could  
want, but IE just stops on even medium size pages.


Is this some kind of limitation in IE that can be increased with a  
registry setting or something?


Any suggestions would be helpful, as I am a bit perplexed.

Would using POST rather than get to submit the URL to the server  
handle more data?


--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut

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



Skip,

Get limits you to about 2Kb of data. Post is the better way to handle it

Bastien

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



[PHP] RE: AJAX with POST

2009-04-04 Thread Brad Broerman
Well, as the "A" in Ajax is asynchronous, there's no real way to make it
wait. What you would normally do is use a callback:

function createXHRObject( )
{
if (typeof XMLHttpRequest != "undefined")
{
return new XMLHttpRequest();
}
else if (typeof ActiveXObject != "undefined")
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
throw new Error("XMLHttpRequest not supported");
}
}

function sendAjaxRequest( websvcurl , params, callbackFn )
{
var xhrObject = createXHRObject();

xhrObject.open("POST", websvcurl, true);
xhrObject.onreadystatechange = function()
{
if (xhrObject.readyState == 4)
{
if( xhrObject.responseXML != null )
{
callbackFn (xhrObject.responseXML);
}
}
}

xhrObject.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
xhrObject.setRequestHeader("Content-length", params.length);
xhrObject.setRequestHeader("Connection", "close");
xhrObject.send(params);
}


-Original Message-
From: Skip Evans [mailto:s...@bigskypenguin.com]
Sent: Saturday, April 04, 2009 5:30 PM
To: php-general@lists.php.net
Subject: AJAX with POST


Hey all,

At the risk of being told this is a PHP and not a JS list, but
also knowing the discussions on this list, to the benefit of
all I believe, very wildly, I'm posting this JS code snippet
for some advice.

As I posted earlier, my AJAX app that uses a GET to post to
the server (and get a response), fails on IE with larger data,
so I thought I'd take a shot at writing a POST function, but
so far I can get it to get the data back, but the problem is
by the time the data has come back the function has already
returned null back to the calling function. What I need this
function to do is wait for the data to come back and then send
it back to caller. Here's the function. Any advice would be
greatly appreciated. (The code to get the appropriate object
per browser has been omitted.)

http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", url.length);
http.setRequestHeader("Connection", "close");

http.send(url);

http.onreadystatechange = function() {//Call a function when
the state changes.
if(http.readyState == 4 && http.status == 200) {
alert('['+http.responseText+']');
return (http.responseText);
}
}
--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
  -- Kurt Vonnegut


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



Re: [PHP] AJAX with POST

2009-04-04 Thread Skip Evans

Hey Bastien & all,

...D'oh! Thanks for the catch, yes, I am sending args on the 
URL. But more to my problem, if I switch to POST will IE be 
able to submit more data? If so, I can parse the URL down in 
the function and build a proper post transaction, but my real 
problem is IE can't submit, apparently, more than 2K through a 
GET.


Do you know if POST can handle more?

Thanks tons for your reply!

Skip

PS. I'd very interested in seeing your set of functions.


Phpster wrote:



On Apr 4, 2009, at 17:30, Skip Evans  wrote:


Hey all,

At the risk of being told this is a PHP and not a JS list, but also 
knowing the discussions on this list, to the benefit of all I believe, 
very wildly, I'm posting this JS code snippet for some advice.


As I posted earlier, my AJAX app that uses a GET to post to the server 
(and get a response), fails on IE with larger data, so I thought I'd 
take a shot at writing a POST function, but so far I can get it to get 
the data back, but the problem is by the time the data has come back 
the function has already returned null back to the calling function. 
What I need this function to do is wait for the data to come back and 
then send it back to caller. Here's the function. Any advice would be 
greatly appreciated. (The code to get the appropriate object per 
browser has been omitted.)


http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type", 
"application/x-www-form-urlencoded");

http.setRequestHeader("Content-length", url.length);
http.setRequestHeader("Connection", "close");

http.send(url);

http.onreadystatechange = function() {//Call a function when the state 
changes.

if(http.readyState == 4 && http.status == 200) {
   alert('['+http.responseText+']');
   return (http.responseText);
   }
}
--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut

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



Skip,

You didn't show the code to build the url variable but I would assume 
that since you started with a get method you are tacking data onto the 
end of the URL that is the called Ajax page.


I had the same issue at work correcting the VP's mistake of mixing up 
post and get in his ajax call. The trick is to build the data separately 
from the URL and pass it.


I do an ajax.open(URL) then an Ajax. Send(data) to send just the data.

I can post my entire function set if you want.

Bastien


--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

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



Re: [PHP] RE: AJAX with POST

2009-04-04 Thread Skip Evans

But my function using GET does seem to wait.

Granted I cobbled it together from various samples and didn't 
author it from my own deep understanding of the exact process, 
but here's the snippet that does the real work.


req.open('GET', url, false);
req.send(null);

if(req.responseText) {
   if(req.responseText.substring(0,7) == 'debug!!') {
   alert(req.responseText.substring(7));
   }
}

return(req.responseText);

It seems to wait until it has data to return, because it works 
perfectly. I can send it a URL from another function and get 
the data back from server to the function as expected.


The only part of it I'm unsure of is this:

req.send(null);

What does that do? As I said, I cobbled this function from 
examples, got it working, and presto, was off and running.


Skip


Brad Broerman wrote:

Well, as the "A" in Ajax is asynchronous, there's no real way to make it
wait. What you would normally do is use a callback:

function createXHRObject( )
{
if (typeof XMLHttpRequest != "undefined")
{
return new XMLHttpRequest();
}
else if (typeof ActiveXObject != "undefined")
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
throw new Error("XMLHttpRequest not supported");
}
}

function sendAjaxRequest( websvcurl , params, callbackFn )
{
var xhrObject = createXHRObject();

xhrObject.open("POST", websvcurl, true);
xhrObject.onreadystatechange = function()
{
if (xhrObject.readyState == 4)
{
if( xhrObject.responseXML != null )
{
callbackFn (xhrObject.responseXML);
}
}
}

xhrObject.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
xhrObject.setRequestHeader("Content-length", params.length);
xhrObject.setRequestHeader("Connection", "close");
xhrObject.send(params);
}


-Original Message-
From: Skip Evans [mailto:s...@bigskypenguin.com]
Sent: Saturday, April 04, 2009 5:30 PM
To: php-general@lists.php.net
Subject: AJAX with POST


Hey all,

At the risk of being told this is a PHP and not a JS list, but
also knowing the discussions on this list, to the benefit of
all I believe, very wildly, I'm posting this JS code snippet
for some advice.

As I posted earlier, my AJAX app that uses a GET to post to
the server (and get a response), fails on IE with larger data,
so I thought I'd take a shot at writing a POST function, but
so far I can get it to get the data back, but the problem is
by the time the data has come back the function has already
returned null back to the calling function. What I need this
function to do is wait for the data to come back and then send
it back to caller. Here's the function. Any advice would be
greatly appreciated. (The code to get the appropriate object
per browser has been omitted.)

http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", url.length);
http.setRequestHeader("Connection", "close");

http.send(url);

http.onreadystatechange = function() {//Call a function when
the state changes.
if(http.readyState == 4 && http.status == 200) {
alert('['+http.responseText+']');
return (http.responseText);
}
}
--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
  -- Kurt Vonnegut




--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

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



Re: [PHP] Possible Server Infection?

2009-04-04 Thread TG
Had to deal with a rogue PHP based backdoor situation recently.  Two remote 
management scripts were installed somehow that would allow you to do 
something like what you describe.

You probably want to download a fresh copy of the entire site (assuming you 
don't have remote shell access and/or the desire to use remote *nix 
commands to do any of this) and see if whatever your favorite editor is 
has a "find in files" function.

Using this, I searched for all the files that may contain the PHP "eval" 
function, or "fopen" or other commands that could potentially allow 
editing/creating files or executing *nix commands or arbitrary PHP 
functions.

Also, check the permissions on the files and directories on your site.


Another thing I did was to use a version control software to see if any 
files changed after I redownloaded the site and if any new files were 
added.  I'm sure there's a way to do this with SVN or CVS or GIT or 
something, but I used a Windows based system called Code Co-op.

If/when you find the script that may have allowed this, you can look at 
your raw web logs and see who was accessing that file.  You should be 
able to at least get their IP address and with that, you can get some 
information about them.  Or just hand it over to the authorities or 
whatever you want to do.


If you're really curious... if you find the backdoor script file, you can 
modify it to either not function, or appear to function but not really do 
anything bad, etc.  More importantly, you could modify it to collect 
information (what little you can at least) about the person accessing it. 
 This could include some javascript to get additional information about 
their browser, OS, etc.  Google "Browserhawk" for an example of what 
information you can get from someone's browser.

Anyway, just some thoughts.  Good luck!

-TG

- Original Message -
From: sono...@fannullone.us
To: php-general@lists.php.net
Date: Sat, 4 Apr 2009 16:12:06 -0700
Subject: [PHP] Possible Server Infection?

> Hi all,
> 
>   I was wondering if someone might know about a problem I'm having on  
> my server.  It appears that I've been infected by a rogue PHP  
> script(?).  Something has gone through my server and placed .htaccess  
> files in every directory that didn't have one with contents that look  
> like this:
> 
> Options -MultiViews
> ErrorDocument 404 //graphics/cc/52.php
> 
>   The path is different for each file and corresponds to the directory  
> that it's in.  The php document name is a different number for each  
> file I've found.
> 
>   Does this sound familiar to anyone?  What would be the purpose of  
> placing files like these in the directories?  As far as I know, there  
> isn't a file called "52.php" anywhere on my site, so this doesn't  
> make any sense to me.
> 
>   I realize that this is a very general question, but I'm hoping that  
> someone has seen or heard of this type of thing before and can help me  
> eliminate the problem.
> 
>   I'm using A2 Hosting and they don't know why this happened.
> 
> Thanks,
> Frank
> 
> -- 
> 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] AJAX with POST

2009-04-04 Thread Phpster

Yep, much more

Bastien

Sent from my iPod

On Apr 4, 2009, at 21:24, Skip Evans  wrote:


Hey Bastien & all,

...D'oh! Thanks for the catch, yes, I am sending args on the URL.  
But more to my problem, if I switch to POST will IE be able to  
submit more data? If so, I can parse the URL down in the function  
and build a proper post transaction, but my real problem is IE can't  
submit, apparently, more than 2K through a GET.


Do you know if POST can handle more?

Thanks tons for your reply!

Skip

PS. I'd very interested in seeing your set of functions.


Phpster wrote:

On Apr 4, 2009, at 17:30, Skip Evans  wrote:

Hey all,

At the risk of being told this is a PHP and not a JS list, but  
also knowing the discussions on this list, to the benefit of all I  
believe, very wildly, I'm posting this JS code snippet for some  
advice.


As I posted earlier, my AJAX app that uses a GET to post to the  
server (and get a response), fails on IE with larger data, so I  
thought I'd take a shot at writing a POST function, but so far I  
can get it to get the data back, but the problem is by the time  
the data has come back the function has already returned null back  
to the calling function. What I need this function to do is wait  
for the data to come back and then send it back to caller. Here's  
the function. Any advice would be greatly appreciated. (The code  
to get the appropriate object per browser has been omitted.)


http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form- 
urlencoded");

http.setRequestHeader("Content-length", url.length);
http.setRequestHeader("Connection", "close");

http.send(url);

http.onreadystatechange = function() {//Call a function when the  
state changes.

if(http.readyState == 4 && http.status == 200) {
  alert('['+http.responseText+']');
  return (http.responseText);
  }
}
--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut

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


Skip,
You didn't show the code to build the url variable but I would  
assume that since you started with a get method you are tacking  
data onto the end of the URL that is the called Ajax page.
I had the same issue at work correcting the VP's mistake of mixing  
up post and get in his ajax call. The trick is to build the data  
separately from the URL and pass it.
I do an ajax.open(URL) then an Ajax. Send(data) to send just the  
data.

I can post my entire function set if you want.
Bastien


--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut

--
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] RE: AJAX with POST

2009-04-04 Thread Phpster
Ajax can be both async and sync. Itsbthe fourth param in the open call  
and I believe by default it's a sync call not async


Bastien

Sent from my iPod

On Apr 4, 2009, at 21:33, Skip Evans  wrote:


But my function using GET does seem to wait.

Granted I cobbled it together from various samples and didn't author  
it from my own deep understanding of the exact process, but here's  
the snippet that does the real work.


req.open('GET', url, false);
req.send(null);

if(req.responseText) {
  if(req.responseText.substring(0,7) == 'debug!!') {
  alert(req.responseText.substring(7));
  }
}

return(req.responseText);

It seems to wait until it has data to return, because it works  
perfectly. I can send it a URL from another function and get the  
data back from server to the function as expected.


The only part of it I'm unsure of is this:

req.send(null);

What does that do? As I said, I cobbled this function from examples,  
got it working, and presto, was off and running.


Skip


Brad Broerman wrote:
Well, as the "A" in Ajax is asynchronous, there's no real way to  
make it

wait. What you would normally do is use a callback:
   function createXHRObject( )
   {
   if (typeof XMLHttpRequest != "undefined")
   {
   return new XMLHttpRequest();
   }
   else if (typeof ActiveXObject != "undefined")
   {
   return new ActiveXObject("Microsoft.XMLHTTP");
   }
   else
   {
   throw new Error("XMLHttpRequest not supported");
   }
   }
   function sendAjaxRequest( websvcurl , params, callbackFn )
   {
   var xhrObject = createXHRObject();
   xhrObject.open("POST", websvcurl, true);
   xhrObject.onreadystatechange = function()
   {
   if (xhrObject.readyState == 4)
   {
   if( xhrObject.responseXML != null )
   {
   callbackFn (xhrObject.responseXML);
   }
   }
   }
   xhrObject.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
   xhrObject.setRequestHeader("Content-length", params.length);
   xhrObject.setRequestHeader("Connection", "close");
   xhrObject.send(params);
   }
-Original Message-
From: Skip Evans [mailto:s...@bigskypenguin.com]
Sent: Saturday, April 04, 2009 5:30 PM
To: php-general@lists.php.net
Subject: AJAX with POST
Hey all,
At the risk of being told this is a PHP and not a JS list, but
also knowing the discussions on this list, to the benefit of
all I believe, very wildly, I'm posting this JS code snippet
for some advice.
As I posted earlier, my AJAX app that uses a GET to post to
the server (and get a response), fails on IE with larger data,
so I thought I'd take a shot at writing a POST function, but
so far I can get it to get the data back, but the problem is
by the time the data has come back the function has already
returned null back to the calling function. What I need this
function to do is wait for the data to come back and then send
it back to caller. Here's the function. Any advice would be
greatly appreciated. (The code to get the appropriate object
per browser has been omitted.)
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", url.length);
http.setRequestHeader("Connection", "close");
http.send(url);
http.onreadystatechange = function() {//Call a function when
the state changes.
if(http.readyState == 4 && http.status == 200) {
   alert('['+http.responseText+']');
   return (http.responseText);
   }
}
--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut


--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut

--
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] RE: AJAX with POST

2009-04-04 Thread Bruno Fajardo
Ajax is asynchronous. The option of asynchronous or synchronous can be set
in the XMLHTTPRequest object (used by Ajax), but a synchronous call is not
Ajax.

Cheers,
Bruno.

2009/4/5 Phpster 

> Ajax can be both async and sync. Itsbthe fourth param in the open call and
> I believe by default it's a sync call not async
>
> Bastien
>
> Sent from my iPod
>
> On Apr 4, 2009, at 21:33, Skip Evans  wrote:
>
>  But my function using GET does seem to wait.
>>
>> Granted I cobbled it together from various samples and didn't author it
>> from my own deep understanding of the exact process, but here's the snippet
>> that does the real work.
>>
>> req.open('GET', url, false);
>> req.send(null);
>>
>> if(req.responseText) {
>>  if(req.responseText.substring(0,7) == 'debug!!') {
>>  alert(req.responseText.substring(7));
>>  }
>> }
>>
>> return(req.responseText);
>>
>> It seems to wait until it has data to return, because it works perfectly.
>> I can send it a URL from another function and get the data back from server
>> to the function as expected.
>>
>> The only part of it I'm unsure of is this:
>>
>> req.send(null);
>>
>> What does that do? As I said, I cobbled this function from examples, got
>> it working, and presto, was off and running.
>>
>> Skip
>>
>>
>> Brad Broerman wrote:
>>
>>> Well, as the "A" in Ajax is asynchronous, there's no real way to make it
>>> wait. What you would normally do is use a callback:
>>>   function createXHRObject( )
>>>   {
>>>   if (typeof XMLHttpRequest != "undefined")
>>>   {
>>>   return new XMLHttpRequest();
>>>   }
>>>   else if (typeof ActiveXObject != "undefined")
>>>   {
>>>   return new ActiveXObject("Microsoft.XMLHTTP");
>>>   }
>>>   else
>>>   {
>>>   throw new Error("XMLHttpRequest not supported");
>>>   }
>>>   }
>>>   function sendAjaxRequest( websvcurl , params, callbackFn )
>>>   {
>>>   var xhrObject = createXHRObject();
>>>   xhrObject.open("POST", websvcurl, true);
>>>   xhrObject.onreadystatechange = function()
>>>   {
>>>   if (xhrObject.readyState == 4)
>>>   {
>>>   if( xhrObject.responseXML != null )
>>>   {
>>>   callbackFn (xhrObject.responseXML);
>>>   }
>>>   }
>>>   }
>>>   xhrObject.setRequestHeader("Content-type",
>>> "application/x-www-form-urlencoded");
>>>   xhrObject.setRequestHeader("Content-length", params.length);
>>>   xhrObject.setRequestHeader("Connection", "close");
>>>   xhrObject.send(params);
>>>
>>>   }
>>> -Original Message-
>>> From: Skip Evans [mailto:s...@bigskypenguin.com]
>>> Sent: Saturday, April 04, 2009 5:30 PM
>>> To: php-general@lists.php.net
>>> Subject: AJAX with POST
>>> Hey all,
>>> At the risk of being told this is a PHP and not a JS list, but
>>> also knowing the discussions on this list, to the benefit of
>>> all I believe, very wildly, I'm posting this JS code snippet
>>> for some advice.
>>> As I posted earlier, my AJAX app that uses a GET to post to
>>> the server (and get a response), fails on IE with larger data,
>>> so I thought I'd take a shot at writing a POST function, but
>>> so far I can get it to get the data back, but the problem is
>>> by the time the data has come back the function has already
>>> returned null back to the calling function. What I need this
>>> function to do is wait for the data to come back and then send
>>> it back to caller. Here's the function. Any advice would be
>>> greatly appreciated. (The code to get the appropriate object
>>> per browser has been omitted.)
>>> http.open("POST", url, true);
>>> //Send the proper header information along with the request
>>> http.setRequestHeader("Content-type",
>>> "application/x-www-form-urlencoded");
>>> http.setRequestHeader("Content-length", url.length);
>>> http.setRequestHeader("Connection", "close");
>>> http.send(url);
>>> http.onreadystatechange = function() {//Call a function when
>>> the state changes.
>>> if(http.readyState == 4 && http.status == 200) {
>>>   alert('['+http.responseText+']');
>>>   return (http.responseText);
>>>   }
>>> }
>>> --
>>> 
>>> Skip Evans
>>> Big Sky Penguin, LLC
>>> 503 S Baldwin St, #1
>>> Madison WI 53703
>>> 608.250.2720
>>> http://bigskypenguin.com
>>> 
>>> Those of you who believe in
>>> telekinesis, raise my hand.
>>>  -- Kurt Vonnegut
>>>
>>
>> --
>> 
>> Skip Evans
>> Big Sky Penguin, LLC
>> 503 S Baldwin St, #1
>> Madison WI 53703
>> 608.250.2720
>> http://bigskypenguin.com
>> 
>> Those of you who believe in
>> telekinesis, raise my hand.
>> -- Kurt Vonnegut
>>
>> --
>> 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/u