Re: [PHP] Re: automatic caller

2008-01-03 Thread FrozenDice
If you want to make the job really easy go with Delphi, yeah I know
it's not PHP, but it comes with the Jedi components, which I'm pretty
sure have a built in Speech component, and you can do the Skype api on
it.

- Dan

On Jan 3, 2008 1:53 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Wed, January 2, 2008 4:35 pm, Dan wrote:
> > ""blackwater dev"" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >> I'm working on a prototype now and was wondering if anyone new of a
> >> service
> >> where I could pass in text and a number and the service would call
> >> the
> >> number and read the text.  I know I can do this with asterisk and
> >> it's php
> >> api but don't have time to set up all the outgoing
> >> code/functionality.
> >> Does
> >> anyone know of a service that does this so I can show it as a proof
> >> of
> >> concept.  I looked at GrandCentral but it doesn't appear to have
> >> this
> >> feature.
> >>
> >> Thanks!
> >
> > A simple google search for "automated calling" returns a lot of
> > results,
> > although most are services which you have to pay to use and they dont'
> > seem
> > like you can just call them with text but must have a pre-recorded
> > message.
> > Off the top of my head probably the simplest thing would be to just
> > use the
> > Skype API and use them for calls.  Since this is just a prototype then
> > there
> > probably won't be many calls made on it and it should not be very
> > expensive.
> > You would have to combine the skype API though with some kind of text
> > to
> > speech software.
>
> If you go this route, "festival" is a nice open source text-to-speech
> engine that is reasonably easy to install and get going.
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
>

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



Re: [PHP] PHP calling an ISAPI Extension

2007-06-22 Thread FrozenDice

On 6/22/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/22/07, FrozenDice <[EMAIL PROTECTED]> wrote:
> What do you mean not all the data is sent at once?  I'm doing a http
> request, the browser responds sending back the code for the page.
> I've never heard of it sending back multiple responses.  Plus I'm
> controling what the server sends from the ISAPI code, I'm only sending
> info back once.  I'm kinda confused on this whole not sending all the
> data at once.
>
> - Dan

That's just the way how our network works :)
HTTP is over TCP/IP.
TCP/IP sends data in packets, each package is max. 1500 bytes.
So, when your server sends a site of let's say 1200 bytes then all
data will be in one single packet. But when your site returned is more
then 1500 bytes, your site will be split across multiple packets.
Reading with fread stops after a package is available...
This is also noted in the second warning on the fread manual page[1].

Tijnema

ps. Please don't top post

pps. When you make reply, make sure you have the PHP list in your To:
or Cc:, most mail clients allow you to use "Reply to all" for this.

[1] http://www.php.net/fread



Thanks, I'm pretty new to Newsgroups so I don't know all the
etiquette.  I'm actually sometimes reading through email but usually
I'm using a newsreader so when a message doen't get to the server it's
because I forgot to click reply all in gmail.

I'll give another look at your code and try to implement it.  It
shouldn't take too much longer because the page it's calling is on the
same machine.  :D

- Dan

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



Re: [PHP] Re: get domain component from email

2007-08-07 Thread FrozenDice
I guess I was just happy that I was able to remember how to do PHP.  Yeah,
that one works better.  Just seemed a bit similar.  Besides, people usually
give pseudo code any way rather than working code.  My code didn't work.
Yours was better.

- Dan

On 8/7/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
>
> Stut wrote:
> > Jim Lucas wrote:
> >> Dan wrote:
> >>> What are you trying to do exactly, maybe there's a better way.  If
> >>> you're trying to determine if an email address is valid there's a
> >>> pretty cool way to do so by using dns records.  It's like 5 lines,
> >>> here's the site
> http://www.sitepoint.com/article/users-email-address-php
> >>>
> >>> As far as actually just getting the domain, w/o subdomains from a
> >>> string you could try this.  I'm not sure if the code runs because I
> >>> haven't tested it, and I have been working exclusively with Delphi
> >>> for a month so something might be off.
> >>>
> >>> function getDomain($email)
> >>> {
> >>> list($userName, $mailDomain) = split("@", $email);
> >>> $anarray = split(".", $mailDomain);
> >>> for ($i = 0; $i < count($anarray); $i++)
> >>> {
> >>>if (in_array($anarray[$i], $TLDArray)) // if $anarray[$i] is a TDL
> >>> then we move back 1 to get it's domain
> >>>return $anarray[$i-1] . '.' . $anarray[$i];
> >>> }
> >>> }
> >>
> >> As far as I can tell, this doesn't work at all.
> >>
> >> Yours,
> >>
> >> http://www.cmsws.com/examples/php/domain_verification/example2.php
> >>
> >> Mine,
> >>
> >> http://www.cmsws.com/examples/php/domain_verification/example.php
> >
> > And yours is fatally flawed. Not all ccTLDs are sub-divided.
>
> Fixed.
>
> >
> > http://dev.stut.net/php/domain.php
> >
> > http://stut.be/
> >
> > -Stut
> >
>
>
> --
> 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
>
>


-- 
Confidentiality Statement:
This message is intended only for the use of the Addressee and may contain
information that is PRIVILEGED and CONFIDENTIAL.  If you are not the
intended recipient, dissemination of this communication is prohibited.
If you have received this communication in error, please erase all
copies of the message and its attachments and notify us immediately.


Re: [PHP] Echoing input w/o sanatizing - what is the danger

2007-08-07 Thread FrozenDice
Thanks for the info Richard.  I'll check out that website.  Do they
recommend any literature about PHP security, or is there a "bible"(one book
that everyone recomends, in EE it's
http://www.amazon.com/Elements-Analysis-Electrical-Electronic-Engineering/dp/0070612854)
for PHP security like there usually is for whatever field you're in.

On 8/7/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> On Tue, August 7, 2007 4:57 pm, Dan wrote:
> > I've always heard it is bad if you let a user type some input, then
> > show it
> > back to them w/o sanatizing the code.  Eg. I have a form, where the
> > user
> > types something, they hit submit and it submits to itself then prints
> > back
> > to the user something like, account created with password: whatever
> > they
> > typed.
> >
> > Why and how do you sanatize what they typed before echoing it back to
> > them?
> > I figured it was something like they could type in PHP commands but I
> > tried
> > typeing phpinfo(); into the box and submitting.  All that happened is
> > that
> > it echoed phpinfo();
> >
> > Can someone explain this?
>
> You're actually conflating not one, but TWO (!) different problems.
>
> Number 1 is to "filter input".
> What that means specifically is to be sure that the user input looks
> EXACTLY the way you expect.
>
> Number 2 is to "escape output"
> What that means specifically is to transform any given chunk of data
> to a format suitable for its output medium.
>
> For example, ANY output headed to the browser should have
> http://php.net/htmlentities called on it.
>
> If it's headed out to a database, it should have a database-specific
> function called, such as http://php.net/mysql_real_escape_string
>
> If it's going to be data in a GET parameter in a URL, it needs
> http://php.net/urlencode called FIRST, and then htmlentities.
>
> If it's headed to XML, however, it should have some kind of XML
> function called to wrap it into CDATA or a pre-defined data type /
> format.
>
> If it's headed out to Javascript, I think you want http://php.net/json
>
> So, you've really got TWO phases:
>
> filter input; escape output
>
>
> Why it matters is that Evil People do exist, and they WILL find a way
> to cause damage to you or even to others, if you fail to do this.
>
> Common hacks include executing SQL to damage databases, or adding
> Javascript to deface websites, or even adding Javascript to use YOUR
> web-site in an attack upon another website.
>
> Here is a good starting point for some of the details of what to do
> and why:
> http://phpsec.org/
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
>