php-general Digest 22 Nov 2004 12:37:30 -0000 Issue 3127

Topics (messages 202631 through 202660):

Re: include files, ".php" or ".inc" ?
        202631 by: John Holmes
        202653 by: steve
        202659 by: Marek Kilimajer

Re: images process
        202632 by: edwardspl.ita.org.mo
        202633 by: James Cartledge
        202636 by: Raditha Dissanayake

Re: Tabs or Spaces?
        202634 by: Ryan King
        202635 by: John Holmes

Upload is not working
        202637 by: Michael Leung
        202638 by: Jason Wong

Contract programmer needed
        202639 by: lou5403.cox.net

Code needed
        202640 by: lou5403.cox.net

Upload is still not working
        202641 by: Michael Leung
        202642 by: Jason Wong
        202643 by: Michael Leung
        202645 by: Jason Wong
        202646 by: Michael Leung
        202647 by: Jason Wong

Re: Mysql Connect Help
        202644 by: Manoj Kumar

About xmldoc and ISO-8859-1
        202648 by: Patrick Gelin

Upload is still not working ( More tesitngs)
        202649 by: Michael Leung
        202650 by: Raditha Dissanayake

Re: inline_C installation
        202651 by: Burhan Khalid
        202652 by: Jeffery Fernandez

IE title bug
        202654 by: Giles

Problems running PHP.
        202655 by: Jose Arguello
        202656 by: Jose Arguello
        202657 by: Eakin, W

Re: Timezones
        202658 by: Venelin Arnaudov

perl to php translation tool?
        202660 by: Markus Mayer

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- Perry Jönsson wrote:
Does it make any difference if you include (include/require/include_once/require_once) files with extension ".inc" or ".php"?

It makes no difference as far as PHP is concerned. You're just telling PHP what file to load.


However, .inc files are generally served up as plain text if requested on their own. This means that anyone can view the PHP code (and possibly passwords?) they contain.

So many people will just name them with a .php extension so nothing is returned to the user. This has it's own set of problems because now the files can be run out of context. Depending on your application, this could be a big issue; what if they could bypass your security measures by requesting files on their own?

This is a fairly frequently asked question and the number one suggestion is always to place the files outside of your web root so they can not be requested through a browser at all. PHP can still include them, you just have to provide the correct path. Then you can give them any extension you want.

This isn't always possible or ideal, though and then you have to resort to either naming them with .php extensions (and being aware of the issue discussed above) or relying on an .htaccess file to deny access to any .inc files (so people cannot view/run them out of context). .htaccess is not an entirely portable solution, though, so you have to take that into consideration also.

Good luck with your decision. I personally use .inc.php (for visual reference of which ones are include files) and stay aware of what could happen if these files are run out of context.

--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Graham Cossey wrote:
> If you only have limited control/knowledge of Apache you could adopt
> names something like: script.inc.php
> 
> In such a way PHP will always process the script as it's extension
> is .php and you can easily identify that it is a script to be
> included/required.

FWIW, I use .php for main scripts/pages, and .phtml for includes, as the
latter get processed through PHP too.

-- 
@+
Steve

--- End Message ---
--- Begin Message --- Richard Davey wrote:
Hello Perry,

Sunday, November 21, 2004, 8:02:48 PM, you wrote:

PJ> What it the purpose of the ".inc" file then?

Security - on a properly configured web server a .inc file will never
actually try and compile/execute itself. Whereas a .php one always
will.

Yes, .inc files will show up as they are - php source, db username/password etc. So it's even less secure unless you forbid serving them:


<Files "*.inc">
Order Allow,Deny
Deny from all
</Files>

--- End Message ---
--- Begin Message ---
Sorry,

I need a sample of php program...

Thanks!

Paul Furman wrote:

> You need to set up an apache server & get that running on your windows
> machine in order to run php. Then you go thru IE to view the php script
> & run it that way.
>
> [EMAIL PROTECTED] wrote:
>
> > Yes, I need a sample ( display images with php directly from database )
> > for reference...
> > So, can you help me ?
> >
> > Many thank for your help !
> >
> > Raditha Dissanayake wrote:
> >
> >
> >>[EMAIL PROTECTED] wrote:
> >>
> >>
> >>>So, how can we fix this kind of problem ?
> >>>
> >>>
> >>
> >>is it a problem?
> >>
> >>
> >>>Raditha Dissanayake wrote:
> >>>
> >>>
> >>>
> >>>
> >>>>[EMAIL PROTECTED] wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>Dear You,
> >>>>>
> >>>>>How to load images ( eg: gif, jpg....) with base64 function from
> >>>>>Database on IE directly ?
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>as far as I know you cannot do this with IE directly.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>Is there any samples to me for reference ?
> >>>>>
> >>>>>Many thank for your help !
> >>>>>
> >>>>>Ed.
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>--
> >>>>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

--- End Message ---
--- Begin Message ---
On Mon, 22 Nov 2004 09:13:14 +0800, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Sorry,
> 
> I need a sample of php program...
> 
> Thanks!
> 
> 

Does this help?
<http://www.onlamp.com/pub/a/onlamp/2002/05/09/webdb2.html>
google: php image database

J.

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:

>Sorry,
>
>I need a sample of php program...
>  
>
They are dime a dozen on google.
please trim your posts.

--- End Message ---
--- Begin Message ---
On Nov 21, 2004, at 5:09 PM, Chris Shiflett wrote:

--- Ryan King <[EMAIL PROTECTED]> wrote:
However, when indenting with 3 spaces instead of a single tab,
then your code-size WILL increase, and will include 3x more
"space content" than it used to :)

Who cares?

Just to point out the obvious, if you're not using a compiler cache, size
does matter. Of course, if you're to the point where the difference is
important to you, you're to the point where you should figure out how to
use APC or something. :-)

I agree. I can't imagine that having more whitespace characters in a script will significantly effect the performance of said script. I would guess that there would always be more significant issues to deal with in regards to performance- php compiling and optimizing SQL queries being chief in my mind. Its silly and inefficient (work-wise) to optimize the small issues in programming. Just remember, "Premature optimization is the root of all evil." (Knuth)


-ryan
--- End Message ---
--- Begin Message --- Ryan King wrote:
I agree. I can't imagine that having more whitespace characters in a script will significantly effect the performance of said script. I would guess that there would always be more significant issues to deal with in regards to performance- php compiling and optimizing SQL queries being chief in my mind. Its silly and inefficient (work-wise) to optimize the small issues in programming. Just remember, "Premature optimization is the root of all evil." (Knuth)

Wait... I'm writing an extension to remove spaces and convert double quotes to single and use echo instead of print... are you saying that's silly? Bah!


--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hi all,
   I am implementing a upload file PHP program. The script is not
working. it keeps on generating the permission Error.
I am not very sure this is PHP or Apache problem. But one things I can
sure I changed all upload file dir in 777.

Anyone can help? Or are there any people facing this kind of problem too?

yours,
Michael Leung

--- End Message ---
--- Begin Message ---
On Monday 22 November 2004 10:56, Michael Leung wrote:

>    I am implementing a upload file PHP program. The script is not
> working. it keeps on generating the permission Error.
> I am not very sure this is PHP or Apache problem. But one things I can
> sure I changed all upload file dir in 777.

The user running the apache process (apache or www or nobody or whatever) 
needs execute permissions ('x') on the destination directory (which you 
already have in the form of 777) AND on all its parent directories.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
RADIO SHACK LEVEL II BASIC
READY
>_
*/

--- End Message ---
--- Begin Message --- I am looking for a program, either stand alone or web based, that will allow the user to enter basic shipping information and will return shipping charges from USPS, UPS, FedEx, and DHL.  The application should allow for a hidden % markup/handling function.  The displayed charges will include the markup.  The program will not be used for e-commerce and will not be integrated with any on-line shopping applications.  The program is meant to be used solely to display shipping choices and rates to the actual user.  If web based, the "calculator" will be hosted on a shared site with no other function except to display rate comparisons.  contact [EMAIL PROTECTED] w/any questions and with an estimate and timeline.
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.290 / Virus Database: 265.4.1 - Release Date: 11/19/2004

--- End Message ---
--- Begin Message --- I am looking for a program, either stand alone or web based, that will allow the user to enter basic shipping information and will return shipping charges from USPS, UPS, FedEx, and DHL.  The application should allow for a hidden % markup/handling function.  The displayed charges will include the markup.  The program will not be used for e-commerce and will not be integrated with any on-line shopping applications.  The program is meant to be used solely to display shipping choices and rates to the actual user.  If web based, the "calculator" will be hosted on a shared site with no other function except to display rate comparisons.  contact [EMAIL PROTECTED] w/any questions and with an estimate and timeline.
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.290 / Virus Database: 265.4.1 - Release Date: 11/19/2004

--- End Message ---
--- Begin Message ---
Hi all,
  I have already checked all parent dir are in 777 too.
But this is not working!!!!

Anyone can help me?

yours,
Michael

On Monday 22 November 2004 10:56, Michael Leung wrote:

>    I am implementing a upload file PHP program. The script is not
> working. it keeps on generating the permission Error.
> I am not very sure this is PHP or Apache problem. But one things I can
> sure I changed all upload file dir in 777.

--- End Message ---
--- Begin Message ---
On Monday 22 November 2004 11:25, Michael Leung wrote:

Please do not top post.

>   I have already checked all parent dir are in 777 too.
> But this is not working!!!!

Post some *concise* code that illustrates your problem.

Post the full error message(s) that you get.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Consultant, n.:
 An ordinary man a long way from home.
*/

--- End Message ---
--- Begin Message ---
Hi all,
  I have some problems for upload file script. The script generated a
lot of permission denied error msg. I have changed the upload dir and
its parent dir into 777. I am quite sure I did the permission settings
right.

I have attached the error msg and my testing source code with this email

Anyone can help me .

Thanks!

yours,
Michael

My Error Msg: 

Warning: move_uploaded_file(upload_files/Blue hills.jpg)
[function.move-uploaded-file]: failed to open stream: Permission
denied in /var/www/html/simple_upload.php on line 47

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
move '/tmp/phpvdnBbQ' to 'upload_files/Blue hills.jpg' in
/var/www/html/simple_upload.php on line 47
Somthing is wrong with uploading a file.

My Testing Code:
<?php

$site_name = $_SERVER['HTTP_HOST'];
$url_dir = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
$url_this =  "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];

$upload_dir = 'upload_files/';
$upload_url = $url_dir."upload/";
$message ="";


if ($_FILES['userfile']) {
        $message = do_upload($upload_dir, $upload_url);
}
else {
        $message = "Invalid File Specified.";
}

print $message;

function do_upload($upload_dir, $upload_url) {

        $temp_name = $_FILES['userfile']['tmp_name'];
        $file_name = $_FILES['userfile']['name']; 
        $file_type = $_FILES['userfile']['type']; 
        $file_size = $_FILES['userfile']['size']; 
        $result    = $_FILES['userfile']['error'];
        $file_url  = $upload_url.$file_name;
        $file_path = $upload_dir.$file_name;

        //File Name Check
    if ( $file_name =="") { 
        $message = "Invalid File Name Specified";
        return $message;
    }
    //File Size Check
    else if ( $file_size > 500000) {
        $message = "The file size is over 500K.";
        return $message;
    }
    //File Type Check
    else if ( $file_type == "text/plain" ) {
        $message = "Sorry, You cannot upload any script file" ;
        return $message;
    }

    $result  =  move_uploaded_file($temp_name, $file_path);


    $message = ($result)?"File url <a href=$file_url>$file_url</a>" :
              "Somthing is wrong with uploading a file.";

    return $message;
}
?>
<form name="upload" id="upload" ENCTYPE="multipart/form-data" method="post">
  Upload Image<input type="file" id="userfile" name="userfile">
  <input type="submit" name="upload" value="Upload">
</form>

--- End Message ---
--- Begin Message ---
On Monday 22 November 2004 12:14, Michael Leung wrote:

>   I have some problems for upload file script. The script generated a
> lot of permission denied error msg. I have changed the upload dir and
> its parent dir into 777. I am quite sure I did the permission settings
> right.
>
> I have attached the error msg and my testing source code with this email

> Warning: move_uploaded_file(upload_files/Blue hills.jpg)
> [function.move-uploaded-file]: failed to open stream: Permission
> denied in /var/www/html/simple_upload.php on line 47

Add the following lines to the top of your code and us show the output of:

  if (is_dir('upload_files')) {
    echo ('upload_files is valid a directory');
  } else {
    echo ('upload_files is NOT a directory');
  }
  if (is_writeable('upload_files')) {
    echo ('I am able to write to upload_files');
  } else {
    echo ('I am NOT able to write to upload_files');
  }

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Marriage is not merely sharing the fettucine, but sharing the
burden of finding the fettucine restaurant in the first place.
  -- Calvin Trillin
*/

--- End Message ---
--- Begin Message ---
Hi Jason,
 Thank you for your help. This is the output from PHP script:
"upload_files is valid a directoryI am able to write to upload_files
Warning: move_uploaded_file(upload_files/Water lilies.jpg)
[function.move-uploaded-file]: failed to open stream: Permission
denied in /var/www/html/simple_upload.php on line 58

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
move '/tmp/phpHuSGRK' to 'upload_files/Water lilies.jpg' in
/var/www/html/simple_upload.php on line 58"

Well, this shows upload_files is writeable. Therefore, it should not
be any error in permission setting issues.

yours,
Michael

On Mon, 22 Nov 2004 13:54:28 +0800, Jason Wong <[EMAIL PROTECTED]> wrote:
> On Monday 22 November 2004 12:14, Michael Leung wrote:
>
>
>
> >   I have some problems for upload file script. The script generated a
> > lot of permission denied error msg. I have changed the upload dir and
> > its parent dir into 777. I am quite sure I did the permission settings
> > right.
> >
> > I have attached the error msg and my testing source code with this email
>
> > Warning: move_uploaded_file(upload_files/Blue hills.jpg)
> > [function.move-uploaded-file]: failed to open stream: Permission
> > denied in /var/www/html/simple_upload.php on line 47
>
> Add the following lines to the top of your code and us show the output of:
>
>   if (is_dir('upload_files')) {
>     echo ('upload_files is valid a directory');
>   } else {
>     echo ('upload_files is NOT a directory');
>   }
>   if (is_writeable('upload_files')) {
>     echo ('I am able to write to upload_files');
>   } else {
>     echo ('I am NOT able to write to upload_files');
>   }
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> Marriage is not merely sharing the fettucine, but sharing the
> burden of finding the fettucine restaurant in the first place.
>   -- Calvin Trillin
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Monday 22 November 2004 14:01, Michael Leung wrote:

Please do not top post.

>  Thank you for your help. This is the output from PHP script:
> "upload_files is valid a directoryI am able to write to upload_files
> Warning: move_uploaded_file(upload_files/Water lilies.jpg)
> [function.move-uploaded-file]: failed to open stream: Permission
> denied in /var/www/html/simple_upload.php on line 58
>
> Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
> move '/tmp/phpHuSGRK' to 'upload_files/Water lilies.jpg' in
> /var/www/html/simple_upload.php on line 58"
>
> Well, this shows upload_files is writeable. Therefore, it should not
> be any error in permission setting issues.

Add these following tests to the top of your code:

    error_reporting(E_ALL);
    ini_set('display_errors', TRUE);   

    if (is_readable($_FILES['userfile']['tmp_name'])) {
        echo "I can read " . $_FILES['userfile']['tmp_name'];
    }

    if ($fp0 = fopen('upload/doodah', 'w')) {
        echo 'I can open upload/doodah for writing';
    }

    if ($fp1 = fopen('upload/' . $_FILES['userfile']['name'], 'w')) {
        echo 'I can open upload/' . $_FILES['userfile']['name'] . ' for 
writing';
    }

Also what is your safe_mode setting? Usually when something fails because of 
safe_mode setting the error would explicitly say it failed because of 
safe_mode setting.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If you wish to succeed, consult three old people.
*/

--- End Message ---
--- Begin Message ---
 

 You should enable php_mysql module in your php.ini file.

-- Manoj Kr. Sheoran  

-----Original Message-----
From: Nathan Mealey [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 21, 2004 10:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Mysql Connect Help

A seemingly simple problem, still confounding me.

The following line of code:
mysql_connect('database','user','password'); [with values of course]

Generates the following error:
Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/phptest.php on line 3

My PHP info page says that PHP (4.3) was compiled with MySQL, and
extensions_dir is correct (although the extensions_dir itself is empty, but
I don't know if this matters).  So PHP itself is working.

I installed MySQL 4.1 from RPM (client and server RPMs) on Redhat 8.0 this
morning.

Thanks for any help,
Nathan
--
Nathan Mealey
Director of Operations
Cycle-Smart, Inc.
P.O. Box 1482
Northampton, MA
01061-1482
[EMAIL PROTECTED]
(413) 587-3133
(413) 210-7984 Mobile
(512) 681-7043 Fax

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

--- End Message ---
--- Begin Message ---
Hi,

I'm trying to make DRES project (http://sourceforge.net/projects/dres/)
compliant with ISO-8859-1.  I'm not using mbstring into my windows 2000
server, I know there is problem with Internet Explorer browser...

I saw DRES it use 'xmldoc' API  into the file xmlutil.php. But this fonction
seems not to be in use at this time. By the way I can't find any
documentation about UTF-8, ISO-8859-1 and so about XMLDOM API.

What I saw it's when I save a formula with DRES, it register a XML file, and
the content is:

<?xml version="1.0"?>
<requirement identifier="aaaaaaaa" name="&#xE0;&#xE0;&#xE0;&#xE0;"
priority="high" status="draft"><revision date="2004-11-19 13:14:45"
label=""><author id="gelinp">Patrick
Gelin</author><comment></comment></revision><description>&#x9A69;</descripti
on></requirement>

The name filed was originaly:

name='àààà'

I don't know if it's UTF-8 or ISO-8859-1 format.

When the formula refresh it show:

name='Ã Ã Ã Ã '

Where does this come from? Is it a problem with XMLDOM API? How to correct
this?

Thank.

--- End Message ---
--- Begin Message ---
Hi All,
 I did more testes

I have added the followings code into my script
    error_reporting(E_ALL);
   ini_set('display_errors', TRUE);

   if (is_readable($_FILES['userfile']['tmp_name'])) {
       echo "I can read " . $_FILES['userfile']['tmp_name'];
   }

   if ($fp0 = fopen('upload_files/doodah', 'w')) {
       echo 'I can open upload/doodah for writing';
   }

   if ($fp1 = fopen('upload_files/' . $_FILES['userfile']['name'], 'w')) {
       echo 'I can open upload_files/' . $_FILES['userfile']['name'] . ' for
writing';
   }

 if (is_dir('upload_files')) {
   echo ('upload_files is valid a directory');
 } else {
   echo ('upload_files is NOT a directory');
 }
 if (is_writeable('upload_files')) {
   echo ('I am able to write to upload_files');
 } else {
   echo ('I am NOT able to write to upload_files');
 }



My Error Msg:
  I can read /tmp/phphRiKeP
Warning: fopen(upload_files/doodah) [function.fopen]: failed to open
stream: Permission denied in /var/www/html/simple_upload.php on line
18

Warning: fopen(upload_files/Water lilies.jpg) [function.fopen]: failed
to open stream: Permission denied in /var/www/html/simple_upload.php
on line 22
upload_files is valid a directoryI am able to write to upload_files


This is very strange. upload_files is writeable, but can't write by
fopen('upload_files/doodah', 'w')

yours,
Michael Leung

--- End Message ---
--- Begin Message ---
Michael Leung wrote:

My Error Msg:
 I can read /tmp/phphRiKeP
Warning: fopen(upload_files/doodah) [function.fopen]: failed to open
stream: Permission denied in /var/www/html/simple_upload.php on line
18

Warning: fopen(upload_files/Water lilies.jpg) [function.fopen]: failed
to open stream: Permission denied in /var/www/html/simple_upload.php
on line 22
upload_files is valid a directoryI am able to write to upload_files


This is very strange. upload_files is writeable, but can't write by
fopen('upload_files/doodah', 'w')


Nothing strange about that it may be writable by the owner but not by others. Besides that as jason as already pointed out you may be running in safe mode. Other than that, the file upload page on php.net has a wealth of information posted by others like you who had trouble with their uploads, you are sure to find a usefull comment there.


-- Raditha Dissanayake http://www.radinks.com/upload/ - Drag and Drop File Upload

yours,
Michael Leung




--- End Message ---
--- Begin Message --- Rayan Lahoud wrote:
Does anybody knows how to install a pear package. i have the inline_C package that i want to install and use. And can i have some sample functions using this package?

pear install Inline_C -- that's it.

You don't need to restart Apache, or load any modules. To find out examples on usage, try checking the pear repository.

hth,
Burhan

--- End Message ---
--- Begin Message ---
Burhan Khalid wrote:

Rayan Lahoud wrote:

Does anybody knows how to install a pear package. i have the inline_C package that i want to install and use. And can i have some sample functions using this package?


pear install Inline_C -- that's it.

You don't need to restart Apache, or load any modules. To find out examples on usage, try checking the pear repository.

hth,
Burhan

maybe try:

pear install -f Inline_C

as its not stable yet

Jeffery
--- End Message ---
--- Begin Message ---
Hello people

 

I am making a movie browsing site. On one page I have a list of movies as
links. When you click on the movie it goes to another page with the movie ID
as an anchor in the page so that the browser scrolls to that movie. 

 

The title of the page is made up of the movie category name and the movie
name. This all works fine in mozilla but in IE the title appears like this:

 

Site Name - Category Name#3037#3037#3037#3037#3037#3037#3037#3037

 

Where #3037 is the ID of the movie and obviously appears at the end of the
url. Looking at the source of the page the <title> tag is fine and does not
contain any id's (or it would appear in mozilla as well).

Also the title appears ok to begin with - the page has flash thumbnails of
the movies in and as each of these swf's load into the page another  #3037
appears in the title. We are using the satay method of flash embedding as
this is required by the client. Possibly it is something to do with that?

 

Anyone seen anything like this before or have any suggestions?

 

Thanks

 

 

Giles Roadnight

http://giles.roadnight.name

 


--- End Message ---
--- Begin Message ---
I just install in my computer PHP 5.0.2, I followed
the instruction on the book PHP and MySql Web
Development by Luke Welling and Laura Thomson.
But, it is not working. I have tried to use this
codes, one is just a html form and the other is a php
code. I tried to pass the values from the form to the
php code but it is not getting the values.

HTML Form:
 
 <form action="proccessorder.php" method="GET">
 <table border="0">
 <tr bgcolor="#cccccc">
          <td width="150">Item</td>
          <td width="15">Quantity</td>
 </tr>
 <tr>
          <td>Tires</td>
          <td align="center"><input type="text"
 name="tireqty" size="3"
                maxlenght="3" /></td>
 </tr>
 <tr>
          <td>Oil</td>
          <td aling="center"><div align="center">
           <input type="text" name="oilqty" size="3"
                maxlenght="3" />
         </div></td>
 </tr>
 <tr>
          <td>Spark Plugs</td>
          <td aling="center"><div align="center">
           <input type="text" name="sparkqty" size="3"
                maxlenght="3" />
         </div></td>
 </tr>
 <tr>
          <td colspan="2" align="center"><input
 type="submit" value="Submit Order" /></td>
 </tr>
 </table>
 </form>
 
 Php Code:
 
 <?php
        // variables para capturar desde la orderform
        $tireqty = $HTTP_GET_VARS['tireqty'];
        $oilqty = $HTTP_GET_VARS['oilqty'];
        $sparkqty = $HTTP_GET_VARS['sparkqty'];
 ?>
 
 <html>
    <head>
       <title>Bob's Auto Parts - Order Results</title>
    </head>
    <body>
      <h1>Bob's Auto Parts</h1>
      <h2>Order Results</h2>
      <?php
                echo '<p>Order pordessed at ';
                echo date('H:i, jS F');
                echo '</p>';
                
                echo '<p>Your order is as follows: </p>';
                echo $tireqty.' tires<br />';
                echo $oilqty.' bottles of oil<br />';
                echo $sparkqty.' spark plugs<br />';
      ?>
    </body>
 </html>
 
 
 I am sure that this code works because I tried it on
a server who is running php 4.0, I know that in php
 5.0.2, I can use $_POST and $_GET instead of
 $HTTP_GET_VARS or $HTTP_POST_VARS. But, I have tried
 them and they are not working.
 So, I hope you can help me to fix it, because I
really want to learn how to program with PHP.
 
 Best Regards,
                  Jose


                
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 

--- End Message ---
--- Begin Message ---
Note: forwarded message attached.



                
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 
--- Begin Message ---
Hi Jose,

Since your report is not about the php.net website, this is not the right address to send it. Please consult [EMAIL PROTECTED] for support questions.

Regards,
Gabor Hojtsy

Jose Arguello írta:
I just install in my computer PHP 5.0.2, I followed
the instruction on the book PHP and MySql Web
Development by Luke Welling and Laura Thomson.
But, it is not working. I have tried to use this
codes, one is just a html form and the other is a php
code. I tried to pass the values from the form to the
php code but it is not getting the values.

HTML Form:

<form action="proccessorder.php" method="GET">
<table border="0">
<tr bgcolor="#cccccc">
         <td width="150">Item</td>
         <td width="15">Quantity</td>
</tr>
<tr>
         <td>Tires</td>
         <td align="center"><input type="text"
name="tireqty" size="3"
                maxlenght="3" /></td>
</tr>
<tr>
         <td>Oil</td>
         <td aling="center"><div align="center">
          <input type="text" name="oilqty" size="3"
                maxlenght="3" />
        </div></td>
</tr>
<tr>
         <td>Spark Plugs</td>
         <td aling="center"><div align="center">
          <input type="text" name="sparkqty" size="3"
                maxlenght="3" />
        </div></td>
</tr>
<tr>
         <td colspan="2" align="center"><input
type="submit" value="Submit Order" /></td>
</tr>
</table>
</form>

Php Code:

<?php
        // variables para capturar desde la orderform
        $tireqty = $HTTP_GET_VARS['tireqty'];
        $oilqty = $HTTP_GET_VARS['oilqty'];
        $sparkqty = $HTTP_GET_VARS['sparkqty'];
?>

<html>
   <head>
      <title>Bob's Auto Parts - Order Results</title>
   </head>
   <body>
     <h1>Bob's Auto Parts</h1>
     <h2>Order Results</h2>
     <?php
                echo '<p>Order pordessed at ';
                echo date('H:i, jS F');
                echo '</p>';
                
                echo '<p>Your order is as follows: </p>';
                echo $tireqty.' tires<br />';
                echo $oilqty.' bottles of oil<br />';
                echo $sparkqty.' spark plugs<br />';
     ?>
   </body>
</html>


I am sure that this code works because I tried it on a server who is running php 4.0, I know that in php 5.0.2, I can use $_POST and $_GET instead of $HTTP_GET_VARS or $HTTP_POST_VARS. But, I have tried them and they are not working. So, I hope you can help me to fix it, because I really want to learn how to program with PHP.

Best Regards,
                 Jose



__________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com




--- End Message ---

--- End Message ---
--- Begin Message ---
<snip>


<?php // variables para capturar desde la orderform $tireqty = $HTTP_GET_VARS['tireqty']; $oilqty = $HTTP_GET_VARS['oilqty']; $sparkqty = $HTTP_GET_VARS['sparkqty']; ?>



</snip>
<snip>



I am sure that this code works because I tried it on
a server who is running php 4.0, I know that in php
5.0.2, I can use $_POST and $_GET instead of
$HTTP_GET_VARS or $HTTP_POST_VARS. But, I have tried
them and they are not working.
So, I hope you can help me to fix it, because I
really want to learn how to program with PHP.

Best Regards,
Jose


</snip>

Hello Jose,
You may have already tried this, but have you checked your php.ini file to see if you have


register_globals = Off

If you don't, change it to 'Off', and try your code again.

William
--- End Message ---
--- Begin Message ---
Hi Trevor,

I have list of Timezones (see the attachment) but I do not know the offset in respect of GMT. Then I will be able to calculate my local time for every user local input.

I would like to know which PHP date/time functions operate with the system time alone and which one take the timezone into consideration. When in the function description is mentioned "local time" what does this mean? User local or system local?

Kindest regards,
Venelin

Gryffyn, Trevor wrote:

Don't know if this helps, but this was a message regarding Windows based
long timezone formats that was posted a little while ago by another
user:


--------------------------------------- Kim [EMAIL PROTECTED] Managed to find it !!!! It helps using just those right keywords after a million goes.... http://www.steltor.com/notes/corptime-server/5_4/refmanual/refappd.htm this is a list of all timezone notations. Thanks for your help. Thought about the long way but it was not a pleasant thought as you may imagine, was hoping to avoid at all costs. Hopefully this sorts it. ---------------------------------------


You might want to build a table or a list in some way that'll return the GMT offset for you.

Let us know what you end up doing.

-TG



-----Original Message-----
From: Venelin Arnaudov [mailto:[EMAIL PROTECTED] Sent: Friday, November 19, 2004 6:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Timezones



Hi,

I have a legacy PHP3 system and a MySQL DB with two tables:
user {
user_id int,
timezone varchar (like "Europe/Brussels", "US/Eastern", "America/New_York", etc.)
}
and
messages {
msg_id int,
user_id int,
date int
}


When a user submits a message, my PHP script (using time() function) stores the submission time in messages.date field. However this value is not the server's system time but shifted according the users timezone.

1. How can I convert it to reflect my timezone (ex. GMT)? Is there a way to find the offset between two timezones given in long format as in my table?
2. I would appreciate any information on how the PHP/Apache handles the timezone offset when calculating the time. Which of the PHP date/time functions take into consideration the environment variable TZ (upon user login there is putenv('TZ='.user_get_timezone()); command)?


Thank you in advance,
Venelin

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








--- End Message ---
--- Begin Message ---
Hello everyone!

I've searched for a tool that would translate, or at least mostly translate, 
perl scripts into php, unfortunately with no success.  I didn't even find a 
reference in the archives of this list to this subject, which surprises me.  
Does anyone know of any tool that can handle this type of thing?

regards
Markus

--- End Message ---

Reply via email to