Re: [PHP] Re: A native Windows binding for PHP

2004-07-29 Thread Travis Low
Another way to make money on free software is consulting.  Many organizations 
don't have the time, resources, or interest in adapting free software for their 
needs.

cheers,
Travis
Manuel Lemos wrote:
Hello,
"Rubem Pechansky" <[EMAIL PROTECTED]> wrote in message..
I have designed and successfully prototyped a native Windows binding
for PHP. This binding is already capable of doing dialogs, controls,
and a lot more with very few lines of code. PHP can thus be used as a
tool for developing native Windows applications, so it can compete
with several much more expensive languages/environments. Go to
http://hypervisual.com/winbind/ for more details. This library will
eventually grow into a full-fledged IDE. I believe this idea has great
potential in the low-end market given the enormous installed base of
Windows users and the ever-growing interest about PHP.
I'd like to open the code source *and* make a profit at the same time
(although I'm not sure if that's possible), so I'm open to any ideas
or business opportunities regarding the large-scale development of
this product.
What do you think? Does this idea have potential? Would any serious
company be interested in investing on a project like this?

I think that once you  have opened the source code, it is hard to make a 
profit just from its development.

On the other hand you can always open the source of the library and 
develop closed source extensions or tools that make the development of 
your library more powerful and useful so it will be an advantage for 
people to buy those extensions and tools from you instead of developing 
themselves.

Regards,
Manuel Lemos
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP version usage statistics?

2004-04-14 Thread Travis Low
Can you point me to a link showing usage of PHP, Java, ASP, etc.?  I've been 
looking at netcraft.com, but I'm not seeing it.  Thanks!

Travis

Jeffrey Tavares wrote:
netcraft shows how many servers have php, but nothing specific about 
versions. Maybe I'm wrong, but I checked all over netcraft's site.

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP editor

2004-04-15 Thread Travis Low
XEmacs www.xemacs.org.

T

Arthur Radulescu wrote:
Hello!

This might sound like a stupid question but could anyone recommand a good
PHP editor...
I have used some editors until now but each one has some problems...
Right now I am using PHPed which is pretty good but oine of the major
problems is that it does fills the tabs with spaces which will increase a
lot the size of pages specially the templates...
Also using Zend which is very good but this is extremly slowly and some
times it is almost crashing the computer so it is not very good for fast
editing...
What I am looking for is something to work pretty fast, have code
autocompletion (even for functions defined in the included files like zend
does) and also code ident in a similar manner with zend studio


Arthur



Looking for a job!? Use the smart search engine!!
Find a Job from Millions WorldWide...
http://search.jobsgrabber.com

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [Re: [PHP] PHP editor]

2004-04-15 Thread Travis Low
You are correct, but I believe the bandwidth savings is small.

What I usually do for my apps is allow the admin to configure whitespace 
trimming.  If configured, I only remove whitespace from the beginning of the 
line to the first non-whitespace character.  This reduces the code size 
somewhat, while still leaving the HTML human-readable (newlines are intact).

cheers,

Travis

Arthur Radulescu wrote:
What I meant was that it is obiously that eliminating the spaces but not by
a blind replacement, the new lines characters and even the tabs will reduce
the size of the page which will result in a faster loading and less
bandwidth consumed... And the example was google... Am I wrong with anything
here?


[snip]
PHP is one thing and HTML is another thing.. Check the google source
code
and you'll that this is how they have it... I assume the reason is to
reduce
the size of the page...
[snip]
Your assumption about Google would be incorrect, it has nothing to do
with page size as most of their pages are predominately text.
See http://www.w3.org/TR/html401/struct/text.html#whitespace for a more
detailed dissertation on white space in HTML.
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Unwanted e-mails

2004-04-16 Thread Travis Low
Lester Caine wrote:
Chris W. Parker wrote:
David A. Stevens <mailto:[EMAIL PROTECTED]>
on Friday, April 16, 2004 10:31 AM said:
I have somehow, for reasons unknown to me, gotten onto some e-mail
list that I don't want to or need to be on. Somebody please, at all
the above addresses, do everything possible to get me off that
list(s).
DON'T MAKE AN AUTO-REPLY!!

UNSUBSCRIBE YOURSELF!!
Does not Fing work!!
The unsubscribe process requires you to reply to the eMail that is sent.
THAT email is bounced for many people who are trying to unsubscribe.
SOMEBODY NEEDS TO GET THEIR ACT TOGETHER AND FIX THE SYSTEM SO THAT WE 
C*A*N* UNSBSCRIBE !
I just unsubscribed and re-subscribed, no problems at all.

Did I miss anything?  :-)

cheers,

Travis

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Why are Session Variables carried over into a brand new browser window?

2004-04-17 Thread Travis Low
Sorry, the new window is part of the same session.  You'll have to find some 
other way to distinguish between the two windows.

cheers,

Travis

Bob Bruce - Programmer wrote:
This is my first posting to this group, so I am not familiar
with any special etiquette for it, please bear with me. . .
I maintain the PHP code for the website for the murals of Winnipeg and
have found a situation where I have a session open with the state of
the user's search results saved in the session and link to a location
with the following link:
http://www.themuralsofwinnipeg.com/Mpages/index.php?action=gotomural&m
uralid=179">
so this opens a new browser window, but it is inheriting the session values
from the browser window that called it and is causing problems in the new
window. When I open a new browser window shouldn't it start a whole new
session and not get anything from the previous browser.
Thanks in advance for your help,

Bob Bruce,
Winnipeg, Manitoba
    Canada
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] sessions getting destroyed for *Some* clients

2004-04-19 Thread Travis Low
Make sure it's not just a cookie-problem related to server name.  The shopping 
cart session for "original-remote-control.co.uk" is different from the shopping 
cart for "www.original-remote-control.co.uk".  If this is your problem, I think 
you can fix it by changing how you call "setcookie".

Of course, this may not be the problem, in which case you can ignore what I 
just said. :-)

cheers,

Travis

Jaskirat Singh wrote:
Hi Guys,

I have some thing weird happening with sessions here.
They are getting destroyed/reset for *SOME* clients.
I wrote a shopping cart which obviously needs sessions to work.
It works perfectly fine on my development server .. but when I move it
to my production server it starts behaving strange. It works for some
client PCs and not so for others.
I tested with 2 servers and 2 clients.

Test Results
---
Client   Server   Result
PC   Development Server   OK
NoteBook Development Server   OK
PC   Production ServerPROBLEM
Notebook Production ServerOK
---
PC = Win 98, IE6/Opera7
Notebook = Win XP, IE 6
Devlopment Server = PHP 4.1.2
Production Server = PHP 4.3.5
Three out of four cases are working OK. And one is simply not working
and sessions keep getting reset on every page request. 
This kinda sounds as if its neither the server nor the client which is
the problem but some combination of the two which is the problem. The
combination which had the problem had it for IE 6 as well as Opera 7.

I asked my friends to test and 2 reported its OK and 1 reported the
same problem that I encountered.
The shopping cart code is written by me and is running on a couple of
other servers perfectly fine.
The production server is http://original-remote-control.co.uk
PHPinfo() page http://original-remote-control.co.uk/phpinfo.php
Any ideas on where to look would be highly appreciated.

Jas



__
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Whats faster? text files or mysql?

2004-04-20 Thread Travis Low
Isn't the database kept in a file?  Why would that file be faster than a plain 
text file?

cheers,

Travis

Jay Blanchard wrote:
[snip]
I have two text files with two rows of data on each line sperated by a
tab for about 20 lines in each file. Would it be faster accessing this
data by putting it in a mysql table?
[/snip]
Sounds like the perfect opportunity to set up a test! File I/O is always
slower.
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Making an app unviewable during system maintainance

2004-04-20 Thread Travis Low
Michal Migurski wrote:
Hi there I was wondering how people usually turn the app off during
system maintainance. During the hours of 6-7 the database goes down for
backing up, the users therefore keeping trying to get into the system, i
get an error that the database is down when i know it should be down
near that time. Without causing too many if statements what is the best
way to do this ?
Don't take the database down for backups.

I can think of no logical reason why you'd want to kill the DB to back it
up, since it's just a big "read" operation.
Referential integrity might be a reason.

However, I agree -- don't back up the database directly -- use whatever 
utilities the database provides to dump the database, then back up the dump. 
Depending on how well the dump utility works, you might be able to do away with 
the downtime.

cheers,

Travis

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Making an app unviewable during system maintainance

2004-04-20 Thread Travis Low
Michal Migurski wrote:
Don't take the database down for backups.

I can think of no logical reason why you'd want to kill the DB to back
it up, since it's just a big "read" operation.
Referential integrity might be a reason. 
Good point, though if this is a concern, the OP will probably use the
built-in enforcement of referential integrity and transaction support of
whatever database they are running.
I don't know what an "OP" is, though I'm not sure it's relevant to my point. 
What I'm saying is that I don't think it's a good idea to back up a live 
database, because at that point you can't enforce referential integrity any more.

If a single database is spread over files A, B, and C, then in the time it took 
for a naive backup to grab file A, files B and C may have changed such that the 
database cannot be restored to an internally-consistent state using files A, B, 
and C.  At this point, enforcement of referential integrity would actually work 
against you.

Bottom line is that I wouldn't trust a backup of a live database, ever.  I 
would take every step to avoid relying on such a backup.

*cough* postgresql ;)

However, I agree -- don't back up the database directly -- use whatever
utilities the database provides to dump the database, then back up the
dump.  Depending on how well the dump utility works, you might be able
to do away with the downtime.


mysql has mysqldump, and postgresql has pg_dump. Both of these are pretty
much all you'd need, and neither requires any site downtime.
Exactly.  Use the DB to make the snapshot, then back up the snapshot.

cheers,

Travis

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Scripting practices

2004-04-23 Thread Travis Low
It's not necessary.  If you want to go to that much trouble, I would switch to 
Java for the speed.  I stick with PHP for the shorter development time.

cheers,

Travis

Gabe wrote:
When scripting in a language (such as PHP) that doesn't require you to 
determine the variable type before you use it, is it still considered 
good technique to initialize it to the type you're going to use it as? 
Or is it considered ok to just use it?

e.g.

$strText = "";//initialize
$strText = "now i'll give it a useful value";
Or is it just better to skip the first line?  Just curious, thanks!

Gabe

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Scripting practices

2004-04-23 Thread Travis Low
Also, for the lazy variable typing.  To me, strong typing means pounding the 
keyboard extra hard.

cheers,

Travis

Travis Low wrote:
It's not necessary.  If you want to go to that much trouble, I would 
switch to Java for the speed.  I stick with PHP for the shorter 
development time.

cheers,

Travis

Gabe wrote:

When scripting in a language (such as PHP) that doesn't require you to 
determine the variable type before you use it, is it still considered 
good technique to initialize it to the type you're going to use it as? 
Or is it considered ok to just use it?

e.g.

$strText = "";//initialize
$strText = "now i'll give it a useful value";
Or is it just better to skip the first line?  Just curious, thanks!

Gabe


--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] overloaded, overworked ereg statement?

2004-04-23 Thread Travis Low
Break it up a little.  Try something like this:

$title = preg_replace( "/.*/i", "", $file_text );
$title = preg_replace( "/.*/i", "", $title );
Ditto for body.

Since you're looking for certain tags, it stands to reason that you're 
primarily interested in characters after "<" characters.  So this might be faster:

$chunks = split( "<", $file_text );
for( $i = 0; $i < count( $chunks ); $i++ )
{
if( 0 === strpos( $chunks[$i], "title" ) )
{
# Title starts after the next ">", so get it.
# If you're careful, you can modify $i here
# as you gather up the title.
}
if( 0 == strpos( $chunks[$i], "body" ) )
{
# Body starts after the next ">"
# Modify $i, but be vewwy caweful.
}
}
The de-commenting is left to the reader.

cheers,

Travis

Tim wrote:
This script worked on one server, but started choking after I moved it 
to a new server.

Summary:  I use the php_auto_prepend script to start output buffering, 
then use the php_auto_append script to extract the content between the 
title tags and between the body tags.  When the size of the content 
between the body tags reaches around 11,500 characters, the ereg 
function stops working correctly.

What governs the number of characters that ereg can process?

I looked at the phpinfo from both servers but didn't find any clues...

Thanks for the help :)

FYI sample code:

prepend--



ob_start();

?>

append--



// load document into $file_text

$file_text = ob_get_contents();
ob_end_clean();
// extract title

unset($regs);

// use preg_match because its supposed to be faster...
//eregi("(.*)",$file_text,$regs);
preg_match("|(.*)|i",$file_text,$regs);

$document_title = $regs[1];

// extract body of document (need to add onload statement in  tag)

unset($regs);

// I don't have the foggiest why preg_match doesn't seem to work here...
//preg_match("|\$|i",$file_text,$regs);
//preg_match("|>(.*)|i",$regs[1],$temp);
eregi("",$file_text,$regs);
ereg(">(.*)",$regs[1],$temp);
$template_body = $temp[1];
// stuff $document_title and $document_body into the "official" template

/* snip */
?>
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Question about the mail() php function

2004-04-23 Thread Travis Low
Sounds like you don't have a mail server running on localhost at port 25.

If you do have a mail server running, then it seems to me that you should 
verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in 
C:\Program Files\Abyss Web Server\htdocs\page.php on line 24.  Just 
paraphrasing here.

cheers,

Travis

Shawn Inder wrote:
Hello,
I was browsing your site and came across the mail() PHP function. I 
tryed it out:


[EMAIL PROTECTED] is my e-mail adress, obviously enough..
The problem is, the e-mail doesn't get sent.
A warning appears on the page:
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, 
verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() 
in C:\Program Files\Abyss Web Server\htdocs\page.php on line 24

What is this all about?  Why wont it work?
Thanks you very much
If this is not the right place to send a question, please tell me where 
that right place would be :)

shlagish (or Shawn, you choose)

_
STOP MORE SPAM with the MSN Premium and get 2 months FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines 


--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: php mail() scaleability

2004-04-25 Thread Travis Low
Manuel Lemos wrote:
Hello,

On 04/25/2004 04:18 PM, Josh Klobe wrote:

Using  mail($to, $subject, $content, $headers) takes way too long when
attempting to mail to 30k people.  This seems to be a result of a socket
being opened for each send.  Is there a better way to approach this
situation via php?
Under Unix/Linux, PHP itself does not open any sockets to queue messages 
with the mail function. If you are using Unix/Linux with sendmail there 
are some options that can be tweaked to make it just queue the message 
instead of trying to deliver the message immediately.
Okay, I'll bite.  What options?

cheers,

Travis

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] HTTP_RAW_POST_DATA

2004-05-11 Thread Travis Low
Chris Shiflett wrote:
--- Curt Zirzow <[EMAIL PROTECTED]> wrote:

Check the value of "always_populate_raw_post_data" in php.ini on
both servers.

Thats such a funny name.
Not to mention misleading, since it doesn't always populate
$HTTP_RAW_POST_DATA when enabled. Always should mean always.
No, no, that's crazy talk.  :-)

cheers,

Travis

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] SuExec and PHP

2004-05-12 Thread Travis Low
Greetings.  We have a need for our PHP scripts to run as the user and group 
associated with each Apache virtual domain on our Redhat server.  Currently, 
all PHP scripts run as nobody.nobody.

I know that the apache suexec module allows CGI scripts to run as the user and 
group of the virtual host, but that doesn't seem to be the case for PHP scripts 
run under the apache php module (mod_php).

So my questions are:

(1) Can we use suexec to force PHP scripts (running under mod_php) to run as 
the user/group associated with the virtual host?  If so, how?  Are there any 
special configuration tricks to make this happen?

(2) If we CAN'T use suexec with mod_php, I assume we can run PHP as CGI to 
solve our problem.  However, I'm worried about performance.  Have any of you 
done this on linux?  Is it difficult to configure?  Do you have to audit all of 
your PHP scripts?  Etc., etc.

I did read the pages http://www.php.net/security.cgi_bin and 
http://www.php.net/manual/en/security.apache.php, but did not come away with 
clear answers to my questions.  There were also a lot of contradictory comments 
at the bottom of those pages, and a whole mess of stuff on google, so I'm 
getting more lost, not less.  Please help!

cheers,

Travis

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP5 - instanceof

2004-05-12 Thread Travis Low
An instance only exists after it has been instantiated.  So you can't know 
anything about an instance (== an object) beforehand.  It's like knowing a 
person before they are born.

Maybe you mean you want to determine if class B is a subclass of class A. 
That's the same problem again.  Even if PHP5 had a Class object (a la Java), 
you'd have to instantiate *it* in order to find the relationship between class 
A and class B.  Prior to that point, you only have text strings to work with. 
I suppose you could search the text of the file for "extends FooBar" or something.

cheers,

Travis

Martin Towell wrote:
I have been playing with PHP5 and am liking it more and more. But I have one
question about "instanceof"
If you have something like this:


This would echo "BA". That's good, I understand that.

Now the question: Is it possible to determine if B is an instance of A
without instantiating it?
Thanks
Martin
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] md5() with rand() || Strange results, need help....

2004-05-13 Thread Travis Low
Besides checking the browser cookie settings, have one of the affected users 
turn off the auto-fill form feature, then tell the browser to forget all saved 
form information.  Let us know what happens.

cheers,

Travis

CF High wrote:
Re: the browser track, it looks like all adversely affected users; i.e.
those who can no longer log in, have a browser of I.E. 6.0.
I know that in many cases I.E. 6.0 has session and cookie vars disabled by
default.
Is it possible, a long, long shot, that rand() behaves differently in I.E.
6.0 -- I know PHP is server side, but I'm looking for any clues
--Noah

"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
CF High wrote:


If anyone has any clues as to what might be happening; i.e. why the
md5'd

submitted plain text password does not match the stored md5'd password,
please, please let me know.
md5() results in a 32 character string. What kind of field are you
storing it in?
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com


--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] auto saving data in forms

2004-05-07 Thread Travis Low
To do this reliably, you'll need something like a Java applet.  In your shoes, 
I'd ask the customer how important this requirement REALLY is.  It will cost 
more to develop, and will increase the load on the database a LOT.

cheers,

Travis

[EMAIL PROTECTED] wrote:
i'm currently designing a website in which i have some forms with data saved in
database.
My customer wants that when he add or modify some datas in these forms, changes
will be made immediately in database. I really don't know how to do it and don't
know if it is possible. 

Is there anyone who have fijnd a solution to solve that problem and who can help
me. I accept solutions in other langages than PHP like JAVA + XML.
thanks,

Marc

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] A work around my HTTP_REFERER Prob...

2004-05-07 Thread Travis Low
How about something like this:

Write a script on server 1 to accept "username" and "password" parameters.  If 
successful, it echoes "1", if not, it echoes "0".

On server 2, you do something like this:

$s = file("http://server1?login.php?username=$username&password=$password";);
if ($s[0])
{
# User is logged in.
}
You can also write the script on server1 so that it only returns 1 if the 
request came from server2.

Disclaimer: I know this scheme isn't airtight, but it beats relying on the referer.

cheers,

Travis

[EMAIL PROTECTED] wrote:
To recap...
We have two servers:
1. USA - holds most of our databases, and E-mail. but specifically, the 
usernames and passwords, or all our users (Lotus Domino Server)
2. UK - Runs our website. (Unix Server)

We wanted to be able to allow people to login on on server 1, and getr 
authenticated etc, and then get redirected to server 2.
Using http_referer we would confirm that they came from server 1

However, as I discovered, that is not possible.
So what we did was this:
On the login form on server 1, the referering URL to server 2, contains a 
varibale called 'secure'
we asign that variable that value of '4654376534' and divide it by the day 
(eg: if it's the 12th of may, we divide by 12.. 7th of June, we divide by 
7)
I know that this is crackable, but it's just a stop gap measure...

My problem today is this:
It's not confirming the values?
See my code below

session_start();
$today_day = date("d");
$code1 = ($today_day+1) * $secure;
$code2 = $today_day * $secure;
$code3 = ($today_day-1) * $secure;
$master_code = 4654376534;
if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 == 
$master_code)) {
$_SESSION[logged] = 'true';
$login_info = "You are now Logged in";
} else if ($_SESSION[logged] == 'true') {
$login_info = "You are still Logged in";
}
=

I start by getting the date $today_day
As we're in two time zones, I don't wanna get caught out by the time 
difference, so I've created a +/- 1 each side ($code1-3)
and fianlly, asigned the master input variable (the decoder)

Now it all works great..! (all variables echo what they should) however, 
I'm not getting logged in?
I'm really stumped...
any ideas?

Tris...

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Profiling (Was: Re: [PHP] PHP Website Architecture)

2004-05-07 Thread Travis Low
Hi Richard,

Just curious...how do you do your profiling?

cheers,

Travis

Richard Davey wrote:
Hello Ryan,

Friday, May 7, 2004, 4:51:45 PM, you wrote:

RA> Nearly all programs can be written in *one* very large .php file but just
RA> thinking of going back in to make changes 3 months down the road would be a
RA> nightmare.
I was just looking at this the other day - I had a local site running
here and profiling the index page took around 800ms with 30 include
files. Out of interest I dumped a load of those files into one and
re-profiled it (11 includes rather than 300) and the load time dropped
dramatically (300ms). I know there are other factors at play here
(Windows vs. Unix, cached vs. needing to seek across the hard drive
every time), but the difference still surprised me. Of course I could
never cope with all of those files "as one", but I will definitely
keep them split up locally and combine into one when published live.
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: protecting web page

2004-05-08 Thread Travis Low
Petr U. wrote:
On Sat, 08 May 2004 21:00:43 -0500
Anguz <[EMAIL PROTECTED]> wrote:
 > > Do you know any solution that can help me. I've find an application named
 > > HTML guard but it only work for static html pages. I need more a class or
 > > function to prevent for printing.
There is _no way_ to really hide/protect html page on client side.. If someone
(some knowing) would like to show your source and it's important for him, then
he spend some time to break this ugly protection.
Just to strengthen/clarify this statement, look at it this way.  The user has 
downloaded the data to his machine.  You don't have any control over the data 
after that point.  Heck, the user can just print the screen they are looking 
at.  How you gonna stop that?

If you're just looking to discourage casual copying, then carry on. :-)  If 
it's really important, you might be able to generate non-printable PDF files, 
or generate images containing the desired text, or stuff like that.  Just to 
make copying/printing harder.

cheers,

Travis

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: SuExec and PHP

2004-05-14 Thread Travis Low
I sent this a couple days ago and haven't heard a peep.  Can anyone help me? 
Or, is there a better place I could be asking these questions?

cheers,

Travis

Travis Low wrote:
Greetings.  We have a need for our PHP scripts to run as the user and 
group associated with each Apache virtual domain on our Redhat server.  
Currently, all PHP scripts run as nobody.nobody.

I know that the apache suexec module allows CGI scripts to run as the 
user and group of the virtual host, but that doesn't seem to be the case 
for PHP scripts run under the apache php module (mod_php).

So my questions are:

(1) Can we use suexec to force PHP scripts (running under mod_php) to 
run as the user/group associated with the virtual host?  If so, how?  
Are there any special configuration tricks to make this happen?

(2) If we CAN'T use suexec with mod_php, I assume we can run PHP as CGI 
to solve our problem.  However, I'm worried about performance.  Have any 
of you done this on linux?  Is it difficult to configure?  Do you have 
to audit all of your PHP scripts?  Etc., etc.

I did read the pages http://www.php.net/security.cgi_bin and 
http://www.php.net/manual/en/security.apache.php, but did not come away 
with clear answers to my questions.  There were also a lot of 
contradictory comments at the bottom of those pages, and a whole mess of 
stuff on google, so I'm getting more lost, not less.  Please help!

cheers,

Travis

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] making changes on arrays

2004-04-29 Thread Travis Low
Hi Katie,

The foreach construct operates on copies of the array values.  I usually just 
stick to C-like syntax:

for( $i = 0; $i < count( $array ); $i++ )
{
$array[$i] = doSomething( $array[$i] );
}
cheers,

Travis

Katie Marquez wrote:
I'm practicing from a beginning PHP book regarding
arrays and the PHP manual, so please no one flame me
that I didn't try to research before posting.  I'm
thinking that what I want to do requires me to use the
function array_walk or a foreach loop, but I'm not so
sure so maybe someone help here can help.
I want to have an array, perform an action on the
values in the array, and have those actions
permanently affect the values in the array.  Here's
something I've written to test it out how I thought it
could be done:

I'm guessing by now someone can see my error, but I
don't know enough programming to spot it.  What I
thought would happen is my values would have the
backslash removed in the second print_r().  What I
would want is for any changes made in the array
(meaning my "values") to be permanent in the array
afterwards.  If I can accomplish the code above, I
figure I can create my own functions to affect changes
on values or at least better understand what I'm
looking at in other people's examples/comments at the
online PHP manual.
Thank you in advance.

Katie

	
		
__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP and AS/400

2004-04-30 Thread Travis Low
Wow, what a concept.  I found this link by searching the PHP site for "AS/400":

http://publib-b.boulder.ibm.com/Redbooks.nsf/RedpieceAbstracts/redp3639.html

cheers,

Travis

William Lovaton wrote:
Hi,

Is there a way to integrate PHP with AS/400??

-William

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP and AS/400

2004-04-30 Thread Travis Low
Hi William,

http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=connect+from+PHP+%28in+a+linux+box%29+to+an+AS%2F400+database&btnG=Google+Search

All I did was paste your phrase "connect from PHP (in a linux box) to an AS/400 
database" into a Google search.  Many hits were returned.

To answer your question, no I have never done this.

cheers,

Travis

William Lovaton wrote:
El vie, 30-04-2004 a las 10:42, Jay Blanchard escribió:

[snip]
So, is this possible? is this a viable solution for a production system?
[/snip]
Did you even read this article posted by Travis earlier?
http://publib-b.boulder.ibm.com/Redbooks.nsf/RedpieceAbstracts/redp3639.
html


Yes, I did, the thing is that I don't know anything about AS/400.  I'm
not sure exactly how it stores the data in the tables.
I don't want to install PHP on OS/400 (is this the OS?) I want to
connect from PHP (in a linux box) to an AS/400 database.
I don't even know if I can use ODBC.

Have you done this?

-William

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Select from 24 tables

2004-05-01 Thread Travis Low
This isn't always desirable, or even possible.  I once designed a database to 
hold characteristics for a series of 70 different tests.  There were about 50 
different characteristics used in various combinations for each test.  Each 
characteristic could be one of many values.  So the characteristics tables all 
looked like this:

  id, name, value

And the test tables looked like this:

  id, name, value

And the mapping of characteristics to test looked like this:

  test_id, characteristic_id

This is actually a gross oversimplification, but you get the idea.  Displaying 
test results typically required joining 30-40 tables together, but since each 
characteristic table was small (10-15 entries), performance was acceptable.

So do as John Nichel first suggested, and do this:

select c1.id as characteristic1_id, c2.id as characteristic2_id from 
characteristic1 c1, characteristic2 c2 etc.

cheers,

Travis

John W. Holmes wrote:
Dave Carrera wrote:

Hi List,

How do I select data from 24 table in my database.

Each one is identical in structure layout being

Id,name,list


The first thing you need to do is reorganize your database schema and 
put all of this into one table. You can see what a pain it is having 24 
similar tables already and it's only going to get worse.

You could probably use a UNION to join all of the tables together in 
your query, but I doubt it's going to very efficient. You can't select 
from a list of tables the way you're trying to, though.

Last option is putting your query in a loop and executing it 24 
different times, but you _really_ need to just fix the database 
structure now.

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Select from 24 tables

2004-05-01 Thread Travis Low
Michal Migurski wrote:
In my experience, it's usually a safe assumption that if you have a bunch
of tables all structured identically and used in similar ways, you should
probably merge them all into a single table with an extra column that
corresponds to whatever differentiating characteristic used to distinguish
your original tables.
I.e., go with John Holmes' suggestion before you're really up the creek.
Up what creek?  You didn't really provide any technical justification for your 
suggestion.

In my experience, the best way to deliver a quality application is to start 
with a fully-normalized database schema, then de-normalize it slightly here and 
there if performance is really a problem.  But I've rarely had to do that.  In 
most cases, an upgrade to a faster server with more memory solves the problem 
more quickly and cheaply than an application re-write would.

On the other hand, I've been called in many times to deal with application 
problems that arise from using "mashed-together" schemas such as the one you 
propose.

John W. Holmes wrote:
> The first thing you need to do is reorganize your database schema and
> put all of this into one table. You can see what a pain it is having 24
> similar tables already and it's only going to get worse.
The "pain" only occurs when writing the SQL statements to join the tables.  I 
don't think it's a good idea to optimize the database schema for the sake of 
the programmer, who only has to write the SQL one time.  Later, when the 
customer wants to fix bugs, or add enhancements, the pain is far greater. 
That's usually when I get called in, long after the original programmer has 
flown the coop.

The only times I ever purposely deliver denormalized applications such as you 
suggest are when the customers are asking for quick-and-dirty stopgap 
solutions.  Then it makes sense to optimize for the application writer. 
However, I have found that stopgap solutions have a way of becoming permanent. 
 These days, I usually turn down such jobs.

cheers,

Travis

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php user management functionality

2004-05-01 Thread Travis Low
I wrote a job-tracking/workflow management application called Willow Job 
Tracker.  You can download a copy of the free GPL version from here:

  http://dawnstar.com/index.php?display=ProductDetails&id=780

And there's a demo here:

  http://dawnstar.com/wjtf/

Login to the demo using admin/admin.

Currently, only the MySQL DB is supported, but you can add support for other 
databases by implementing the Db.class.php for each database.

Also, there are no provisions for denying based on IP, but you could add that 
pretty easily.  Though I question the utility of that, since so many people 
live behind firewalls.

As for user registration, you'd have to clone the Add User page to make a 
Registration page, but that should be pretty easy too.

Other than that, I think it has everything you listed.  You'd have to rip out 
the job tracking stuff, but frankly, you could just remove the links and leave 
the code.  There is also extensive documentation to help you get started with 
your customizations.

Have fun.

cheers,

Travis

bruce wrote:
hey

doing some basic research... has anyone found a seriously good user
management script (preferably free) that can be incorporated within a web
application.
i'm looking for something that allows for the following functions:
 - user registration/login
 - admin function
 - group/team definition
 - email verification
 - database driven (mysql/postgres)
 - ability to grant user multiple rights/access levels
 - ability to check/deny by IP Address
 - session based function
 - page security
 - linux/apache/php
we've seen a few, but nothing that really grabs us we're considering
taking something like phpbb/gforge and just ripping the login/admin function
out, although we'd prefer another approach but if we have to rip the
functionality out of another app, has anybody seen an app (open source/free)
that has a serious login/admin/user management function that we should look
at...
thanks

bruce
[EMAIL PROTECTED]
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Select from 24 tables

2004-05-01 Thread Travis Low
Hi Michal,

Getting back to the original posting, I'm basically saying that I don't think 
it's a good idea to structure or restructure a database for the sake of 
simplifying a few SQL statements.  Especially if the data being joined is in 
separate tables for a good reason.

Regarding optimizing for programmer/bug-fixer/etc, after thinking about it, I 
realized that what constitutes "optimization" really depends a lot on your 
development situation, so I'll refrain from further comments on that.  I 
probably shouldn't have brought it up, sorry.

cheers,

Travis

Michal Migurski wrote:
Up what creek?  You didn't really provide any technical justification
for your suggestion.


Up the creek of having to call for help on php-general because you have 24
identical tables you need to join, having never performed a join before.

The "pain" only occurs when writing the SQL statements to join the
tables.  I don't think it's a good idea to optimize the database schema
for the sake of the programmer, who only has to write the SQL one time.


I wholeheartedly disagree. :) I think that optimizing for the sake of the
programmer, the bug fixer, and the possible inheritor of the project is a
/great/ idea. Servers keep getting faster, while the human attention span
and rate of familiarization with code stays approximately constant, so
optimizing your development time is at least as sensible as optimizing SQL
select performance, which is probably better handled through well-chosen
indexes anyway.
Optimizing for the programmer usually translates into thinking about the
humans who will need to interpret your code, and making it easy to pick up
the gist of your intent. A 24-table join is not a typical characteristic
of what I'd consider a well-planned DB schema, whose meaning can be
quickly grokked by a newcomer to the project.
If all those 24 tables store the same kind of data, then there's no reason
to split them up. Of course, we haven't seen the specific usage of those
tables in this thread, but I'm basing my posts on the assumption that it's
better for the OP to have a "marbles" table with a "color"  column, than
tables named "red_marbles", "blue_marbles", 'green_marbles,"  etc. If
that's not the kind of data we're talking about, then I stand corrected,
and John Nichel's initial response is all that's needed.
A huge table count is often evidence of a need for some refactoring.

---------
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html



--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: word to pdf via web server ??

2004-05-04 Thread Travis Low
Jason Barnett wrote:
John Doe wrote:
hello, does any know how to conver microsoft word document to pdf via 
on the server using php language?? i try to implementing the feature 
that allow user to upload microsoft word document to the web server, 
after the upload, it automatic covert to pdf file ??? any one done that ?
I haven't done it, but if you have Windows + Word on the server then you 
can take advantage of the native Word API using COM.  Pseudocode would 
be something like this:

1.  Handle uploading the file to a temporary directory
2.  Create a COM object for Word
3.  Use this COM object load the temporary file
4.  Use the adobe/pdf distiller to convert the file to a pdf file.
I don't think you need steps 2 and 3.  Just upload the file, then have a cron 
job (or Windows "at" job) distill the file.  However, there might be some 
licensing issues -- you should probably look at the Adobe Distiller license.

Adobe sells a Distiller server for 100 users for $5000, unlimited users for 
(cough) $15,000.  See their website for details.

cheers,
Travis
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] New Newbie Question

2004-05-15 Thread Travis Low
Change:
  value=
to
  value=""
or
  value=""

cheers,
Travis
Ronald "The Newbie" Allen wrote:
Here is my problem:
When I get the value of $date and I echo it it shows up just fine
$date =  date("Y-m-d H:i");
echo "$date";
2004-05-15 16:20
but when I go to insert the value into a form like this
Time:
size="50">
 it only displays
2004-05-15
why is this?????
Annoying


Master Station Log



Time:
size="50">

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] create if table not exists

2004-05-16 Thread Travis Low
The manual says:
";
}
?>
To paraphrase, just use mysql_list_tables() to get a table list in a result 
set, then go through the result set to see if the named table exists.

But wouldn't it be easier to create the tables in the first place?
cheers,
Travis
John Taylor-Johnston wrote:
How can I check if a table exists in a mysql db. If it table does not exist, then,
$news = mysql_query($sql_create);
else
$news = mysql_query($sql);
Not sure I know where to start?
-snip
$server = "localhost";
$user = "user1";
$pass = "";
$db="user1table";
$table="comments";
$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);
$sql = 'SELECT * FROM '.$table.' WHERE MATCH (username) AGAINST 
(\''.stripslashes($searchenquiry).'\' IN BOOLEAN MODE) ORDER BY id asc;';
$sql_create = "CREATE TABLE ".$table." (
   id int(11) NOT NULL auto_increment,
   username varchar(100) NOT NULL,
   comment text,
   PRIMARY KEY (id)
);

Sorry, I'm not even sure if this is a php thing as much as it is also mysql.
-
John
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] what do '?' and ':' do?

2004-05-17 Thread Travis Low
They confuse non-C programmers, mostly.
See this: http://www.php.net/operators.comparison
cheers,
Travis
Radek Zajkowski wrote:
Here's a code snippet
// call gui object method
$method = $cmd."Object";
$class_name = $objDefinition->getClassName($obj_type);
$module = $objDefinition->getModule($obj_type);
$module_dir = ($module == "")
? ""
: $module."/";
what does the semicolon and the question mark do?
TIA
R>
-----
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] i need help

2004-05-17 Thread Travis Low
You need to learn how to use regular expressions.  The manual page is here:
http://www.php.net/manual/en/ref.pcre.php
I could easily write the regular expression for you, but then you wouldn't 
learn anything.

cheers,
Travis
Student wrote:
Hi i was hoping if someone can help;
I want to trim the following text
[i:abcdef]
but the inside text is different at time eg abcdef, bcdefg, etc etc
how can i trim [i:(some text here)] so that i can replace them with nothing.
eg these are to be trimmed.
[i:abcdef]
[i:bcdefg]
[i:xyzab]
[i:priftds]
how can i trim them..
thanks
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] why i could not use DB.php?

2004-05-18 Thread Travis Low
David wrote:
> hi
> I want to use the DB.php to access mysql database, so I add the following line to my 
> file:
> require_once 'DB.php';

Is "my file" the file referenced in the error message below?  Namely,
D:\Apache2\htdocs\dunj\test\member\connectDatabase.php.

I'm guessing the message "No such file or directory" probably came from the
operating system.  Naively, I would say it means you're wrong about the
existence of d:\php\PEAR\DB.php, but I suppose it's possible that the OS might
give the same message if the webserver didn't have permissions to read d:\ or
d:\php or d:\php\PEAR, etc.

Good luck.

Travis

> 
> but I get the following error info:
> Warning: main(DB.php): failed to open stream: No such file or directory in 
> D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2
> 
> Fatal error: main(): Failed opening required 'DB.php' (include_path='.;d:\php\PEAR') 
> in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2
> 
> what happened?
> i am convinced that the DB.php exists under the directory 'd:\php\PEAR'.
> 
> 
> David Oilfield
> China Lottery Online Co. Ltd.
> Email:[EMAIL PROTECTED]
> Mobile:13521805655
> Phone:010-83557528-263
> 

-- 
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>

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



Re: [PHP] Cpanel accounting library

2004-05-21 Thread Travis Low
Jordi Canals wrote:
I'm working on some scripts to manage the [cpanel] accounts directly from PHP 
(Scripts will be GNU/GPL licensed).

After STFW, I've not found any good documentation on it, just the short 
samples on http://www.cpanel.net/remoteaccess-php.html
I haven't found anything more detailed on their site.  I just ended up looking 
at the scripts themselves.  They are just wrappers around the scripts that are 
part of the cpanel installation.  If you find more documentation, I'd love to 
know about it.

At this moment, I have access to some servers with the accounting libs 
installed, but I have no access to the fonts (Which could help to make 
it work).
I didn't have to do anything with the fonts.  What problems are you having?
If anyone can post a link where to find good docs about this cpanel lib, 
and, if possible the source code for it, it will help me so much.
Here's a snippet:
  # cpanel idiotically outputs html rather than
  # programmatically-useful error codes.  Thus, we have to manipluate
  # the output before and after calling cpanel function.
  flush();
  ob_start();
  # You can get the $cpkey from the WHM.  The rest are yours to fill in.
  createacct( "localhost", "root", $cpkey, 0, $domain, $acctuser, $acctpass, 
"packagename" );
  ob_end_clean();

  # Now we check after the fact to see if account was created.
  # This is a VERY WEAK test, needs improvement.
  $accounts = listaccts( "localhost", "root", $cpkey , 0);
  $keys = array_keys( $accounts );
  $account_found = NULL;
  for( $i = 0; $i < count( $keys ); $i++ )
  {
  if( in_array( $domain, $accounts[$keys[$i]] ) )
  {
  $account_found = TRUE;
  break;
  }
  }
There are a few gotchas with this API.  For one thing, createacct() always 
returns the string "Account Creation Complete" no matter if the account was 
created or not.  You have to verify the creation some other way.

For another thing, the createacct() function writes directly to the output 
stream.  So all of the stuff you see when you create an account the normal way 
(using the Cpanel web interface) will be displayed unless you stop it.  That's 
what the flush() and the ob_* stuff does.

If you find more information, that would be great.  We can trade notes.
cheers,
Travis
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: php and java applets

2004-05-21 Thread Travis Low
The link you provided seems broken -- here's another:
http://www.raditha.com/java/sandbox/
raditha dissanayake wrote:
Tom Playford wrote:
That was my original plan. The problem is that if someone works out 
the commands needed to
communicate with the php control page, they will be able to bypass the 
Java access control systems.
I suppose I could use https, but does that encrypt the url and post data?

I think you have found yourself trapped in the java applet sandbox. You 
need to create a signed applet. see 
http://www.radinks.com/java/sandbox/  for a brief guide.

all the best
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ColdFusion / SQL > PHP / mySQL HELP!

2004-05-28 Thread Travis Low
Here's what you do.   Assume 10-hour work days.  Obviously, you want to start 
with the schema.  That's pretty darn important, so allow yourself a whole day 
for that.

You have four days left.  Oh wait -- you will probably have to work the weekend 
for this one.  So you have six days left.  That's 60 hours, or 3600 minutes. 
You have 300 files, so you can't spend more than 12 minutes per file.  Wait, 
you said OVER 300, so try to keep it to 10 minutes per file.  To play it safe, 
spend no more than 8 minutes per file -- that way, you have a little extra time 
in case something unexpected comes up.

It might be easier to buy a CFM-to-PHP converter.  You can get those at most 
Kmart stores.  They're usually next to the bacon stretchers and smoke-shifters.

Hope this helps!
cheers,
Travis
Chris Jernigan wrote:
Hi everyone,
Ok, I need serious help. I have been handed a project by my boss to convert
an existing site that was built using ColdFusion / SQL into a site that will
use PHP / mySQL. The site relies heavily on calls to the database for
everything from site content, to an admin area where you can edit that
content, to a news ticker, to the actual navigation of the site.
What's the problem? I have one week to do this. Oh, and did I mention that I
know VERY little about PHP / mySQL. I know NOTHING about ColdFusion or
MSSQL. And to top it off, the site in question contains over 300 .cfm files!
Does anyone have any idea how I could pull this off?
Even if I had a working knowledge of ColdFusion, MSSQL, PHP, mySQL...still
one week isn't enough time to retool a site of this proportion. Especially
considering that I don't understand any of the code that I'm staring at.
I've been a web designer for about five years now. Notice I said "designer"
not "developer". I want to learn PHP / mySQL but in order to complete this
project I also need to understand ColdFusion in order to replicate the site
functionality. Any advice on what I should do?
Thanks in advance for your help,
Chris
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] triggering php scripts...

2004-05-30 Thread Travis Low
Chris Wagner wrote:
i am wondering if there is a good way to trigger a php script from a web
page *without* sending the user to a new page or opening a new browser
windows.
for instance, suppose you wanted to make a button/link on a web page
that, when clicked, would cause a database entry to be decremented. 
however, you do not want to refresh the page or open a popup window or
any stinky little tricks like that.
Use a virtual include to call the php script.
or, if this is not possible, does anyone know how to trigger a php
script when someone accesses a particular file from an apache server? 
or if a file from a particular directory is downloaded...
I don't think you can do that unless the php script is used to access the file 
or perform the download you speak of.

cheers,
Travis
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: PHP Coding Standards

2004-05-30 Thread Travis Low
I have to say I like everything about the PEAR coding standards except for the 
K&R bracing style.  I much prefer:

  if( foo )
  {
 blah;
  }
to
  if( foo ) {
 blah;
  }
The latter form (K&R) conserves vertical space, but I find it a lot harder to 
follow.  Harder to move blocks of code around too.  I'm sure plenty of people 
disagree, so of course this is IMHO.

cheers,
Travis
Michael Nolan wrote:
charles kline wrote:
Hi all,
I was having a conversation with a friend and talking about coding 
standards in the open source community (focusing on PHP). I seem to 
remember there being a document out there that sort of laid it out 
pretty well.

Anyone know where I might find a copy?
PEAR has a page in their documentation about coding standards:
http://pear.php.net/manual/en/standards.php
HTH,
Mike
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: PHP Coding Standards

2004-06-01 Thread Travis Low
Justin Patrin wrote:
Travis Low wrote:
 [I hate K&R indenting]
And I'm one of them. :-) I like the K&R version because it saves 
verticaly space and most editors can't really handle correct tabbing...
Arrggghh...TABS.  Don't even get me started on tabs...
cheers,
Travis
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php as user apache

2004-06-03 Thread Travis Low
John W. Holmes wrote:
From: "Nirnimesh" <[EMAIL PROTECTED]>
I have a problem regarding using my php scripts to write files to my
account.
We know that php runs as user apache. Now giving write permissions to
apache for uploading files to my account essentially means that I have to
give write permissions for apache (i.e. o+w). Now, does that not mean that
any user which is can run php scripts can have access to my account?
Yes (well, has access to that directory).
Is there any configuration setting that I'm missing.
Safe mode, open_basedir, etc.
Is there a way to cause PHP scripts to run as the user and group associated 
with the apache virtual host?

cheers,
Travis
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Fw:

2004-06-14 Thread Travis Low
$conn = mysql_connect("localhost:3308","user","password");
You are connecting as user "user" with password "password" in the code, yet the 
error message references "[EMAIL PROTECTED]" so I'm pretty confused.

cheers,
Travis
Sriranganath wrote:
- Original Message - 
From: Sriranganath 
To: [EMAIL PROTECTED] 
Sent: Tuesday, June 15, 2004 9:50 AM

Dear Sir, 
I am finding difficulty in inserting a record into a MySQL DB through PHP  inpsite of all the privileges given to that  database . Can u plz clarify it?
 
Plz let me know what are all the processes that i  have to start or include ..;;; in my files:

 
Plz go through my code: and associated erors messages :
 

if (isset($_POST['submit'])) {
$conn = mysql_connect("localhost:3308","user","password");
mysql_select_db("database");
$query = "insert into branch (sol_id,sol_desc,ip_address,email_id) values ('".$_POST['solid']."', '".$_POST['brname']."', '".$_POST['ipadd']."', '".$_POST['email']."')";
if (mysql_query($query))
echo 'Success';
   else
  echo 'Failed';
}
else {
?>


Sol-ID 
Branch Name 
IP-Address 
E-Mail 



 ?>

after submitting the inputs; it is giving the following errors:
username is the finfaq and database name is also finfaq 
password and username when i give directly to mysql, it is accepting.


Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in 
/var/www/html/whatnew/a.php on line 3
Warning: MySQL Connection Failed: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /var/www/html/whatnew/a.php on line 3
Failed 

When i try to insert directly into the table, it is allowing:. 

regards
Sriranganath

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Get users MAC-address of visitor

2004-06-23 Thread Travis Low
I don't think you can get that information.  The packet at the MAC level is 
encpasulating the IP datagram.  When the datagram is passed along to another 
network (e.g. through a router), another MAC packet is constructed, and the 
payload (datagram) of the original MAC packet is placed into the new MAC 
packet.  At that point, the original MAC address is lost.

cheers,
Travis
Yngve wrote:
Hi!
I wonder how i can retrive the MAC-address of the visitor using PHP?
What i am thinking about is using the MAC-address instead of the IP-address
to ban troublesome users from forums etc.
If i just use the IP-address some users will just change it. I know that
it´s possibly to spoof the MAC address but it´s much harder than just
changing the IP-address.
Do you think that there is a big speed penalty by using the MAC-address? I
could just use it when the users first arrives to the site. Then he/she
could be logged in using a session the rest of his visit. I could also store
the MAC-address of the user in encoded form in a cookie so that i won´t have
to retrive the MAC-address "the hard way" on every visit.
Comments and tips would be greatly appreciated!
Yours supersinerely, Yngve
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] placing values in html teaxtarea

2004-07-12 Thread Travis Low
Would you please turn off return receipt in your messages?  Thanks!
Travis
Hull, Douglas D wrote:
After doing calculations etc on my data I am wanting to place it in a textarea form in html.  I 
am having trouble getting my data to show up in my texarea.  For example, say after all my 
calculations I my field called $test ends up containing "This is a test".  Here is 
what I tried:
 

I can add the $test to input like this but not a textarea.
Name:  
Is this possible?
Thanks,
Doug
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Grab a range of rows from a mysql result

2004-07-13 Thread Travis Low
select * from foo limit n, m
n == starting index, zero-based
m == maximum number of rows to return.
You probably shouldn't cross-post to different mailing lists.
cheers,
Travis
[EMAIL PROTECTED] wrote:
I need to grab a range of rows from a mysql result resource.
The resource is made up of 1000+ records from a mysql table that I am
breaking up to make my PHP application run faster.  I have figured out how
to compute the range but I don¹t know how to pull out a group of rows within
a range from a mysql result resource.
Anyone have any insights into how I can do this in PHP?
VR/Tim


--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php