[PHP] PHP+MS Access and/or MS SQL

2001-04-26 Thread kelvin

just point your browser to phpbuilder.net. Alternatively, just send me an email =)



Date: Wed, 25 Apr 2001 19:02:12 -0700 (PDT)
From: John Monfort <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Subject: PHP+MS Access and/or MS SQL


 Hello everyone,

 I'm looking for information on PHP+ MS Access , and PHP+MS SQL.

 Any recommendations?

 Thx in advance!


__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___+-

On Thu, 26 Apr 2001, Ben Quinn wrote:

> Hi all,
>
> I am trying to copy an image from an external server and save it to my own.
> I have the following script to do this for a txt file and it works great!
>
> ?>
>
> $page  = "../temp/yep.txt";
>
> $date = date("http:/www.example.com/yep.txt");
>
> $cartFile = fopen("$page","a");
> fwrite($cartFile,$date,strlen($date));
> fclose($cartFile);
>
> ?>
>
> But i can't get it to work for image files - the images are saved and
> displayed on screen as a whole bunch of rubbish.
>
> I'd appreciate any help you can give me
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>




k.e.l.v.i.n c.h.a.n
the open web technology company
www.eXtropia.com
[EMAIL PROTECTED]
Tel: 7738550 



Re: [PHP] fopen question

2001-05-07 Thread Kelvin

Hi sean,

   try to put a file name not a directory or path.
  $file = fopen("filename.withextension","r+"

Kelvin.


<[EMAIL PROTECTED]> wrote in message
9d6apq$eka$[EMAIL PROTECTED]">news:9d6apq$eka$[EMAIL PROTECTED]...
> hi
>
> I am running the following on my redhat 7.0 / php4 / apache box and
> receiving the error below.
>
>  $file = fopen("/dev/ttys0","r+");
> fputs($file,"ATI");
> rewind($file);
> echo fgets($file,1024);
> fclose($file);
> ?>
>
> Warning: fopen("/dev/ttys0","r+") - Input/output error in
> /var/www/html/test.php on line 2
>
> I would be grateful if you could help.
>
>
> Many thanks,
>
> Sean
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] help!! Double-byte character problem

2004-04-12 Thread Kelvin
Hi all,
Is there any function/method in PHP to convert a double-byte character into
its ascii code?

for example, the traditional Chinese charater "§A" is equal to 20320. In ASP
there is a function AscW() to do so. Don't know if we have similar function
in PHP.

thanks,
Kelvin

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



[PHP] Need a suggestion on developing a php-related system

2003-01-07 Thread Kelvin Poon

HI, I am new to PHP and I am just wondering if anyone could give me some 
help.

I am currently working for infomart.ca, it is basically a company that sells 
articles (news/business).  MY employer require me to develop a system using 
Perl and PHP, and the assignment is as follow:

To develop a system that collects, stores, processes and disseminates 
internally the updating status of our databases.

We currently have over 200 databases from various daily newspapers, 
magazines, TV transcripts and other periodicals.  Most of them are updated 
every weekday between 4a.m. and 7a.m..  Others are updated on a weekly or 
monthly basis.  THe update schedule Tv. the actual status need to be 
captured and made available to internal staff.  This is similar to the 
flight departure/arrival information in an airport.

Basically I was just wondering if anyone could give me any kind of 
suggestions.  Thanks a lot, any type of suggestions would be great!

Kelvin




_
MSN 8: advanced junk mail protection and 2 months FREE*. 
http://join.msn.com/?page=features/junkmail


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



RE: [PHP] Re: Need a suggestion on developing a php-related system

2003-01-08 Thread Kelvin Poon

HI,

Thanks for all the suggestions.  I guess I should have given a more detail 
description.  My employer have just provided me with some background 
information of the setup:

Our data come in mostly automatically by FTP on to our Vax, then eventually 
moved on to our R30 (RS6000/AIX) and then H80 (RS6000/AIX).  The databases 
are running on the 2 RS6000's.  Although we have numerous scripts processing 
the data along the route, my employer would prefer to have this system 
checking independently the situation/condition of the upload.  Besides, if 
the original data processing script crashes before any error message can be 
sent, we might still don't know if there is a problem.

There are files on various machines to look for that indicate the status of 
the update.  So this program may go to look for these signs in order to 
collect the update status.  For making the information available to our 
staff, the most convenient way for them is via a web page.  Although the 
information is not as confidential as such, it would be nice to be able to 
password protect the contents.  There is also a need for selected staff to 
manually update certain fields of a record (publication), e.g. Reason for 
Delay.  So the web page should be able to capture manual text input from 
authorized staff and updated to the status information.

Anyways thanks a lot for all your suggestions.  All your kind suggestions 
would help me to have a head start on this project.

Kelvin


From: "Larry Brown" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Subject: RE: [PHP] Re: Need a suggestion on developing a php-related system
Date: Wed, 8 Jan 2003 02:52:11 -0500

From the remark about the arrival and departure time scenario, it sounds
like you want to show whether the updates occurred and when they
began/ended.  If this is accurate, you should find out whether the scripts
used to populate those databases record that information for the database 
it
is updating.  If so you need to create a script that opens each database 
and
queries that data.  If they do not record these things you could either
modify them to do so or you could have them also connect to a central db
that you create to store this collection of data to show beginning and
ending of the scripts.  I think either way you should store this in your 
own
db.  Is this along the lines of what you had in mind?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




On 01/08/2003 03:40 AM, Kelvin Poon wrote:
> HI, I am new to PHP and I am just wondering if anyone could give me some
> help.
>
> I am currently working for infomart.ca, it is basically a company that
> sells articles (news/business).  MY employer require me to develop a
> system using Perl and PHP, and the assignment is as follow:
>
> To develop a system that collects, stores, processes and disseminates
> internally the updating status of our databases.
>
> We currently have over 200 databases from various daily newspapers,
> magazines, TV transcripts and other periodicals.  Most of them are
> updated every weekday between 4a.m. and 7a.m..  Others are updated on a
> weekly or monthly basis.  THe update schedule Tv. the actual status need
> to be captured and made available to internal staff.  This is similar to
> the flight departure/arrival information in an airport.








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


_
MSN 8: advanced junk mail protection and 2 months FREE*. 
http://join.msn.com/?page=features/junkmail


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



[PHP] PHP and SQL

2003-01-17 Thread Kelvin Poon

Hi all,

My company had just ordered a SQL 2000 Server.  I need to make a webpage 
that collects data from the Server's database.  I guess I need to use PHP 
with SQL.  My question is what is the difference between SQL and mySQL?  I 
brought a book that teaches you how to use PHP with MymySQL, I am just 
wondering if this book will give me a good enough idea of how to do my job, 
since I know a little bit of SQL already.  Please advise, thanks.

Kelvin



_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus


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



[PHP] Garbage .html via HTTP/1.0 or Proxy

2002-08-12 Thread Kelvin Lawson

Hi All,

When connecting to my site from certain clients, the .html returned contains a large 
block of non-standard characters.

Running it locally and from various other places, the site looks normal. But when I 
connect from work, the .html file returned is corrupted. At work we have a web proxy, 
and I also noticed from my Apache logs that HTTP/1.0 is used for the request. Has 
anyone experienced problems due to those two reasons ?

This seems weird to me because PHP is generated on my server, so I assumed all clients 
would see exactly the same. But this isn't the case here. Either the html generated is 
different for these clients, or the returned page is getting corrupted somewhere along 
the way.

Does anyone know why this might happen ?

I'm using WinXP Apache 2.0.39 with PHP 4.2.1. There are no errors in the Apache logs. 
Also the corruption doesn't happen on all pages.

Thanks for any tips,
Kelvin.



RE: [PHP] include("../file.inc");

2001-05-14 Thread kelvin chan .


Hi,

I came across this problem before, when I was working with windows. Not sure 
if the same problem occurs in Linux, i guess not as otherwise there would 
have been tonnes of postings on that then.

Well, basically my script architecture spans over at least 3 directory 
levels. Just for the sake of discussion let my highest directory be A. 
followed by B, and then C.

My A script is the module controller. the B script is the module, and it 
imports all of its functions by importing scripts contained in C.

So my A script has the line : include("B/fileB.php");
My B "fileB.php" script has : include("C/fileC.php");

Theorectically this is sufficient for A to manage my C scripts. However, i 
realised that PHP wasn't able to do that. The reason being that when A 
script is runned, the contents of fileB.php are sort of "pasted" onto the A 
script. Now the A script sort of has a

include("C/fileC.php");

line of code. this will generate an error, as there is no C directory 
relative to the A directory.


1. you may have generated errors if you have, like me, been working with 
multiple directories, and not taken notice of that subtle problem above. The 
work-around is to put

include("B/C/fileC.php");

in the B script.

2. in your case "require" or "include" makes no difference, but there is a 
subtle difference when used in other situations, you might wanna check that 
out when you are free.

3. My example above is slightly different from yours as yours is traversing 
up a tree, mine was traversing down the tree. However, the conclusion still 
stands: take note and display full paths when working with directory levels 
exceeding 2.


If theres anything you'll like to ask about what i said here, or otherwise, 
pl mail me directly, as i dun check this list very often. All the best then! 
=)

kelvin Chan




Message-ID: <[EMAIL PROTECTED]>
From: "Taylor, Stewart" <[EMAIL PROTECTED]>
To: "'Matthew Ralston'" <[EMAIL PROTECTED]>,
   [EMAIL PROTECTED]
Date: Fri, 11 May 2001 11:52:17 +0100
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Subject: RE: [PHP] include("../file.inc");

Either of the first two should work under linux.

I have done similar many times myself
e.g.
require_once "../common/localvars.php";


-Stewart

-Original Message-
From: Matthew Ralston [mailto:[EMAIL PROTECTED]]
Sent: 11 May 2001 11:40
To: [EMAIL PROTECTED]
Subject: [PHP] include("../file.inc");


How do you include or require a file that is above the current script in the
directory hierarchy? For example how would I include or require a file whose
path is "../file.inc" relative to the current script? I tried all of:

include("../file.inc");
require("../file.inc");
include("/file.inc");
require("/file.inc");
include("..\file.inc");
require("..\file.inc");
include("\file.inc");
require("\file.inc");

but it doen't like any of them. :(
I don't want to use a full path relative to the root of the drive or
webserver folder because the included file and the script may move as the
development server is setup differently to the real web server.

Any ideas?

--
Thanks,

Matt
[EMAIL PROTECTED]
< www.mralston.co.uk />




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ASSISTANCE NEEDED

2001-08-06 Thread kelvin asonze

FROM: MR.KELVIN NZE. 
AUDITING AND ACCOUNTING UNIT.
FOREIGN OPERATIONS DEPARTMENT. 
BANQUE TOGOLAISE POUR LE COMMERCE ET L'INDUSTRIE, 
LOME- TOGO. TEL:(228)04-45-26.

Dear sir,


I am Mr.KELVIN NZE, the director in charge of
auditing and accounting section of Banque Togolaise
Pour le Commerce Et l'Industrie Lome-Togo in West
Africa with due respect and regard. I have decided to
contact you on a business transaction that will be
very beneficial to both of us at the end of the
transaction . 



During our investigation and auditing in this bank, my
department came across a very huge sum of money
belonging to a deceased person who died on November
1st 1999 in a plane crash and the fund has been
dormant in his account with this Bank without any
claim of the fund in our custody either from his
family or relation before our discovery to this
development. 

Although personally, I keep this information secret
within myself and partners to enable the whole plans
and idea be Profitable and successful during the time
of execution. The said amount was (U.S $8.5M UNITED
STATES DOLLARS), As it may interest you to know, I got
your impressive information through my good friends
who works with chamber of commerce on foreign business
relations here in Lome- Togo. It is him who
recommended your person to me to be viable and capable
to champion a business of such magnitude without any
problem. 

Meanwhile all the whole arrangement to put claim over
this fund as the bonafide next of kin to the deceased,
get the required approval and transfer this money to a
foreign account has been put in place and directives
and needed information will be relayed to you as soon
as you indicate your interest and willingness to
assist us and also benefit your self to this great
business opportunity. 



In fact I could have done this deal alone but because
of my position in this country as a civil servant(A
Banker),we are not allowed to operate a foreign
account and would eventually raise an eye brow on my
side during the time of transfer because I work in
this bank. This is the actual reason why it will
require a second party or fellow who will forward
claims as the next of kin with affidavit of trust of
oath to the Bank and also present a foreign account
where he will need the money to be re-transferred into
on his request as it may be after due verification and
clarification by the correspondent branch of the bank
where the whole money will be remitted from to your
own designation bank account.



I will not fail to inform you that this transaction is
100% risk free. On smooth conclusion of this
transaction, you will be entitled to 30% of the total
sum as gratification, while 10% will be set aside to
take care of expenses that may arise during the time
of transfer and also telephone bills, while 60% will
be for me and my partners. Please, you have been
adviced to keep "top secret" as we are still in
service and intend to retire from service after we
conclude this deal with you.

I will be monitoring the whole situation here in this
bank until you confirm the money in your account. and
ask us to come down to your country for subsequent
sharing of the fund according to percentages
previously indicated and further investment, either in
your country or any country you advice us to invest
in. All other necessary vital information will be sent
to you when I hear from you. 

I suggest you get back to me as soon as possible
stating your wish in this deal. My mobile telephone
number is +228 04-45-26. 

I look forward to pick your call asap. 

Yours faithfully,

KELVIN NZE. 







Sign up for your "FREE E-MAIL" @ MADMAIL http://www.madmail.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ASSISTANCE NEEDED

2001-08-06 Thread kelvin asonze

FROM: MR.KELVIN NZE. 
AUDITING AND ACCOUNTING UNIT.
FOREIGN OPERATIONS DEPARTMENT. 
BANQUE TOGOLAISE POUR LE COMMERCE ET L'INDUSTRIE, 
LOME- TOGO. TEL:(228)04-45-26.

Dear sir,


I am Mr.KELVIN NZE, the director in charge of
auditing and accounting section of Banque Togolaise
Pour le Commerce Et l'Industrie Lome-Togo in West
Africa with due respect and regard. I have decided to
contact you on a business transaction that will be
very beneficial to both of us at the end of the
transaction . 



During our investigation and auditing in this bank, my
department came across a very huge sum of money
belonging to a deceased person who died on November
1st 1999 in a plane crash and the fund has been
dormant in his account with this Bank without any
claim of the fund in our custody either from his
family or relation before our discovery to this
development. 

Although personally, I keep this information secret
within myself and partners to enable the whole plans
and idea be Profitable and successful during the time
of execution. The said amount was (U.S $8.5M UNITED
STATES DOLLARS), As it may interest you to know, I got
your impressive information through my good friends
who works with chamber of commerce on foreign business
relations here in Lome- Togo. It is him who
recommended your person to me to be viable and capable
to champion a business of such magnitude without any
problem. 

Meanwhile all the whole arrangement to put claim over
this fund as the bonafide next of kin to the deceased,
get the required approval and transfer this money to a
foreign account has been put in place and directives
and needed information will be relayed to you as soon
as you indicate your interest and willingness to
assist us and also benefit your self to this great
business opportunity. 



In fact I could have done this deal alone but because
of my position in this country as a civil servant(A
Banker),we are not allowed to operate a foreign
account and would eventually raise an eye brow on my
side during the time of transfer because I work in
this bank. This is the actual reason why it will
require a second party or fellow who will forward
claims as the next of kin with affidavit of trust of
oath to the Bank and also present a foreign account
where he will need the money to be re-transferred into
on his request as it may be after due verification and
clarification by the correspondent branch of the bank
where the whole money will be remitted from to your
own designation bank account.



I will not fail to inform you that this transaction is
100% risk free. On smooth conclusion of this
transaction, you will be entitled to 30% of the total
sum as gratification, while 10% will be set aside to
take care of expenses that may arise during the time
of transfer and also telephone bills, while 60% will
be for me and my partners. Please, you have been
adviced to keep "top secret" as we are still in
service and intend to retire from service after we
conclude this deal with you.

I will be monitoring the whole situation here in this
bank until you confirm the money in your account. and
ask us to come down to your country for subsequent
sharing of the fund according to percentages
previously indicated and further investment, either in
your country or any country you advice us to invest
in. All other necessary vital information will be sent
to you when I hear from you. 

I suggest you get back to me as soon as possible
stating your wish in this deal. My mobile telephone
number is +228 04-45-26. 

I look forward to pick your call asap. 

Yours faithfully,

KELVIN NZE. 







Sign up for your "FREE E-MAIL" @ MADMAIL http://www.madmail.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] About Buggy SQL Query

2007-08-13 Thread Kelvin Park
mySQL database becomes inaccessible after a buggy sql string gets queried.
The SQL server runs fine, however it seems like just the database is being
looped infinitely so to say.
Here is an example:

(PHP)
$sql = "SELECT * FROM DB_TABLE WHERE PR_NUMBER = $whatever, DFLJJ =
$SD;LOOE"; (<-- invalid sql query string)
mysql_query($sql);

When this query string is queried during the (webpage) loading process, the
webpage just gets timed out without any error nor warning messages.

Does anyone know if there is a certain way to prevent mysql database from
stalling due to buggy sql strings?


Re: [PHP] About Buggy SQL Query

2007-08-14 Thread Kelvin Park

Chris wrote:

Kelvin Park wrote:
mySQL database becomes inaccessible after a buggy sql string gets 
queried.
The SQL server runs fine, however it seems like just the database is 
being

looped infinitely so to say.
Here is an example:

(PHP)
$sql = "SELECT * FROM DB_TABLE WHERE PR_NUMBER = $whatever, DFLJJ =
$SD;LOOE"; (<-- invalid sql query string)
mysql_query($sql);

When this query string is queried during the (webpage) loading 
process, the

webpage just gets timed out without any error nor warning messages.

Does anyone know if there is a certain way to prevent mysql database 
from

stalling due to buggy sql strings?


use mysql_real_escape_string to stop it from happening.

Thanks, I looked over some comments posted on the PHP library web site 
under mysql_real_escape_string function. I didn't realize it is also 
used to aid sql injection prevention.


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



[PHP] About UTF-8 / ANSI

2007-08-14 Thread Kelvin Park
I heard from a person that he was having some problem with uploading and 
displaying a web site on an ordinary web hosting server because the 
files weren't saved as UTF-8 charset (instead they were saved in 
iso-8859-1).


Could saving HTML files in a different charset (UTF-8 or iso-8859-1) 
cause problem with the web hosting server making the website totally 
inaccessible?


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



Re: [PHP] About Buggy SQL Query

2007-08-15 Thread Kelvin Park

Chris wrote:

Kelvin Park wrote:
mySQL database becomes inaccessible after a buggy sql string gets 
queried.
The SQL server runs fine, however it seems like just the database is 
being

looped infinitely so to say.
Here is an example:

(PHP)
$sql = "SELECT * FROM DB_TABLE WHERE PR_NUMBER = $whatever, DFLJJ =
$SD;LOOE"; (<-- invalid sql query string)
mysql_query($sql);

When this query string is queried during the (webpage) loading 
process, the

webpage just gets timed out without any error nor warning messages.

Does anyone know if there is a certain way to prevent mysql database 
from

stalling due to buggy sql strings?


use mysql_real_escape_string to stop it from happening.

I've tried the mysql_real_escape_string, however it seemed like it was 
working well at first, but the problem is that when I do the following 
query, the database crashes:


$query = "SELECT * FROM PRODUCT_TABLE WHERE MATCH (product, description) 
AGAINST('whatever') OR MATCH(categoryname) AGAINST('whatever')";


It seems like putting two match functions in the same query might have 
caused the crash.


My question is, how could I immediately just have one of my databases in 
the Database Server restarted (w/o affecting any of the data)?


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



[PHP] About Session And Cookies

2007-08-17 Thread Kelvin Park

I am trying to setup a secure login system.
I've heard that if I use just cookies for login, members without cookie 
turned out won't be able to see the member pages.


Is using session recommended for e-commerce websites with shopping carts?
Or, using both of them might be more effective in some way.


Re: [PHP] Cookies and sent headers

2007-08-18 Thread Kelvin Park

Kelvin Park wrote:

Otto Wyss wrote:
If built a simple login page and store any information within 
$_SESSION's. Yet I'd like to move these into cookies but I always get 
an error about sent headers. Is there a way to circumvent this 
problem without changing too much in the page?


The setting of the cookies happens just at the end of the page.

  if (!$errortext and $Anmelden) {
if (!empty($Permanent)) {
  $expires = time()+ 365 * 86400;  // 365 days
  setcookie ("l.Lastname", $_SESSION['l_Lastname'], $expires);
  setcookie ("l.Firstname", $_SESSION['l_Firstname'], $expires);
  setcookie ("l.Email1", $_SESSION['l_Email1'], $expires);
  setcookie ("l.Email2", $_SESSION['l_Email2'], $expires);
}
echo "
  parent.location.replace('$index_php";
  ";
exit;
  }

O. Wyss


ob_start() might help



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



Fwd: [PHP] Cookies and sent headers

2007-08-18 Thread Kelvin Park
-- Forwarded message --
From: Kelvin Park <[EMAIL PROTECTED]>
Date: Aug 18, 2007 4:34 PM
Subject: Re: [PHP] Cookies and sent headers
To: "M. Sokolewicz" <[EMAIL PROTECTED]>

the javascript code can definitely change to head("location: whatever.php")
for redirection, if that's the solution, that would be the way to go, but if
you're encountering quite similar problems later you can try ob_start() or
whatever that was recommended in the comments before M. Sokolewicz's
bullshitting comment.

On 8/18/07, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
>
> bullshit,
>
> what he sees is a warning emitted by PHP, his redirect is done using
> JavaScript (which is clientside and has no, 0.0 effect on what PHP
> emits). Now, I'm not going to go into how redirecting that way won't
> work (or at least shouldn't), but a hint would be to do it properly
> using header('Location: [...]') instead.
>
> - Tul
>
>
> Sanjeev N wrote:
> > Hi,
> > Its not the problem of cookies. Its problem of redirection or the
> > parent.location.replace function. I mean if you already output something
> on
> > the page and tries to redirect then this problem happens.
> >
> > Redirect before outputting anything on the page.. like space is also an
> > output.
> >
> > Warm Regards,
> > Sanjeev
> > http://www.sanchanworld.com/
> > http://webdirectory.sanchanworld.com - Submit your website URL
> > http://webhosting.sanchanworld.com - Choose your best web hosting plan
> > -Original Message-
> > From: Otto Wyss [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, August 18, 2007 2:56 PM
> > To: php-general@lists.php.net
> > Subject: [PHP] Cookies and sent headers
> >
> > If built a simple login page and store any information within
> > $_SESSION's. Yet I'd like to move these into cookies but I always get an
>
> > error about sent headers. Is there a way to circumvent this problem
> > without changing too much in the page?
> >
> > The setting of the cookies happens just at the end of the page.
> >
> >if (!$errortext and $Anmelden) {
> >  if (!empty($Permanent)) {
> >$expires = time()+ 365 * 86400;  // 365 days
> >setcookie ("l.Lastname", $_SESSION['l_Lastname'], $expires);
> >setcookie (" l.Firstname", $_SESSION['l_Firstname'], $expires);
> >setcookie ("l.Email1", $_SESSION['l_Email1'], $expires);
> >setcookie ("l.Email2", $_SESSION['l_Email2'], $expires);
> >  }
> >  echo "
> >parent.location.replace('$index_php";
> >";
> >  exit;
> >}
> >
> > O. Wyss
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Re: About Session And Cookies

2007-08-21 Thread Kelvin Park
Hello, thanks for all the replies.
However, since I'm not very familiar with trans_sid I'll do some research on
that.

Michelle Konzack, if hiding the id in hidden form field element or enabling
trans_sid could lead to security risks, what would you recommend as an
alternative method to safely transfer user information across different
pages in a website?

Thank you.

On 8/18/07, Michelle Konzack <[EMAIL PROTECTED]> wrote:
>
> Am 2007-08-17 22:07:47, schrieb Bastien Koert:
> >
> > If cookies are not available, you can either
> >
> > hide the id in the hidden form field element
> > or
> > enable trans_sid to automatically pass the session id in the url
>
> This will be a security risk since Session-Hijacker can grap the URL
>
> Greetings
> Michelle Konzack
> Systemadministrator
> Tamay Dogan Network
> Debian GNU/Linux Consultant
>
>
> --
> Linux-User #280138 with the Linux Counter, http://counter.li.org/
> # Debian GNU/Linux Consultant #
> Michelle Konzack   Apt. 917  ICQ #328449886
>50, rue de Soultz MSN LinuxMichi
> 0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)
>
>


[PHP] About DREAMWEAVER

2007-07-05 Thread Kelvin Park

I'm trying to get rid of all the comments that are in a different language
in dreamweaver.
Anyone know how to do that automatically? I have like 1000 php files with
full of comments in different language. I do not intend on translating them
or doing anything with em, I just wanna get rid of them just like that.
Maybe regular expressions will do? dunno. I'll appreciate any comment.
thanks


[PHP] About Website Search Engine

2007-07-05 Thread Kelvin Park

I'm trying to build a search engine for my website (with php), it will have
functions such as finding product names and their codes from the mysql
database.
Does anyone know any good tutorial or reference on any website, or any good
books out there that you might recommend?
I couldnt' find any decent one but only the ones that keep on saying, "use
google search engine to search your website!" etc.
Thanks!


[PHP] About PHP CMS

2007-07-06 Thread Kelvin Park

Is it possible to have PHP code completely separate from the HTML page that
needs to be completely dynamic? (That's how ASP.NET sort of works I think).
If this is possible, HTML CODE, PHP CODE, AND THE CSS CODE can be completely
separate, increasing the clarity of all the source code.

My second question is:
Is it more efficient to always code OOP PHP then just simple functions here
and there?


[PHP] About DOM function in PHP

2007-07-08 Thread Kelvin Park

I'm getting the following fatal error message:

*Fatal error*: Cannot instantiate non-existent class: domdocument in *
/home/hosting/infotechnow_com/htdocs/admin/inventory/catalog.php* on line *3
*
when running this code:

// Initialize new object for DOMDocument
$doc = new DOMDocument();

What's the problem?
**


[PHP] About Incorporating MySQL and XML/XSLT/PHP

2007-07-09 Thread Kelvin Park

I'm using XSLT to make a website template and XML to describe the data on my
website. Do I parse the data from MySQL to XML in order to apply styles and
display them as XHTML with XSLT?

I would have to use PHP to parse XML, however I was unclear on how to pass
MySQL data to XML in order for it do be displayed through XSLT template.
Do you know a good reference (website, book, article) for the most correct
way to display MySQL data with XML/XSLT/PHP?


[PHP] About Eclipse JVM Termination

2007-07-10 Thread Kelvin Park

Do you know the cause of this error?
I'm trying to run it on 64bit Fedora 7. I have AMD64 and JRE 1.6.0_02 64bit
is installed.
Do you know how to fix the following error? if yes how?

**
JVM terminated. Exit code=13
/usr/java/jre1.6.0_02/bin/java
-Xms40m
-Xmx256m
-jar
/home/kelvino/downloads/eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070516.jar
-os linux
-ws gtk
-arch x86
-showsplash
-launcher /home/kelvino/downloads/eclipse/eclipse
-name Eclipse
--launcher.library/home/kelvino/downloads/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.0.v20070516/eclipse_1017.so
-startup
/home/kelvino/downloads/eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070516.jar
-exitdata 158008
-clean
-data /tmp_workspace
-vm /usr/java/jre1.6.0_02/bin/java
-vmargs
-Xms40m
-Xmx256m
-jar
/home/kelvino/downloads/eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070516.jar


**


[PHP] About Fraud Prevention

2007-07-10 Thread Kelvin Park

I'm trying to make a program with PHP, that prevents ecommerce fraud orders.
Technically, what's the most effective way to prevent fraud orders on
e-commerce web sites?


[PHP] About PHP/XML/XSLT/MYSQL Web Sites

2007-07-12 Thread Kelvin Park

I'm trying to setup a XSLT based web site.
I wasn't exactly sure about the flow of the whole system when data from 
relational database is transferred to XML and in turn the data inputted 
from the user is relayed back to the database through XML (or directly 
to the database with PHP DB connection). I built a flowchart 
illustrating what the flow of the XSLT/PHP/MYSQL system might be like. 
If you think it's the wrong way or an inefficient way of getting user 
inputted data back to mysql, I would appreciate any comments.
If you cannot download the PDF file, you can bring it up with direct 
address the the file: http://www.envigan.net/CMSFLOW.pdf



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

[PHP] About Login Authentication

2007-07-20 Thread Kelvin Park

What's a good place in the Internet where I could learn about creating login
and member authentication enabled web site?
I would appreciate any good references.


[PHP] About XML XSLT

2007-07-20 Thread Kelvin Park

I'm trying to make a web site that it entirely XML/XSLT/PHP driven, without
MYSQL.
However, since I need to reuse the database from my last web site, I had to
parse XML with PHP and save it as a file (e.g. xmlFile.xml) in my htdocs
folder in FTP. However, I understand that this can cause some security
issues such as someone just accessing the xml file from the htdocs folder.
Would it be the best way to just place the parsed/saved XML file in the root
folder of the FTP server for security purposes? Root folder meaning, the
parent folder of htdocs, where it cannot be accessed normally through the
browser.


[PHP] Re: About XML XSLT

2007-07-20 Thread Kelvin Park

I had to Parse XML with PHP with database from mysql.

On 7/20/07, Kelvin Park <[EMAIL PROTECTED]> wrote:


I'm trying to make a web site that it entirely XML/XSLT/PHP driven,
without MYSQL.
However, since I need to reuse the database from my last web site, I had
to parse XML with PHP and save it as a file (e.g. xmlFile.xml) in my
htdocs folder in FTP. However, I understand that this can cause some
security issues such as someone just accessing the xml file from the htdocs
folder. Would it be the best way to just place the parsed/saved XML file in
the root folder of the FTP server for security purposes? Root folder
meaning, the parent folder of htdocs, where it cannot be accessed normally
through the browser.



[PHP] About XSLT/XML Pagination

2007-07-22 Thread Kelvin Park

This site generally explains how pagination is done with xslt and xml.
However it does not fully explain how to paginate the data when a 
certain number of rows are printed.
For example, it wouldn't make another page after 100 item names were 
printed out where total there are 1000 items that need to be printed 
out, making it total 10 pages.

Do you know what should be added in order to make it work?

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



[PHP] About XSLT/XML Pagination

2007-07-22 Thread Kelvin Park

http://www.tonymarston.net/php-mysql/xsl.html#a1
This site generally explains how pagination is done with xslt and xml.
However it does not fully explain how to paginate the data when a 
certain number of rows are printed.
For example, it wouldn't make another page after 100 item names were 
printed out where total there are 1000 items that need to be printed 
out, making it total 10 pages.

Do you know what should be added in order to make it work?

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



[PHP] PHP/MYSQL/XML Conversion

2007-07-23 Thread Kelvin Park
I'm trying to convert joined multiple database table to one xml file. Is 
it more efficient to initially, join multiple (more that 4 tables) 
together to produce XML file, or convert every table in to XML file and 
use those XML files to relate data?


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



[PHP] About One To Many MYSQL TO XML WITH PHP

2007-07-24 Thread Kelvin Park
I am keep running in to a dead end with trying to convert mysql databse 
tables (more than 4) to XML with PHP. Initially I tried to convert two 
tables with the code that's attached to this email, however it's limited 
to printing out just a table row "WHERE column='value'". I can relate 
two tables on database with two rows that share same relational data, so 
I can do that for one row. Do you know any website that might explain 
how to convert joined multiple tables(with every rows) to XML?


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

[PHP] About XSL Transformation

2007-07-28 Thread Kelvin Park
I have an XML file with 10 products with their registered dates(dates 
when they were created).
My XSL code is set so that it sorts the products in descending 
order(latest to oldest) by registered dates.
I tried to declare xsl:variable to increment within xsl:for-each, 
however I ran in to some dead ends.

How do I print only the 5 latest products?

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



Re: [PHP] About XSL Transformation

2007-07-29 Thread Kelvin Park

Nathan Nobbe wrote:
this is basically a design decision on your part.  since you are 
working w/ 2 programming languages, ie.
php and xsl, you will need to determine how much logic is implemented 
in each language.  i would
recommend you devise a scheme early on in your application lifetime 
and stay consitent w/ the decisions

you make.
it will save you headaches in the long run.

-nathan

On 7/29/07, *Kelvin Park* <[EMAIL PROTECTED] 
<mailto:[EMAIL PROTECTED]>> wrote:


Nathan Nobbe wrote:
> build or modify the xml w/ php.
> or pickup a book on xsl :)
>
> -nathan
    >
> On 7/29/07, *Kelvin Park* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>>
wrote:
>
> I have an XML file with 10 products with their registered
dates(dates
> when they were created).
> My XSL code is set so that it sorts the products in descending
> order(latest to oldest) by registered dates.
> I tried to declare xsl:variable to increment within
xsl:for-each,
> however I ran in to some dead ends.
> How do I print only the 5 latest products?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Thanks!

I checked out sitepoint's XSL book, and figured it out. I tried to
do it
with PHP, for me it seemed just a little bit more work than XSL
transformation.


Since I'm not very familiar with XSL most of my applications are in PHP 
and XML (parsed from MYSQL). I have the current project's design planned 
out with just PHP/XML, however I felt like it was more convenient to 
just do the latest item print out part with XSL (couple of files). I 
might run in to some challenges when I get to pagination, I was thinking 
whether I should deviate a little bit from the plan to create XML/XSL 
pagination of list of items. This might just become all hybrid code with 
PHP and XSL, which I'm not looking forward to have.


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



[PHP] About PHP/MYSQL Pagination

2007-08-02 Thread Kelvin Park
I just couldn't find it anywhere, google or yahoo. I know how to make 
first, previous, last, and next links for php/mysql pagination. How do 
you list page numbers in the middle, between previous and next? (ex. << 
first previous | 1 2 3 4 5 | next last >> )


I know how to display them from 1 to whatever by using for loop, but the 
problem comes in when I click "next" from page "5", it does not get 
re-listed starting from page "6".


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



[PHP] Re: About PHP/MYSQL Pagination

2007-08-02 Thread Kelvin Park

Kelvin Park wrote:
I just couldn't find it anywhere, google or yahoo. I know how to make 
first, previous, last, and next links for php/mysql pagination. How do 
you list page numbers in the middle, between previous and next? (ex. 
<< first previous | 1 2 3 4 5 | next last >> )


I know how to display them from 1 to whatever by using for loop, but 
the problem comes in when I click "next" from page "5", it does not 
get re-listed starting from page "6".



nevermind, I figured it out. didn't know it was quite easy

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



[PHP] About MySQL Tables

2007-08-05 Thread Kelvin Park

I have two tables that share product codes to relate data.
One table is called IMAGE, and another one is called the PRODUCT.
There are more than one image for every product, for example product 
code 1122 will have 3 images and 4938 will have 5 images within the 
IMAGE table. Since all my product information is stored in PRODUCT table 
except for the image file names (e.g. 1122_1.jpg, 1122_2.jpg or 
4938_1.gif), I have to build the following query: SELECT * FROM PRODUCT, 
IMAGE WHERE PRODUCT.productcode = IMAGE.productcode. However, this 
causes a little problem. When I print out all the product information 
with its images, more than one copy of a product is printed out (because 
of multiple images for each product). I'm still looking for a way to 
build a query string so that I could have only one image displayed per 
product (so that a user can click on the product to view more images).


Do you know how this problem can be best approached?

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



[PHP] allow_url_fopen ini directive not enough

2004-12-09 Thread Kelvin Jones
Hi,
I would like to see a new directive to go alongside "allow_url_fopen" to
allow people to turn on or off the ability to include/require a remote file.
The ability to include and execute a file as php from a remote host
leaves many applications open to cross-site-scripting attacks.
This would be easily avoidable if we had a directive
(allow_url_include?) that by default removed this capability.
Any thoughts?
Kelvin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Simple PHP script

2003-02-13 Thread Poon, Kelvin (Infomart)
Hi,

I am new to PHP and had just written a simple php script to get things
started.  I have the following code:







Input yourname







So this page is suppose to display a input box and a submit button and once
you enter ur name and press the button, it should show Hello [ur name] and
the input box at the bottom of it and the button below and the process
continue.

I tried running it and inputted some text and pressed the button, and the
Hello [ur name] didn't show up, it just display an input box and the submit
button.

Can someone please help me?

Thanks a lot

Kelvin


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




RE: [PHP] Simple PHP script

2003-02-13 Thread Poon, Kelvin (Infomart)
Thanks everyone, It worked.

Kelvin

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 4:13 PM
To: Poon, Kelvin (Infomart)
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP] Simple PHP script


Sigh

if ( $_POST['submit1'] ) {
echo ( "Hello $_POST['vname']" );
}

http://www.php.net/manual/en/language.variables.scope.php
http://www.php.net/manual/en/language.variables.external.php

Poon, Kelvin (Infomart) wrote:
> Hi,
> 
> I am new to PHP and had just written a simple php script to get things
> started.  I have the following code:
> 
> 
> 
> 
>  if($submit1) {
> echo "hello $vname";
> } else {
> ?>
> 
> 
> Input yourname
> 
> 
> 
>  }
> ?>
> 
> 
> 
> So this page is suppose to display a input box and a submit button and
once
> you enter ur name and press the button, it should show Hello [ur name] and
> the input box at the bottom of it and the button below and the process
> continue.
> 
> I tried running it and inputted some text and pressed the button, and the
> Hello [ur name] didn't show up, it just display an input box and the
submit
> button.
> 
> Can someone please help me?
> 
> Thanks a lot
> 
> Kelvin
> 
> 


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




[PHP] Help with Sessions

2003-02-28 Thread Poon, Kelvin (Infomart)
Hi

I just have a little problem with sessions.   

my code:

TEST



\n";
echo "\n";
echo "\n";
}
?>



my error msgs:

Warning: Cannot send session cookie - headers already sent by (output
started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6) in
d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8

Warning: Cannot send session cache limiter - headers already sent (output
started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6) in
d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8

Can anyone please help? Thanks

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



RE: [PHP] Help with Sessions

2003-02-28 Thread Poon, Kelvin (Infomart)

Thanks everyone! it worked fine now!
-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 10:58 AM
To: Poon, Kelvin (Infomart)
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP] Help with Sessions


Hi,

Saturday, March 1, 2003, 1:54:24 AM, you wrote:
PKI> Hi

PKI> I just have a little problem with sessions.   

PKI> my code:
PKI> 
PKI> TEST
PKI> 
PKI> 

PKI>  session_start();

PKI> if ($submit) {
PKI> echo 'Hello '.$_SESSION['ID'];
PKI> } else {

PKI> $_SESSION['ID']=2;

PKI> echo "\n";
PKI> echo "\n";
PKI> echo "\n";
PKI> }
?>>
PKI> 
PKI> 

PKI> my error msgs:

PKI> Warning: Cannot send session cookie - headers already sent by (output
PKI> started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6)
in
PKI> d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8

PKI> Warning: Cannot send session cache limiter - headers already sent
(output
PKI> started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6)
in
PKI> d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8

PKI> Can anyone please help? Thanks


move session_start() to the first line in your file

-- 
regards,
Tom

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



[PHP] PERL/PHP, MSSQL, Unix AIX

2003-03-07 Thread Poon, Kelvin (Infomart)
Hi,

I got a little project and I need to come up with a solution on how to
finish it and was hoping if you guys can give me any ideas.

I have a PERL script on a Unix AIX machine that checks for incoming update
of data.  Specificly what it does is, when it runs, it will look at the
corresponding directories in the AIX machine and record the time WHEN a data
has come in and check if the time is delayed or on time, kind of like how
the flight Arrival/departure information work in an airport.  After it
collects this information, it will store these information in a text file.

I need to display this information in a form of a web page so that my
internal staff can see this information.  I usually store this kind of
information in a MSSQL table and use PHP to general a page that collects its
information from the database/MSSQL table.

The way I want to do it, somehow store/update the data in the text file of
the AIX machine to the MSSQL table so that my php page would be able to get
the updated information for display. 

My problem is I haven't come up with a solution as to how I can pull this
text file out fo the AIX machine and transfer the data to the MSSQL table.

Anyone have an ideas?  IS there anything in PHP I can use to do this?  

Any help is appreicated, thanks!

Kelvin

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



RE: [PHP] PERL/PHP, MSSQL, Unix AIX

2003-03-11 Thread Poon, Kelvin (Infomart)
Thanks,

but what can FreeTDS do?  So it can connect to my AIX server and retrieve
that text file out?  

Kelvin

-Original Message-
From: Frank M. Kromann [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 1:35 AM
To: Poon, Kelvin (Infomart)
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP] PERL/PHP, MSSQL, Unix AIX


Hi Kelvin,

You can use both PERL and PHP (prefered :-)).

You need to download, compile and install FreeTDS (http://freetds.org). If
you are using PHP you need to recompile it using --with-mssql. This will
enable the mssql extension. You can then create a php script to read the
text file, parse it and create the data in a MSSQL server on a Win32 box
(PHP is running on your AIX box).

- Frank

> Hi,
> 
> I got a little project and I need to come up with a solution on how to
> finish it and was hoping if you guys can give me any ideas.
> 
> I have a PERL script on a Unix AIX machine that checks for incoming
update
> of data.  Specificly what it does is, when it runs, it will look at the
> corresponding directories in the AIX machine and record the time WHEN a
data
> has come in and check if the time is delayed or on time, kind of like
how
> the flight Arrival/departure information work in an airport.  After it
> collects this information, it will store these information in a text
file.
> 
> I need to display this information in a form of a web page so that my
> internal staff can see this information.  I usually store this kind of
> information in a MSSQL table and use PHP to general a page that collects
its
> information from the database/MSSQL table.
> 
> The way I want to do it, somehow store/update the data in the text file
of
> the AIX machine to the MSSQL table so that my php page would be able to
get
> the updated information for display. 
> 
> My problem is I haven't come up with a solution as to how I can pull
this
> text file out fo the AIX machine and transfer the data to the MSSQL
table.
> 
> Anyone have an ideas?  IS there anything in PHP I can use to do this?  
> 
> Any help is appreicated, thanks!
> 
> Kelvin
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 




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

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



[PHP] really simple problem with GET

2003-03-12 Thread Poon, Kelvin (Infomart)
Hi,

I am sorry if the level of this question is too simple but I can't figure
out what's wrong.  I want to pass a variable value through the URL using the
Get method.

FOr example http://.../test.php?$test=0

and my test.php code are as follow:










BUt my outcome is 

hello

so therefore my $test variable isn't passing through, does anybody know what
I did wrong?

Thanks

Kelvin

   

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



RE: [PHP] Re: really simple problem with GET

2003-03-12 Thread Poon, Kelvin (Infomart)
Yeah it worked...
thanks everyone!

-Original Message-
From: Jan Grafström [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 2:02 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: really simple problem with GET


Try

...test.php?test=0 //no $ before test=

/Jan

"Kelvin Poon" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
.ca...
> Hi,
>
> I am sorry if the level of this question is too simple but I can't figure
> out what's wrong.  I want to pass a variable value through the URL using
the
> Get method.
>
> FOr example http://.../test.php?$test=0
>
> and my test.php code are as follow:
>
> 
> 
> 
> if (!empty($_SERVER))
>   extract($_SERVER);
>
> if (!empty($_GET)) {
> extract($_GET);
> } else if (!empty($HTTP_GET_VARS)) {
> extract($HTTP_GET_VARS);
> }
>
> if (!empty($_POST)) {
> extract($_POST);
> } else if (!empty($HTTP_POST_VARS)) {
> extract($HTTP_POST_VARS);
> }
>
> echo "hello $test";
> ?>
>
>
> 
> 
>
>
> BUt my outcome is
>
> hello
>
> so therefore my $test variable isn't passing through, does anybody know
what
> I did wrong?
>
> Thanks
>
> Kelvin
>
>



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

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



[PHP] form/text area input problem

2003-03-13 Thread Poon, Kelvin (Infomart)
Hi,

I was wondering if anyone could give me some idea to help me solve this
problem.  I am creating a KnowledgeBase for my company.  In this
knowledgeBase, the employees will input articles in the database.  I decided
to store it as such: a column for the title, a column for the content.  

I have a page that lets the employees input these aticles, and in my form I
would have a text box for the title and a text area that lets the user to
input the content.  And when the user press submit, the page will store
these information into the database.  

My problem is, for the text area.  Obviously the content of the aritcle is
going to be longer than one line.  However when I get the value of the text
area, everything the user typed in the text area becomes one line (unless
the user press enter but that isn't neccessary because once the text
approaches the edge of the text area it will automanticly take you to the
next line).  Because of that, me content is all in one line.  When I
retrieve this content and display it in a page, the content becomes a really
long one line paragraph.  I hope you understand what I am trying tto say.  I
was just wondering if there is any way I can fix this.  Right now I
basically wrote my own function, and it reads the content..and adds a 
tag for every let's say 100 characters.but that isn't too efficient coz
sometimes it can add the  int he middle of a word, therefore it cuts of
the word.  Also if the user press ENTER somewhere in the textarea, then it
would crash this function.  I am just looking for a more efficient way of
solving this, can anyone give me any idea?


Kelvin

THANKS!

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



Re: [PHP] form/text area input problem

2003-03-13 Thread Poon, Kelvin (Infomart)

for 2, yes nl2br() will do it.  THanks.

but for 1, if the user don't press enter (yes they were typing a long
paragraph), then the variable will contain one LONG string.  

ANd if I retrieve this data and put it in the html page, it would appear as
a one lined long string.  DO you know what I am trying to say?


Let's say in the paragraph the user input in the text area is somethign like
this:

Hi, this is a longg paragraph  that iss
about our knowledgease.  I have NEVE
press enter in this text area at alll.


then this content will be stored in the database and I would retrieve this
and display it in a html page.

the problem is when I display it it would be a one lined paragraph.   THe
page's format is ruin since this is one long line and the user will have to
scroll across to read the paragraph which look pretty bad. 

I hope you know what i am trying to say.  

Thank you for the suggestions anyways

Kelvin

-Original Message-
From: - Edwin [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 10:14 AM
To: Poon, Kelvin (Infomart); '[EMAIL PROTECTED]'
Subject: Re: [PHP] form/text area input problem


Hi,

"Poon, Kelvin (Infomart)" <[EMAIL PROTECTED]> wrote: 

[snip]
> I am just looking for a more efficient way of solving this, can anyone 
> give me any idea?
[/snip]

I think you'll save yourself from so much trouble if:
1. You just leave those long text. If they didn't press ENTER, it means 
that they were typing a looong paragraph, no?
2. Use the nl2br() function to make sure that those parts where they 
pressed ENTER (a newline), would be turn into .

  http://www.php.net/manual/en/function.nl2br.php

Just my idea...

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/

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



RE: [PHP] form/text area input problem

2003-03-13 Thread Poon, Kelvin (Infomart)
THanks guys, I think I will use wordwarp()



-Original Message-
From: - Edwin [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 11:07 AM
To: Poon, Kelvin (Infomart); '[EMAIL PROTECTED]'
Subject: Re: [PHP] form/text area input problem


"Poon, Kelvin (Infomart)" <[EMAIL PROTECTED]> wrote: 
[snip]
> the problem is when I display it it would be a one lined paragraph.   
> THe page's format is ruin since this is one long line and the user 
> will have to scroll across to read the paragraph which look pretty bad.
> 
> I hope you know what i am trying to say.  
[/snip]

Hmm, I guess I know what you're trying to say but *that* is NOT the 
normal behaviour (if I may say). Putting one long paragraph inside
 tags "should" automagically wrap it... If not, you can probably 
use CSS to limit the width of your 's (paragraphs) so it wouldn't 
destroy the "format" of your page.

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/

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



[PHP] Search/Regular Expression problem

2003-03-13 Thread Poon, Kelvin (Infomart)
Hi,

I am sorry if this problem is too easy but I just can't figure out a way to
do this.

I am making a search engine and I would have the user to type a sentence to
search for.

Let's say it is stored in $search.

My search enginue will bring up a result IF and only if ALL of the words in
$search exist in the result.  For example
if 

$search = Vax Useful Commands

Then the result is only true if (eregi(".*Vax.*Useful.*Commands.*",
'possible result')) is true

Now, I don't know how many words there are in $search initially.  How do I
do a search like that?  I mean if I know $search is 3 words then I can do

$words = preg_split("/  /", $search);

if (eregi(".*words[0].*words[1].*words[2].*", 'possible result')) {
 .
}


Even if I know how many words there are, everytime the number of words in
$search can be different.

Can anybody give me any ideas?
Thanks a lot

Kelvin

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



RE: [PHP] Search/Regular Expression problem

2003-03-13 Thread Poon, Kelvin (Infomart)

Yeah my data are from a database.  How do I use query to search something
like that?
-Original Message-
From: Chris Hayes [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 4:02 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Search/Regular Expression problem


At 21:48 13-3-2003, you wrote:
>My search enginue will bring up a result IF and only if ALL of the words in
>$search exist in the result.  For example
>if
>
>$search = Vax Useful Commands
>
>Then the result is only true if (eregi(".*Vax.*Useful.*Commands.*",
>'possible result')) is true
Are your data in a database? In that case it is much faster to use a query 
to check whether the words are in some record. Regular expressions can take 
quite some time!



>Now, I don't know how many words there are in $search initially.  How do I
>do a search like that?  I mean if I know $search is 3 words then I can do
>
>$words = preg_split("/  /", $search);
I like the 'explode()' function very much , which splits a string on a 
separator (can be ' ') and puts the results in a long array.





>if (eregi(".*words[0].*words[1].*words[2].*", 'possible result')) {
>  .
>}
>
>
>Even if I know how many words there are, everytime the number of words in
>$search can be different.
So if you have used explode() then you can do a loop that goes through the 
array, for instance

$searchwords=explode(' ', $search);

for ($x=0;$xhttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

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



RE: [PHP] Search/Regular Expression problem

2003-03-14 Thread Poon, Kelvin (Infomart)
THANKS I got it!

-Original Message-
From: Chris Hayes [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 5:45 PM
To: Poon, Kelvin (Infomart); 'Chris Hayes'
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Search/Regular Expression problem


At 22:15 13-3-2003, Poon, Kelvin (Infomart) wrote:

>Yeah my data are from a database.  How do I use query to search something
>like that?


well like in my code, suppose you want to look in table 'tablename' in 
field 'textfield', and you want to show the fields 'title' and 'textfield', 
and you need the 'ID' too, Then you go

$query='SELECT title,textfield,ID
 FROM tablename
 WHERE textfield LIKE "%word1%"'

for more than one word, need to match all:

$query='SELECT title,textfield,ID
 FROM tablename
 WHERE textfield LIKE "%word1%"
 AND
 textfield LIKE "%word2%"'

to match one of both words:
$query='SELECT title,textfield,ID
 FROM tablename
 WHERE textfield LIKE "%word1%"
 OR
 textfield LIKE "%word2%"'





>-Original Message-
>From: Chris Hayes [mailto:[EMAIL PROTECTED]
>Sent: Thursday, March 13, 2003 4:02 PM
>To: [EMAIL PROTECTED]
>Subject: Re: [PHP] Search/Regular Expression problem
>
>
>At 21:48 13-3-2003, you wrote:
> >My search enginue will bring up a result IF and only if ALL of the words
in
> >$search exist in the result.  For example
> >if
> >
> >$search = Vax Useful Commands
> >
> >Then the result is only true if (eregi(".*Vax.*Useful.*Commands.*",
> >'possible result')) is true
>Are your data in a database? In that case it is much faster to use a query
>to check whether the words are in some record. Regular expressions can take
>quite some time!
>
>
>
> >Now, I don't know how many words there are in $search initially.  How do
I
> >do a search like that?  I mean if I know $search is 3 words then I can do
> >
> >$words = preg_split("/  /", $search);
>I like the 'explode()' function very much , which splits a string on a
>separator (can be ' ') and puts the results in a long array.
>
>
>
>
>
> >if (eregi(".*words[0].*words[1].*words[2].*", 'possible result')) {
> >  .
> >}
> >
> >
> >Even if I know how many words there are, everytime the number of words in
> >$search can be different.
>So if you have used explode() then you can do a loop that goes through the
>array, for instance
>
>$searchwords=explode(' ', $search);
>
>for ($x=0;$x{//build the search command OR build the query
>// i recommend to make it a query, so:
>
>$WHERE.= ' AND textfield=LIKE '"%'.$searchwords[$x].'%"';
>
>}
>
>//now cut off the first ' AND '
>   $WHERE=substr($WHERE,4,strlen($WHERE);
>
>
>now finish the query
>$query="SELECT title,text,ID FROM tablename ".$WHERE;
>
>
>then proceed by doing the query and showing the results.
>
>
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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



[PHP] A faster way to Redirect pages

2003-03-17 Thread Poon, Kelvin (Infomart)
Hi,

I know this topic was discussed but I deleted my previous mail so I can't go
back and review them.  My question is, is there a faster way to redirect
html pages other than just using   ?  Is there any way we can do that in php so that it
redirect "FASTER"?  Right now I set the redirect time to be 1 sec, but for
some reason it still takes kind of long until it actually redirects, I was
wondering if there is any other way I can do this faster.


THanks a lot everyone,

Kelvin

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



[PHP] Addslashes problem (MSSQL)

2003-03-20 Thread Poon, Kelvin (Infomart)
Hi,

I have a problem that lets you add a record to a database.  THere is a
problem with it, and the following is the area of the program where it has
problem.



$created_date = date('m, d, Y');

$title = strip_tags($title);
$keywords = strip_tags($keywords);
$content = strip_tags($content);
$product = strip_tags($product);


if (!get_magic_quotes_gpc()) {
$title = addslashes($title);
$keywords = addslashes($keywords);
$product = addslashes($product);
$content = addslashes($content);
}

$query = "SELECT * FROM knowledgeBase";
$result = mssql_query($query);

$ID = mssql_num_rows($result);
$ID += 1;

$query2 = "INSERT INTO knowledgeBase(
ID,
Title,
Keywords,
Content,
[Created Date],
[Updated Date],
Product)
   VALUES(
'".$ID."',
'".$title."',
'".$keywords."',
'".$content."',
'".$created_date."',
'Never',
'".$product."')";
$result2 = mssql_query($query2);



where my $content value is osmethign like this.

"Step 1: Access the homepage
Step 2: type in your username under the field 'username' "

and after the addslashes funciton there would be \ around the 'username'
like this..
\'username\'and now after running this program I got an error message:

Warning: MS SQL message: Line 14: Incorrect syntax near 'username'.
(severity 15) in d:\apache_docroots\internal.infomart.ca\infodesk\kb_add.php
on line 119

Warning: MS SQL: Query failed in
d:\apache_docroots\internal.infomart.ca\infodesk\kb_add.php on line 119



does any body have any idea?  I did the same thing with another problem but
it worked fine.  I have no idea what the problem is.  I know I need to
addslashes to the string since I am putting it in the valuable
$query2..please advise..

THanks!.
 

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



RE: [PHP] Addslashes problem (MSSQL)

2003-03-20 Thread Poon, Kelvin (Infomart)

What do you mean by "It escapes single quotes with single quotes."?

so let's say my $content is 

lalal 'lalalal' "lalala"


then what do I have to do to $content in order to insert to my MSSQL table?
-Original Message-
From: Lowell Allen [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 11:20 AM
To: PHP
Subject: Re: [PHP] Addslashes problem (MSSQL)


MS-SQL doesn't escape with slashes. It escapes single quotes with single
quotes.

--
Lowell Allen

> From: "Poon, Kelvin (Infomart)" <[EMAIL PROTECTED]>
> Date: Thu, 20 Mar 2003 10:58:02 -0500
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: [PHP] Addslashes problem (MSSQL)
> 
> Hi,
> 
> I have a problem that lets you add a record to a database.  THere is a
> problem with it, and the following is the area of the program where it has
> problem.
> 
> 
> 
> $created_date = date('m, d, Y');
> 
> $title = strip_tags($title);
> $keywords = strip_tags($keywords);
> $content = strip_tags($content);
> $product = strip_tags($product);
> 
> 
> if (!get_magic_quotes_gpc()) {
> $title = addslashes($title);
> $keywords = addslashes($keywords);
> $product = addslashes($product);
> $content = addslashes($content);
> }
> 
> $query = "SELECT * FROM knowledgeBase";
> $result = mssql_query($query);
> 
> $ID = mssql_num_rows($result);
> $ID += 1;
> 
> $query2 = "INSERT INTO knowledgeBase(
> ID,
> Title,
> Keywords,
> Content,
> [Created Date],
> [Updated Date],
> Product)
> VALUES(
> '".$ID."',
> '".$title."',
> '".$keywords."',
> '".$content."',
> '".$created_date."',
> 'Never',
> '".$product."')";
> $result2 = mssql_query($query2);
> 
> 
> 
> where my $content value is osmethign like this.
> 
> "Step 1: Access the homepage
> Step 2: type in your username under the field 'username' "
> 
> and after the addslashes funciton there would be \ around the 'username'
> like this..
> \'username\'and now after running this program I got an error message:
> 
> Warning: MS SQL message: Line 14: Incorrect syntax near 'username'.
> (severity 15) in
d:\apache_docroots\internal.infomart.ca\infodesk\kb_add.php
> on line 119
> 
> Warning: MS SQL: Query failed in
> d:\apache_docroots\internal.infomart.ca\infodesk\kb_add.php on line 119
> 
> 
> 
> does any body have any idea?  I did the same thing with another problem
but
> it worked fine.  I have no idea what the problem is.  I know I need to
> addslashes to the string since I am putting it in the valuable
> $query2..please advise..
> 
> THanks!.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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

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



[PHP] MSSQL/PHP Problem

2003-03-31 Thread Poon, Kelvin (Infomart)
Hi, 

I have this problem retrieving data from a mssql table with PHP.

I have this in my mssql table column:

Globe and Mail data are retrieved and processed for CustomSearch.

On the R30, the crontab entry:
0 4 * * 1-6  /usr1/applic/ntgm/ntgm_get.pl
will run the Perl script at 4 a.m. everyday to retrieve the data from Globe
and Mail.  It will look for the file, retry if not found, until 6 a.m.

Most common problem is caused by the data file not available after 6 a.m.
for retrieval.  The system will send an error message to the support team to
alert the problem.

To retry downloading manually, simply sign on to the R30 and run the script
/usr1/applic/ntgm/ntgm_get.pl.

The data file can be found in the done directory and two log files in the
log directory.

WHen I retrieve this data from php to display on my webpage I get this:

Globe and Mail data are retrieved and processed for CustomSearch. 
On the R30, the crontab entry: 
0 4 * * 1-6 /usr1/applic/ntgm/ntgm_get.pl 
will run the Perl script at 4 a.m. everyday to retrieve the data from Globe
and Mail. It will look for the fi

The code I have in my php to display this text is:

$query = "SELECT * FROM knowledgeBase WHERE Title = '$title'";
$result = mssql_query($query);
$line = mssql_fetch_row($result);
echo "$line[2]";

$line[2] because this data is in the second column of the mssql table of the
row '$title'

P.S. I have set the limit of the mssql table to have 8000 character, so it
should exceed the limit, but I just don't know why it takes only 6 lines of
the total 11 lines of what I had in the mssql table.

Please advise! THANKS!

Kelvin

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



[PHP] File Searching problem

2003-04-01 Thread Poon, Kelvin (Infomart)
Hi,

I need to work on a tiny little program, and was wondering if anyone could
help me.

I need just a simple program that searches a phrase (inputted by the user in
a form) from all the php files in the directory.  Let's say the user inputed
"How to Log on to XXX", then my programs needs to search this phrase in all
of the php files that are in the directory.  

My problem is I don't know how to open all of the files in the directory,
since I don't know the name of the files.  These php files keep updating,
and the names would be KB_XX.php, where XX is the ID of that
particular file.  I need to open ALL of these files and search the phrase in
it.  Any body have any idea how I can open these files?  I am probably going
to be using RE to search, so maybe I can use fread() to store a file in a
variable and search one file at a time.

Please Advice.

Thanks
Kelvin

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



[PHP] Can php run as a script?

2003-04-02 Thread Poon, Kelvin (Infomart)
Hi,

This might be a newbie question but I can't find an answer anywhere I
search.  I know php can be excuted by a web browser, but can it run as a
script like Perl?

The reason i ask is, I need to write a php script that updates a database in
a server.  And this script needs to be running in the background as a
service, that's why i was wondering if I can excute it like a perl script.

If it can't, do you guys know if I can use perl to call up a php script?

Please advise.

Thanks,
Kelvin

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



[PHP] RE: Can php run as a script?

2003-04-02 Thread Poon, Kelvin (Infomart)
Thanks!

but the thing is I have php 4.2.2 version installed in that server.  And
since it is not 4.3.0 therefore CLI isn't on by default.  How can I check if
CLI is on or not?  If it is not on, I won't be able to excute the php as a
script in another other way?

THnaks@

-Original Message-
From: Tim Burden [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 02, 2003 12:02 PM
To: Kelvin Poon
Cc: [EMAIL PROTECTED]
Subject: Re: Can php run as a script?


Look for PHP CLI in google.

Recent versions of PHP install at CLI PHP executable by default.
e.g I ended up with one in:

 /usr/local/apache/bin/php

[EMAIL PROTECTED] root]# /usr/local/apache/bin/php -v
PHP 4.3.1 (cli) (built: Feb 20 2003 14:09:35)
Copyright (c) 1997-2002 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies


- Original Message -----
From: "Kelvin Poon" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 02, 2003 11:43 AM
Subject: Can php run as a script?


> Hi,
>
> This might be a newbie question but I can't find an answer anywhere I
> search.  I know php can be excuted by a web browser, but can it run as a
> script like Perl?
>
> The reason i ask is, I need to write a php script that updates a database
in
> a server.  And this script needs to be running in the background as a
> service, that's why i was wondering if I can excute it like a perl script.
>
> If it can't, do you guys know if I can use perl to call up a php script?
>
> Please advise.
>
> Thanks,
> Kelvin

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