[PHP] Output HTML Compression

2001-04-19 Thread Floyd Piedad

Hi,

Any tips on how to speed-up dynamic page loads by either lessening the HTML file
sent or compressing it?  I found two ways but don't exactly know how to do it.
1. Enable output buffering with compression.  This seems to be only available on
php4.04.  Is there a way to do this with php4.01?
2. Remove extraneous whitespaces.  I normally program with heavy use of
indention, especially in table outputs, to make code more readable.  But the
html files sent out also have these indentations and whitespaces.  Is there a
code that can clean these out?

Thanks,

Floyd


-- 
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] Use of special characters in filenames results in IE problems

2001-04-19 Thread Floyd Piedad

Hi,

I discovered a bug in my program for uploading files, which stores the
filename in the database in order to create a link for it on the web page in
the future.  The bug is when the filename makes use of special characters
(e.g. Oplg).  When I create a link to the file, the link works with
Netscape.  With IE however, it says that file is not found.  I discovered that
if I use the "encoded" version of the file name ("Opl%e6g") it works on both
IE and Netscape.  What function or code is used to convert to this format?

Thanks!
Floyd



Re: [PHP] HTML and slashes.

2001-04-19 Thread Floyd Piedad

Could you enlighten me on the advantages or disadvantages and dangers of
turning-on both magic_quotes_gpc and magic_quotes_runtime?

Thanks,

Floyd Piedad

Plutarck wrote:

 Check magic_quotes_runtime in your ini. If it's on, turn it off.

 Use the htmlspecialchars() family of functions. They will "hide" HTML in
 that the browser will not attempt to parse. so "B" will be displayed as
 "B", and not make all the text turn to bold.

 --
 Plutarck
 Should be working on something...
 ...but forgot what it was.

 ""Dddogbruce (@home.com)"" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   there is NO way of hiding the html from the user.
   the browser can't output otherwise. You can only
   try to make it difficult to get the source.
 
  I want to hide the HTML from the browser.  If someone adds some malicious
  code, or even u/u I don't want it to underline.
 
   Where does the " 's " problem come in? More detail plz.
   Is it a part of a text? Then try htmlspecialchars() or
   htmlentities().
 
  Say I right "Hiya, my name's Owen" on the submission part of the form.
 It'll
  show up as "Hiya, my name\'s Owen" on the output (which is a .txt file.)
 
  HTH,
  Owen
 
 
  --
  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 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: [PHP] slashes added to template files

2001-04-14 Thread Floyd Piedad

Check your PHP config.  On the remote server, you probably have Magic Quotes Runtime 
Activated while on the local
machine it is not.  Best if you make both the same config.  Run php info command to 
check.

Floyd

Franklin Hays wrote:

 Apologies in advance if this has been discussed before or is a simple
 fubar on my part.  I can only search through the archives for so
 long...  :-)

 Experiencing a frustrating problem on this end with slashes being added to
 my template files.  Here are the details:

 Using PHP on a webhost that compiled php as a cgi in my www/cgi-bin
 directory.

 I have all HTML files in templates/filename.tpl and all PHP files in
 includes/filename.inc, this includes the template.inc file from PHPLib.

 I have a file called 'script' with the following in it:

  ?php
 require('includes/Directory.inc');
 include('includes/Header.inc');
 // Now parse a second template:
 $t-set_file("MainHandle","MainGadget.tpl");
 // wholePage.ihtml has "{MyOutput}" in it
 $vari= $t-parse("MyFinalOutput","MainHandle");
 // All {MyOutput}'s get replaced
 $t-p("MyFinalOutput");
 // output the value of MyFinalOutput
 /*eval( "?".$vari );*/
 include('includes/Footer.inc');
 ?

 include/Directory.inc has the following in it:

 ?php
 include('includes/Template.inc');
 $url_array=explode("/",$REQUEST_URI);
 $url_cat=$url_array[3];
 $url_grp=$url_array[4];
 $url_misc=$url_array[5];
 $t = new Template("/www/hostname/ocean/templates/");
 $title = "name";

 if($url_misc == 'misc') {
 $Handle='MiscHandle';
 $Template='MiscGadget.tpl';
 }
 elseif ($url_grp == 'tanks') {
 $Handle='TankHandle';
  $Template='TankGadget.tpl';
 }
 elseif ($url_cat == 'psupply') {
 // These three lines are the same as the first example:
 $Handle='PowerHandle';
 $Template='PowerGadget.tpl';
 }
 elseif ($url_cat == 'purpose') {
 $Handle='PurposeHandle';
 $Template='PurposeGadget.tpl';
 } else {
 $Handle='IntroHandle';
 $Template='IntroGadget.tpl';
 }
 $t-set_file("$Handle","$Template");
 $t-set_var("name",$title);
 $t-parse("MyOutput","$Handle");
 ?

 Now, this setup work without a hitch on my personal development server
 where PHP is loaded as a module in Apache. The file called via the
 'script' above is loaded into the MainGadget.tpl template and displayed
 without a problem. Everything, including javascript, works great.

 Now, I moved this code to the providers server, where the only difference
 I can tell is php works as a cgi , and I get output from the HTML files
 with slashes added to the HTML, such as:

 a href=\'about.php\'
 onMouseOut=\'MM_swapImgRestore()\" 
onMouseOver=\"MM_swapImage(\'about\',\'\',\'graphics/toolsbar3_01.gif\',1)\"img
 name=\"about\" border=\"0\" src=\"graphics/toolsbar_01.gif\" width=\"105\" 
height=\"35\"/a
 a href=\'contact.php\' onMouseOut=\'MM_swapImgRestore()\'
 onMouseOver=\'MM_swapImage(\'contact\',\'\',\'graphics/toolsbar3_02.gif\',1)\"img
 name=\"contact\" border=\"0\" src=\"graphics/toolsbar_02.gif\" width=\"96\" 
height=\"35\"/a

 Everything else is output just fine. The only HTML with this in it is the
 {MyOutput} files from templates directory (.tpl files). I am not very
 familiar with PHPLib but imagine there is some other not so subtle item I
 am missing since things work great on my linux/apache/php4 server.

 Any ideas? I have tried using stripslashes() in the 'script' above but get
 errors. Is there something unique to the php cgi I am missing? Something
 else?

 Any all help is greaty appreciated!!

 Thanks,

 //frank

 --
 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] Fastest way to encrypt database storage?

2001-04-04 Thread Floyd Piedad

Hi,

I want to store all data into mySQL database in encrypted format and
then show it only after decrypting it.  What is the fastest way of doing
it?

Floyd


-- 
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] Cookie not getting set in IE 5 but no problem in Netscape

2001-03-28 Thread Floyd Piedad

My program works really well with Netscape.  But with some Internet Explorer
installs, the cookie does not get remembered?  I already set the Security
options to Allow Cookies (both).  When I set it to prompted, it even asked me if
I wanted to accept the cookie, replied yes, but still the cookie cannot be read
by the PHP program?

Thanks,

Floyd


-- 
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] Sending html email

2001-03-23 Thread Floyd Piedad

Can anybody tell me the easiest and quickest way to send email in HTML
format?

Thanks,

Floyd


-- 
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: [PHP] Problems connecting to remote mySQL server

2001-03-21 Thread Floyd Piedad

Hi Almir,

Here is more info:
Server1: where my database resides
Server2: where my script resides
On Server1: I can access the database using mysql command and PHP.
On Server2: I can access the database using mysql -hserver1   I can show all
the tables, select data, etc.  BUT, when running PHP script on this server,
(mysql_connect("server1",user,password)) all that happens is that it still
connects to the mysql in Server2 and not in Server1.

I really cannot understand why.  Being able to access Server1 using Server2
mysql command verifies my access rights right?


I am about to give up on this!

Thanks,

Floyd

almir wrote:

 the only problem could be that yourUser@webhost do not have same permisions
 for this db as yourUser@yourHost, check them if you can

 -almir

 "Floyd Piedad" [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi Almir,
 
  Yes I checked the names and they are correct.  Yes I am able to connect
 using
  the command prompt from the remote server as I am able to list the
 databases,
  tables, etc. remotely.
 
  Thanks,
 
  Floyd
 
  almir wrote:
 
   when you connect to server issue
   "show databases" -query then look inside what you can see some servers
 are
   case sensitive
   i hope that will help,
   and are you sure that you are connected , it could be that you may not
   connect at all because of firewalls or something like that
   -almir
  
   "Floyd Piedad" [EMAIL PROTECTED] schrieb im Newsbeitrag
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I am trying to connect to a remote mySQL server through PHP but I get
 a
mySQL error of "Unknown Database".  I can connect to the remote mySQL
   server
using the mysql command but not with PHP.
   
1. How can I debug what the problem is?
2. Do I need to specify the Port parameter in PHP?
3. Which mySQL error logs do I examine to help me out - the one on the
   local
machine or on the remote machine?
4. And where is the mySQL error logs anyway?
   
I tried other lists but no help there.  I hope this list helps!
   
Thanks all,
   
Floyd Piedad
   
   
--
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 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 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: [PHP] Benchmark single page

2001-03-21 Thread Floyd Piedad

Hi Jason,

At the very start of the page to be outputted, even before the HTML tags, put this in.
? php
$time = microtime();
$time = explode(" ",$time);
$microtime = $time[1]+$time[0];
$transaction_start = $microtime;
?

Then at the very bottom of the generated page, before the /BODY/HTML tag:
? php
$newtime = microtime();
$newtime = explode(" ",$newtime);
$newmicrotime = $newtime[1]+$newtime[0];
$elapsed_time = number_format(($newmicrotime - $transaction_start),3);
echo "Transaction completed in ".$elapsed_time." seconds!"
?


This takes into account all of the php codes executed to generate all the contents 
inbetween these two sections, including database extractions.

Regards,

Floyd Piedad

Jason Granum wrote:

 I'm wanting to benchmark a single PHP page to the millisecond (if possible) that 
basicly just will put a

 This page generated in X.XXX seconds

 at the bottom of every page.

 I've tried looking through the past messages on the group but havn't found any 
threads relating to this. Anyone have any ideas of how to do this simple thing simply?

 Thanks


-- 
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] Problems connecting to remote mySQL server

2001-03-20 Thread Floyd Piedad

I am trying to connect to a remote mySQL server through PHP but I get a
mySQL error of "Unknown Database".  I can connect to the remote mySQL server
using the mysql command but not with PHP.

1. How can I debug what the problem is?
2. Do I need to specify the Port parameter in PHP?
3. Which mySQL error logs do I examine to help me out - the one on the local
machine or on the remote machine?
4. And where is the mySQL error logs anyway?

I tried other lists but no help there.  I hope this list helps!

Thanks all,

Floyd Piedad


-- 
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: [PHP] Problems connecting to remote mySQL server

2001-03-20 Thread Floyd Piedad

Hi Almir,

Yes I checked the names and they are correct.  Yes I am able to connect using
the command prompt from the remote server as I am able to list the databases,
tables, etc. remotely.

Thanks,

Floyd

almir wrote:

 when you connect to server issue
 "show databases" -query then look inside what you can see some servers are
 case sensitive
 i hope that will help,
 and are you sure that you are connected , it could be that you may not
 connect at all because of firewalls or something like that
 -almir

 "Floyd Piedad" [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I am trying to connect to a remote mySQL server through PHP but I get a
  mySQL error of "Unknown Database".  I can connect to the remote mySQL
 server
  using the mysql command but not with PHP.
 
  1. How can I debug what the problem is?
  2. Do I need to specify the Port parameter in PHP?
  3. Which mySQL error logs do I examine to help me out - the one on the
 local
  machine or on the remote machine?
  4. And where is the mySQL error logs anyway?
 
  I tried other lists but no help there.  I hope this list helps!
 
  Thanks all,
 
  Floyd Piedad
 
 
  --
  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 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]