RE: [PHP] Is there a 'Beginner's' PHP List

2007-11-15 Thread Instruct ICC



> Date: Thu, 15 Nov 2007 10:17:29 -0500
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Is there a 'Beginner's' PHP List
> CC: php-general@lists.php.net
> 
> On Nov 14, 2007 10:29 PM, Instruct ICC <[EMAIL PROTECTED]> wrote:
> > I'm going to have to move this to gmail to keep it threaded better.
> 
> As long as the subject doesn't change, it works great.
> Unfortunately, I don't think Gmail uses message IDs for threading.


Thanks for reminding me to setup my gmail account with this list.  I think I'll 
do that before finding out if that guy got his HTML email working.

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Instruct ICC

> No access to the server command line to install it!
> And, I am into this guy too deep to switch technologies. For the next time
> around, no problem, this time I am just trying to get php to do what it is
> supposed to do.

[sarcastic]Rough install.[/sarcastic]  If you can write a php script, you can 
use PHPmailer http://phpmailer.sourceforge.net/tutorial.php#4


IsSMTP();  // telling the class to use SMTP

$mail->Host = "smtp.example.com"; // SMTP server



$mail->From = "[EMAIL PROTECTED]";

$mail->AddAddress("[EMAIL PROTECTED]"); 



$mail->Subject  = "An HTML Message";

$mail->Body = "Hello, my friend! \n\n This message uses HTML 
entities!";



?>

_
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC

> >> Something like the following would be much better (untested)...
> >>
> >> $page = realpath(dirname(__FILE__).'/inc/'.$_GET['page'].'.php');
> >> $expecteddir = realpath(dirname(__FILE__).'/inc');
> >> if (substr($page, 0, strlen($expecteddir)) != $expecteddir)
> >> {
> >>  // Ideally return a 403 status here
> >>  die('Access denied');
> >> }
> >> // Now we know it's a file in the right directory
> >> if (file_exists($page))
> >> {
> >>  include($page);
> >> }
> >> else
> >> {
> >>  // Return a 404 status here
> >>  die('Resource not found');
> >> }
> >>
> >> That should lock the requested page to the given directory. If anyone 
> >> can see any way around that I'd be interested in hearing about it.
> >>
> >> -Stut
> >>
> >> -- 
> >> http://stut.net/
> > 
> > Good points about (.php, evil-payload, and evil-payload.php?).
> > 
> > Although I'll defer to a security expert, your modification looks good to 
> > not include a remote site's code.
> > But on a shared host, what about this?:
> > index.php?page=../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php
> > 
> > If that gives something like:
> > $expecteddir === 
> > "/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
> > maybe it will include "/home/evil-user-home-dir/evil-payload.php"
> > 

> 
> No, you've missed the point. $expecteddir is a fixed variable that you, 
> the script author, specify. It does not contain anything coming from 
> external veriables. You then compare the full path you build from the 
> external variables to $expecteddir to verify that the file is in the 
> right directory.
> 
> I suggest you read the code I posted again.
> 
> -Stut

I meant if $page evaluates to 
"/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
which it does not.

However I don't think your if (substr($page, 0, strlen($expecteddir)) != 
$expecteddir)
ever evaluates to TRUE.  So you'll never get Access denied.

So how you set $page saved your ass.  Good job.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC

> My server is down right now so I can't do my usual example script.

A likely story.

Just kidding.

Stut, YOU WERE RIGHT, AND I WAS WRONG.
Your code is golden.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC

> >> No, you've missed the point. $expecteddir is a fixed variable that you, 
> >> the script author, specify. It does not contain anything coming from 
> >> external veriables. You then compare the full path you build from the 
> >> external variables to $expecteddir to verify that the file is in the 
> >> right directory.
> >>
> >> I suggest you read the code I posted again.
> >>
> >> -Stut
> > 
> > I meant if $page evaluates to 
> > "/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
> > which it does not.
> > 
> > However I don't think your if (substr($page, 0, strlen($expecteddir)) != 
> > $expecteddir)
> > ever evaluates to TRUE.  So you'll never get Access denied.
> > 
> > So how you set $page saved your ass.  Good job.
> 
> You clearly don't know what the realpath function does. Look it up.
> 
> -Stut

No I didn't.  And I looked it up for the previous reply.  And I said that's the 
only thing saving your ass.

Your IF never evaluates to true.

But it works to keep out the hacker.  So I said "Good job".

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC



> Date: Thu, 15 Nov 2007 13:16:46 +
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> CC: php-general@lists.php.net
> Subject: Re: [PHP] file_exists
> 
> Instruct ICC wrote:
> > 
> > 
> >> Date: Thu, 15 Nov 2007 00:20:52 +
> >> From: [EMAIL PROTECTED]
> >> To: [EMAIL PROTECTED]
> >> CC: php-general@lists.php.net
> >> Subject: Re: [PHP] file_exists
> >>
> >> Philip Thompson wrote:
> >>> I've run into similar problems where I *thought* I was looking in the
> >>> correct location... but I wasn't. Take this for example
> >>>
> >>>> $page = $_GET['page'];
> >>> if (file_exists ("$page.php")) {
> >>> include ("$page.php");
> >>> }
> >>> ?>
> >> I really hope this is not a piece of production code. If it is then you
> >> might want to think very hard about what it's doing. If you still can't
> >> see a problem let me know!
> >>
> >> -Stut
> >>
> >> --
> >> http://stut.net/
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> > 
> > Called like this?
> > 
> > index.php?page=http://evil-hacker-site.com/evil-payload.php
> > 
> > And the browser will probably url_encode for me if needed.
> 
> Actually in this example that would end up getting evil-payload.php.php 
> - probably not what your evil mind wanted. You could do this...
> 
> index.php?page=http://evil-hacker-site.com/evil-payload
> 
> ...assuming you know it's gonna stick .php on the end. Alternatively you 
> could do this...
> 
> index.php?page=http://evil-hacker-site.com/evil-payload.php?
> 
> Resulting in the appended .php being in the querystring. The easiest way 
> to protect your code from this is to always always prefix the string 
> with something as well as appending to it. For example...
> 
> $page = dirname(__FILE__).'/'.$_GET['page'].'.php';
> if (file_exists ($page)) {
>  include ($page);
> }
> 
> But that doesn't prevent a malicious user including any PHP file on your 
> server. $_GET['page'] should be one of a known set of values. At the 
> very least it should be restricted to file in a particular directory.
> 
> Something like the following would be much better (untested)...
> 
> $page = realpath(dirname(__FILE__).'/inc/'.$_GET['page'].'.php');
> $expecteddir = realpath(dirname(__FILE__).'/inc');
> if (substr($page, 0, strlen($expecteddir)) != $expecteddir)
> {
>  // Ideally return a 403 status here
>  die('Access denied');
> }
> // Now we know it's a file in the right directory
> if (file_exists($page))
> {
>  include($page);
> }
> else
> {
>  // Return a 404 status here
>  die('Resource not found');
> }
> 
> That should lock the requested page to the given directory. If anyone 
> can see any way around that I'd be interested in hearing about it.
> 
> -Stut
> 
> -- 
> http://stut.net/

Good points about (.php, evil-payload, and evil-payload.php?).

Although I'll defer to a security expert, your modification looks good to not 
include a remote site's code.
But on a shared host, what about this?:
index.php?page=../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php

If that gives something like:
$expecteddir === 
"/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
maybe it will include "/home/evil-user-home-dir/evil-payload.php"

Maybe a switch statement that only uses the file name supplied by the script 
(whether or not an unknown user supplies an actual file name.  I just did 
something like that today.  I have a custom "ls" type PHP script and I want it 
to search 1 of 2 directories only.  I check if the GET var is set; don't even 
look at the value, then do a custom "ls" on 1 or the other directory which is 
in the web path.  The whole site is behind htaccess though, but I added this 
layer for this special "ls" function.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] Re: file_exists

2007-11-15 Thread Instruct ICC

> > I think file_exists returns false for remote files ;)
> 
> Even if it did (it doesn't:
> http://uk3.php.net/manual/en/wrappers.ftp.php), I'd still rather not let
> someone steal my /etc/passwd or /etc/shadow etc. files.
> 
> As I said before. Some form of regexp or similar restriction is 100%
> necessary before trusting untrustworthy data.
> 
> Col

1 test I did confirmed the "false" for the remote files.

How about that shared host hack attempt?  Does that present a problem for 
shared hosts?

This should be my last post to this list from hotmail.  Hopefully I'll see you 
all nicely threaded with gmail.  That's where I keep my other lists anyway.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Instruct ICC

> Next time Brad, please try to take a look yourself at the line the error 
> indicates (and the lines around it aswell) and TRY to figure out what 
> MIGHT be wrong.
> 
> - Tul

If it's not on the line it reported, it may be immediately above that line.

The only unhelpful error I've seen (once you know what T_STRING means) is when 
it gives you the last line number in your entire file.

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Instruct ICC

> Still parsing as text and not html!

You should be able to do this in both PHPmailer and "Example 1127. Sending HTML 
email" before I finish reading the 60 emails I have remaining to catch up on 
this list.  Including any download.

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Instruct ICC

> We are sending email now,
> But we are back to the original problem,
> No hyperlink!
>
> $email = $_REQUEST['email'] ;
> $fromaddress .= '[EMAIL PROTECTED]';
> $fromname .= 'Zone of success Club';
> $eol="\r\n";
> $headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
> $headers .= "X-Mailer: PHP v".phpversion().$eol;
> $msg .= "--".$htmlalt_mime_boundary.$eol;
> $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
> $msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
> $body.= 'link ';
> $msg .= $body.$eol.$eol;
> mail($email, $subject, $msg, $headers);
>
>
> Yields
>
> Parse error: parse error, unexpected T_STRING in
> /home/zoneof5/public_html/index.php on line 76

If you can't deal with Example 1127. Sending HTML email 
http://php.net/manual/en/function.mail.php
Check out http://phpmailer.sourceforge.net/ and 
http://phpmailer.sourceforge.net/tutorial.php#4

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] file_exists

2007-11-14 Thread Instruct ICC



> Date: Thu, 15 Nov 2007 00:20:52 +
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> CC: php-general@lists.php.net
> Subject: Re: [PHP] file_exists
>
> Philip Thompson wrote:
>> I've run into similar problems where I *thought* I was looking in the
>> correct location... but I wasn't. Take this for example
>>
>> > $page = $_GET['page'];
>> if (file_exists ("$page.php")) {
>> include ("$page.php");
>> }
>> ?>
>
> I really hope this is not a piece of production code. If it is then you
> might want to think very hard about what it's doing. If you still can't
> see a problem let me know!
>
> -Stut
>
> --
> http://stut.net/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Called like this?

index.php?page=http://evil-hacker-site.com/evil-payload.php

And the browser will probably url_encode for me if needed.
_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Is there a 'Beginner's' PHP List

2007-11-14 Thread Instruct ICC



> Date: Wed, 14 Nov 2007 13:20:16 -0800
> From: [EMAIL PROTECTED]
> To: php-general@lists.php.net
> Subject: [PHP] Is there a 'Beginner's' PHP List
> 
> Come to think of it - if there is a more basic 'newbie' forum list (for PHP
> beginners like myself) that anyone knows of (I found a few listed below) -
> please let me know and I'll use that instead for these 'basic' questions...
> Until I get up to speed...
> 
> I found these 2 - any others (better)?
> 
> http://p2p.wrox.com/forum.asp?FORUM_ID=89
> 
> http://phpbuilder.com/board/forumdisplay.php?f=3
> 
> Others ... ?
> 
> --
> Thanks - RevDave
> Cool7 @ hosting4days . com
> [db-lists]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

Wow.  Turns out _you_ are the guy I thought the "PHP Developers and the manual" 
poster intimidated.


I'm going to have to move this to gmail to keep it threaded better.

You have enough resources, you just need to use them.

Personally, I'd post wherever I thought they should know the answer.  I never 
posted at php.net, but that is also an option.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] Newbie question - current date - time

2007-11-14 Thread Instruct ICC



> Date: Wed, 14 Nov 2007 09:39:19 -0800
> From: [EMAIL PROTECTED]
> To: php-general@lists.php.net
> Subject: [PHP] Newbie question - current date - time
>
> Hi Folks,
>
> Newbie question :
>
> - how do I get and display the current date?
> - how do I get and display the current time?
>
> I see the getdate function - but I'm not sure if this is the right function
> or how to display it
>
> http://www.php.net/manual/en/function.getdate.php
>
> --
> Thanks - RevDave
> Cool @ hosting4days . com
> [db-lists]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

You know?  I was going to chime in and blast the guy who posted "PHP Developers 
and the manual", who I think intimidated the next guy who asked if there is a 
newbie forum.

But dude, there are many ways to skin a cat.  You posted 1 method and if you 
read that link and scrolled down, you would see comments by users with actual 
code and their experiences with this function.  If their comments were not 
applicable, you could return to the "See Also" area mentioning date() and 
time().

For my first PHP job, I told my prospective employer that I didn't have any 
on-the-job experience with PHP, (but had other languages practiced and 
certified professionally), and if I would have access to the php.net website, I 
would have all I needed.  That was 5 years ago and I only subscribed to this 
general list a few months ago when my admin couldn't explain why my working 
code stopped working (and he claimed he didn't make any change, but it turns 
out he had).  However, I was on the PHP-DB list that first year.

Enough about me.  I never thought I'd say this in earnest...
RTFM

Have I become like who I've despised?
_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] enhanced_list_box

2007-11-12 Thread Instruct ICC

> I am using this function enhanced_list_box. This works
> fine. Except the return value is None. How is it possible for it to
> return a proper value. It reads a list from a data base.

while $row is valid you do stuff.

then when $row is invalid, you return it.


But maybe you knew that.

To return a "proper value"?:
while($row...[is something valid]){
$lastValidRow = $row;
...
}
$row is invalid
do something with 
$lastValidRow i.e.: return it
_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Need a hint how to track an error

2007-11-12 Thread Instruct ICC

> >> My php program is working with Firefox, but not with Internet Explorer.
> >
> > Nothing to do with php, your problem is javascript.
> >
> >> Is there a tool to find the problem?
> >
> > For IE, try
> >
> > http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en
> >
> >
> 
> Why do you guys assume javascript
> 
> I am disappointed that after switching totally from XP to Ubuntu to
> suggest me a Windows tool! I installed in a VirtualBox XP again and
> above tool helped me to find the mistake:
> 
>  }
> ?>
> 
> 
> The tool helped me to find the missing ``>'' after  showed me no value for the submit buttons.
> 
> Is there no other tool available that can find such errors? tool
>  error.list

http://validator.w3.org/

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] Help securing a server : Owned by W4n73d H4ck3r

2007-11-09 Thread Instruct ICC



> >The person doing this seems to be relatively new to the scene,
> > only defacing websites with common vulnerabilities that you can find
> > anywhere on the Internet (http://astalavista.box.sk/ for example).
> > Check out Zone-H (http://www.zone-h.net/) to see if your domains are
> > on there, and to see if you can build a pattern from his/her past
> > exploits.  That should help you in determining how he/she is doing it.
> >
> >You're on the right track in guessing that it was CMS-related.
> > Remember how many sites and servers were compromised when phpBB
> > exploits were announced and left unpatched?  These jackass skript
> > kiddies just Google for known versions and deface whatever they can.
> > It's not like the old days where you picked a target and found a way
> > in now it's just that you pick your way in and find a target.
> >
> >*yawn!* No challenge anymore these kids are too lazy

Are you using joomla cms ?  Several google hits were about that one.  My $0.02. 
 I'll defer to the security practitioner.


_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] Re: PHP ide?

2007-11-09 Thread Instruct ICC

> >> Ubuntu = Debian + New Life
> > 
> > Mandriva has Eclipse and PHPEclipse 'out of the box' along with Apache
> > and PHP
> > I can build a fully functional development machine from a pile of bits
> > in under an hour ;)
> > And currently that includes downloading the latest updates :)
> > 
> 
> +1 for Mandriva :)
> 
> As a long time Mandriva user and not-such-a-long time contributor, I've
> looked on the rise of Ubuntu with great interest. I think where they've
> excelled is in community - it's definitely got a lot of momentum but
> where this falls down is the lack of centralised management. There are
> simply too many independent package repositories out there doing there
> own packages and not necessarily getting them all correct with their
> naming and obsoletion etc. This makes it difficult for people upgrading
> in the future from ad-hoc third party packages to official packages. One
> of the things I like about Linux (distros) is the central
> packaging/deployment system as it keeps things neat, tidy and, most
> importantly, structured... Just my €0.02.

I think PCLinuxOS is based on Mandriva (I could be wrong), and it passed Ubuntu 
on distrowatch.com

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] PHP ide? Back On Topic

2007-11-09 Thread Instruct ICC

> But I highly doubt you'll find a first-class PHP code IDE (Zend Studio) that
> is also a first-class HTML layout tool (Dreamweaver).

My 2006 rant said I'll accept multiple tools.  I'll have to find that post and 
see if my needs have changed.  Ahh here:

I am looking for a tool (or tools) that can do the following:

Use a Model Driven Architecture (Ex. Gentleware's "just model" concept and 
Applied Models' "the model is the program" concept)

UML (Ex. Sun Java Studio Enterprise)

Generate Database from UML (Ex. Umbrello)

Generate Classes from UML (Ex. Umbrello/Sun Java Studio Enterprise -- backend 
classes)

UI Design (Ex. Netbeans Matisse -- frontend classes)

Integrate AJAX toolkits (Ex. Aptana/Dojo/jMaki)

Separate application code from presentation, Model-View-Controller (Ex. 
Smarty/symfony)

Deploy/Convert to HTML/Javascript (Ex. Google Web Toolkit/Visual Web Developer 
2005 Express Edition --> design in Design view and have automatic code 
generated in "code behind" Source view)

Code Refactoring (Ex. Sun Java Studio Enterprise/Netbeans)

The above tools do some part of the workflow I want, but they do not play well 
together as far as I know (usually because they are based on a specific 
language or dialect of that language).  And some do not have a web application 
as the deployment target.


> Then you don't want to be working in HTML.
True.  With the ongoing browser wars, let vendors like Yahoo and YUI handle 
that layer.
And let's start getting some decent requirements 
http://www.serena.com/products/prototype-composer/home.html and 
http://www.visual-paradigm.com/
Okay okay, maybe I'm advancing myself out of a job.
_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP ide?

2007-11-08 Thread Instruct ICC

 Blah blah blah...electricity
 You see where I'm going.
>> You forgot Adam and Eve

For those who believe "You see where I'm going".
For the others, you get vacuum fluctuations LOL.
_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP ide? Back On Topic

2007-11-08 Thread Instruct ICC

Do you pay for Ubuntu?  Maybe a support package?

Earlier this week I was pissed at Adobe Dreamweaver CS3 and their developers.  
And I began thinking that the major difference between open source software 
(free as in no $ outa my pocket) and retail closed source software is that 
maybe, just maybe, I have someone to complain to about their bugs in the retail 
case, and should just be thankful I have an ordered set of bits given to me for 
free in the open source case that sometimes gets the job done (not to mention 
sometimes getting support, community, knowledge, etc.).

I tend to fall back to DW -- currently CS3, but I'm always looking around.  It 
crashed on a paste attempt after a simple plain text copy.
The DW 8 developers didn't know how to use threads (and threads were hyped in 
that version).  They would run a thread to block my current requested action to 
do something locally by doing something remote (which I state again, I did not 
request.  If you insist on doing the remote action which I didn't request, it's 
perfect for a thread, so please put it in the background.)
I think I prefered DW MX 2004 over DW MX.  8 had a nice "fold your source 
wherever you want" feature though.
I was interested in CS3 for the Spry, but it's weak.  Back to basic hand coding 
with YUI, Scriptaculous, Xajax, etc. using DW basically as an editor and FTP 
client.

Oh and Crimson Editor when I was on MS Windows for Perl files which DW couldn't 
deal with.
I use Xcode on the Mac for Perl files now.  I should also start using Xcode for 
PHP projects.

My (perceived) problem is that I need a tool that helps me do my job well, but 
not so well that it looks like I can be replaced.  I'm telling you that Tersus 
scares me [and I will not tell my employer about it LOL].  gi.tibco.com will be 
my next real evaluation for an IDE at work.  At home I'll spend my time on 
Tersus.  Except I'm into a project at home now that is easier if I use what I 
know.

I just looked at Eclipse PDT (due to this topic and its posts).  It looks like 
a text editor with possible project grouping of files.  What do I gain by using 
it?

Aptana is okay for Ajaxy javascript and html (and I think PHP).  It's Eclipse 
again though LOL.  I just don't like when I feel constrained and can't 
absolutely place a widget (like you can in MS Visual Basic).  Netbeans Matisse 
(it has a new name now) can do it, but it deploys to Java.  Delphi for PHP 
(retail product) looks good, but its MS Windows only.  And although I can use a 
VM, I'd rather stay away from MS products.  Sun Java Studio Creator can, but 
it's Java again.

What do you want in an integrated development environment?

I would expect Zend Studio to be _the_ PHP IDE, but it doesn't meet what I want 
in an IDE.

I want to "just model" like Gentleware's Poseidon.  Maybe some UML; maybe just 
Tersus.
I want to refactor like Sun Java Studio Enterprise.
I want to layout my GUI like VB, Matisse, and Apple's Interface Builder.
I want to remote debug like Zend Studio.
I have an extensive list I made in 2006 that would make this post even longer.  
So I know I'm missing some features.
And I want it all for free as in beer and no $ out of my pocket (to use 
personally).
Well, if neccessary, I'll also have the company pay for it and expect to be 
able to use it at home like the DW licenses.
And I'll still be looking around for the next best thing.



> From: [EMAIL PROTECTED]> To: 
php-general@lists.php.net> Date: Fri, 9 Nov 2007 01:03:13 +0100> Subject: Re: 
[PHP] PHP ide? OT>> On Friday 09 November 2007 00:47:56 you wrote:>> On Fri, 
2007-11-09 at 00:28 +0100, Børge Holen wrote:>>> On Friday 09 November 2007 
00:03:32 Instruct ICC wrote:>>>>>>>>> Just wondering if anyone uses an IDE and 
if so what ones?>>>>>>>>>>>>>>>>>> Ta,>>>>>>>>>>>>>>>>>> H.>>>>>>>>>>>>>>>> 
Quanta +, of course.>>>>>>>> Other is to much work and not worth the 
effort...>>>>>>>> I really cannot see what so many of you guys see in 
eclipse,>>>>>>>> it's a mistake all together>>>>>>>>>>>>>> I use JOE of course. 
I really can't see what so many of you guys>>>>>>> see in an IDE :B>>>>>>>>>>>> 
I'm waiting for Tersus4PHP (which is basically Eclipse>>>>>> 
http://www.tersus.com -- Go there with FF)>>>>>>>>>> umm yeah right, some 
create and some steal and brag bout em>>>>> discoveries they've made to save 
the f* day.

RE: [PHP] PHP ide?

2007-11-08 Thread Instruct ICC

Sorry for the crap below.  I think it's MS Hotmail not playing nice with Safari.

Eclipse and Netbeans (now it may look like I'm pushing Java) have offerings to 
allow us developers to build upon -- not just apps, but tools.  I think that's 
a good thing.

"Don't reinvent the wheel" is another good practice to build upon the work of 
others.

Where would this forum be without the web?
Where would the web be without the internet?
Where would the internet be without Al Gore?  ;-P

Where would Debian be without Linus?
Where would Linus be without GNU?

Blah blah blah...electricity

You see where I'm going.


> From: [EMAIL PROTECTED]> To: 
php-general@lists.php.net> Date: Fri, 9 Nov 2007 00:28:59 +0100> Subject: Re: 
[PHP] PHP ide?>> On Friday 09 November 2007 00:03:32 Instruct ICC wrote:>>>>>>> 
Just wondering if anyone uses an IDE and if so what ones?>>>>>>>>>>>>>> 
Ta,>>>>>>>>>>>>>> H.>>>>>>>>>>>> Quanta +, of course.>>>>>> Other is to much 
work and not worth the effort...>>>>>> I really cannot see what so many of you 
guys see in eclipse, it's a>>>>>> mistake all together>>>>>>>>>> I use JOE of 
course. I really can't see what so many of you guys see>>>>> in an IDE 
:B>>>>>>>> I'm waiting for Tersus4PHP (which is basically Eclipse>>>> 
http://www.tersus.com -- Go there with FF)>>>>>> umm yeah right, some create 
and some steal and brag bout em discoveries>>> they've made to save the f* day. 
;D>>>> Not mine. But if you do Java, that's your bogey.>> oh no, I wasn't 
hinting your way, I more or less commented on tersus beeing> eclipse. It's like 
the ubunty hype, witch fails to state on the> homepage: "we're practically 
NOTHING without debian".>>>>> 
_>> Boo! Scare 
away worms, viruses and so much more! Try Windows Live OneCare!>> 
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmail>>news>>>>
 --> ---> Børge Holen> http://www.arivene.net>> --> PHP General Mailing List 
(http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php>

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP ide?

2007-11-08 Thread Instruct ICC

> > > > > Just wondering if anyone uses an IDE and if so what ones?
> > > > >
> > > > > Ta,
> > > > >
> > > > > H.
> > > >
> > > > Quanta +, of course.
> > > > Other is to much work and not worth the effort...
> > > > I really cannot see what so many of you guys see in eclipse, it's a
> > > > mistake all together
> > >
> > > I use JOE of course. I really can't see what so many of you guys see in
> > > an IDE :B
> >
> > I'm waiting for Tersus4PHP (which is basically Eclipse
> > http://www.tersus.com -- Go there with FF)
> 
> umm yeah right, some create and some steal and brag bout em discoveries 
> they've made to save the f* day. ;D

Not mine.  But if you do Java, that's your bogey.

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

RE: [PHP] PHP ide?

2007-11-08 Thread Instruct ICC

> On Thu, 2007-11-08 at 21:47 +0100, Børge Holen wrote:
> > On Thursday 08 November 2007 11:02:07 Hulf wrote:
> > > Just wondering if anyone uses an IDE and if so what ones?
> > >
> > > Ta,
> > >
> > > H.
> > 
> > 
> > Quanta +, of course.
> > Other is to much work and not worth the effort...
> > I really cannot see what so many of you guys see in eclipse, it's a mistake 
> > all together
> 
> I use JOE of course. I really can't see what so many of you guys see in
> an IDE :B

I'm waiting for Tersus4PHP (which is basically Eclipse http://www.tersus.com -- 
Go there with FF)

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

RE: [PHP] More info on timeout problem, with code

2007-11-06 Thread Instruct ICC

> Thanks for the comment. I removed the trailing semi-colon in the two
> areas where it was being sent to mysql_query() and tried the code again.
> I'm still getting the same basic problem -- it silently aborts somewhere
> around 22,000 to 26,000 records being processed out of just under 30,000.
> When I don't build the $insert_query string, I am able to read through the
> CSV file completely.
>
> As odd as this sounds, should I put in some type of delay? Could the
> system be thinking it's getting flooded by all of the inserts?

I didn't know you were on a shared server.  I think your first problem is 
getting your 50+ MB file transfered/uploaded.  Maybe it can be FTP'd from 
authenticated users, then a cronjob can run to check the directory for 
unprocessed uploaded files, then parse it to create the TRUSTED SQL statement 
and maybe even use LOAD DATA INFILE.
_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] More info on timeout problem

2007-11-05 Thread Instruct ICC

> Sounds much like what I'm trying to do. I have had to give up, for the
> time being, on using PHP to upload the datafile; it's about 56 MB in size
> and nothing I do seems to let me upload anything larger than a 2MB file. :(

I don't know if it's been mentioned in this thread, but 2M is a default setting 
for upload_max_filesize http://php.he.net/manual/en/ini.core.php
You may also need to adjust post_max_size and memory_limit.  My 
upload_max_filesize is at 5M,, post_max_size at 8M, and memory_limit is at 32M.

>From the docs:
post_max_size integer

Sets max size of post data allowed. This setting also affects file upload. To 
upload large files, this value must be larger than upload_max_filesize.

If memory limit is enabled by your configure script, memory_limit also affects 
file uploading. Generally speaking, memory_limit should be larger than 
post_max_size.

When an integer is used, the value is measured in bytes. You may also use 
shorthand notation as described in this FAQ.

If the size of post data is greater than post_max_size, the $_POST and $_FILES 
superglobals are empty. This can be tracked in various ways, e.g. by passing 
the $_GET variable to the script processing the data, i.e. , and then checking 
if $_GET['processed'] is set.


> How do I save the individual query statements to a file? That may give
> me a good option for checking a "log" of activity when the process fails
> again.


I'm assuming you are building an $sql variable, so you would write that to a 
file instead of executing it in a query.
Look at an example here http://php.he.net/manual/en/function.fwrite.php to 
write data to a file.

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] More info on timeout problem

2007-11-05 Thread Instruct ICC

> I'm now wondering if some error is occurring that, for some reason, is 
> silently ending the routine.  I'm building what may be a very long SQL INSERT 
> statement for each line in the CSV file that I'm reading; could I be hitting 
> some upper limit for the length of the SQL code?  I'd think that an error 
> would be presented in this case, but maybe I have to do something explicitly 
> to force all errors to display?  Even warnings?
> 
> Another thing I've noticed is that the "timeout" (I'm not even certain 
> the problem IS a timeout any longer, hence the quotation marks) doesn't 
> happen at the same record every time.  That's why I thought it was a timeout 
> problem at first, and assumed that the varying load on the server would 
> account for the different record numbers processed.  If I were hitting some 
> problem with the SQL statement, I'd expect it to stop at the same record 
> every time.  Or is that misguided thinking, too?

1) When you say, "doesn't happen at the same record every time" are you using 
the same dataset and speaking about the same line number?  Or are you using 
different datasets and noticing that the line number varies?  If it's the same 
dataset, it sounds like "fun" -- as in "a pain in the assets".

2) I'm writing something similar; letting a user upload a CSV file via a 
webpage, then creating an SQL query with many records.  So now I'll be watching 
your thread.  For debugging purposes, create your SQL statement and print it 
out on the webpage (or save it somewhere -- maybe a file).  Don't have your 
webpage script execute the query.  Then see if you get the complete query you 
expect.  Then copy that query into a database tool like phpmyadmin and see if 
you get errors when executing the query.

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] Threads

2007-11-02 Thread Instruct ICC

> >>> Greetings everyone, I was wondering where I could find information on the
> >>> status and possibilities of threads being included in PHP. Or if you are
> >>> knowledge-able on the status of threads, if it is a planned addition or 
> >>> not
> >>> and the reasons as such. I understand PHP is not thread safe, that the 
> >>> core
> >>> is thread safe but many required extensions are not. Is there a road map 
> >>> to
> >>> this?
> >> Being thread safe and being able to use threads are two different things.
> >>
> >> PHP 5 *is* thread safe, but a great many extensions are not.
> >>
> >> PHP is never likely to support threads. Remember that the majority of
> >> PHP usage is in the context of web requests. There are a great many
> >> issues the crop up when you consider adding threading to an Apache
> >> module, and I'm sure the same is true of most of the other SAPIs.
> >>
> >> Hope that helps.
> > 
> > Hmm.  I was looking into proc_open and pcntl_fork as a way to have a 
> > "Manager application" handle "Worker applications" (or worker threads -- so 
> > to speak).
> > 
> > Actually as a quick way to develop in PHP instead of C++.  Some of the 
> > worker processes are actually C++ and some are PHP.
> > 
> > Can anyone expound on these alternatives to threads?  I'm assuming that 
> > neither "blocks" execution of the spawned process.  Is it merely the 
> > difference between processes and threads whereas threads have less 
> > overhead?  This is for a command line PHP-GTK app (the Manager Application) 
> > and I'm not too concerned about running out of resources.
> > 
> > I noticed the proc_* methods allow for getting the status and maybe the 
> > manager will kill off some workers if they do not behave as desired.
> 
> proc_* will give you complete control over spawned/child processes at the OS 
> level.
> overhead is not the only difference, but for your practical purposes child 
> process spawning
> will cover your bases.

Thanks.

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] Including GD inside HTML code

2007-11-01 Thread Instruct ICC

> Alberto García Gómez wrote:
> > I trying to include some image generate for a function that use GD.
> > 
> > eg.:
> > 
> > function myfunct(){
> > [MY_CODE]
> > }
> > 
> > but when I call the function it generate me a lot of symbols, letters and 
> > numbers but no image.
> > 
> > WHAT CAN I DO?
> > 
> > PS.: I actually usgin a iframe to create the iomage in another .php page 
> > and place it using this tag.
> > 
> > Este correo ha sido enviado desde el Politécnico de Informática "Carlos 
> > Marx" de Matanzas.
> > "La gran batalla se librará en el campo de las ideas"
> > 
> 
> Sounds like you are trying to output the actual file content of the image in 
> the HTML.
> 
> You should have a separate script generate the img and link to it with your 
> HTML
> 
> 
> 
> Then in the script generate_image.php you create the image and pass it back 
> at that point.

Depending on what is in your myfunct(), you may also need to set a header to 
let the browser know what type of content you are outputting.

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

RE: [PHP] Threads

2007-11-01 Thread Instruct ICC

>> Greetings everyone, I was wondering where I could find information on the
>> status and possibilities of threads being included in PHP. Or if you are
>> knowledge-able on the status of threads, if it is a planned addition or not
>> and the reasons as such. I understand PHP is not thread safe, that the core
>> is thread safe but many required extensions are not. Is there a road map to
>> this?
>
> Being thread safe and being able to use threads are two different things.
>
> PHP 5 *is* thread safe, but a great many extensions are not.
>
> PHP is never likely to support threads. Remember that the majority of
> PHP usage is in the context of web requests. There are a great many
> issues the crop up when you consider adding threading to an Apache
> module, and I'm sure the same is true of most of the other SAPIs.
>
> Hope that helps.

Hmm.  I was looking into proc_open and pcntl_fork as a way to have a "Manager 
application" handle "Worker applications" (or worker threads -- so to speak).

Actually as a quick way to develop in PHP instead of C++.  Some of the worker 
processes are actually C++ and some are PHP.

Can anyone expound on these alternatives to threads?  I'm assuming that neither 
"blocks" execution of the spawned process.  Is it merely the difference between 
processes and threads whereas threads have less overhead?  This is for a 
command line PHP-GTK app (the Manager Application) and I'm not too concerned 
about running out of resources.

I noticed the proc_* methods allow for getting the status and maybe the manager 
will kill off some workers if they do not behave as desired.
_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] system command

2007-10-27 Thread Instruct ICC

>> Maybe something to do with the last line (but I get several lines)
>> Return Values
>>
>> Returns the last line of the command output on success, and FALSE on failure.
>>
>>
>
> I have within a web page:
>  $a=system('/usr/bin/lynx -dump http://api.hostip.info/country.php?ip='.$aa);
> ?>
>  .
>
> later I pickup the variable $a again ...
>
> The problem for me is that the line $a=system('/usr/bin/lynx -dump
> http://api.hostip.info/country.php?ip='.$aa); prints (before ) the
> result ($a). I need the variable within the program, but do not want to
> display it. It seems that 'system' includes an 'echo'

I always go back to the manual:
http://php.net/system
Maybe that built-in echo is related to this:
"The system() call also tries to automatically flush the web server's output 
buffer after each line of output if PHP is running as a server module."

Check out the other "Program Execution Functions" functions http://php.net/exec 
particularly http://php.net/manual/en/function.exec.php

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Executing PHP

2007-10-26 Thread Instruct ICC

> > Well on Mac/Unix/Linux you could type "ps" at the terminal to see the path
> > to the running processes or "which php" to see which one you would invoke.
> >
> > Maybe you can upgrade to a Mac?
> >
> > Parallels running Windows XP didn't show me such info in the Task Manager;
> > sorry.
> 
> 
> 
> Oh I wish! I am a Mac user but my work is a Windoze shop so I don't have
> much of an option. =/ Woe is me.
> 
> ~Philip
> 
> PS... Anyone getting Leopard today? =D

Earlier this week, the upgrade was poo pd at the job, but now that the 
manager knows it is 64-bit, it's a go.

Personally, I'll wait and probably get a new mini as well.
Old mini is Core Duo and unless having it at work makes me really want to get 
it, I wasn't going to put it on my MacBook Pro yet.

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

[PHP] RE: [Ticket #29] [PHP] Executing PHP

2007-10-26 Thread Instruct ICC

What the hell is this?
Is Charlie Schulz trying to get me to click on this link?

> Date: Fri, 26 Oct 2007 15:08:10 -0400
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: [Ticket #29] [PHP] Executing PHP
> 
> Your ticket has been submitted.  Please reply to this email (keeping the 
> subject intact) with any additional information or comments.
> 
> Help Desk: 
> http://KHS2:/account/public_login/29?email=instructicc%40hotmail.com
> Ticket: # 29
> Submitted: Oct 26, 2007 at 03:08 PM
> Summary: [PHP] Executing PHP
> Status: open
> Priority: Medium
> 
> Description:
> 
> Well on Mac/Unix/Linux you could type "ps" at the terminal to see the path to 
> the running processes or "which php" to see which one you would invoke.
> 
> Maybe you can upgrade to a Mac?
> 
> Parallels running Windows XP didn't show me such info in the Task Manager; 
> sorry.
> 
> 
> > Date: Thu, 25 Oct 2007 15:34:20 -0500
> > From: [EMAIL PROTECTED]
> > To: php-general@lists.php.net
> > Subject: [PHP] Executing PHP
> > 
> > Hi. Feel free to tell me this is a "duh" question. I don't know which PHP
> > executable (php.exe, php-cgi.exe, php-win.exe) is being run - how can I
> > tell?
> > 
> > I am on a Win2k3 server running PHP5 (manual install) and IIS6. I've pointed
> > to the php5isapi.dll in IIS. I'm assuming b/c I do this that I am using the
> > php.exe. Thoughts? I've searched the PHP manual, but have had no luck.
> > 
> > Thanks in advance,
> > ~Philip
> 
> _
> Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
> today.
> http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
> 
> This is an automated message sent from your Spiceworks Desktop.

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

RE: [PHP] system command

2007-10-26 Thread Instruct ICC

>> Use double quotes to get the value of $a or else you get the literal string 
>> "$a".
>>
>> $aa=system("lynx -dump http://api.hostip.info/country.php?ip=$a",$location);
>> or
>> $aa=system('lynx -dump http://api.hostip.info/country.php?ip='.$a,$location);
>>
>>
> Thanks! 1st solution did not work for me, but the second one did.
>
> I still have a problem with it. It prints the info to the page. Can I
> suppress this somehow?

man lynx
?

I don't use lynx and I don't know what you mean by "info to the page".
I tried
lynx -dump http://www.google.com
to try to see what you mean.

Maybe something to do with the last line (but I get several lines)
Return Values

Returns the last line of the command output on success, and FALSE on failure.

Sorry.

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Executing PHP

2007-10-26 Thread Instruct ICC

Well on Mac/Unix/Linux you could type "ps" at the terminal to see the path to 
the running processes or "which php" to see which one you would invoke.

Maybe you can upgrade to a Mac?

Parallels running Windows XP didn't show me such info in the Task Manager; 
sorry.


> Date: Thu, 25 Oct 2007 15:34:20 -0500
> From: [EMAIL PROTECTED]
> To: php-general@lists.php.net
> Subject: [PHP] Executing PHP
> 
> Hi. Feel free to tell me this is a "duh" question. I don't know which PHP
> executable (php.exe, php-cgi.exe, php-win.exe) is being run - how can I
> tell?
> 
> I am on a Win2k3 server running PHP5 (manual install) and IIS6. I've pointed
> to the php5isapi.dll in IIS. I'm assuming b/c I do this that I am using the
> php.exe. Thoughts? I've searched the PHP manual, but have had no luck.
> 
> Thanks in advance,
> ~Philip

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] Question about time...

2007-10-25 Thread Instruct ICC

> >> I want to be able to display something like an image of a turkey
> >> during the month of november from now until I'm dead.
> >
> > And how will the application know when you are dead?
> 
> Well, I code all of my applications to receive RFID signals, and I  
> had a RFID transmitter embedded into me that gets powered by the  
> electricity that my body generates, so when it can no longer get that  
> signal, the application is designed to shut down and put up a message  
> that says "Due to the death of my creator I quit, have a nice day!" :)

I'm not amused.
http://zeitgeistmovie.com/
Way way way at the end.

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

RE: [PHP] mail from

2007-10-25 Thread Instruct ICC

> > in my php.ini, I have this set
> > sendmail_from = [EMAIL PROTECTED]

The first thing I'd do is verify if the script is really using the php.ini you 
think it is by having the script output phpinfo.

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] system command

2007-10-24 Thread Instruct ICC



> Date: Thu, 25 Oct 2007 09:43:14 +0800
> From: [EMAIL PROTECTED]
> To: php-general@lists.php.net
> Subject: [PHP] system command
> 
> I tried:
> 
> $a=$_SERVER["REMOTE_ADDR"];
> echo "REMOTE_ADDR=$a";
> if($a="192.168.250.108") {
> $a="61.64.101.101";
> }
> 
> 
> $aa=system('lynx -dump http://api.hostip.info/country.php?ip=$a',$location);
> echo "a=$aaa=$aalocation=$location";
> 
> $aa=system('lynx -dump 
> http://api.hostip.info/country.php?ip=61.64.101.101',$location);
> echo "a=$aaa=$aalocation=$location";
> 
> 
> I get:
> 
> REMOTE_ADDR=192.168.250.108
> XX
> 
> a=61.64.101.101
> aa=XX
> location=0
> TW
> 
> a=61.64.101.101
> aa=TW
> location=0
> 
> 
> as you can see, if I put the IP address in, I get the right answer (TW).
> 
> What am I doing wrong?
> 
> bye
> 
> Ronald
Use double quotes to get the value of $a or else you get the literal string 
"$a".

$aa=system("lynx -dump http://api.hostip.info/country.php?ip=$a",$location);
or
$aa=system('lynx -dump http://api.hostip.info/country.php?ip='.$a,$location);


_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] Question about time...

2007-10-24 Thread Instruct ICC

> >  > I want to be able to display something like an image of a turkey 
> >>  during the month of november from now until I'm dead.
> >
> >And how will the application know when you are dead?
> 
> When you stop paying for hosting, the application get's the idea when 
> it's bits go poof!
Yep, that will do it.

I wonder if they can legally bill your "estate"?  Or if the estate is liable.


> If anyone ever noticed, my web site (http://sperling.com) has a tree 
> on it that changes with the seasons. I use:
Nice.

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

RE: [PHP] Question about time...

2007-10-24 Thread Instruct ICC

> I want to be able to display something like an image of a turkey  
> during the month of november from now until I'm dead.

And how will the application know when you are dead?

_
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

RE: [PHP] help with code not wrking

2007-10-24 Thread Instruct ICC

> From: [EMAIL PROTECTED]
> To: php-general@lists.php.net
> Date: Wed, 24 Oct 2007 15:27:28 -0400
> Subject: [PHP] help with code not wrking 
> 
> Hi all,
> 
>  
> 
> I have inherited a problem script from a client, and it's a simple upload
> function.
> 
> The problem is that while the image is being uploaded and saved as the same
> name it was uploaded as, it's not writing to the table the file name for
> display reference so it's like there is no picture.
> 
>  
> 
> I appreciate any help you can provide.
> 
>  
> 
> Thanks!
> 
> 
> Joey
> 
>  
> 
>  
> 
>  
> 
> include ("sesion_admin.php");
> 
> include("../contentdb.php");
> 
>  
> 
> $res_state=mysql_query("select * from states where 1 order by state");
> 
> $id = $_GET["id"];
> 
>  
> 
> echo "ID: " . $id . "IDL: " . $local_id . "   Photo: " . $userfile . " [B4
> Upload]";
> 
>  
> 
> $p_proceso = $_POST["p_proceso"];
> 
>  
> 
> if($p_proceso=="borrar"){
> 
>  
> 
> $query_editar ="update Basic_Info set photo='' where Id=$id ";
> 
> mysql_query($query_editar);
> 
> }
> 
>  
> 
> if($p_proceso=="upload"){
> 
>  
> 
>  
> 
> $UPLOAD = fopen($userfile, "r" );
> 
> $contents = fread($UPLOAD,$userfile_size);
> 
> fclose($UPLOAD);
> 
> $SAVEFILE = fopen("../photos/".$userfile, "wb" );
> 
> fwrite( $SAVEFILE, $contents,$userfile_size);
> 
> fclose( $SAVEFILE );
> 
>  
> 
>  
> 
> #$query_editar ="update Basic_Info set photo='$userfile' where Id=$id ";
> 
> mysql_query($query_editar);
> 
> }

What is "$userfile"?
Are you using "$_FILES"? http://php.he.net/manual/en/features.file-upload.php
$_FILES['userfile']['name']
The original name of the file on the client machine.
   $_FILES['userfile']['tmp_name']
The temporary filename of the file in which the uploaded file
was stored on the server.
   
And don't forget to set the HTML form tag's enctype="multipart/form-data"
_
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

RE: [PHP] echo VS print : that's a cool behavior !

2007-10-23 Thread Instruct ICC

> Hello everyone.
> 
> We all know the difference between print and echo, but has someone ever
> tried to combine them together ??
> 
> Right, try this :
> 
>  echo "coucou " . print('v ' . print('u ' . print('toctoc ') . 'hihi ') ) .
> 'tata ' . print('zozo ' . print('pupu '));
> 
> 
> And guess the result ...
> 
> Can someone explain it ?
> ( the result is : toctoc hihi u 1pupu zozo 1v 1tata 1coucou 1 )

Precedence.

_
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

RE: [PHP] This, then that.

2007-10-20 Thread Instruct ICC

> > >>  > I want to prohibit an image from being shown to anyone who is not
> > >>  > permitted (i.e., logged in).
> > >>  >
> > >>  > The way I want to do this is to:
> > >>  >
> > >>  > 1. Set [file] permissions...
> > >>
> > >>
> > >>
> > >>  What if 2 or more users access the application at the same time?
> > >>
> > >>  Set the permissions so only the PHP application can access it.
> > >>  Have the PHP application decide if this present user running this 
> > >>instance should see the image.
> > >>  If approved, display image.
> > >
> > >One idea that has always been REALLY popular around here... stuff your
> > >image in a database. *MUHAWHAWHAWHAWHAW* *Ducks from the flying rocks*.
> > >
> > >Cheers,
> > >Rob.
> > >--
> > 
> > Rob:
> > 
> > That's really not a bad idea, but in this experiment I'm using images 
> > as a stand-in for larger files (CD's, Videos, etc).
> > 
> > Side note to everyone else (Rob knows this) Storing images in a dB 
> > has some advantages, but the concept has been beat to death on this 
> > list and no need to repeat it -- everything that could be said 
> > pro/con has been said -- just review the archives.
> 
> I use the db for images sometimes. I don't really care what some people
> think since I've thought it out for myself and like th epros versus the
> cons sometimes. At any rate, y our problem appears to be related to
> safe_mode for not putting images outside the web tree. Most likely
> though, you have access to .htaccess and so you could create a locked
> images directory that exists within the web tree but which can't be
> accessed by a browser. This would give you what you need to be within
> the confines of safe mode.
> 
> Cheers,
> Rob.

Regardless, I said from your file or db when I gave more of an example.  And in 
this thread I merely said "display image".  Haha?

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

RE: [PHP] This, then that. [solved?]

2007-10-20 Thread Instruct ICC

> >>  I think I found a solution.
> >>
> >>  Here's the url:
> >>
> >>  http://www.webbytedd.com/bbb/image-test1/
> >>
> >>  The point is that the image is only accessible via this script, is
> >>  this correct?
> >
> >I can access it without a script:
> >http://www.webbytedd.com/bbb/image-test1/images/a.jpg
> 
> I think what you were seeing was a cached image.

Yes, it seems I was accessing a cached image.

If I am allowed to see this picture, but not another, you may still have a 
security issue.
If I am allowed to see this picture, and thereby am also allowed to see any 
other, then you probably don't need to secure it more.

I just don't like the actual image filename in the HTML view source.  I prefer 
to hand off an id to a display_image.php script which checks credentials for 
the specific picture.

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] This, then that. [solved?]

2007-10-19 Thread Instruct ICC

> but in the img tag, try src="display_image.php?id=anId"
> and in display_image.php, test if the user is authorized before displaying 
> the image.
> Then a direct call to display_image.php?id=anId would still have a chance to 
> authenticate the user.

Forgot to reiterate:
Keep the images where only PHP can read them.
If you have the images in a file or a database, use header, and echo or 
fpassthru on the data.

Something like "jan at anh dot sk"
http://php.he.net/image

_
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] This, then that. [solved?]

2007-10-19 Thread Instruct ICC

> Hi gang:
> 
> I think I found a solution.
> 
> Here's the url:
> 
> http://www.webbytedd.com/bbb/image-test1/
> 
> The point is that the image is only accessible via this script, is 
> this correct?

I can access it without a script:
http://www.webbytedd.com/bbb/image-test1/images/a.jpg

It may be difficult to guess a.jpg even if I can guess /images
but in the img tag, try src="display_image.php?id=anId"
and in display_image.php, test if the user is authorized before displaying the 
image.
Then a direct call to display_image.php?id=anId would still have a chance to 
authenticate the user.
_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] This, then that.

2007-10-19 Thread Instruct ICC

> I want to prohibit an image from being shown to anyone who is not 
> permitted (i.e., logged in).
> 
> The way I want to do this is to:
> 
> 1. Set [file] permissions...



What if 2 or more users access the application at the same time?

Set the permissions so only the PHP application can access it.
Have the PHP application decide if this present user running this instance 
should see the image.
If approved, display image.

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

RE: [PHP] p-s-e-x-e-c

2007-10-19 Thread Instruct ICC

> > > When I run the command on the server itself, it
> > > works just fine. When I run the same command via a webpage, the text file
> > > does not generate.
> >
> >
> > I also have a similar problem but reversed.  It works in a webpage but not 
> > on the command line.
> > mysql_connect, mssql_connect, and a non-db function.
> > A command line script calling file() to call the web page works however.
> > And it just stopped working about 2 months ago (from the command line).
> 
> one word: permissions
>... 
> also perhaps the php.ini settings are different for either one, and
> there's a different ini file for shell vs. web.

Even though the build date was before the time the problem started, I 
scrutinized both the phpinfo's which pointed to the same php.ini, but I noticed 
that the ./configure switches did not match up and finally the admin admitted 
that his yum update must have overwritten the formerly manually compiled 
version.

My issue is resolved.  Sorry for the partial hijacking of this thread but as 
you can see, it can be beneficial.

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

RE: [PHP] p-s-e-x-e-c

2007-10-18 Thread Instruct ICC

> When I run the command on the server itself, it
> works just fine. When I run the same command via a webpage, the text file
> does not generate.


I also have a similar problem but reversed.  It works in a webpage but not on 
the command line.
mysql_connect, mssql_connect, and a non-db function.
A command line script calling file() to call the web page works however.
And it just stopped working about 2 months ago (from the command line).

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] p-s-e-x-e-c

2007-10-18 Thread Instruct ICC

> Hi. I'm wanting to run an executable that generates a text file, and I'm
> having some issues. When I run the command on the server itself, it works
> just fine. When I run the same command via a webpage, the text file does not
> generate. My first impression was that the permissions were wrong. So, I
> gave the web user and the user making the call the necessary permissions...
> no luck. Here's what I'm doing...
>
>  $command = "psexec.exe -i -w C:/Folder -u user -p pass -e
> C:/Folder/executable.exe 2>&1";
> exec ($command);
> ?>
>
> This should generate this file but doesn't: C:/Folder/printer_list.txt
>
> Again, when this exact statement is run in the terminal on the Win2k3
> server, it works fine. Any thoughts?
>
> Thanks in advance,
> ~Philip
>
> PS... Side note: the list rejected my original email b/c of the subject:
> 'Psexec'. Odd.

Maybe you need the full path to psexec.exe

Or the web server isn't allowed to use exec due to safemode 
http://php.he.net/manual/en/features.safe-mode.functions.php
or disable_functions in php.ini.
_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] round()

2007-10-12 Thread Instruct ICC

> > > Yes, but precision is not the issue.
> > > 
php -r '$t=123.45; echo $t . "\n"; $t+=0.001; echo $t . "\n";'
123.45
123.451
php -r '$t=123.45; echo $t . "\n"; $t+=0.0001; echo $t . "\n";'
123.45
123.45

php -r '$t=123.45678901234567; echo $t . "\n";'
123.45678901235

Geee garbage in, garbage out.
round would have been given garbage to process depending upon the precision 
desired.

Anyway, you can still believe what you want.  I see others agree.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] round()

2007-10-12 Thread Instruct ICC

> > Yes, but precision is not the issue.
> > 
> > It doesn't make any difference if you are rounding.
> > You still have to make a decision


Uuhm, what was $t on the platform before the round please (the += 
.000..1 post)?  Then that will confirm that precision is not the 
problem.



Also, "making a decision" is setting the optional precision value in the round 
function.
_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

RE: [PHP] RE: round()

2007-10-11 Thread Instruct ICC

> well,
> seems to be OS dependent:
> 
> PHP_OS:Linux (Suse 9.x 32bit) | PHP_VERSION:5.0.3
> $t=1.255;
> round($t,2):1.26
> $t += .0001;
> round($t,2):1.26
> 
> 
> PHP_OS:WINNT (2000) | PHP_VERSION:5.2.4
> $t=1.255;
> round($t,2):1.25
> 
> $t += .0001;
> round($t,2):1.26
> 
> -- 
> View this message in context: 
> http://www.nabble.com/round%28%29-tf4602528.html#a13164737
> Sent from the PHP - General mailing list archive at Nabble.com.

First, you may have to be aware of floating point precision on your platform.
http://php.he.net/manual/en/language.types.float.php
"The size of a float is platform-dependent"

What is $t after $t += .0001; ?

Now I see why BCMath was mentioned.

_
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

RE: [PHP] round()

2007-10-10 Thread Instruct ICC

> While we're entertaining algorithms, has anyone else noticed that
> php's round() isn't the most accurate algorithm to round?

For those that replied that there is a problem, can you provide examples?

precision

The optional number of decimal digits to round to, defaults to 0


_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Looking for help with a complex algorithm

2007-10-10 Thread Instruct ICC

If the OP wants any single valid set, then this seems to work.
If he wants all valid sets, no joy.
I added a 10.00 and a 0.22 to the $values array and varied the position of the 
10.00 (before and after 3.76) and it seems to pull the first set where the 
first member in the $values array is a member of the set.

For a second there, I thought it pulled the set where the largest possible 
member in the $values array is also in the set.

Maybe it meets the needs of the OP?

> Date: Tue, 9 Oct 2007 18:34:25 -0700
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> CC: php-general@lists.php.net
> Subject: Re: [PHP] Looking for help with a complex algorithm
> 
> Jay Blanchard wrote:
> > [snip]
> > what is it suppose to return if it cannot find records that the exact
> > total do not match the total 
> > you are looking for?  should it return nothing?
> > [/snip]
> > 
> > Correct. It should say that there are no records that generate a match. 
> > 
> 
> Ok, so based off what you were asking for, here is a function that I 
> think does what you are looking to do.
> 
> So, test for false on the returned value and if it is false, the 
> function could not find any matches that together would total the amount 
> you are asking for. Otherwise, it returns the array of items that will 
> total the amount that you are trying to match.
> 
> Let me know if it works for you.
> 
>  
> function getTotal($total, $values, &$currentValue) {
>   $items  = array();
>   
>   foreach ( $values AS $row ) {
>   list($id, $value) = $row;
>   $items[] = array('id' => $id, 'value' => round($value, 
> 2));
>   $currentValue   += round($value, 2);
> 
>   if ( round($currentValue, 2) > round($total, 2) ) {
>   $currentValue -= round($value, 2);
>   array_pop($items);
>   continue;
>   }
> 
>   if ( round($currentValue, 2) == round($total, 2) ) {
>   $stack = array();
>   foreach ($items AS $id => $val) {
>   if ( in_array($val['id'], $stack) ) {
>   unset($items[$id]);
>   } else {
>   $stack[] = $val['id'];
>   }
>   }
>   return $items;
>   }
> 
>   if ( ( $new = getTotal(round($total, 2), array_slice($values, 
> 1), 
> round($currentValue, 2)) ) === false ) {
>   $currentValue -= round($value, 2);
>   array_pop($items);
>   } else {
>   $items = array_merge($items, $new);
>   }
>   }
>   $tv = 0;
>   foreach ( $items AS $tmp_value ) {
>   $tv += round($tmp_value, 2);
>   }
>   if ( round($tv, 2) != round($total, 2) ) {
>   return false;
>   }
>   $testing = array();
>   foreach ( $items AS $row ) {
>   $testing[$row['id']] = $row['value'];
>   }
>   return $testing;
> }
> 
> $values[] = array(1,3.98);
> $values[] = array(2,9.77);
> $values[] = array(3,3.76);
> $values[] = array(4,4.13);
> $values[] = array(5,7.86);
> $values[] = array(6,1.45);
> $values[] = array(7,12.87);
> $values[] = array(8,10.01);
> $values[] = array(9,0.88);
> 
> var_dump(getTotal(10.22, $values, $value));
> 
> ?>
> 
> my results are
> 
> array(4) {
>[0]=>
>array(2) {
>  ["id"]=>
>  int(3)
>  ["value"]=>
>  float(3.76)
>}
>[1]=>
>array(2) {
>  ["id"]=>
>  int(4)
>  ["value"]=>
>  float(4.13)
>}
>[2]=>
>array(2) {
>  ["id"]=>
>  int(6)
>  ["value"]=>
>  float(1.45)
>}
>[3]=>
>array(2) {
>  ["id"]=>
>  int(9)
>  ["value"]=>
>  float(0.88)
>}
> }
> 
> 
> 
> -- 
> Jim Lucas
> 
> 
>  "Perseverance is not a long race;
>  it is many short races one after the other"
> 
> Walter Elliot
> 
> 
> 
>  "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
> 

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] Looking for help with a complex algorithm

2007-10-09 Thread Instruct ICC

> CC: php-general@lists.php.net
> From: [EMAIL PROTECTED]
> Date: Tue, 9 Oct 2007 15:58:22 -0400
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Looking for help with a complex algorithm
>
> And that is when I realize how much more I still need to learn about
> php...

IMHO, I don't think this has anything to do with PHP except he apparently wants 
to implement the algorithm in PHP.

Apparently any Turing complete language could do it.  (That's just a cool 
phrase I learned today on the information super highway).

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Looking for help with a complex algorithm

2007-10-09 Thread Instruct ICC

I never heard of the knapsack problem before this post.
But the w in the w*x terms appear to be 1, and he seems to want an exact value, 
not "less than or equal to".
I think my brute force factorial technique is a solution, but dynamic 
programming may be more efficient?  Not familiar with DP although I have heard 
of it.

Was someone suggesting a random walk?

_
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

RE: [PHP] Looking for help with a complex algorithm

2007-10-09 Thread Instruct ICC


> Date: Tue, 9 Oct 2007 14:01:30 -0500
> From: [EMAIL PROTECTED]
> To: php-general@lists.php.net
> Subject: [PHP] Looking for help with a complex algorithm
>
> Good afternoon gurus and guru-ettes!
>
> I am searching for an algorithm that will take a list of monetary values
> and determine which of these values totals a value supplied to the
> widget.
>
> 1. I supply a value to the application and give a date range
> 2. The application will query for all of the values in the date range
> 3. The application will determine which of the values will total the
> supplied value
> a. if the total values in the date range do not add up to the
> supplied value the application will return that info. (I have this done
> already)
> 4. The application will return the records comprising the total value
> given
>
> For instance I supply 10.22 and a date range of 2007-10-01 to 2007-10-05
>
> Values in the range;
> 3.98
> 9.77
> 3.76
> 4.13
> 7.86
> 1.45
> 12.87
> 10.01
> 0.88
>
> Values comprising the total;
> 3.76
> 4.13
> 1.45
> 0.88
>
> It is possible to have duplicate values, so we will have to assume that
> the first one of the dupes is correct, the records will be sorted by
> date. I have been working with a recursive function, but so far the
> results are not pretty and it is getting too complex.
>
> FYI, this is very similar to the "knapsack problem"" in dynamic
> programming.
>
> Just another challenging day in paradise!

The first thing that came to my mind was factorials.  So that may be why it got 
complicated quickly.  You still need your recursion, but by following a 
factorial pattern.
Given:
1 2 3

Test:
1
1+2
1+2+3

1+3

2
2+3

3

Given:
1 2 3 4

Test:
1
1+2
1+2+3
1+2+3+4

1+3
1+3+4

1+4

2
2+3
2+3+4
2+4

3
3+4

4

And I'm not sure if that covers all for the case of 3 or 4 values.
Something like Permutation as opposed to Combination
http://www.gomath.com/algebra/probability.php
_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Socket how to die if connection broken

2007-10-08 Thread Instruct ICC

> I dont get that error
> 
> Warning: socket_write() expects parameter 1 to be resource, null given in
> /path/script.php on line 34
> 
> but just the original error msg
> 
> Warning: socket_write(): unable to write to socket [32]: Broken pipe in

Multiple times still?
Or just the one time?

Use http://php.he.net/manual/en/function.socket-last-error.php
if (false === socket_write($sock, $buffer))
{
  $errorcode = socket_last_error();
  $errormsg = socket_strerror($errorcode);
  //socket_close($sock);//Doubt if this is needed if $sock isn't good
  exit("ERROR: [$errorcode] $errormsg");
}

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

RE: [PHP] Socket how to die if connection broken

2007-10-08 Thread Instruct ICC

It looks like you didn't pass in a socket resource as the first parameter to 
socket_write.
http://php.he.net/manual/en/function.socket-write.php

> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]; php-general@lists.php.net
> Date: Mon, 8 Oct 2007 19:51:15 +0100
> Subject: Re: [PHP] Socket how to die if connection broken
> 
> Hi I got this error
> 
> Warning: socket_write() expects parameter 1 to be resource, null given in 
> /path/script.php on line 34
> 
> Thanks
> 
> ----- Original Message - 
> From: "Instruct ICC" <[EMAIL PROTECTED]>
> To: 
> Sent: Monday, October 08, 2007 7:43 PM
> Subject: RE: [PHP] Socket how to die if connection broken
> 
> 
> 
> Remove the @ and see if you get any useful message.
> 
> > From: [EMAIL PROTECTED]
> > To: [EMAIL PROTECTED]
> > CC: php-general@lists.php.net
> > Date: Mon, 8 Oct 2007 19:04:45 +0100
> > Subject: Re: [PHP] Socket how to die if connection broken
> >
> > Hi Stut Ive tried your example but still cant get it to work.
> >
> > - Original Message - 
> > From: "Stut" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Cc: 
> > Sent: Monday, October 08, 2007 5:26 PM
> > Subject: Re: [PHP] Socket how to die if connection broken
> >
> >
> > > [EMAIL PROTECTED] wrote:
> > >> Hi I have a socket connection like so..
> > >>
> > >> $sourceip = '84.234.18.16'; // ip you want to bind to
> > >>
> > >> $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
> > >> socket_bind($sock, $sourceip);
> > >> socket_connect($sock, 'dac.nic.uk', 2043);
> > >>
> > >> if ($socket === false) {
> > >>$errorcode = socket_last_error();
> > >>$errormsg = socket_strerror($errorcode);
> > >>   die("Couldn't create socket: [$errorcode] $errormsg");
> > >> }
> > >>
> > >>
> > >> But if the socket connection gets broken it creates an error msg
> > >> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> > >> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> > >> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> > >>
> > >> That spills out for thousands and thousands of lines.
> > >>
> > >> What would I need for the script to die if the connection gets broken.
> > >
> > > This has nothing to do with opening the socket. When you are writing to
> > > the socket you need something like this...
> > >
> > > if (false === @socket_write($s, $buffer))
> > > {
> > > // In here you know something is wrong. Use socket_last_error() to
> > > // find out what and deal with it appropriately. Bear in mind that
> > > // socket_write can fail for lots of reasons, not just a broken
> > > // pipe so you need to check what error occurred before you can
> > > // know what to do with it.
> > > }
> > >
> > > Note that you should never use the @ operator unless you are absolutely
> > > sure you're handling any potential errors correctly.
> > >
> > > -Stut
> > >
> > > -- 
> > > http://stut.net/
> > >
> > > -- 
> > > 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
> >
> 
> _
> Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
> http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews
>  
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] Socket how to die if connection broken

2007-10-08 Thread Instruct ICC

Remove the @ and see if you get any useful message.

> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> CC: php-general@lists.php.net
> Date: Mon, 8 Oct 2007 19:04:45 +0100
> Subject: Re: [PHP] Socket how to die if connection broken
> 
> Hi Stut Ive tried your example but still cant get it to work.
> 
> - Original Message - 
> From: "Stut" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: 
> Sent: Monday, October 08, 2007 5:26 PM
> Subject: Re: [PHP] Socket how to die if connection broken
> 
> 
> > [EMAIL PROTECTED] wrote:
> >> Hi I have a socket connection like so..
> >> 
> >> $sourceip = '84.234.18.16'; // ip you want to bind to
> >> 
> >> $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
> >> socket_bind($sock, $sourceip);
> >> socket_connect($sock, 'dac.nic.uk', 2043);
> >> 
> >> if ($socket === false) {
> >>$errorcode = socket_last_error();
> >>$errormsg = socket_strerror($errorcode);
> >>   die("Couldn't create socket: [$errorcode] $errormsg");
> >> }
> >> 
> >> 
> >> But if the socket connection gets broken it creates an error msg
> >> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> >> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> >> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> >> 
> >> That spills out for thousands and thousands of lines.
> >> 
> >> What would I need for the script to die if the connection gets broken.
> > 
> > This has nothing to do with opening the socket. When you are writing to 
> > the socket you need something like this...
> > 
> > if (false === @socket_write($s, $buffer))
> > {
> > // In here you know something is wrong. Use socket_last_error() to
> > // find out what and deal with it appropriately. Bear in mind that
> > // socket_write can fail for lots of reasons, not just a broken
> > // pipe so you need to check what error occurred before you can
> > // know what to do with it.
> > }
> > 
> > Note that you should never use the @ operator unless you are absolutely 
> > sure you're handling any potential errors correctly.
> > 
> > -Stut
> > 
> > -- 
> > http://stut.net/
> > 
> > -- 
> > 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
> 

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

RE: [PHP] Socket how to die if connection broken

2007-10-08 Thread Instruct ICC

> But if the socket connection gets broken it creates an error msg 
> 
> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> 
> That spills out for thousands and thousands of lines.
> 
> What would I need for the script to die if the connection gets broken.

It's just sitting around, gets broken, then outputs those errors?

Do you check that it is a valid socket before you attempt a write?

_
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

RE: [PHP] Alternating Anything

2007-10-05 Thread Instruct ICC

> > its mysterious statements like this that make code fragile, 
> > imho. i prefer the modulus approach.
> 
> I would have agreed before reading the clarification. Not so sure
> now...
> 
> At the risk of semantic nitpicking, and only because I find this
> discussion stimulating (pity us poor geeks), I might call "($r=!$r)"
> esoteric rather than mysterious, even though I'm the one who asked
> the question, suggesting it was a mystery to me.

That's why I use:
$toggle = !$toggle;
or
$toggleNameOfWhatIsBeingToggled = !$toggleNameOfWhatIsBeingToggled;

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] Re: Super bizarre changing variable!!

2007-10-04 Thread Instruct ICC

> Brian Dunning wrote:
> > I'm running the following code:
> > 
> > $query3 = "DELETE FROM table1 WHERE referer=$referer ORDER BY creation
> > LIMIT $numtodelete";
> > $result3 = mysql_query($query3);
> > $string = "$total found, $n kept, $numtodelete extras removed ($query3)";
> > $x = mysql_query("insert into table2 (friend_id,data) values
> > ($referer,'$string')");
> > 
> > I created the table2 log file just so I could see what the hell is going
> > on. Here is a typical entry in table2:
> > 
> > FRIEND_ID = 8388607
> > 
> > DATA = 908 found, 100 kept, 808 extras removed (DELETE FROM table1 WHERE
> > referer=69833818 ORDER BY creation LIMIT 808)
> > 
> > Notice that the value in FRIEND_ID, which was set with $referer, is
> > DIFFERENT than the value of $referer shown in DATA! How the flying
> > f*&^%k is this possible??? I've been tearing my hair out for 3 days over
> > this.
> > 
> > Almost all records show 8388607 in that FRIEND_ID field. Once in a blue
> > moon, a different value is shown, which does match the value in DATA. So
> > it's displaying this erroneous behavior 95% of the time but not always.
> 
> Sorry, I reread it and what you say makes sense now I am tired!!
> 
> OK, I give. It's odd and confusing :)
> 
> Col

Are you showing us the real code?

(I only came in on this post)

>From your posted code, I think your DATA value should be the literal 7 
>characters $string.

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

RE: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Instruct ICC

> From: [EMAIL PROTECTED]
> Today's post was
> prompted by my desire to prototype yet another suite of
> browse-read-edit-add-delete functions for someone.

I was just going to ask you what is BREAD.  Cool, basically a Web-based CRUD?  
I can't find anything on it, can you point me to some sites?

_
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

RE: [PHP] Page Numbering (To The Unsubscribe Guy)

2007-09-21 Thread Instruct ICC

Just for grins, tell us the steps you took to unsubscribe.

There is a link at the bottom of every email inviting you to unsubscribe.  So 
I'm sure you began there.

Tell us where it failed.
_
Kick back and relax with hot games and cool activities at the Messenger Café.
http://www.cafemessenger.com?ocid=TXT_TAGLM_SeptWLtagline
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] MAX_FILE_SIZE not working with file uploads

2007-09-20 Thread Instruct ICC

In the  To: php-general@lists.php.net> Date: Thu, 20 Sep 2007 14:45:36 -0500> 
From: [EMAIL PROTECTED]> Subject: [PHP] MAX_FILE_SIZE not working with file 
uploads>> The punchline question is: What am I missing?>> Now for the 
details.>> I have a form through which a user uploads image files. In the 
event> the chosen file exceeds the MAX_FILE_SIZE (which I have included as> a 
hidden form field immediately after the form tag), I want to abort> the upload 
process and display an appropriate error message to the> user, including the 
size of the file s/he attempted to upload.>> But that doesn't seem to be 
working.>> Instead, the computer chugs along and then properly refuses to> 
perform the upload, but not immediately.>> And here is the dump of the $_FILES 
array (which, notably, reports> zero as the size):>> [code]> Array> (> 
[userfile] => Array> (> [name] => beach_iStock_00112348_L2.jpg> [type] =>> 
[tmp_name] =>> [error] => 2> [size] => 0> )>> )> [/code]>> The file (about 
1.2MB) DOES upload when I increase the MAX_FILE_SIZE> value to 200.>> This, 
from PHP.net:> [quote]> The MAX_FILE_SIZE hidden field (measured in bytes) must 
precede the> file input field, and its value is the maximum filesize accepted 
by> PHP. Fooling this setting on the browser side is quite easy, so> never rely 
on files with a greater size being blocked by this> feature. The PHP settings 
for maximum-size, however, cannot be> fooled. This form element should always 
be used as it saves users> the trouble of waiting for a big file being 
transferred only to find> that it was too big and the transfer failed.> 
[/quote]>>> Here is the form code:>> [code]>  enctype="multipart/form-data" 
name="upload" id="upload">> > Filename on your PC:> > Please click ONCE and be 
patient:> > > [/code] Pertinent php.ini settings:> version = 4.3.10> 
file_uploads = on> upload_max_filesize = 2M> post_max_size = 8M>> Any guidance 
would be appreciated.>> Jeff>> --> PHP General Mailing List 
(http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php>

_
Can you find the hidden words?  Take a break and play Seekadoo!
http://club.live.com/seekadoo.aspx?icid=seek_wlmailtextlink
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] disappearing array?

2007-09-20 Thread Instruct ICC

Wow this formatted badly.  (new hotmail on Safari -- MS made FF not even render 
well)

Anyway, are you sure you are reaching the code you want to reach?
Perhaps !== is overkill and maybe even wrong when you should use ==.

Same with the other === usage?

Try some
echo "HERE1\n";
echo "HERE2\n";
to see if you are getting to the line you expect.  Like after that "count(~) 
!== ".

_
Gear up for Halo® 3 with free downloads and an exclusive offer. It’s our way of 
saying thanks for using Windows Live™.
http://gethalo3gear.com?ocid=SeptemberWLHalo3_WLHMTxt_2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] MAX_FILE_SIZE not working with file uploads

2007-09-20 Thread Instruct ICC

In the 
_
More photos; more messages; more whatever – Get MORE with Windows Live™ 
Hotmail®. NOW with 5GB storage.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_5G_0907
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] blocking exec() silently

2007-09-14 Thread Instruct ICC

> From: [EMAIL PROTECTED]
> Actually in this example, there is an error handling function provided 
> in the comments.

I'm commenting again because I want to stress the distinctions between errors 
E_ERROR, warnings E_WARNING, *USER* and other "messages/notices/etc.":
http://php.net/manual/en/ref.errorfunc.php#errorfunc.constants
http://php.net/manual/en/function.trigger-error.php

It may help you better design what you want on or off (and also versus logged 
somewhere else as I mentioned in my last post).

_
Capture your memories in an online journal!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] blocking exec() silently

2007-09-14 Thread Instruct ICC

> Instruct ICC schrieb:
> > I was going to mention
> > http://php.he.net/manual/en/features.safe-mode.functions.php and ask 
> > you if you need any of those functions, but I prefer Nathan's answer.  
> > You may be able to set the error reporting in conjunction with 
> > disable_functions and be done.

> Date: Thu, 13 Sep 2007 20:30:52 +0200
> From: [EMAIL PROTECTED]
> Hey,
> 
> Thanks for the replies!
> safe-mode is not an option unfortunately!
> But changing the Error reporting, is the first thing I wanted to do, but 
> when I asked if this was possible on this list, somebody replied, that 
> it this is not possible!
> 
> Could you point me to a way, how I can achieve, that the "this function 
> is disabled" error, without suppressing other error messages?
> 
> Regards,
> Samy

I just tested what I had in mind.  And it worked.  When I added phpinfo to 
disable_functions in php.ini and attempted to use it in a script, it was 
displayed as a warning.  So I modifed error_reporting in php.ini to not show 
warnings and I believe I achieved the results you want.  However, in a 
production environment, I think you should disable all error reporting to not 
tip your hand to a hacker.  I haven't verified this today, but I remember a 
situation where the PHP script would not display errors (or notices or warnings 
or ... whatever messages) in the web page, yet the message would still appeared 
in the Apache logs.

I just changed php.ini to: 
disable_functions = "phpinfo"
...
error_reporting  =  E_ALL & ~E_WARNING

http://php.net/manual/en/features.safe-mode.php
http://php.net/manual/en/function.error-reporting.php
http://php.net/manual/en/features.safe-mode.functions.php

Ahh, read this in php.ini:
; Print out errors (as a part of the output).  For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below).  Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.


Also Samy,
I saw something like this in someone's signature line on this list:


Because it destroys the context or flow of the discussion.

>Why should I not "TOP-POST"?

_
Can you find the hidden words?  Take a break and play Seekadoo!
http://club.live.com/seekadoo.aspx?icid=seek_wlmailtextlink

Re: [PHP] blocking exec() silently

2007-09-13 Thread Instruct ICC

On 9/12/07, Samuel Vogel <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
>
> Actually I'm still looking for a way to block for example the exec()
> function without throwing an error!



From: "Nathan Nobbe" <[EMAIL PROTECTED]>
i dont know why you wouldnt just use the
disable_functions directive in php.ini

disable_functions = "exec"


I was going to mentionn 
http://php.he.net/manual/en/features.safe-mode.functions.php and ask you if 
you need any of those functions, but I prefer Nathan's answer.  You may be 
able to set the error reporting in conjunction with disable_functions and be 
done.


_
Can you find the hidden words?  Take a break and play Seekadoo! 
http://club.live.com/seekadoo.aspx?icid=seek_hotmailtextlink1


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



RE: [PHP] SEARCHING for an answer...

2007-09-11 Thread Instruct ICC

From: Jason Pruim <[EMAIL PROTECTED]>
Here is the relevant code (I think...)

$search = $_GET["search"];
$self = $_SERVER['PHP_SELF'];
$qstring = "SELECT * FROM current WHERE FName like '%$qstring%' or  LName 
like '%$qstring%' or Add1 like '%$qstring%' or Add2 like '% $qstring%' or 
City like '%$qstring%' or State like '%$qstring%' or  Zip like '%$qstring%' 
or XCode like '%qstring%'";


Perhaps you meant
like '%$search%'
instead of
like '%$qstring%' multiple times?

Also read http://en.wikipedia.org/wiki/SQL_injection

_
Gear up for Halo® 3 with free downloads and an exclusive offer. 
http://gethalo3gear.com?ocid=SeptemberWLHalo3_MSNHMTxt_1


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



RE: [PHP] Security Issue

2007-09-05 Thread Instruct ICC
It was able to call up external includes using the below code which 
resulted

that the server was used to send out spam.
How can I protect the code?


Is ../inc/ in the web path?  $_SERVER['DOCUMENT_ROOT']

If so, then what do you mean by "external includes"?  You need to move inc/ 
to a path unreachable by a browser yet reachable by PHP.


_
Test your celebrity IQ.  Play Red Carpet Reveal and earn great prizes! 
http://club.live.com/red_carpet_reveal.aspx?icid=redcarpet_hotmailtextlink2


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



Re: [PHP] Reload page after form submit

2007-08-30 Thread Instruct ICC

From: Martin Marques <[EMAIL PROTECTED]>
Stut wrote:

Wagner Garcia Campagner wrote:





header('Location: index.php');

Although technically speaking that should be an absolute URL.


AFAIK, they are both equivalent.


Ahhh, if the OP meant, "Load a different page after doing some form 
processing in the current PHP page", then just go with the PHP "header" 
function.  The HTML META HTTP-EQUIV='refresh' would require the HTML be 
rendered first.  The PHP "header" would be slightly faster, and you are 
already in the PHP script.


I'm like, "How is the page becoming outdated?  You are not still on that 
page -- it's gone.  The next page display will gather the latest info."


_
A new home for Mom, no cleanup required. All starts here. 
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us


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



Re: [PHP] Reload page after form submit

2007-08-30 Thread Instruct ICC

From: Afan Pasalic <[EMAIL PROTECTED]>

rough code, to give you an idea:

   ('".mysql_real_escape_string($first)."', 
'".mysql_real_escape_string($last)."')

   ");
}
else
{
   $query = mysql_query("
   select first, last
   from table
   where id=xyz
   ");
   $result = mysql_fetch_array($query, MYSQL_ASSOC);
   $first = $result['first'];
   $last = $result['last'];
}
?>


First: 
Last: 




-afan


Afan,
From your rough code, I'd say the OP always needs the select block (just 
remove the "else" keyword and keep the block) for the current info at the 
present page refresh/load.  But I'd like clarification on how the OP thinks 
about it.


_
A new home for Mom, no cleanup required. All starts here. 
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us


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



RE: [PHP] Reload page after form submit

2007-08-30 Thread Instruct ICC

From: "Wagner Garcia Campagner" <[EMAIL PROTECTED]>
Is there a way to tell PHP to reload the page after the user submit the
information, so the page is always updated??

Thanks in advance,
Wagner.


I don't get your fundamental problem.  When a user submits a form, the page 
handling the submission  (the PHP script) decides what next to display.  
Can't you have it display the updated information?


From your subject, I was thinking "xajax".  But isn't this basic form 
handling?


Do you mean User1 submits a change, and you want User1, User2 and UserN to 
see the new information?  Then I could see scheduling a refresh.


_
Booking a flight? Know when to buy with airfare predictions on MSN Travel. 
http://travel.msn.com/Articles/aboutfarecast.aspx&ocid=T001MSN25A07001


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



RE: [PHP] Reload page after form submit

2007-08-30 Thread Instruct ICC

From: "Wagner Garcia Campagner" <[EMAIL PROTECTED]>

Hello,

I'm building a web page just like a blog...

Where the user input some information... (name, website and comment)

This information is stored in a file...

And then the page displays it...

When the user access the page the first time, the information is displayed
correct...

After the user submit the information, the page become outdated... without
this last information the user submitted...

Is there a way to tell PHP to reload the page after the user submit the
information, so the page is always updated??

Thanks in advance,
Wagner.


I don't get your fundamental problem.  When a user submits a form, the page 
handling the submission  (the PHP script) decides what next to display.  
Can't you have it display the updated information?


From your subject, I was thinking "xajax".  But isn't this basic form 

handling?

_
A new home for Mom, no cleanup required. All starts here. 
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us


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



Re: [PHP] Spam Post Defense / ID spam form posts

2007-08-23 Thread Instruct ICC
Because that means messing with the recipient list - that's donkey work 
your client should do, hence my use of reply-to-all.

Wouldn't gmail thread it but still have 2 copies?
I could send email TO/CC/BCC the list to a specific folder, but I'd still 
get the copy to me directly in another folder.  What should I train my 
donkey to do?  I reply to all, then I only let the list address survive and 
make sure it is in the TO field.


Attacking a server with the express intention of preventing it from working 
correctly is in most countries. It's the technological equivalent of 
getting prosecuted for assault because you defended your property from a 
burglar.
Now I'm thinking I should inform the attacking server of the situation by 
shutting them down until they address the issue.  It may need new laws on 
the books to cover my ass.  But what do you think?  Either a "YOU'VE BEEN 
PWND BY THE GUARDIANS because you are either running hijacked services for 
an attacker, (likely on an MS Windows flavor -- upgrade your OS to a non-MS 
OS), or you are the actual attacker.  When you patch your security holes, 
THE GUARDIANS will consider your petition to re-enter the superhighway." or 
some such.  If the HTTP_USER_AGENT hasn't been spoofed, they all seem to be 
Opera/9.0 (Windows NT 5.1; U; en), since I began tracking.  If the server 
could be shutdown and reported to an authority that would re-evaluate their 
access to the net, it could help catch the attacker or in the least, stop 
attacks on other "innocents".


Well, if the hijacked service is down, it will "hurt" the attacker.  If the 
"innocent's" server is down, they could learn about the need to be a better 
net citizen while at the same time not providing services to the attacker.


The point I was trying to make is that your first step should be to find 
out why he has that position, educate him as to the benefits of the CAPTCHA 
and the complications that any other approach might have.
He holds that position because he does not want the user to have to enter 
any additional keystrokes or mouse clicks (or think more?) while they are 
becoming a sales lead.  Not unlike your repulsion to cut and paste to send 
only to the list perhaps?


_
Tease your brain--play Clink! Win cool prizes! 
http://club.live.com/clink.aspx?icid=clink_hotmailtextlink2


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



Re: [PHP] Spam Post Defense / ID spam form posts

2007-08-23 Thread Instruct ICC
Why don't you and others just reply to the list?  (I'm smiling when I say 
this.)


Wow, that's for that egg-sucking lesson. I would think it was clear from my 
answer that I know what a socket is.
Sorry.  You understood the concept but it wasn't clear to me that you 
understood about the socket.  Save me a google search and define 
"egg-sucking", although I get your point.


That is pointless since most spam comments come from compromised machines, 
so you'd only succeed in pissing essentially innocent (albeit probably 
stupid) users.


Moreover that would definitely be illegal and you're more likely to be sued 
than the person behind the spam.
I'll try to remember that.  However, the technical interest remains and may 
be handy for a known attacker server (meaning a known party that is not a 
compromised innocent).  It sounds like I'm looking for a "Reflected attack".


Doesn't stop him/her being an idiot. Curious that you only value your job 
when payday is approaching.
Come on now.  I meant that he pays me.  I'm not trying to stop him on either 
count.



They do seem to have the bbcode url style markup.  Thanks again.


You've got to bear in mind that they are trying to achieve something, and 
that something is usually to build traffic and/or inbound links to their 
sites. The only way they can do this is to include URLs in their posts.

Yes I was wondering, wtf is their objective?

_
Find a local pizza place, movie theater, and more….then map the best route! 
http://maps.live.com/default.aspx?v=2&ss=yp.bars~yp.pizza~yp.movie%20theater&cp=42.358996~-71.056691&style=r&lvl=13&tilt=-90&dir=0&alt=-1000&scene=950607&encType=1&FORM=MGAC01


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



Re: [PHP] Spam Post Defense / ID spam form posts

2007-08-23 Thread Instruct ICC
Not sure what you mean by "hand off the socket to multiple threads on 
multiple servers". I think you're talking about detecting that a POST is 
spam and passing that off to another machine to handle it.
Yes, that is what I meant.  A socket is a lower level "object" that the web 
server is using to communicate.



Why would you waste any more time with it than you need to.
This was my knee-jerk response that wanted to bring down the attacker's 
server.  I was wondering if I could spawn multiple threads and on multiple 
servers to write back to that attacker socket.



Legally?


Grey area. You can put restrictions in the terms and conditions of use on 
your site, but AFAIK those have never been legally tested and would be 
extremely difficult and prohibitively expensive to enforce.
I'm pretty sure I read that bringing down an attacker's server (or making 
the attempt) would put me in the wrong.  And yes, I was thinking of adding 
legal terms to the form of the type "Bogus form submissions will be {dealt 
with}."


Then your boss is an idiot. Some form of CAPTCHA is the best defence 
currently available.

No comment, except that pay-day is approaching.

There are alternatives such as putting a generated key into a hidden field 
in the form which you also store in the session. When you get the POST you 
check the key you get to make sure that request has come from the form you 
just generated and not something/someone just using the field set. However, 
this is not overly secure since spammers just need to get the page 
containing the form each time.

I was thinking of this and came to the same conclusion.

There are projects out there ...taking part in a larger effort will 
certainly be more effective than doing it on your own.

Thanks.

You might want to check out the source for Akismet which is one of the 
anti-comment-spam plugins available for Wordpress. There are others around 
that do similar things.
I think I saw this name "Akismet" in my defense searches.  I'll take another 
look.


You don't say what context you're taking this data in, but if you can 
refuse to accept posts containing bbcode-style markup and links you will 
get rid of 70-80% of bogus posts.

They do seem to have the bbcode url style markup.  Thanks again.

_
Tease your brain--play Clink! Win cool prizes! 
http://club.live.com/clink.aspx?icid=clink_hotmailtextlink2


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



[PHP] Spam Post Defense / ID spam form posts

2007-08-23 Thread Instruct ICC

Can server1 receive a web page form post from remoteAttacker,
identify it as spam (or a DoS or DDoS attack),
hand off the socket to multiple threads on multiple servers owned by 
server1's owner,
return multiple responses to remoteAttacker which normally would have been a 
single response returned by server1,
so that server1 is not busy responding to remoteAttacker and is able to 
handle legitimate requests?


Technically?
Legally?

The boss doesn't want to use a CAPTCHA on the form but wants us to identify 
it without additional user input.


Also, can a form post be run through an email spam filter to identify it as 
spam?


Do you have any ideas to detect spam form posts?
I'm tracking the spam posts in an attempt to find a pattern I can use to 
detect them.


_
Learn.Laugh.Share. Reallivemoms is right place! 
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us


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



RE: [PHP] ptting the variable inside the input

2007-08-22 Thread Instruct ICC

From: "Hulf" <[EMAIL PROTECTED]>

This does not work

echo $title=$row['title'];
echo "";

Ta,

R.


I'll pull a Johnny Carson divining moment and say:

Did you need the first 'echo'?  Does $title need to be set?  Try:
$title=$row['title'];

You missed a double quote after your backslash; the attempt to escape one 
after 'text' and before 'value':

echo "";

Or perhaps use single quotes and don't set $title:
echo '/>';


But I like that 4 step approach to addressing a problem and posting a 
question.


Maybe you are using a wireless keyboard which needs batteries or charging or 
needs to be placed closer to the receiver?  You also missed a character in 
your subject.  Unless you just type lazily.


_
Now you can see trouble…before he arrives 
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_protection_0507


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



RE: [PHP] XHTML/CSS templates for developers

2007-08-04 Thread Instruct ICC
I have since hired a designer who's going to take everything I hand to him 
and CSS

it and add the right touches to it to make it a deliverable project.


You mean you will hand him your PHP code?  I wouldn't expect a designer to 
take it from there.  Perhaps you mean hand him the rendered HTML?



Thank you kindly for any insight.

- sf


To the person who started this post and everyone answering it...

I would appreciate your thoughts on this post as well:


From :  Instruct ICC <[EMAIL PROTECTED]>

Sent :  Thursday, August 2, 2007 1:46 PM
To :php-general@lists.php.net
Subject :   [PHP] Separation of Roles; with Salaries

_
Learn.Laugh.Share. Reallivemoms is right place! 
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us


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



[PHP] Separation of Roles; with Salaries

2007-08-02 Thread Instruct ICC

Finally I have the green light to get some separation of roles/duties.

First there was just me.  "Web Programmer", yet all web related hats.
Then there was the "Server Administrator", and me, the "Web Developer" (sort 
of like peers).  Although the admin doesn't like to change the server 
settings with recompiles, etc.
Now there is also a "Project Manager" (over both of us) that is still 
studying project management in school and hasn't programmed in years.  And 
is a joke when it come to getting requirements.  But at least I'm grooming 
him to take on gathering requirements while I code.


How do you recommend duties be separated if we can add more staff?  The US 
Salary post (which I did not want to hijack) listed many tasks, but how 
specialized can the duties be reduced?


Originally my thoughts were for 2 positions to report to me:
Presentation/GUI/Designer (let's say Web Designer)
Web Programmer
But these 2 will probably be direct reports to the "Project Manager".

Even if I continue as Architect and Developer (according to Sun Java 
certification definitions), the Web Programming part would still be PHP, 
Perl, *NIX, MySQL, MSSQL, Javascript, HTML, CSS, Ajax, JSON, Security, 
Testing, Version Control, and possibly Java.  Did I miss anything?


Can I really have a PHP Programmer who doesn't do Javascript, Ajax, and 
JSON?  (With the intent to low-ball the salaries so we can have 2 more 
bodies).  I suppose the Web Designer can do the HTML and CSS, and the Web 
Programmer can just use certain CSS selectors defined by the Web Designer?


I still feel like I'll be doing all the above except html and css.

How should we separate the roles?
And what should their salaries be?

Please advise.

_
Find a local pizza place, movie theater, and more….then map the best route! 
http://maps.live.com/default.aspx?v=2&ss=yp.bars~yp.pizza~yp.movie%20theater&cp=42.358996~-71.056691&style=r&lvl=13&tilt=-90&dir=0&alt=-1000&scene=950607&encType=1&FORM=MGAC01


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



Re: [PHP] Profile / Debug w/o server modification?

2007-08-01 Thread Instruct ICC

From: "Richard Lynch" <[EMAIL PROTECTED]>
Your dev box should only match in software versions (okay, and any
really funky specialized hardware like a hardware random number
generator MAYBE).



Regarding duplicating the box versus software:
I'm working on a C++ project on a Mac Pro and a MacBook Pro.


Phew!

When I archived my sources and makefiles rather than reproducing them from 
memory, it built the same successfully on both.  As I would hope.


_
Puzzles, trivia teasers, word scrambles and more. Play for your chance to 
win! http://club.live.com/home.aspx?icid=CLUB_hotmailtextlink


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



Re: [PHP] Profile / Debug w/o server modification?

2007-07-31 Thread Instruct ICC

From: "Richard Lynch" <[EMAIL PROTECTED]>
Your dev box should only match in software versions (okay, and any
really funky specialized hardware like a hardware random number
generator MAYBE).

Don't ask them for a Gigaplex Mu-on 16-cpu 64 Gig RAM 4 Terabyte hard
drive box.

Take an old box out of your closet and install the same versions of
the OS, Webserver, DB, and PHP and call it done.

Now, a QA box, where you do load-testing and serious "release
candidate" testing, yeah, THAT should match the production box, if at
all possible...


Do you know of any (free as in money) disk imaging software that would 
capture all the patches/configurations/etc.  Actually, as I write this, I 
remember the reason the imaging tool I used had mysterious failures was 
probably due to bad memory, and I could use a different box now.


Thanks for the advice.


Regarding duplicating the box versus software:
I'm working on a C++ project on a Mac Pro and a MacBook Pro.  Both have 
Intel Core 2 Duo (but the Mac Pro states Xeon, while the MacBook Pro does 
not detail that.  The Mac Pro is 4 cores while the MacBook Pro is 2 cores).
Both use MinGW for Mac 3.4.5, the same mtapi 
http://www.metaquotes.net/files/mtapi.zip and Wine 0.9.40.  Same OS version 
of course, and only 2GB RAM in both each.
I was able to compile on the Mac Pro, but when I tried on the MacBook Pro, I 
receive undefined reference to [EMAIL PROTECTED]  I also saw that on the Mac Pro, 
but I don't remember exactly what I did to resolve it.  I used -shared on 
the MacBook Pro, and I know I did not use that on the Mac Pro.  But now I'm 
getting


../Client/MetaTraderAPI.o: In function `atexit':
/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/dllcrt1.c:161: 
multiple definition of `_atexit'
/usr/local/i386-mingw32-3.4.5/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/crt2.o:/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/crt1.c:269: 
first defined here

../Client/MetaTraderAPI.o: In function `_onexit':
/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/dllcrt1.c:177: 
multiple definition of `__onexit'
/usr/local/i386-mingw32-3.4.5/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/crt2.o:/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/crt1.c:277: 
first defined here

../Client/MetaTraderAPI.o: In function `_onexit':
/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/dllcrt1.c:183: 
multiple definition of `___do_sjlj_init'
/usr/local/i386-mingw32-3.4.5/lib/gcc/i386-mingw32/3.4.5/crtbegin.o:crtstuff.c:(.text+0x0): 
first defined here


It was concept code from my memory and I'm going to have to make sure I 
duplicate my steps, but other than the processor, I thought I had identical 
environments.


I haven't had time to test the PHP environment you suggested.

_
Local listings, incredible imagery, and driving directions - all in one 
place! http://maps.live.com/?wip=69&FORM=MGAC01


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



RE: [PHP] Unexpected values in an associative array

2007-07-31 Thread Instruct ICC

From: Ken Tozier <[EMAIL PROTECTED]>
Hi

I think this is probably just a misunderstanding on my part, but I'm  
creating associative arrays with string keys from MySQL query results  and 
when I put a value in the array, I get the expected key  association along 
with an index key that has a different value.


And here's some sample output

array(6) {
  ["task_id"]=>
  int(22)
  [0]=>
  string(2) "22"
  ["container_id"]=>
  int(3784)
  [1]=>
  string(4) "3784"
  ["name"]=>
  string(12) "108-6972.XTG"
  [2]=>
  string(24) "3130382D363937322E585447"
}

Why is that? Is there any way to fix this without coercing the same  value 
twice? Once for the key accessor and once for the index accessor?


Thanks In advance

Ken


What is $coersions or $inQuery['coersions']?  Maybe a var_dump or a print_r 
on that for the list?

What is $value and what is this supposed to do:

case'integer':
$value  
+= 0;
break;

case'float':
$value  
+= 0.0;


If $value is a string, you should quote your 0 and 0.0.  What add 0 or 0.0 
to an int or float respectively?


Do a print_r on $row before your foreach ($row as $key => $value) and echo 
your $key and $value as the first line in after that for loop.  Then echo 
$coersions[$key].  Does $coersions[$key] have what you want for switch 
($coersions[$key]) at this point?  I assume you expect $coersions to contain 
datatypes, but does it?


Perhaps "start at the end" considering the structure of the output array you 
want, then consider how to populate it to have that structure.


What's the extra "[]" about in $rows[$groupKey][] = $fields;
Maybe that's where your duplicates are coming from although I don't see 
duplicates in your output.


_
http://liveearth.msn.com

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



Re: [PHP] Profile / Debug w/o server modification?

2007-07-29 Thread Instruct ICC

From: "Richard Lynch" <[EMAIL PROTECTED]>

On Fri, July 27, 2007 10:01 pm, Instruct ICC wrote:
> If you mean get a dev box.  You don't know how long I've been asking
> for one
> to match the production box.

Your dev box should only match in software versions (okay, and any
really funky specialized hardware like a hardware random number
generator MAYBE).

Don't ask them for a Gigaplex Mu-on 16-cpu 64 Gig RAM 4 Terabyte hard
drive box.

Take an old box out of your closet and install the same versions of
the OS, Webserver, DB, and PHP and call it done.

Now, a QA box, where you do load-testing and serious "release
candidate" testing, yeah, THAT should match the production box, if at
all possible...


Do you know of any (free as in money) disk imaging software that would 
capture all the patches/configurations/etc.  Actually, as I write this, I 
remember the reason the imaging tool I used had mysterious failures was 
probably due to bad memory, and I could use a different box now.


Thanks for the advice.

_
Local listings, incredible imagery, and driving directions - all in one 
place! http://maps.live.com/?wip=69&FORM=MGAC01


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



RE: [PHP] Authentication

2007-07-27 Thread Instruct ICC

From: "Dan Shirah" <[EMAIL PROTECTED]>

All,

I looked on PHP.net but I couldn't not find anything suitable to answer my
question.

Within PHP, is there a way to pull the name of the user that is currently
logged into the PC?

I know with some of the _SERVER functions you can pull the IP of the 
machine

and other data, is there a function within this family that would work?

Thanks,

Dan


What operating system is being run on this personal computer?
Who is running the PHP script?
Is the PHP script being run from a web page or the command line?

On a Mac, if I run phpinfo from a command line script, I see my user name in 
6 entries with variants of USER and LOGNAME.
If the user was logged into a PHP web page with say htaccess or a custom 
HTML Form, I could see the name he logged in with.


_
Don't get caught with egg on your face. Play Chicktionary!  
http://club.live.com/chicktionary.aspx?icid=chick_hotmailtextlink2


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



Re: [PHP] Profile / Debug w/o server modification?

2007-07-27 Thread Instruct ICC

From: "Richard Lynch" <[EMAIL PROTECTED]>
> But xdebug and apd are probably moot.
>
> BTW, I'm not using separate development and production machines.

Right there is your first problem.

Solve that first.


If you mean get a dev box.  You don't know how long I've been asking for one 
to match the production box.


_
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_pcmag_0507

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



[PHP] Profile / Debug w/o server modification?

2007-07-27 Thread Instruct ICC
Are there any "magic functions" like __sleep and __wakeup that get called 
upon entry and exit of user functions or user object methods?


Something like
__hookEntry For User Functions
__hookExit For User Functions
__hookOoEntry For User Object Methods
__hookOoExit For User Object Methods

Basically I want a profiler like xdebug, but I know my admin is going to 
cringe since it involves adjusting the server settings.


Also, I don't want it "always on".  I want it only to profile when I say.
http://php.net/apd seems to say it will only be in use when I use 
"apd_set_pprof_trace".


Is "xdebug.default_enable" able to be set with ini_set per script?  This 
site http://www.phpdeveloper.org/news/7780 made me think it will be always 
on, "Debugging
Without doing anything you'll see the benefits of Xdebug when messages are 
outputted to your browser." but maybe that's just because 
xdebug.default_enable is On by default.


But xdebug and apd are probably moot.

BTW, I'm not using separate development and production machines.

_
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_pcmag_0507

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



Re: [PHP] double output from trigger_error from command line

2007-07-20 Thread Instruct ICC

From: "Richard Lynch" <[EMAIL PROTECTED]>

There's the display_error_in_browser or whatever it is that might be
causing the second output...



From the command line?


_
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_pcmag_0507

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



Re: [PHP] repetition of tedious references

2007-07-19 Thread Instruct ICC

From: tedd <[EMAIL PROTECTED]>
Olav:

Mine too.

But, Rasmus gave me this:

 $action = isset($_GET['action']) ? $_GET['action'] : null;

Which could be translated to:

 $language = isset ($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? 
($_SERVER["HTTP_ACCEPT_LANGUAGE"]) : "*";


I think that might help.

Anyone see a problem with it?

Cheers,

tedd


I see a problem.  If it is set and == "", you let it stay "" instead of 
being assigned "*".  Only when it is not "" should it be allowed to stay the 
same.


_
Local listings, incredible imagery, and driving directions - all in one 
place! http://maps.live.com/?wip=69&FORM=MGAC01


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



Re: [PHP] Re: Pirate PHP books online?

2007-07-18 Thread Instruct ICC
First "Hitler and the Nazis"[1] reference.  You lose!  Thanks for playing. 
:-)


[1] http://en.wikipedia.org/wiki/Godwin's_Law




Dang I didn't know that existed, thanks for the reference now I have 
something for all my other discussions.


ROFLMAO

_
http://liveearth.msn.com

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



RE: [PHP] Error on installing under Windows Vista leads to inability to uninstal

2007-07-18 Thread Instruct ICC

From: Stephan G <[EMAIL PROTECTED]>
php-5.2.3-win32-installer.msi

It has the following md5 sum, taken locally on my system:

4d042f649d9c264477e1b421c64c6435

I can confirm the same md5 sum.


"The installer has encountered an unexpected error
installing this package.  This may indicate a problem with
this package.  The error code is 2738."

A few hits for a search on "msi error 2738" give:
"Could not access VBScript run time for custom action"

I would appreciate help with any of the following (roughly in my priority 
order):


1.  How can I uninstall this and remove it from my system?

Try a System Restore point.


2.  What is error code 2738 and what does it mean?

"Could not access VBScript run time for custom action"


3.  What steps might I take subsequently to install without
incurring this error?
Maybe test that any VBScript can run before trying this installer.  Maybe M$ 
is protecting you from running potentially malicious scripts.  You didn't 
get a "PC Guy Agent: VBScript would like to run.  Allow or Deny?"  Perhaps 
the installer from the PHP site is bad and M$ is not the guilty party.


_
http://liveearth.msn.com

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



Re: [PHP] Error on installing under Windows Vista leads to inability to uninstal

2007-07-18 Thread Instruct ICC

He did say "or Win XP".

I'll have to go back to find your original post to see if I can help.

Well, from your subject, maybe you can use a System Restore point?


---
If you need a stable, secure OS, get Ubuntu.
If you need a stable, secure OS, and need new hardware, get a Mac. 
(Guaranteed OSX Ultimate Capable)





From: Stephan G <[EMAIL PROTECTED]>

Dear Alan:

Thank you for your suggestion on wiping the disk and reloading the OS, 
which I imagine you might be suggesting because of your political feelings 
to Microsoft... which I don't think are wrong.


However, this would not be a practical solution for me in any way, and this 
installer claims on the PHP site to be Vista compatible, so I am hoping 
there is a much less destructive way of dealing with this issue.


Anyone else?

Many thanks.

-stephan

Alan Milnes wrote:

On 18/07/07, Stephan G <[EMAIL PROTECTED]> wrote:

I have tried to install the following on my Windows Vista Home Premium
System:


Ah I see the problem there 

Vista is not a mature OS yet - wait until at least SP1 before trying it.


 1.  How can I uninstall this and remove it from my system?


Best bet is to wipe the disk and install a decent OS - Ubuntu or WinXP 
perhaps.


Alan


_
http://liveearth.msn.com

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-18 Thread Instruct ICC

From: Tijnema <[EMAIL PROTECTED]>

I didn't read the full thread (because it is 80 emails...)

But really, it isn't special that these books are found on the net,
and you really can't stop them, nor can the author of the book.

With a quick search, I found these books related to PHP(all "free" to 
download):

Beginning Ajax with PHP: From Novice to Professional
...
need one?

Tijnema


Yes, I need one.  Kindly send me the full free download link to the one 
above.  All I see are free excerpts.


_
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507

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



Re: [PHP] double output from trigger_error from command line

2007-07-18 Thread Instruct ICC

From: "Instruct ICC" <[EMAIL PROTECTED]>


From: "Olav Mørkrid" <[EMAIL PROTECTED]>

sorry. still get it twice.

c:\>php -r "error_reporting(E_ALL ^ E_NOTICE);
trigger_error(\"hello\", E_USER_ERROR);"
PHP Fatal error:  hello in Command line code on line 1
Fatal error: hello in Command line code on line 1

- if i do error_reporting(0) then i get NO lines at all. and if i do
error_reporting(E_NOTICE) and then trigger_error("hello", E_NOTICE) i
get two again.

so there must be some setting beside error_reporting.


What do you get with:
php -r "error_reporting(E_USER_ERROR); trigger_error(\"hello\", 
E_USER_ERROR);"


"Show only user errors"

But you may be interested in other errors, warnings, or notices (system 
versus user)?


Hmm, I'm seeing the behavior you mentioned on PHP 5.1.6 box, but not on PHP 
4.4.4.


_
http://liveearth.msn.com

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



Re: [PHP] double output from trigger_error from command line

2007-07-18 Thread Instruct ICC

From: "Olav Mørkrid" <[EMAIL PROTECTED]>

sorry. still get it twice.

c:\>php -r "error_reporting(E_ALL ^ E_NOTICE);
trigger_error(\"hello\", E_USER_ERROR);"
PHP Fatal error:  hello in Command line code on line 1
Fatal error: hello in Command line code on line 1

- if i do error_reporting(0) then i get NO lines at all. and if i do
error_reporting(E_NOTICE) and then trigger_error("hello", E_NOTICE) i
get two again.

so there must be some setting beside error_reporting.


What do you get with:
php -r "error_reporting(E_USER_ERROR); trigger_error(\"hello\", 
E_USER_ERROR);"


"Show only user errors"

But you may be interested in other errors, warnings, or notices (system 
versus user)?


_
http://newlivehotmail.com

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



Re: [PHP] Sessions Lose Form Field Data When Back Button Used?

2007-07-17 Thread Instruct ICC

From: "Richard Lynch" <[EMAIL PROTECTED]>
It's still browser-dependent, really, but now your browser isn't doing
what YOU want for your form-filling-in-experience...


I like this.  I'll have to add it to my "operator error", "pass the buck" 
bag of tricks.




There's still nothing you can do about it from PHP, unless you want to
make the user who LIKES it that way have a miserable experience, since
you force their browser to not behave they way they expect it.


Well, the users expect the old behavior, so I need to maintain it until a 
redesign.  In a way, my only user is the VP.  Then he will tell others that 
this is the desired behavior LOL.




You have to call session_start() on every request to have sessions
working in that request...  I doubt that you want to skip that for any
page involved in your FORM processing...


Agreed.  Such code would not be reached anyway because my approach is to now 
have the browser cache redisplay the form data and not reload my script.




Ignore this "problem" for awhile and see if it doesn't go away.
(read: you realize it's not really a problem)


Are you really a CEO?  I like your style.

_
Local listings, incredible imagery, and driving directions - all in one 
place! http://maps.live.com/?wip=69&FORM=MGAC01


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



  1   2   >