RE: [PHP] Forum coded in PHP with mail and news gateway

2008-06-12 Thread Arno Kuhl
Not sure about the gateways but you can look at www.phpbb.com


-Original Message-
From: Michelle Konzack [mailto:[EMAIL PROTECTED] 
Sent: 11 June 2008 04:52
To: PHP - General
Subject: [PHP] Forum coded in PHP with mail and news gateway

Hello,

because it is actual for me while having  some  problems  with  Ubuntu's
LAUNCHPAD (does not support threating) I like to know, whether there  is a
light Forum software written in PHP availlable.

It should support:

1)  PostgreSQL  (my own database)
2)  MySQL   (my current hosting provider offer it only)
3)  Threating
4)  Gateway to mailinglist including threating
5)  Gateway to usenet including threating
6)  Subscriber only
7)  Scanning for SPAM  :-D

I like to install it on my devel website  and  have  the  need  for  a
category for each software package I have.  So it is  not  a  big  thing
with currently 61 packages bu maybe increase to arround 150.

My current mailinglist software is courier-mlm which works nicely.

Any suggestions?

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
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
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


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



Re: [PHP] class? package?

2008-06-12 Thread Iv Ray

Shelley wrote:

Probably you have noticed this:
The classes in a package are reused together. If you reuse one of the 
classes in a package, you reuse them all. 


If that's the case, then why not just use one class as one package?
What's the point of splitting a package into several classes? :-(


I think somebody already answered.

It is actually up to you.

My grandmother used to write letters starting with a capital letter, 
writing the whole letter as one long sentence and ending with a dot. 
This would perhaps confuse most high school teachers, but in her case it 
somehow worked :)


If we take this worn out example - if you have a class dog and a class 
cat - it becomes quite clear why you need several classes. You can put 
them in a package called animals - but as other people already noted, 
the packages in php have only a symbolic role, just for clarity of 
code organization.


Iv

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



Re: [PHP] regular expression to find body text in mobile

2008-06-12 Thread Yui Hiroaki
The server recieve email from mobile phone.
I would like to retrieve the text of body of mobile phone, which recieve
email from mobile phone email.

Of cource, server run php and is able to use regular expression.
But the email, which is recieved by mobile phone, retrieve text body
on server.


Regards,
Yui

2008/6/12 Nitsan Bin-Nun [EMAIL PROTECTED]:
 I'm confused.
 PHP runs on the server, so it shouldn't be a problem at all to run regex
 search/reaplce/match/whatever on mobile phone internet, maybe you are
 talking on JS regex?

 Nitsan


 On 11/06/2008, Yui Hiroaki [EMAIL PROTECTED] wrote:

 Doese any know how to find text in mobile using Regular Expression?
 I am using php.

 Regards,
 Yui

 --
 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] Re: Forum coded in PHP with mail and news gateway

2008-06-12 Thread Colin Guthrie

Michelle Konzack wrote:

It should support:

1)  PostgreSQL  (my own database)
2)  MySQL   (my current hosting provider offer it only)
3)  Threating

  ^
I don't think you'll have to search too far to find some old code with a 
very high level of threat..


:p

Col


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



[PHP] Redirect after pdf / file download

2008-06-12 Thread Yashesh Bhatia
Hello:

I'm trying to emulate a problem i'm trying to solve as follows.

1 - user enters information into a html form and submits
2 - a php script is invoked on the submit and a pdf file is stamped
and made available for download
3 - the script finally redirects the user to a thank you html page.

i'm having a problem in the redirect to the thank you page.
here's the 3 files
   1.html 
htmlbody
form action=2.php method=post
  First Name: input type=text name=firstname /
  Last Name:  input type=text name=lastname /
 input type=submit /
/form
/body/html

 2.php 
?php
// some stamping code ...
// open the file in a binary mode
$name = 2.pdf;
fp = fopen($name, 'rb');

// send headers, dump the pdf file and finally redirect
header(Content-Type: application/pdf);
header(Content-Disposition: attachment; filename=$name);
header(Content-Length:  . filesize($name));
fpassthru($fp);

echo 'script type=text/javascript';
echo 'window.location.href=3.html;';
echo '/script';
?

 3.html 
htmlbody
Thank you for downloading 2.pdf
/body/html


The submit works fine and the pdf is availble for download however,
the redirect does not happen.
If i comment the lines
//header(Content-Type: application/pdf);
//header(Content-Disposition: attachment; filename=$name);
//header(Content-Length:  . filesize($name));
//fpassthru($fp);

then the redirect happens after the submit.

i'm testing / running it on fedora core 6, Apache 2.2.5, php 5.2.5 and
firefox 1.5
Any help / pointers is appreciated.

Thanks.

Yashesh Bhatia.

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



Re: [PHP] Redirect after pdf / file download

2008-06-12 Thread Aschwin Wesselius

Yashesh Bhatia wrote:

Hello:

I'm trying to emulate a problem i'm trying to solve as follows.

1 - user enters information into a html form and submits
2 - a php script is invoked on the submit and a pdf file is stamped
and made available for download
3 - the script finally redirects the user to a thank you html page.

i'm having a problem in the redirect to the thank you page.
here's the 3 files
   1.html 
htmlbody
form action=2.php method=post
  First Name: input type=text name=firstname /
  Last Name:  input type=text name=lastname /
 input type=submit /
/form
/body/html

 2.php 
?php
// some stamping code ...
// open the file in a binary mode
$name = 2.pdf;
fp = fopen($name, 'rb');

// send headers, dump the pdf file and finally redirect
header(Content-Type: application/pdf);
header(Content-Disposition: attachment; filename=$name);
header(Content-Length:  . filesize($name));
fpassthru($fp);

echo 'script type=text/javascript';
echo 'window.location.href=3.html;';
echo '/script';
?

 3.html 
htmlbody
Thank you for downloading 2.pdf
/body/html


The submit works fine and the pdf is availble for download however,
the redirect does not happen.
If i comment the lines
//header(Content-Type: application/pdf);
//header(Content-Disposition: attachment; filename=$name);
//header(Content-Length:  . filesize($name));
//fpassthru($fp);

then the redirect happens after the submit.

i'm testing / running it on fedora core 6, Apache 2.2.5, php 5.2.5 and
firefox 1.5
Any help / pointers is appreciated.

Thanks.

Yashesh Bhatia.
  


Hi,

What you are doing is:

header(Content-Type: application/pdf);


And after that you try to echo some script. But the browser already 
thinks that belongs to the PDF and not to a HTML page.


What I think should work instead of the script part is just:

header('Location: 3.html');
exit;

But I'm not sure it works.

--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other'/


[PHP] HTML 5

2008-06-12 Thread Richard Heyes

This may be of interest (HTML 5 diffences to HTML 4 overview):

http://www.w3.org/TR/2008/WD-html5-diff-20080610/

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| Access SSH with a Windows mapped drive |
|http://www.phpguru.org/sftpdrive|
++

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



Re: [PHP] Redirect after pdf / file download

2008-06-12 Thread Yashesh Bhatia
Aschwin:

 Hi i tried

--
//echo 'script type=text/javascript';
//echo 'window.location.href=3.html;';
//echo '/script';
header(Location: 3.html);
exit;
--
but that did not work :(.

thanks for the tip.

yashesh bhatia


 Hi,

 What you are doing is:

 header(Content-Type: application/pdf);

 And after that you try to echo some script. But the browser already thinks
 that belongs to the PDF and not to a HTML page.

 What I think should work instead of the script part is just:

 header('Location: 3.html');
 exit;

 But I'm not sure it works.

 --

 Aschwin Wesselius

 'What you would like to be done to you, do that to the other'


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



RE: [PHP] PHP Runs But Does Not Display on Linux

2008-06-12 Thread Wei, Alice J.
Hi,

  I am assuming that once I install apache, (since now I am assuming that with 
a Linux box, I don't need to install PHP), then this would be a web server with 
a IP address. I could use something like ipconfig or ifconfig in my case to 
find the ip address, which I tried to use yum before to retrieve the 
information, but I still could not read anything from PHP.

  What I keep having trouble figuring out is, when I installed apache and try 
to get even something like ?php echo Hello; ? to show up on the page failed 
me with only a blank screen. But since you mentioned that I have to install 
another package, and I am assuming that I can download it from somewhere, this 
is something I can try. Where did you get your package from?

Alice

-Original Message-
From: DeadTOm [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2008 11:15 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

With localhost I was assuming that the files resided on your local
machine, my bad. How are you accessing these files? The location you are
getting them from has to be running a web server of some kind with php
or the php scripts will not run and you'll only see the html output as
you described.
I run a linux server with apache2, php and mysql and I believe that the
purpose of the php5-mysql package is to add files that define those
mysql function calls. I'm sure that there is something similar for mssql.

-Allen

Wei, Alice J. wrote:
 Hi,

 -Original Message-
 From: DeadTOm [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 11, 2008 10:58 PM
 To: Wei, Alice J.
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

 OK, I see now.
 When you open the script from your browser are you accessing it via a
 server like Http://localhost/some/file.php or are you just opening a php
 file on your hard drive? I'm guessing you're accessing it on the hard
 drive directly, which will not work since PHP scripts are executed
 server side. So you will need to install apache2 with php.
 As far as the mssql_connect error goes, the same rule applies. You need
 to have the proper php module installed to define for php what the
 mssql_connect function does, otherwise php doesn't know what it is and
 yells at you for not defining the function.

 -Allen

 Thanks for clarifying the first point, and that is probably why.
 As for the second point, according to 
 http://us.php.net/manual/en/function.mssql-connect.php, isn't mssql_connect 
 defined already as something internal within PHP? Or, am I missing something 
 here?

 Plus, I connect this not to the localhost, but to a different Windows 
 machine, so does this mean that I have to install it? One of the members on 
 the list suggested something from http://www.freetds.org/, if this is 
 something I have to install, I will definitely give it a shot.

 Alice


 Wei, Alice J. wrote:

 Hi,

For testing purpose, I have something like

html
 headtitleTest/title
body
pThis is test/p
 ?php echo Hello!; ?
/body
 /html

   I see the following from the command prompt when I execute the above 
 script:

html
 headtitleTest/title
body
pThis is test/pHello
/body
 /html

   On the browser, I only see:

 html
 headtitleTest/title
body
pThis is test/p
  /body
 /html

   I just realized that the mysql_connect error is a typo, I should have 
 typed mssql_connect. I call this from a different machine, so I shouldn't 
 get this kind of error even if I don't have it installed, right? Or, am I 
 missing something here?

 Alice

 -Original Message-
 From: DeadTOm [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 11, 2008 10:46 PM
 To: Wei, Alice J.
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

  Otherwise, it consistently gives me errors Call to undefined
 function: mysql_connect()If you're getting an error...

 If you're getting this error, there is a line of code in the php script
 that is trying to connect to a mysql database and the mysql extension
 for php is not installed. So php doesn't know this function is supposed
 to do hence, the undefined function error.

  I can only see the HTML code of the php functions I call within the
 code at the command output in text format, but I cannot see it on the
 browser.

 I'm a little confused about what you mean here. You shouldn't see any
 HTML code in your browser.

 Wei, Alice J. wrote:


 Hi,

   I have originally commented out all the MS SQL lines in the php.ini files 
 so that it supports MS SQL, but that does not seem to work. MySQL? Since I 
 am not using that to connect my PHP to, do I still need to install it? By 
 the way, my Microsoft SQL server database is on a different Windows machine.

 Alice

 -Original Message-
 From: DeadTOm [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 11, 2008 10:29 PM
 To: Wei, 

[PHP] PHP connection to external application

2008-06-12 Thread hce
Hi,

What is the best way for a PHP web application to connect to an
external application written by C in Linux OS?

(1) Can PHP directly call external C functions, or similar solution?

(2) Can PHP pass messages to message queue which external C program can access?

(3) Socket connection between the PHP and externam C program.

Thank you.

Kind Regards,

Jim

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



Re: [PHP] Redirect after pdf / file download

2008-06-12 Thread Steven Macintyre
On Thu, 2008-06-12 at 16:27 +0530, Yashesh Bhatia wrote:
 Aschwin:
 
  Hi i tried
 
 --
 //echo 'script type=text/javascript';
 //echo 'window.location.href=3.html;';
 //echo '/script';
 header(Location: 3.html);
 exit;
 --
 but that did not work :(.
 
 thanks for the tip.
 
 yashesh bhatia

What about doing it the other way ... submitting the page to a script
that calls on the pdf creation, yet doesnt leave this script - then
proceed to redirect when that script (pdf) has been completed?

S


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



Re: [PHP] PHP connection to external application

2008-06-12 Thread Steven Macintyre

On Thu, 2008-06-12 at 21:20 +1000, hce wrote:
 Hi,
 
 What is the best way for a PHP web application to connect to an
 external application written by C in Linux OS?
 
 (1) Can PHP directly call external C functions, or similar solution?
 
 (2) Can PHP pass messages to message queue which external C program can 
 access?
 
 (3) Socket connection between the PHP and externam C program.
 
 Thank you.
 

If that C program can support SOAP calls ... then that will probably be
the best route for you


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



Re: [PHP] PHP connection to external application

2008-06-12 Thread Stut

On 12 Jun 2008, at 12:20, hce wrote:

What is the best way for a PHP web application to connect to an
external application written by C in Linux OS?

(1) Can PHP directly call external C functions, or similar solution?


No, but you can wrap the C functions in a PHP extension.

(2) Can PHP pass messages to message queue which external C program  
can access?


Depends on the implementation of the queue, but the answer is almost  
certainly yes.



(3) Socket connection between the PHP and externam C program.


This would usually be my preferred choice unless there is a particular  
reason to avoid this in which case I would go down the PHP extension  
route.


A lot will depend on what the C code is doing and how your PHP scripts  
will interact with it.


-Stut

--
http://stut.net/

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



Re: [PHP] Redirect after pdf / file download

2008-06-12 Thread Yashesh Bhatia

 What about doing it the other way ... submitting the page to a script
 that calls on the pdf creation, yet doesnt leave this script - then
 proceed to redirect when that script (pdf) has been completed?

 S


steven:

 the steps u'r suggesting are
1 - submit form (1.html) to script (2.php)
2 - 2.php generates the pdf but does not give it for download
3 - after generating the pdf , 2.php then redirects to 3.html..

so where does the download happen ? in 3.html ?

thx.

yashesh

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



Re: [PHP] PHP connection to external application

2008-06-12 Thread Per Jessen
hce wrote:

 What is the best way for a PHP web application to connect to an
 external application written by C in Linux OS?
 
 (1) Can PHP directly call external C functions, or similar solution?

PHP can call external executables via e.g. exec().

 (2) Can PHP pass messages to message queue which external C program
 can access?

PHP can write to a FIFO / pipe. 

 (3) Socket connection between the PHP and externam C program.

Yes, that works too.


What is the best depends on your requirements.


/Per Jessen, Zürich


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



Re: [PHP] HTML 5

2008-06-12 Thread Pavel
В сообщении от Thursday 12 June 2008 16:43:59 Richard Heyes написал(а):
 This may be of interest (HTML 5 diffences to HTML 4 overview):

what about xHTML? html died few years ago and i thought is was official..

//sorry for my english


-- 
===
С уважением, Манылов Павел aka [R-k]
icq: 949-388-0
mailto:[EMAIL PROTECTED]
===
А ещё говорят так:
If there were a school for, say, sheet metal workers, that after three
years left its graduates as unprepared for their careers as does law
school, it would be closed down in a minute, and no doubt by lawyers.
-- Michael Levin, The Socratic Method
[fortune]


[PHP] UK PHP Host/Developer Required

2008-06-12 Thread Colin Sidwell

Hi,

We are looking for someone to develop  host a PHP site in the UK.

The site is a corporate rewards site that enables users to buy gifts
with with points they have been given by their employer.

URL is here-

http://www.waystoamaze.co.uk/

There are databases of users, companies, products and categories.

An admin section allows for product and user updating etc.

Interested parties should contact the client directly on +44 7970 461
295 or email [EMAIL PROTECTED]

Regards,

Colin Sidwell


http://www.idealinternet.co.uk/




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



Re: [PHP] UK PHP Host/Developer Required OT

2008-06-12 Thread tedd

Off-Topic

At 1:46 PM +0100 6/12/08, Colin Sidwell wrote:

Hi,

We are looking for someone to develop  host a PHP site in the UK.



For sake of discussion -- why would one want to be specific about 
hosting in the UK? Why not just hosting, regardless of where the host 
is located?


After all, hopefully the site will be accessible globally, right? So, 
why the need for a specific geographical location for a host?


Are there UK laws that require businesses to be totally self-contain 
within the UK? Or, is this just a limitation of management to 
understand what the net is?


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] UK PHP Host/Developer Required OT

2008-06-12 Thread Richard Heyes

We are looking for someone to develop  host a PHP site in the UK.


For sake of discussion -- why would one want to be specific about 
hosting in the UK? Why not just hosting, regardless of where the host is 
located?


Speed (eg. response time). Technical support hours etc.


After all, hopefully the site will be accessible globally, right?


The site may be only pertinent to a specific locallity. For example I 
used to work for an online film rental firm, who only supplied to the UK.


Are there UK laws that require businesses to be totally self-contain 
within the UK?


Not at all.

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| Access SSH with a Windows mapped drive |
|http://www.phpguru.org/sftpdrive|
++

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



Re: [PHP] Redirect after pdf / file download

2008-06-12 Thread Bastien Koert
On Thu, Jun 12, 2008 at 7:46 AM, Yashesh Bhatia [EMAIL PROTECTED] wrote:

 
  What about doing it the other way ... submitting the page to a script
  that calls on the pdf creation, yet doesnt leave this script - then
  proceed to redirect when that script (pdf) has been completed?
 
  S
 

 steven:

 the steps u'r suggesting are
 1 - submit form (1.html) to script (2.php)
 2 - 2.php generates the pdf but does not give it for download
 3 - after generating the pdf , 2.php then redirects to 3.html..

 so where does the download happen ? in 3.html ?

 thx.

 yashesh

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

 Force the download thru a new window or a frame inside the main window.
Then you can redirect the main window to where you need it


-- 

Bastien

Cat, the other other white meat


Re: [PHP] Re: Forum coded in PHP with mail and news gateway

2008-06-12 Thread Bastien Koert
On Thu, Jun 12, 2008 at 5:05 AM, Colin Guthrie [EMAIL PROTECTED] wrote:

 Michelle Konzack wrote:

 It should support:

 1)  PostgreSQL  (my own database)
 2)  MySQL   (my current hosting provider offer it only)
 3)  Threating

  ^
 I don't think you'll have to search too far to find some old code with a
 very high level of threat..

 :p

 Col



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

 PHP does not support threading AFIAK.


-- 

Bastien

Cat, the other other white meat


[PHP] Re: HTML 5

2008-06-12 Thread Colin Guthrie

Pavel wrote:

В сообщении от Thursday 12 June 2008 16:43:59 Richard Heyes написал(а):

This may be of interest (HTML 5 diffences to HTML 4 overview):


what about xHTML? html died few years ago and i thought is was official..


Oh there are *lots* of discussions about that. Personally I'm sticking 
with XHTML.


Col


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



Re: [PHP] UK PHP Host/Developer Required

2008-06-12 Thread Colin Sidwell

2 reasons-

1. Google and other search engines return local results and the clients 
will all be in the UK


2. It's useful if the host company and the client keep the same office 
hours.


Regards,

Colin


Colin Sidwell wrote:

Hi,

We are looking for someone to develop  host a PHP site in the UK.

The site is a corporate rewards site that enables users to buy gifts
with with points they have been given by their employer.

URL is here-

http://www.waystoamaze.co.uk/

There are databases of users, companies, products and categories.

An admin section allows for product and user updating etc.

Interested parties should contact the client directly on +44 7970 461
295 or email [EMAIL PROTECTED]

Regards,

Colin Sidwell


http://www.idealinternet.co.uk/






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



Re: [PHP] UK PHP Host/Developer Required OT

2008-06-12 Thread Per Jessen
tedd wrote:

 For sake of discussion -- why would one want to be specific about
 hosting in the UK? Why not just hosting, regardless of where the host
 is located?
 
 After all, hopefully the site will be accessible globally, right? So,
 why the need for a specific geographical location for a host?

Local clients quite often have much better connectivity to a local host.

 Are there UK laws that require businesses to be totally self-contain
 within the UK? Or, is this just a limitation of management to
 understand what the net is?

I don't know about the UK, but Swiss banking legislation does have
clauses about the location of data processing equipment.


/Per Jessen, Zürich


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



Re: [PHP] error Failed opening for inclusion

2008-06-12 Thread Lou Baccari


Hello,

Sorry to brother you but I'm really in a pinch with this problem and I 
need to resolve it.


The older Fedora Apache server runs just fine with DocumentRoot 
pointing to the NFS share. The NFS share is on our OS X file server. The 
new CentOS runs fine when DocumentRoot is pointing to the local file 
systems.  When I move DocumentRoot to the NFS share I can not even run 
phpinfo(). 


[root@ ~]# more /projects/proj2/www/html/php_info.php
?
phpinfo();
?
root@ ~]# ls -als /projects/proj2/www/html/php_info.php
4 -rwxrwxrwx 1 root apache 19 Jun 10 16:58 
/projects/proj2/www/html/php_info.php




I've checked permissions, paths, etc... and can not find a cause to this 
problem.  I've compared php.ini and httpd.conf from both fedore and 
centos and they are the pretty much the same.  Both fodera and centos 
are on the same subnets. 



After further investigation I'm find that some php files, below the root 
directory, run successfully,  but now if I edit it or copy it to other 
name the new php file will not run anymore.  I end up with the errors 
listed below. 


I could use some help,  Thanks.

Lou


Lou Baccari wrote:


sorry if I double posted:


Hello,

I'm trying to move my apache server from a Fedora Core 1 with PHP V 
4.3.8 onto a newly built  Centos 5 with PHP 5.1.6, all applications 
installed by rpms.  The www root dir is /projects/proj2/www/html and 
it is a nfs mounted share.


During the installation I had moved all of the contents from the 
remote mount /projects/proj2/www/html to a local disk on the CentOS, 
I tested and I believed I had resolved all issues on the new server.
Now when I changed my httpd.conf to point to the nfs share 
/projects/proj2/www/html my php scripts fail,  even  phpinfo();  
fails.  All errors are identical to the following except for the php 
file name.



*Warning*: Unknown: failed to open stream: Value too large for defined 
data type in *Unknown* on line *0*


*Warning*: Unknown: Failed opening 
'/projects/proj2/www/html/php_info.php' for inclusion 
(include_path='.:/usr/share/pear') in *Unknown* on line *0

* 

Again when I run these same scripts from the local disk I do not 
received any errors.  Any ideas to correcting this problem?


Thanks,

Lou.




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



RE: [PHP] PHP Runs But Does Not Display on Linux

2008-06-12 Thread Wei, Alice J.
Hello,

  I have reinstalled Apache back into my Linux machine, and placed the code


  html
   headtitleTest/title
  body
  pThis is test/p
   ?php echo Hello!; ?
  /body
   /html

into the apache/htdocs folder titled hello.php

  When I execute it from the browser using an http:// address followed by the 
IP address and hello.php, I get this pop up message that asks me if I wanted to 
open up my file and what I want to do with it.
  Is it necessary for me to install anything else? I have added the AddType 
application/x-httpd-php .php into the httpd.conf file, so now it is not giving 
me file does not exist error anymore, but how do I get thie accurate output 
to show up from the browser?


I welcome any suggestion.

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: DeadTOm [EMAIL PROTECTED]
Sent: Wednesday, June 11, 2008 11:15 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

With localhost I was assuming that the files resided on your local
machine, my bad. How are you accessing these files? The location you are
getting them from has to be running a web server of some kind with php
or the php scripts will not run and you'll only see the html output as
you described.
I run a linux server with apache2, php and mysql and I believe that the
purpose of the php5-mysql package is to add files that define those
mysql function calls. I'm sure that there is something similar for mssql.

-Allen

Wei, Alice J. wrote:
 Hi,

 -Original Message-
 From: DeadTOm [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 11, 2008 10:58 PM
 To: Wei, Alice J.
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

 OK, I see now.
 When you open the script from your browser are you accessing it via a
 server like Http://localhost/some/file.php or are you just opening a php
 file on your hard drive? I'm guessing you're accessing it on the hard
 drive directly, which will not work since PHP scripts are executed
 server side. So you will need to install apache2 with php.
 As far as the mssql_connect error goes, the same rule applies. You need
 to have the proper php module installed to define for php what the
 mssql_connect function does, otherwise php doesn't know what it is and
 yells at you for not defining the function.

 -Allen

 Thanks for clarifying the first point, and that is probably why.
 As for the second point, according to 
 http://us.php.net/manual/en/function.mssql-connect.php, isn't mssql_connect 
 defined already as something internal within PHP? Or, am I missing something 
 here?

 Plus, I connect this not to the localhost, but to a different Windows 
 machine, so does this mean that I have to install it? One of the members on 
 the list suggested something from http://www.freetds.org/, if this is 
 something I have to install, I will definitely give it a shot.

 Alice


 Wei, Alice J. wrote:

 Hi,

For testing purpose, I have something like

html
 headtitleTest/title
body
pThis is test/p
 ?php echo Hello!; ?
/body
 /html

   I see the following from the command prompt when I execute the above 
 script:

html
 headtitleTest/title
body
pThis is test/pHello
/body
 /html

   On the browser, I only see:

 html
 headtitleTest/title
body
pThis is test/p
  /body
 /html

   I just realized that the mysql_connect error is a typo, I should have 
 typed mssql_connect. I call this from a different machine, so I shouldn't 
 get this kind of error even if I don't have it installed, right? Or, am I 
 missing something here?

 Alice

 -Original Message-
 From: DeadTOm [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 11, 2008 10:46 PM
 To: Wei, Alice J.
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

  Otherwise, it consistently gives me errors Call to undefined
 function: mysql_connect()If you're getting an error...

 If you're getting this error, there is a line of code in the php script
 that is trying to connect to a mysql database and the mysql extension
 for php is not installed. So php doesn't know this function is supposed
 to do hence, the undefined function error.

  I can only see the HTML code of the php functions I call within the
 code at the command output in text format, but I cannot see it on the
 browser.

 I'm a little confused about what you mean here. You shouldn't see any
 HTML code in your browser.

 Wei, Alice J. wrote:


 Hi,

   I have originally commented out all the MS SQL lines in the php.ini files 
 so that it supports MS SQL, but that does not seem to work. MySQL? Since I 
 am not using that to connect my PHP to, do I still need to install it? By 
 the way, my Microsoft SQL server database is on a 

Re: [PHP] PHP Runs But Does Not Display on Linux

2008-06-12 Thread DeadTOm
Did you install the apache php module? In Ubuntu the package is called 
libapache2-mod-php5.


Wei, Alice J. wrote:

Hello,

  I have reinstalled Apache back into my Linux machine, and placed the code


  html
   headtitleTest/title
  body
  pThis is test/p
   ?php echo Hello!; ?
  /body
   /html

into the apache/htdocs folder titled hello.php

  When I execute it from the browser using an http:// address followed by the 
IP address and hello.php, I get this pop up message that asks me if I wanted to 
open up my file and what I want to do with it.
  Is it necessary for me to install anything else? I have added the AddType 
application/x-httpd-php .php into the httpd.conf file, so now it is not giving me 
file does not exist error anymore, but how do I get thie accurate output to 
show up from the browser?


I welcome any suggestion.

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: DeadTOm [EMAIL PROTECTED]
Sent: Wednesday, June 11, 2008 11:15 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

With localhost I was assuming that the files resided on your local
machine, my bad. How are you accessing these files? The location you are
getting them from has to be running a web server of some kind with php
or the php scripts will not run and you'll only see the html output as
you described.
I run a linux server with apache2, php and mysql and I believe that the
purpose of the php5-mysql package is to add files that define those
mysql function calls. I'm sure that there is something similar for mssql.

-Allen

Wei, Alice J. wrote:
  

Hi,

-Original Message-
From: DeadTOm [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2008 10:58 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

OK, I see now.
When you open the script from your browser are you accessing it via a
server like Http://localhost/some/file.php or are you just opening a php
file on your hard drive? I'm guessing you're accessing it on the hard
drive directly, which will not work since PHP scripts are executed
server side. So you will need to install apache2 with php.
As far as the mssql_connect error goes, the same rule applies. You need
to have the proper php module installed to define for php what the
mssql_connect function does, otherwise php doesn't know what it is and
yells at you for not defining the function.

-Allen

Thanks for clarifying the first point, and that is probably why.
As for the second point, according to 
http://us.php.net/manual/en/function.mssql-connect.php, isn't mssql_connect 
defined already as something internal within PHP? Or, am I missing something 
here?

Plus, I connect this not to the localhost, but to a different Windows machine, 
so does this mean that I have to install it? One of the members on the list 
suggested something from http://www.freetds.org/, if this is something I have 
to install, I will definitely give it a shot.

Alice


Wei, Alice J. wrote:



Hi,

   For testing purpose, I have something like

   html
headtitleTest/title
   body
   pThis is test/p
?php echo Hello!; ?
   /body
/html

  I see the following from the command prompt when I execute the above script:

   html
headtitleTest/title
   body
   pThis is test/pHello
   /body
/html

  On the browser, I only see:

html
headtitleTest/title
   body
   pThis is test/p
 /body
/html

  I just realized that the mysql_connect error is a typo, I should have typed 
mssql_connect. I call this from a different machine, so I shouldn't get this 
kind of error even if I don't have it installed, right? Or, am I missing 
something here?

Alice

-Original Message-
From: DeadTOm [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2008 10:46 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

 Otherwise, it consistently gives me errors Call to undefined
function: mysql_connect()If you're getting an error...

If you're getting this error, there is a line of code in the php script
that is trying to connect to a mysql database and the mysql extension
for php is not installed. So php doesn't know this function is supposed
to do hence, the undefined function error.

 I can only see the HTML code of the php functions I call within the
code at the command output in text format, but I cannot see it on the
browser.

I'm a little confused about what you mean here. You shouldn't see any
HTML code in your browser.

Wei, Alice J. wrote:


  

Hi,

  I have originally commented out all the MS SQL lines in the php.ini files so 
that it supports MS SQL, but that does not seem to work. MySQL? Since I am not 
using that to connect my PHP to, do I still need to install it? By the 

Re: [PHP] Redirect after pdf / file download

2008-06-12 Thread Nitsan Bin-Nun
You are totally in the wrong way.
I would use an a tag and onclick property for opening the PDF in popup 
relocating the current page

HTH
Nitsan

On 12/06/2008, Yashesh Bhatia [EMAIL PROTECTED] wrote:

 Hello:

I'm trying to emulate a problem i'm trying to solve as follows.

 1 - user enters information into a html form and submits
 2 - a php script is invoked on the submit and a pdf file is stamped
 and made available for download
 3 - the script finally redirects the user to a thank you html page.

 i'm having a problem in the redirect to the thank you page.
 here's the 3 files
    1.html 
 htmlbody
 form action=2.php method=post
 First Name: input type=text name=firstname /
 Last Name:  input type=text name=lastname /
 input type=submit /
 /form
 /body/html

 
  2.php 
 ?php
 // some stamping code ...
 // open the file in a binary mode
 $name = 2.pdf;
 fp = fopen($name, 'rb');

 // send headers, dump the pdf file and finally redirect
 header(Content-Type: application/pdf);
 header(Content-Disposition: attachment; filename=$name);
 header(Content-Length:  . filesize($name));
 fpassthru($fp);

 echo 'script type=text/javascript';
 echo 'window.location.href=3.html;';
 echo '/script';
 ?

 
  3.html 
 htmlbody
 Thank you for downloading 2.pdf
 /body/html

 

 The submit works fine and the pdf is availble for download however,
 the redirect does not happen.
 If i comment the lines
 //header(Content-Type: application/pdf);
 //header(Content-Disposition: attachment; filename=$name);
 //header(Content-Length:  . filesize($name));
 //fpassthru($fp);

 then the redirect happens after the submit.

 i'm testing / running it on fedora core 6, Apache 2.2.5, php 5.2.5 and
 firefox 1.5
 Any help / pointers is appreciated.

 Thanks.

 Yashesh Bhatia.

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




RE: [PHP] PHP Runs But Does Not Display on Linux

2008-06-12 Thread Thijs Lensselink

Quoting Wei, Alice J. [EMAIL PROTECTED]:


Hello,

  I have reinstalled Apache back into my Linux machine, and placed the code


  html
   headtitleTest/title
  body
  pThis is test/p
   ?php echo Hello!; ?
  /body
   /html

into the apache/htdocs folder titled hello.php

  When I execute it from the browser using an http:// address   
followed by the IP address and hello.php, I get this pop up message   
that asks me if I wanted to open up my file and what I want to do   
with it.
  Is it necessary for me to install anything else? I have added the   
AddType application/x-httpd-php .php into the httpd.conf file, so   
now it is not giving me file does not exist error anymore, but how  
 do I get thie accurate output to show up from the browser?



I welcome any suggestion.

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: DeadTOm [EMAIL PROTECTED]
Sent: Wednesday, June 11, 2008 11:15 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

With localhost I was assuming that the files resided on your local
machine, my bad. How are you accessing these files? The location you are
getting them from has to be running a web server of some kind with php
or the php scripts will not run and you'll only see the html output as
you described.
I run a linux server with apache2, php and mysql and I believe that the
purpose of the php5-mysql package is to add files that define those
mysql function calls. I'm sure that there is something similar for mssql.

-Allen

Wei, Alice J. wrote:

Hi,

-Original Message-
From: DeadTOm [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2008 10:58 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

OK, I see now.
When you open the script from your browser are you accessing it via a
server like Http://localhost/some/file.php or are you just opening a php
file on your hard drive? I'm guessing you're accessing it on the hard
drive directly, which will not work since PHP scripts are executed
server side. So you will need to install apache2 with php.
As far as the mssql_connect error goes, the same rule applies. You need
to have the proper php module installed to define for php what the
mssql_connect function does, otherwise php doesn't know what it is and
yells at you for not defining the function.

-Allen

Thanks for clarifying the first point, and that is probably why.
As for the second point, according to   
http://us.php.net/manual/en/function.mssql-connect.php, isn't   
mssql_connect defined already as something internal within PHP? Or,  
 am I missing something here?


Plus, I connect this not to the localhost, but to a different   
Windows machine, so does this mean that I have to install it? One   
of the members on the list suggested something from   
http://www.freetds.org/, if this is something I have to install, I   
will definitely give it a shot.


Alice


Wei, Alice J. wrote:


Hi,

   For testing purpose, I have something like

   html
headtitleTest/title
   body
   pThis is test/p
?php echo Hello!; ?
   /body
/html

  I see the following from the command prompt when I execute the   
above script:


   html
headtitleTest/title
   body
   pThis is test/pHello
   /body
/html

  On the browser, I only see:

html
headtitleTest/title
   body
   pThis is test/p
 /body
/html

  I just realized that the mysql_connect error is a typo, I should  
 have typed mssql_connect. I call this from a different machine,  
so  I shouldn't get this kind of error even if I don't have it   
installed, right? Or, am I missing something here?


Alice

-Original Message-
From: DeadTOm [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2008 10:46 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

 Otherwise, it consistently gives me errors Call to undefined
function: mysql_connect()If you're getting an error...

If you're getting this error, there is a line of code in the php script
that is trying to connect to a mysql database and the mysql extension
for php is not installed. So php doesn't know this function is supposed
to do hence, the undefined function error.

 I can only see the HTML code of the php functions I call within the
code at the command output in text format, but I cannot see it on the
browser.

I'm a little confused about what you mean here. You shouldn't see any
HTML code in your browser.

Wei, Alice J. wrote:



Hi,

  I have originally commented out all the MS SQL lines in the   
php.ini files so that it supports MS SQL, but that does not seem   
to work. MySQL? Since I am not using that to connect my PHP to,   
do I still need to install it? By the way, my Microsoft SQL   
server 

Re: [PHP] Redirect after pdf / file download

2008-06-12 Thread Jim Lucas

Yashesh Bhatia wrote:

What about doing it the other way ... submitting the page to a script
that calls on the pdf creation, yet doesnt leave this script - then
proceed to redirect when that script (pdf) has been completed?

S



steven:

 the steps u'r suggesting are
1 - submit form (1.html) to script (2.php)
2 - 2.php generates the pdf but does not give it for download
3 - after generating the pdf , 2.php then redirects to 3.html..

so where does the download happen ? in 3.html ?

thx.

yashesh



1.  Collect Information from client  submit data
2.  Process data and generate PDF, write PDF, display error/success message
3.  If successful, have a javascript or meta .. redirect to then download
PDF generated in step 2.

I would do it this way so in case their were any problems generating the PDF, 
you would have a way to indicate that to the client.  Rather then trying to 
force them to download a broken PDF document.


One suggestion to go along with this is that you will need to have a routine 
that will clean out all the generated PDF's every now and again.



--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare


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



RE: [PHP] PHP Runs But Does Not Display on Linux

2008-06-12 Thread Wei, Alice J.
Hi, Guys:

  Thanks for all of you who helped  out, and I can now get this to work, by 
installing the PHP into the Linux Fedora box I have. What is odd is that on the 
download page of http://www.php.net, it mentioned the following on the 
downloads page:

We do not distribute UNIX/Linux binaries.
Most Linux distributions come with PHP these days,
so if you do not want to compile your own, go to your distribution's download 
site. Binaries available on external servers:

I have followed all the prompts to download it just then, and thanks to those 
of you reminding me to shut down the apache before I restart it, it is now 
displaying Hello where it is supposed to be on the PHP page.
Would anyone say that the statement on the php page above should be modified 
somehow?

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: Thijs Lensselink [EMAIL PROTECTED]
Sent: Thursday, June 12, 2008 10:44 AM
To: php-general@lists.php.net
Subject: RE: [PHP] PHP Runs But Does Not Display on Linux

Quoting Wei, Alice J. [EMAIL PROTECTED]:

 Hello,

   I have reinstalled Apache back into my Linux machine, and placed the code


   html
headtitleTest/title
   body
   pThis is test/p
?php echo Hello!; ?
   /body
/html

 into the apache/htdocs folder titled hello.php

   When I execute it from the browser using an http:// address
 followed by the IP address and hello.php, I get this pop up message
 that asks me if I wanted to open up my file and what I want to do
 with it.
   Is it necessary for me to install anything else? I have added the
 AddType application/x-httpd-php .php into the httpd.conf file, so
 now it is not giving me file does not exist error anymore, but how
  do I get thie accurate output to show up from the browser?


 I welcome any suggestion.

 Alice
 ==
 Alice Wei
 MIS 2009
 School of Library and Information Science
 Indiana University Bloomington
 [EMAIL PROTECTED]
 
 From: DeadTOm [EMAIL PROTECTED]
 Sent: Wednesday, June 11, 2008 11:15 PM
 To: Wei, Alice J.
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

 With localhost I was assuming that the files resided on your local
 machine, my bad. How are you accessing these files? The location you are
 getting them from has to be running a web server of some kind with php
 or the php scripts will not run and you'll only see the html output as
 you described.
 I run a linux server with apache2, php and mysql and I believe that the
 purpose of the php5-mysql package is to add files that define those
 mysql function calls. I'm sure that there is something similar for mssql.

 -Allen

 Wei, Alice J. wrote:
 Hi,

 -Original Message-
 From: DeadTOm [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 11, 2008 10:58 PM
 To: Wei, Alice J.
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

 OK, I see now.
 When you open the script from your browser are you accessing it via a
 server like Http://localhost/some/file.php or are you just opening a php
 file on your hard drive? I'm guessing you're accessing it on the hard
 drive directly, which will not work since PHP scripts are executed
 server side. So you will need to install apache2 with php.
 As far as the mssql_connect error goes, the same rule applies. You need
 to have the proper php module installed to define for php what the
 mssql_connect function does, otherwise php doesn't know what it is and
 yells at you for not defining the function.

 -Allen

 Thanks for clarifying the first point, and that is probably why.
 As for the second point, according to
 http://us.php.net/manual/en/function.mssql-connect.php, isn't
 mssql_connect defined already as something internal within PHP? Or,
  am I missing something here?

 Plus, I connect this not to the localhost, but to a different
 Windows machine, so does this mean that I have to install it? One
 of the members on the list suggested something from
 http://www.freetds.org/, if this is something I have to install, I
 will definitely give it a shot.

 Alice


 Wei, Alice J. wrote:

 Hi,

For testing purpose, I have something like

html
 headtitleTest/title
body
pThis is test/p
 ?php echo Hello!; ?
/body
 /html

   I see the following from the command prompt when I execute the
 above script:

html
 headtitleTest/title
body
pThis is test/pHello
/body
 /html

   On the browser, I only see:

 html
 headtitleTest/title
body
pThis is test/p
  /body
 /html

   I just realized that the mysql_connect error is a typo, I should
  have typed mssql_connect. I call this from a different machine,
 so  I shouldn't get this kind of error even if I don't have it
 

RE: [PHP] PHP Runs But Does Not Display on Linux

2008-06-12 Thread Boyd, Todd M.
 -Original Message-
 From: Wei, Alice J. [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 12, 2008 9:02 AM
 To: [EMAIL PROTECTED]
 Cc: php-general@lists.php.net
 Subject: RE: [PHP] PHP Runs But Does Not Display on Linux
 
 Hello,
 
   I have reinstalled Apache back into my Linux machine, and placed the
 code
 
 
   html
headtitleTest/title
   body
   pThis is test/p
?php echo Hello!; ?
   /body
/html
 
 into the apache/htdocs folder titled hello.php
 
   When I execute it from the browser using an http:// address followed
 by the IP address and hello.php, I get this pop up message that asks
me
 if I wanted to open up my file and what I want to do with it.
   Is it necessary for me to install anything else? I have added the
 AddType application/x-httpd-php .php into the httpd.conf file, so now
 it is not giving me file does not exist error anymore, but how do I
 get thie accurate output to show up from the browser?

Alice,

As others have mentioned thus far, having Apache is simply not enough.
You can even try and configure it yourself via the .conf files, but it
still won't properly process ?php ? tags. In fact, the reason you see
absolutely nothing in their place is that ?php ? is a complete
tag--though unrecognized--and Apache treats it as such. Since it doesn't
know what to do with a ?php ? tag, it simply doesn't display anything
when rendering the tag.

Apache needs a module installed, such as libapache2-mod-php5 (in Debian,
I believe) in order to parse PHP files and tags properly. There are .deb
(Debian pacakage), .rpm (RedHat package), and plain ol' .tgz (GZipped
Tar-ball) distributions of the PHP5 Apache2 module. Without this, there
will be no bridge between Apache(2) and your PHP interpreter.

HTH,


Todd Boyd
Web Programmer




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



[PHP] unlink oddity

2008-06-12 Thread Valuelynk.Com
Ok, here is my problem.  Using the code below, I am saving a posted form to
a database including the files it contains.

There is one line commented out.. The unlink command.  Without the command,
the script works fine and new files

Overwrite the old files when uploaded.  If, however, I uncomment the unlink
line, the new files are still saved and the

if (file_exists($path)) { line evals to true, but the file disappears
after program 

Execution.  The net result of having the unlink command in seems to be that
it executes 

after program termination leaving a record of the successful upload in the
database, but

no file found on the server where the upload occurred.  Does anyone have any
idea of

why this would be occurring?  The php docs for unlink do not talk about
delayed execution

and other scripts I researched seems to use unlink before the move command
with success.

 

Any help would be greatly appreciated.

 

 

Please reply to: [EMAIL PROTECTED]

 

 

 

 

 

 

?

function saveRecord ($db,$POST) {
   $bd = /absolute_path_to_document_root;
   $fp = /path_to_files_from_document_root/;
   $ud = $bd . $fp;

   if ($ud) mkPath($ud); // creates directory if absent
   unset($IDS);
   $names = $_FILES[obj]['name'];
   if (!empty($names)  is_array($names)) {
  while (list($objID,$name)=each($names)) {
 if (!$objID || !$name) continue;
 $IDS[] = $objID;
  }
   }
   if (!empty($IDS)  is_array($IDS)) {
  foreach ($IDS as $objID) {
 $name = $_FILES[obj]['name'][$objID]; // uploaded file name
 $type = $_FILES[obj]['type'][$objID]; // uploaded file type
 $size = $_FILES[obj]['size'][$objID]; // uploaded file size
 $fail = $_FILES[obj]['error'][$objID];// was file uploaded?
 $temp = $_FILES[obj]['tmp_name'][$objID]; // temporary file name
 $file = $objID.strrchr($name,'.'); // newly assigned file name
 $path = $ud.$file; // absolute path to newly named file
 if ($fail || !$name || !$temp) continue;
// @unlink($ud.$file);
 @move_uploaded_file($temp, $path);
 @chmod($path, 0777);

 if (file_exists($path)) {
$dbDAT = array(
'name' = $name
   ,'type' = $type
   ,'size' = $size
   ,'file' = $file
   ,'path' = $fp
);
$OBJ[$objID] = serialize($dbDAT); } 
 }
  }
   }
  /*

All the actual code to save the record in the database 

has been removed, and a fake if/then statement added.

  */

   If ($record_successfully_created) {

  Return $newRecordID;

   } else {

  Return 0;

   }
}

 

If ($_POST[obj]) saveRecord($db,$_POST);


?

form method=POST action=?=$PHP_SELF?

input type=hidden name=form[id] value=23

input type=text name=obj[1234] value=value 1

input type=text name=obj[1235] value=value 2

input type=file   name=obj[1236]

input type=file   name=obj[1237]

/form



Re: [PHP] Redirect after pdf / file download

2008-06-12 Thread Philip Thompson

On Jun 12, 2008, at 8:32 AM, Bastien Koert wrote:

On Thu, Jun 12, 2008 at 7:46 AM, Yashesh Bhatia [EMAIL PROTECTED]  
wrote:




What about doing it the other way ... submitting the page to a  
script

that calls on the pdf creation, yet doesnt leave this script - then
proceed to redirect when that script (pdf) has been completed?

S



steven:

   the steps u'r suggesting are
1 - submit form (1.html) to script (2.php)
2 - 2.php generates the pdf but does not give it for download
3 - after generating the pdf , 2.php then redirects to 3.html..

so where does the download happen ? in 3.html ?

thx.

yashesh



Force the download thru a new window or a frame inside the main  
window.

Then you can redirect the main window to where you need it


Frames = Bad! (and that's not an assignment ;)

As Richard provided the link (http://www.w3.org/TR/2008/WD-html5-diff-20080610/ 
) in a different thread, this comes straight from the article about  
HTML 5:


The following elements are not in HTML 5 because their usage affected  
usability and accessibility for the end user in a negative way:


* frame
* frameset
* noframes

I know we're not in HTML5 yet, but might as well prepare. Sorry to go  
a bit off topic, but I had to throw that out. =D


~Philip

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



Re: [PHP] PHP Runs But Does Not Display on Linux

2008-06-12 Thread Shawn McKenzie

Wei, Alice J. wrote:

Hi, Guys:

  Thanks for all of you who helped  out, and I can now get this to work, by 
installing the PHP into the Linux Fedora box I have. What is odd is that on the 
download page of http://www.php.net, it mentioned the following on the 
downloads page:

We do not distribute UNIX/Linux binaries.
Most Linux distributions come with PHP these days,
so if you do not want to compile your own, go to your distribution's download 
site. Binaries available on external servers:

I have followed all the prompts to download it just then, and thanks to those 
of you reminding me to shut down the apache before I restart it, it is now 
displaying Hello where it is supposed to be on the PHP page.
Would anyone say that the statement on the php page above should be modified 
somehow?


No.  php.net does not provide Linux binaries.  They provide source that 
you can compile into a binary if you need to modify the build.  Their 
point is that most distributions (Fedora, Debian, etc...) provide a PHP 
binary in the form of a RPM, DEB package etc... that in your case you 
can install using yum, etc...


-Shawn



Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: Thijs Lensselink [EMAIL PROTECTED]
Sent: Thursday, June 12, 2008 10:44 AM
To: php-general@lists.php.net
Subject: RE: [PHP] PHP Runs But Does Not Display on Linux

Quoting Wei, Alice J. [EMAIL PROTECTED]:


Hello,

  I have reinstalled Apache back into my Linux machine, and placed the code


  html
   headtitleTest/title
  body
  pThis is test/p
   ?php echo Hello!; ?
  /body
   /html

into the apache/htdocs folder titled hello.php

  When I execute it from the browser using an http:// address
followed by the IP address and hello.php, I get this pop up message
that asks me if I wanted to open up my file and what I want to do
with it.
  Is it necessary for me to install anything else? I have added the
AddType application/x-httpd-php .php into the httpd.conf file, so
now it is not giving me file does not exist error anymore, but how
 do I get thie accurate output to show up from the browser?


I welcome any suggestion.

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: DeadTOm [EMAIL PROTECTED]
Sent: Wednesday, June 11, 2008 11:15 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

With localhost I was assuming that the files resided on your local
machine, my bad. How are you accessing these files? The location you are
getting them from has to be running a web server of some kind with php
or the php scripts will not run and you'll only see the html output as
you described.
I run a linux server with apache2, php and mysql and I believe that the
purpose of the php5-mysql package is to add files that define those
mysql function calls. I'm sure that there is something similar for mssql.

-Allen

Wei, Alice J. wrote:

Hi,

-Original Message-
From: DeadTOm [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2008 10:58 PM
To: Wei, Alice J.
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP Runs But Does Not Display on Linux

OK, I see now.
When you open the script from your browser are you accessing it via a
server like Http://localhost/some/file.php or are you just opening a php
file on your hard drive? I'm guessing you're accessing it on the hard
drive directly, which will not work since PHP scripts are executed
server side. So you will need to install apache2 with php.
As far as the mssql_connect error goes, the same rule applies. You need
to have the proper php module installed to define for php what the
mssql_connect function does, otherwise php doesn't know what it is and
yells at you for not defining the function.

-Allen

Thanks for clarifying the first point, and that is probably why.
As for the second point, according to
http://us.php.net/manual/en/function.mssql-connect.php, isn't
mssql_connect defined already as something internal within PHP? Or,
 am I missing something here?

Plus, I connect this not to the localhost, but to a different
Windows machine, so does this mean that I have to install it? One
of the members on the list suggested something from
http://www.freetds.org/, if this is something I have to install, I
will definitely give it a shot.

Alice


Wei, Alice J. wrote:


Hi,

   For testing purpose, I have something like

   html
headtitleTest/title
   body
   pThis is test/p
?php echo Hello!; ?
   /body
/html

  I see the following from the command prompt when I execute the
above script:

   html
headtitleTest/title
   body
   pThis is test/pHello
   /body
/html

  On the browser, I only see:

html

Re: [PHP] Command-line PHP memory limit

2008-06-12 Thread Shawn McKenzie

Per Jessen wrote:

Rene Fournier wrote:


Is it possible to set a unique memory limit for PHP scripts that are
run from the command line? (That is, different from what's specified
in php.ini.)


This might specific to openSUSE, but the typical installation comes with
separate php.inis for apache and cli. 


/etc/php5/cli/php.ini
/etc/php5/apache2/php.ini


/Per Jessen, Zürich



K/Ubuntu, I would assume Debian as well.

-Shawn

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



RE: [PHP] Command-line PHP memory limit

2008-06-12 Thread Boyd, Todd M.
 -Original Message-
 From: Shawn McKenzie [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 12, 2008 11:06 AM
 To: php-general@lists.php.net
 Subject: Re: [PHP] Command-line PHP memory limit
 
 Per Jessen wrote:
  Rene Fournier wrote:
 
  Is it possible to set a unique memory limit for PHP scripts that are
  run from the command line? (That is, different from what's specified
  in php.ini.)
 
  This might specific to openSUSE, but the typical installation comes
 with
  separate php.inis for apache and cli.
 
  /etc/php5/cli/php.ini
  /etc/php5/apache2/php.ini
 
 
  /Per Jessen, Zürich
 
 
 K/Ubuntu, I would assume Debian as well.

Correct. I am running Debian etch, and I have two separate php.ini files 
(automatically configured as such)--one for Apache, one for command line.


Todd Boyd
Web Programmer





Re: [PHP] Re: HTML 5

2008-06-12 Thread Nathan Nobbe
On Thu, Jun 12, 2008 at 7:37 AM, Colin Guthrie [EMAIL PROTECTED] wrote:

 Pavel wrote:

 В сообщении от Thursday 12 June 2008 16:43:59 Richard Heyes написал(а):

 This may be of interest (HTML 5 diffences to HTML 4 overview):


 what about xHTML? html died few years ago and i thought is was official..


 Oh there are *lots* of discussions about that. Personally I'm sticking with
 XHTML.


i imagine at some point we will see a revision of xhtml that incorporates
the changes from html4 - 5.  something like xhtml 1.1 or 2.0.  at version
1.0, its still just a pup }:D

-nathan


Re: [PHP] Re: Forum coded in PHP with mail and news gateway

2008-06-12 Thread Usamah M. Ali
On Thu, Jun 12, 2008 at 4:34 PM, Bastien Koert [EMAIL PROTECTED] wrote:


 PHP does not support threading AFIAK.



He probably meant threading as in forum threads, i.e. topics where
discussions are presented in a threaded way.

Regards,
Usamah

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



[PHP] Re: Forum coded in PHP with mail and news gateway

2008-06-12 Thread Colin Guthrie

Usamah M. Ali wrote:

On Thu, Jun 12, 2008 at 4:34 PM, Bastien Koert [EMAIL PROTECTED] wrote:


PHP does not support threading AFIAK.


He probably meant threading as in forum threads, i.e. topics where
discussions are presented in a threaded way.


I assumed exactly that :)


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



Re: [PHP] Re: HTML 5

2008-06-12 Thread M. Sokolewicz

Nathan Nobbe wrote:

On Thu, Jun 12, 2008 at 7:37 AM, Colin Guthrie [EMAIL PROTECTED] wrote:


Pavel wrote:


В сообщении от Thursday 12 June 2008 16:43:59 Richard Heyes написал(а):


This may be of interest (HTML 5 diffences to HTML 4 overview):


what about xHTML? html died few years ago and i thought is was official..


Oh there are *lots* of discussions about that. Personally I'm sticking with
XHTML.



i imagine at some point we will see a revision of xhtml that incorporates
the changes from html4 - 5.  something like xhtml 1.1 or 2.0.  at version
1.0, its still just a pup }:D

-nathan


uuuhhmmm 1.0? The thing is already at 1.1 and 2.0 is in the make...
http://www.w3.org/TR/xhtml2 is the latest (xhtml 2.0) draft.
XHTML™ 2.0 W3C Working Draft 26 July 2006, not that new anymore after 2 
years, most browsers even have good support for it these days.


- Tul

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



Re: [PHP] Re: HTML 5

2008-06-12 Thread Nathan Nobbe
On Thu, Jun 12, 2008 at 4:05 PM, M. Sokolewicz [EMAIL PROTECTED] wrote:

 Nathan Nobbe wrote:

 On Thu, Jun 12, 2008 at 7:37 AM, Colin Guthrie [EMAIL PROTECTED]
 wrote:

  Pavel wrote:

  В сообщении от Thursday 12 June 2008 16:43:59 Richard Heyes написал(а):

  This may be of interest (HTML 5 diffences to HTML 4 overview):

  what about xHTML? html died few years ago and i thought is was
 official..

  Oh there are *lots* of discussions about that. Personally I'm sticking
 with
 XHTML.



 i imagine at some point we will see a revision of xhtml that incorporates
 the changes from html4 - 5.  something like xhtml 1.1 or 2.0.  at version
 1.0, its still just a pup }:D

 -nathan


 uuuhhmmm 1.0? The thing is already at 1.1 and 2.0 is in the make...
 http://www.w3.org/TR/xhtml2 is the latest (xhtml 2.0) draft.
 XHTML™ 2.0 W3C Working Draft 26 July 2006, not that new anymore after 2
 years, most browsers even have good support for it these days.


i suppose i put too much faith in the right hand nav on the w3cschools site
=/

http://www.w3schools.com/

-nathan


[PHP] PHP code will not work

2008-06-12 Thread Joseph Subida

Hi.

I am new to PHP. I found a tutorial that said to copy and paste the code 
into a .php document and open it in my browser:


?php
echo $_SERVER['HTTP_USER_AGENT'];
?

I'm pretty sure PHP is enabled on my computer. I've tested code such as:

?php
//Function arguments
function writeMyName2($fname)
  {
  echo $fname .  Refsnes.br /;
  }
echo My name is ;
writeMyName2(Kai Jim);
echo My name is ;
writeMyName2(Hege);
echo My name is ;
writeMyName2(Stale);
?

which works fine.

The error I get when I try


?php
echo $_SERVER['HTTP_USER_AGENT'];
?

is

Parse error: syntax error, unexpected T_VARIABLE in 
/Library/WebServer/Documents/test.php on line 106


I tried Googling T_VARIABLE and haven't found any useful solutions. 
Any ideas? Thanks!


-J.C.

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



Re: [PHP] PHP code will not work

2008-06-12 Thread Nathan Nobbe
On Wed, Jun 11, 2008 at 9:51 PM, Joseph Subida [EMAIL PROTECTED] wrote:

 Hi.

 I am new to PHP. I found a tutorial that said to copy and paste the code
 into a .php document and open it in my browser:

 ?php
 echo $_SERVER['HTTP_USER_AGENT'];
 ?

 I'm pretty sure PHP is enabled on my computer. I've tested code such as:

 ?php
 //Function arguments
 function writeMyName2($fname)
  {
  echo $fname .  Refsnes.br /;
  }
 echo My name is ;
 writeMyName2(Kai Jim);
 echo My name is ;
 writeMyName2(Hege);
 echo My name is ;
 writeMyName2(Stale);
 ?

 which works fine.

 The error I get when I try


 ?php
 echo $_SERVER['HTTP_USER_AGENT'];
 ?

 is

 Parse error: syntax error, unexpected T_VARIABLE in
 /Library/WebServer/Documents/test.php on line 106

 I tried Googling T_VARIABLE and haven't found any useful solutions. Any
 ideas? Thanks!


im guessing

?php
echo $_SERVER['HTTP_USER_AGENT'];
?

isnt the complete file thats giving you troubles, because theres only one
line in it.  whichever file is giving you troubles has a syntax error on
line 106.

-nathan


Re: [PHP] PHP code will not work

2008-06-12 Thread Daniel Brown
On Wed, Jun 11, 2008 at 11:51 PM, Joseph Subida [EMAIL PROTECTED] wrote:
 Hi.

 I am new to PHP. I found a tutorial that said to copy and paste the code
 into a .php document and open it in my browser:

 ?php
 echo $_SERVER['HTTP_USER_AGENT'];
 ?

 I'm pretty sure PHP is enabled on my computer. I've tested code such as:

PHP is definitely on your system.

[snip!]

 The error I get when I try


 ?php
 echo $_SERVER['HTTP_USER_AGENT'];
 ?

 is

 Parse error: syntax error, unexpected T_VARIABLE in
 /Library/WebServer/Documents/test.php on line 106

What is the code on lines 105 and 106 of test.php?  If there's
nothing on line 105, please send us the immediately-preceding code.

By the way, a T_VARIABLE is just a variable --- anything beginning
with a $dollar_sign.

-- 
/Daniel P. Brown
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

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



[PHP] a questoin about the # char

2008-06-12 Thread Sebastian Camino

Hello,

I want to know what the # char does. On a website I was working at,  
I tried to open a file with a # in it's name and I got an error. So  
I'd really appreciate any help to know how to avoid the error and  
what  does the character do.


Thanks a lot

Sebastian

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



Re: [PHP] a questoin about the # char

2008-06-12 Thread Daniel Brown
On Thu, Jun 12, 2008 at 8:18 PM, Sebastian Camino
[EMAIL PROTECTED] wrote:
 Hello,

 I want to know what the # char does. On a website I was working at, I
 tried to open a file with a # in it's name and I got an error. So I'd
 really appreciate any help to know how to avoid the error and what  does the
 character do.

That's pretty vague there, Sebastian.  What error are you getting?
 What operating system?  How are you attempting to open the file?
What is the file name?

Details, man!  ;-P

-- 
/Daniel P. Brown
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

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



Re: [PHP] a questoin about the # char

2008-06-12 Thread DeadTOm
Inside a php script the '#' denotes the beginning of a comment. I don't 
know that it has any use at all in the address line. What specifically 
is the error?
I'd guess that php would ignore the rest of the line following the '#' 
and so this could generate any number of errors depending on what 
information is carried in the address and what that info is for.
I'm not aware of any way to scan the address within php, this might need 
to be done with a proxy of some kind. If it can be done or if you can 
talk to the owner of the site you're trying to get the file from, you  
might try replacing the '#' with a '%23'.


-Allen

Hello,

I want to know what the # char does. On a website I was working at, 
I tried to open a file with a # in it's name and I got an error. So 
I'd really appreciate any help to know how to avoid the error and 
what  does the character do.


Thanks a lot

Sebastian




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



Re: [PHP] unlink oddity

2008-06-12 Thread Chris

 
 function saveRecord ($db,$POST) {
$bd = /absolute_path_to_document_root;
$fp = /path_to_files_from_document_root/;
$ud = $bd . $fp;

snip

  $path = $ud.$file; // absolute path to newly named file
  if ($fail || !$name || !$temp) continue;
 // @unlink($ud.$file);
  @move_uploaded_file($temp, $path);
  @chmod($path, 0777);

Why not just unlink($path) ? It's the same thing but you take 2
variables out of the problem.

While you're trying to debug this remove the '@' signs. An error message
will be particularly useful.

Check your logs if you can, otherwise turn up error reporting and
display errors until you work out what's going on.

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



-- 
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] a questoin about the # char

2008-06-12 Thread Chris
Sebastian Camino wrote:
 Hello,
 
 I want to know what the # char does.

In a url it's an anchor tag (http://www.w3schools.com/HTML/html_links.asp).

In php it's used to mark a comment.

?php
# this is a comment and not executed.
?

It means nothing specific in a filename.

-- 
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] a questoin about the # char

2008-06-12 Thread Robert Cummings
On Fri, 2008-06-13 at 11:10 +1000, Chris wrote:
 Sebastian Camino wrote:
  Hello,
  
  I want to know what the # char does.
 
 In a url it's an anchor tag (http://www.w3schools.com/HTML/html_links.asp).
 
 In php it's used to mark a comment.
 
 ?php
 # this is a comment and not executed.
 ?
 
 It means nothing specific in a filename.

CVS conflict?? :)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] class? package?

2008-06-12 Thread Shelley
On Wed, Jun 11, 2008 at 12:02 PM, Larry Garfield [EMAIL PROTECTED]
wrote:

 On Tuesday 10 June 2008, Shelley wrote:
  Hi all,
 
  If you are designing with OO principles, could you give an explanation of
  what is the difference classes and packages?
 
  Several principles talks about classes and packages, such as:
  The classes in a package are reused together. If you reuse one of the
  classes in a package, you reuse them all.
 
  but few explains the difference between them.
 
  When I was summarizing the OO principles, that question confused me:
 
 http://phparch.cn/index.php/php/43-php-advanced-programming/170-principles-
 of-object-oriented-design
 
  Thanks in advance. :)

 A class is a syntactic way of grouping behavior and data together in an
 encapsulated fashion (at least that's the PHP definition).

 A formal package is a syntactic way of grouping related classes together,
 either for easier distribution, somewhat tighter coupling, or syntactic
 sugar.  For instance, you could have 5 classes that make up your Database
 abstraction package; they're all discrete, but all work in concert.

 PHP does not have a syntactic package concept.  The closest thing would
 be
 namespaces as implemented in PHP 5.3, but that's not out yet.  Many systems
 emulate packages with verbose class naming (eg, Database_Connection,
 Database_Query, Database_Transaction, Database_Query_Select, etc.), but I
 personally find that ugly. :-)

 Thank you very much for the explanation.
I think I got some.
Maybe I am already using them:
I am working on a sns site, and now my practice is grouping classes of a
function
(i.e. subscription) together. When I need it, just load the package:
subscription.

Right? ;)
-- 
Regards,
Shelley


Re: [PHP] a questoin about the # char

2008-06-12 Thread Robert Cummings
On Thu, 2008-06-12 at 22:03 -0400, Robert Cummings wrote:
 On Fri, 2008-06-13 at 11:10 +1000, Chris wrote:
  Sebastian Camino wrote:
   Hello,
   
   I want to know what the # char does.
  
  In a url it's an anchor tag (http://www.w3schools.com/HTML/html_links.asp).
  
  In php it's used to mark a comment.
  
  ?php
  # this is a comment and not executed.
  ?
  
  It means nothing specific in a filename.
 
 CVS conflict?? :)

Actually, I should say... the backup file due to a CVS conflict or auto
merge.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] class? package?

2008-06-12 Thread Shelley
On Thu, Jun 12, 2008 at 3:01 PM, Iv Ray [EMAIL PROTECTED] wrote:

 Shelley wrote:

 Probably you have noticed this:
 The classes in a package are reused together. If you reuse one of the
 classes in a package, you reuse them all.
 If that's the case, then why not just use one class as one package?
 What's the point of splitting a package into several classes? :-(


 I think somebody already answered.

 It is actually up to you.

 My grandmother used to write letters starting with a capital letter,
 writing the whole letter as one long sentence and ending with a dot. This
 would perhaps confuse most high school teachers, but in her case it somehow
 worked :)

 If we take this worn out example - if you have a class dog and a class
 cat - it becomes quite clear why you need several classes. You can put
 them in a package called animals - but as other people already noted, the
 packages in php have only a symbolic role, just for clarity of code
 organization.

Yeah, that's it.



-- 
Regards,
Shel


Re: [PHP] PHP connection to external application

2008-06-12 Thread hce
On Thu, Jun 12, 2008 at 9:30 PM, Stut [EMAIL PROTECTED] wrote:
 On 12 Jun 2008, at 12:20, hce wrote:

 What is the best way for a PHP web application to connect to an
 external application written by C in Linux OS?

 (1) Can PHP directly call external C functions, or similar solution?

 No, but you can wrap the C functions in a PHP extension.

Ok, that is not an option.

 (2) Can PHP pass messages to message queue which external C program can
 access?

 Depends on the implementation of the queue, but the answer is almost
 certainly yes.

I am not certain if the msg_send / msg_receive in PHP can talk to the
external C program msg_send  / msg_receive as PHP and external C
program are in different processes, different memory spaces. Unless
wrap the C functions in a PHP extension as your suggested in (1).


 (3) Socket connection between the PHP and external C program.

 This would usually be my preferred choice unless there is a particular
 reason to avoid this in which case I would go down the PHP extension route.

 A lot will depend on what the C code is doing and how your PHP scripts will
 interact with it.

Let me first describe the requirement more:

The C program is a major business server which accesses the database,
exchanges information to other remote servers and it has many other
background tasks running concurrently for doing monitor, statistic
report, real time update data, etc.

The PHP web application connects to the C program to get data and
information and to display on user's web browser. I know socket works
between the PHP and external C server, but there are many concerns
depends on different implementations:

(a) A simple way is if for every PHP request, it opens socket, sends a
request and gets a response from the C server then closes the socket.
It should work, but I am not sure:
   (i) if the open / close socket per request will cause delays and
performance issues.
   (ii) What is the maximum number concurrent requests in a PHP web
application? Will the maximum socket number  / or port number (up to
2^16) be a bottleneck for large number of concurrent requests (hundred
and thousands)?

(b) If for all PHP requests share only one socket to connect to the
external C server, I am not sure if the PHP is able to do multiplex
responses for each request as the PHP is stateless.

Thank you.

Jim

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