[PHP] Execution Time

2002-10-04 Thread Pong-TC

Hello All

I have a problem with the execution time.  I use PHP to update database,
but it could not perform well due to the limited execution time.  How
could I extend the execution time?  Here is my error:

Fatal error: Maximum execution time of 30 seconds exceeded in
d:\inetpub\wwwroot\cgi-bin\finaid\upfinwhole.php on line 468

I am using PHP on IIS5 as a cgi.

Thank you.
Pong


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




[PHP] Code Improvement

2002-06-13 Thread Pong-TC

Hello All

I run the simple code to display data from the database.  There are around
5000 records and 50 fields.  It takes around 1 1/2 min to retrieve the
data to the browser.  I'd like to know if we can improve my code.  So, I
can retrieve the data in a shorter period of time.  I have codes as
follows:

$conn = (mssql_connect("20.23.252.3","hello","hello")) or die("Cannot
connect to the database.");
mssql_select_db("research",$conn);

$strSQL = "Select * from dss_student order by stuidterm";
$rs = mssql_query($strSQL,$conn) or die("Cannot connect to the table");

echo "";
echo "NO.";

while($fld = mssql_fetch_field($rs)){
echo "" . $fld->name 
.
"";  
}

echo "";

$no_row = 1;
while ($row = mssql_fetch_row($rs)){ 
if (($no_row % 2) == 1) 
echo "";
else 
echo "";

echo "$no_row";
for ($i=0;$i<=49;$i++)
echo "$row[$i]";
$no_row++;
}
echo "";
mssql_close();

POng



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




Re: [PHP] Refresh doesn't work

2002-05-20 Thread pong-TC

[EMAIL PROTECTED] writes:
>Hello php-general,
>
>  Has anyone else here the same proplem as I have? I write in my php:
>
>header("Refresh: 3; url=newpage.php");
>
>Netscape 4.79 works fine and goes to page.php after 3 seconds pass.
>But IE 6 doesn't want to do that. Can anyone explain such a wonderful
>behavior?
>
>-- 
>Best regards,
> Olexandr  
try to use this:

echo "";

I cannot use header either.  Perhaps, I run PHP under Wins.  However, the
above syntax works well with any browser.

Pong
  


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




Re: [PHP] simple function question.

2002-04-10 Thread pong-TC

[EMAIL PROTECTED] writes:
>this is a very simple question.  I'm trying to figure out if there is a
>one line way to do this:
>
>I want to pass a variable to the function only if it matches a certin
>value, I know I can do this:
>
>if($a=='H') my_function($bob,'Y');
>else my_function($bob);
You can do this
($a=='H') ? my_function($bob,'Y'):  my_function($bob);
>
>
>but If it's possible I'd like to do it with one line something that I'd
>think it would be like this.
>
>my_function($bob,if($a=='H') return 'Y'; );
>
Also, if you change this 
>if($a=='H') return 'Y'
  to a function ie foo(a){
>if($a=='H') return 'Y'
;}.  Then, put foo(a) in my_function, I think it would work.

Pong


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




Re: [PHP] formatting a numeric string

2002-04-10 Thread pong-TC

[EMAIL PROTECTED] writes:
>I have the following code --
>
>$phone_number = "8005551212";
>$phone_array = explode("", $phone_number);
>$phone_number = sprintf("(%s%s%s) %s%s%s-%s%s%s%s", $phone_array[0], 
>$phone_array[1], $phone_array[2], $phone_array[3], $phone_array[4], 
>$phone_array[5], $phone_array[6], $phone_array[7], $phone_array[8]);
>
>Is this really the best way to achieve $phone_number = "(800) 
>555-1212" ?  Or am I taking the long way around, and there's a function 
>that can do this better?
>
>Thanks,
>
>
>Erik

I would do this
echo "(" . substr(0,3) . ") " . substr(3,3) . "-" . substr(6,4);

Pong


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




[PHP] Advice Needed

2002-04-08 Thread pong-TC

Hello All

We are planning to install Unix-Like system on our old PC.  I don't know
which one I should go among FreeBSD, Redhat, and Suse.  I'd like a very
easy installation, specially on a network configuration part.  Which is
good?

Thank you.
POng 


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




Re: [PHP] PHP and MS access

2002-04-02 Thread pong-TC

[EMAIL PROTECTED] writes:
>Anybody have a good tutorial on getting PHP to access a MS Access
>Database with ODBC?
>
>I cant even get a connection to succeed.
>
Check at php.weblogs.com/ADOdb



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




[PHP] SSL and Apache

2002-03-28 Thread pong-TC

Hello All

This is quite off the topic.  Does anyone advise me how to install SSL on
Apache server?  I used to do on IIS by using Verisign.  It was quite easy.
 Because I am not used to with the Apache, I don't where I should start..

Any help, please.

Thank you.
Pong


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




Re: [PHP] Re: Calling a javascript function?

2002-03-21 Thread pong-TC

[EMAIL PROTECTED] writes:
>I would want to do something like this:
>
>if (something true)
>{
>somejavafunc();
>}
>?>
>
>I would want to do that. Is there some way of pulling that off? Thanks,
>Dave

YOu can do something like this, embed the following codes in your php file

echo "";
//you can do something here ie
echo "alert(\"Hello World\");";
echo "";

Hope, this would help.
Pong


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




[PHP] Deleting File

2002-03-21 Thread pong-TC

Hello All

I am trying to build a text file, and delete it by using unlink function,
but it always refuse to do so because of permission denied.  It gives me
an error as follows:

Warning: Unlink failed (Permission denied) in
d:\inetpub\wwwroot\cgi-bin\myfile.php on line 45

Actually, the file was created in the same page by using fopen, and then I
want to delete when no longer used.  I had tried a delete function, but
not work.  I am running PHP as a cgi on IIS 5, Win2K.

If anyone can help.

Pong


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




[PHP] U.S. Section 508 Guidelines

2002-03-18 Thread pong-TC

Hello All

It is quite off the topic.  I think most of you work with form while you
are using PHP.  Does anyone need to conform your form webpage to ADA
compliance?  It is a U.S. Section 508 Guidelines for handicap people to
access the webpage.  However, when it applies to the webpage that has many
form elements, it seems to be clumsy for me.  For example, I have to put
all labels in fron of text boxes, radio box, select boxes.  Does anyone
has any idea to get around and to make it pass the compliance?  I am using
the www.cast.org/bobby to test my webpage.

Thank you.
Pong



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




Re: [PHP] Sessions

2002-03-18 Thread pong-TC

[EMAIL PROTECTED] writes:
>Hi,
>
>I got a page that is being reloaded a lot. In the bigging I register a
>Session variable with the SESSION_START and SESSION_REGISTER functions.
>Is it wrong that I keep registering the session?
>Should I also unregister the session at the bottom of the page?
>
>Regards,
>Morten
>
>
I think you should register a variable once.  I keep checking its value on
other pages that you want to.  You can use session_destroy when you don't
want to keep track of session ie. logout page.

Hope, this would help.


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




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread pong-TC

[EMAIL PROTECTED] writes:
>I'm using PHP 4.1.1 (for Windows). Here is *all* of my code.
>
>
>
>Administrative Log-In Page
>
>
>
>
>Please enter your username and password below in the fields below.
>
>  Username:
>  
>  
>  Password:
>  
>  
>  
>  
>  
>

Hello Jason

If I were you, I would not use $HTTP_POST_VARS.. YOur form element like
this  is good enough.  I
don't think you need this value="$HTTP_POST_VARS['password']; ?>".   Also, make sure that echo $PHP_SELF
is output the form name or just put the form name directly.  Anything else
is fine.  Your isset condition should be provoked once clicked,  and call
the insert function.  It is very simple from my opinion.  I use PHP on IIS
also.

Hope, this would help.
Pong

>   if (isset($login)) {
>  insert();
>  echo $login;
> }
>
> function insert() {
>  $db = odbc_connect('IdentDatabase', 'root', '');
>
>  if(!$db) {
>   echo "An error has occured. Please href=\"mailto:[EMAIL PROTECTED]\";>e-mail the text below to
>me.~~~$PHP_ERROR$db~~~";
>  }
>
>  $SQLQuery = "SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
>AND fldPassword = '$password'";
>  $cursor = odbc_exec($db, $SQLQuery);
>
>  if (!$cursor) {
>   echo "An error has occured. Please href=\"mailto:[EMAIL PROTECTED]\";>e-mail the text below to
>me." . odbc_errormsg($db) . "~~~";
>  }
> }
>   ?>
>
>
>



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




Re: [PHP] How do I read a tab delimited file?

2002-03-11 Thread pong-TC

I never try before, but I think you can use explode or strtok function to
chop each field in the line with any delimiter.

hope this would help.
Pong



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




Re: [PHP] php.ini ...

2002-03-11 Thread pong-TC

Go to your PHP directory and open backup folder inside.  It should have
php.ini right there.  That is a real one, and you can use it.

Hope, this would help.
Pong
[EMAIL PROTECTED] writes:
>Hi, it's me again,
>
>when I used the PHP 4.0.6 I had a php.ini with a lot of entries. Now,
>at
>Version 4.1.1, there's a php.ini with this content:
>
>
>-
>; php.ini for PEAR tests
>include_path=..
>[mail function]
>SMTP= localhost ; for Win32 only
>sendmail_from= [EMAIL PROTECTED] ; for Win32 only
>upload_tmp_dir = C:\PHP\uploadtemp  ; temporary directory for HTTP
>uploaded
>files (will use system default if not specified)
>[Session]
>session.save_path= C:\PHP\sessiondata; argument passed to save_handler
>[PHP]
>error_reporting= E_ALL & ~(E_NOTICE | E_USER_NOTICE | E_WARNING |
>E_COMPILE_WARNING | E_CORE_WARNING | E_USER_WARNING) ; display all errors


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




[PHP] Problem with MSSQL

2002-03-08 Thread pong-TC

Hello All

I just reinstalled PHP 4.1.1 on IIS5 (win2000) over the old version by
using the installer.  I installed as a cgi.  Then, I got problems with
mssql_connect function.  It doesn't work as it did before.  Here is the
error message:

Fatal error: Call to undefined function: mssql_connect() in
d:\inetpub\wwwroot\cgi-bin\Submitted.php on line 25

It is my mistake that I reinstalled without realization.  So, I got a
trouble.  Anyone, please help.

Thank you.
Pong


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




[PHP] Initializing Array

2002-01-28 Thread pong-TC

Hello All

I would like to initialize the array $pos[17][7][3] to zero.  Can i do
like in C ie. $pos[17][7][3] = 0;?  Or, will I have to do initialize every
single element of array to zero by using loop?

Thank you.
Pong


-- 
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] Connecting MS SQL

2001-12-13 Thread pong-TC

Hello All

I am trying to connect MS SQL, but got the error message as follows:

Warning: MS SQL message: Login failed for user 'pong'. (severity 14) in
d:\inetpub\wwwroot\cgi-bin\mailman.php on line 26

Warning: MS SQL: Unable to connect to server: dilbert in
d:\inetpub\wwwroot\cgi-bin\mailman.php on line 26
Cannot connect to the database.

I followed all instructions before I did try ie. copy php_mssql.dll to
winnt/system32 directory and uncomment extension in php.ini.  Still no
luck, anyone, please help.  I am running PHP 4.1.0 on IIS 5.

Thank you.
Pong


-- 
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] File Name and Path

2001-12-11 Thread pong-TC

Hello Listers

I have a question on how to get the full path of source file.  I have a
form like this:



Send this file: 



I pass the request to myupload.php.  If my source file's path is
c:/result.txt, how can I know it in myupload.php?  I know that I can get
the file name result.txt, but I don't know how to get the full path.  

Anyone, please help.

Pong


-- 
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] PHP Installed in CGI for IIS 5(microsoft)

2001-12-06 Thread pong-TC

Hello  All

Has anyone installed and used PHP in CGI (not ISAPI) for IIS 5?  Is it
running good?  I mean you got a full capability as PHP has, and there is
no serious harm to the webserver(IIS 5).   I am also using ASP.  I don't
know installing PHP on the system will jeopardize the ASP application. 
Please let me know.

Thank you.
Pong


-- 
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]




Re(2): [PHP] PHP and IIS4

2001-09-10 Thread pong-TC

[EMAIL PROTECTED] writes:
>Yes, it will. But try not to mix and match.

Can you explain more about this?  I would like to know more about the
impact of having and using ASP and PHP together.

Thank you.
Pong
>
>
>George
>- Original Message - 
>From: "pong-TC" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Monday, September 10, 2001 3:53 PM
>Subject: [PHP] PHP and IIS4
>
>
>> Hello All
>> 
>> I am using ASP on IIS4, and interested in PHP.  I would like to know
>that
>> if I install PHP on IIS4, can I still use ASP as well?
>> 
>> Thank you.
>> Pong
>> 
>> 
>> -- 
>> 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]
>
>
>
>_
>
>Do You Yahoo!?
>
>Get your free @yahoo.com address at http://mail.yahoo.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] PHP and IIS4

2001-09-10 Thread pong-TC

Hello All

I am using ASP on IIS4, and interested in PHP.  I would like to know that
if I install PHP on IIS4, can I still use ASP as well?

Thank you.
Pong


-- 
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]