|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 18 Nov 2003 12:10:10 -0000 Issue 2422
php-general-digest-help
lists.php.net
Date: Tue Nov 18 2003 - 06:10:10 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 18 Nov 2003 12:10:10 -0000 Issue 2422
Topics (messages 170032 through 170083):
Re: Communicating with remote server
170032 by: Vail, Warren
170039 by: Webmaster
170046 by: Vail, Warren
170049 by: Marek Kilimajer
170057 by: Burhan Khalid
file descriptor problem with tcpclient
170033 by: Bill Shupp
170045 by: Bill Shupp
Re: Microsoft .NET arguement
170034 by: Raditha Dissanayake
170035 by: Raditha Dissanayake
170036 by: Raditha Dissanayake
170037 by: Raditha Dissanayake
Re: MMCache segmentation faults
170038 by: Manuel Lemos
[Q] Development Best Practices
170040 by: Adam
170042 by: Jason Godesky
170047 by: Robert Cummings
170052 by: Rob Burris
170075 by: Chris Hayes
Re: auto_prepend/append in htaccess....
170041 by: Jason Wong
PHP process .html extension file
170043 by: BennyYim
170044 by: Jason Wong
rmdir withour rmdir function.
170048 by: Vincent M.
170051 by: Marek Kilimajer
170056 by: Vincent M.
170060 by: Eugene Lee
170081 by: Marek Kilimajer
Making a Search Function?
170050 by: Dimitri Marshall
170053 by: Ryan Thompson
About iMail Help
170054 by: D. Jame
170074 by: Derek Ford
ereg_replace help
170055 by: Martin Towell
170063 by: Eugene Lee
170066 by: Jason Wong
170067 by: Henrik Hudson
170071 by: Robert Cummings
PHP and PayFlow Pro Issues
170058 by: Henrik Hudson
Re: Single Session for different websites
170059 by: Manisha Sathe
I need answers for the questions
170061 by: Arivazhagi Govindarajan
170064 by: Henrik Hudson
170079 by: rush
E-mail Gateway
170062 by: Jason Williard
170065 by: Henrik Hudson
170068 by: Jason Wong
170070 by: Robert Cummings
170072 by: Brian M McGarvie
Search For File
170069 by: PHPDiscuss - PHP Newsgroups and mailing lists
170073 by: Burhan Khalid
diff
170076 by: Decapode Azur
.html extension PHP page be interpret
170077 by: BennyYim
170078 by: Nathan Taylor
170080 by: Eugene Lee
170082 by: Wouter van Vliet
Re: Can't fetch HTTP POST data in PHP?
170083 by: Arne Rusek
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Lot's of options.
Will this access be across the internet, or behind a firewall?
Are you concerned about securing your information from prying eyes?
You seem to be focusing on a script that runs on the remote machine, does
this machine have a web server as well, or will you be executing PHP as a
standalone process?
I am taking it for granted that you have PHP installed on the remote
machine?
Do you have access to commands like REXEC, RCP, RSH, SSH on your local
machine, and are the required daemons running on the remote machine?
What platforms are involved at each end?
Just a few questions that may have an impact on your solution...
Warren Vail
-----Original Message-----
From: Webmaster [mailto:webmaster
sweetphp.com]
Sent: Monday, November 17, 2003 2:19 PM
To: 'Jeff McKeon'
Cc: php-general
lists.php.net
Subject: RE: [PHP] Communicating with remote server
Well, I know how to run MySQL queries and connect to the db and things
like that. But I would like to be able to connect to a remote site (ex:
http://my-site.com/functions.php). Here I would like to run functions
from the remote functions.php file and have it connect to it's own
server's db. Then I want to be able to have certain information sent
back to me. Maybe sockets is the best way to do this, but I don't know
much about them. Any advice anyone?
Matt
-----Original Message-----
From: Jeff McKeon [mailto:jmckeon
telaurus.com]
Sent: Monday, November 17, 2003 5:14 PM
To: Matt Palermo
Cc: php-general
lists.php.net
Subject: RE: [PHP] Communicating with remote server
Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK. I would
> like this program to be able to connect to a remote server,
> call some functions that I specify, and return the right
> information (most likely from a MySQL db). I have access to
> the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server
> page and get all the results. I am new to cross-server
> comunication programming, so if anyone knows of a very
> detailed and easy to learn tutorial please send me the link.
> I would appreciate any help you are willing to offer.
>
> Thanks,
>
> Matt
For mysql queries I use this...
function db_connect($dbhost,$dbname,$dbuser,$dbpass) {
global $MYSQL_ERRNO, $MYSQL_ERROR;
$link = mysql_connect($dbhost,$dbname,$dbuser,$dbpass);
if (!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else if(empty($dbname) && !mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link;
}
$link_id=db_connect(dbname,db_user_name,db_user_pass);
Mysql_select_db(dbname, $link_id);
$query="select * from tablename";
$result=mysql_query($query);
While ($query_data=mysql_fetch_row($result))
{
echo $query_data[0],$query_data[1],$query_data[2],etc
}
Jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Yes, both my server and the remote server have webservers with PHP
installed. I have access to both servers to edit/modify/create files
etc. I don't have SSH on the server's though. I have FTP access, so I
can work with anything that way. I basically just need a relatively
easy way to communicate back and forth between the servers. I just have
no prior experience doing it so I need a little guidance.
Thanks,
Matt
-----Original Message-----
From: Vail, Warren [mailto:Warren.Vail
schwab.com]
Sent: Monday, November 17, 2003 7:09 PM
To: 'Webmaster'; 'Jeff McKeon'
Cc: php-general
lists.php.net
Subject: RE: [PHP] Communicating with remote server
Lot's of options.
Will this access be across the internet, or behind a firewall?
Are you concerned about securing your information from prying eyes?
You seem to be focusing on a script that runs on the remote machine,
does
this machine have a web server as well, or will you be executing PHP as
a
standalone process?
I am taking it for granted that you have PHP installed on the remote
machine?
Do you have access to commands like REXEC, RCP, RSH, SSH on your local
machine, and are the required daemons running on the remote machine?
What platforms are involved at each end?
Just a few questions that may have an impact on your solution...
Warren Vail
-----Original Message-----
From: Webmaster [mailto:webmaster
sweetphp.com]
Sent: Monday, November 17, 2003 2:19 PM
To: 'Jeff McKeon'
Cc: php-general
lists.php.net
Subject: RE: [PHP] Communicating with remote server
Well, I know how to run MySQL queries and connect to the db and things
like that. But I would like to be able to connect to a remote site (ex:
http://my-site.com/functions.php). Here I would like to run functions
from the remote functions.php file and have it connect to it's own
server's db. Then I want to be able to have certain information sent
back to me. Maybe sockets is the best way to do this, but I don't know
much about them. Any advice anyone?
Matt
-----Original Message-----
From: Jeff McKeon [mailto:jmckeon
telaurus.com]
Sent: Monday, November 17, 2003 5:14 PM
To: Matt Palermo
Cc: php-general
lists.php.net
Subject: RE: [PHP] Communicating with remote server
Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK. I would
> like this program to be able to connect to a remote server,
> call some functions that I specify, and return the right
> information (most likely from a MySQL db). I have access to
> the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server
> page and get all the results. I am new to cross-server
> comunication programming, so if anyone knows of a very
> detailed and easy to learn tutorial please send me the link.
> I would appreciate any help you are willing to offer.
>
> Thanks,
>
> Matt
For mysql queries I use this...
function db_connect($dbhost,$dbname,$dbuser,$dbpass) {
global $MYSQL_ERRNO, $MYSQL_ERROR;
$link = mysql_connect($dbhost,$dbname,$dbuser,$dbpass);
if (!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else if(empty($dbname) && !mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link;
}
$link_id=db_connect(dbname,db_user_name,db_user_pass);
Mysql_select_db(dbname, $link_id);
$query="select * from tablename";
$result=mysql_query($query);
While ($query_data=mysql_fetch_row($result))
{
echo $query_data[0],$query_data[1],$query_data[2],etc
}
Jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
If you don't care who sees your data, or you are operating behind a
firewall, then the simplest solution has already been mentioned (described
as http).
You basically code a script on your GTK app to perform an open (see fopen
function) to a url on the server machine like
"http://remotedbserver.com/phpfetchscript.php?var=foo&var2=bar" where foo
and bar specify the data selection criterion for your database script.
On the database server, under the control of it's web server, the script
phpfetchscript.php executes, referencing the parameters passed in the url
$var1 = $_GET["var"];
$var2 = $_GET["var2];
the phpfetchscript.php on the server then runs the query and begins echoing
the comma separated columns from the database, perhaps ending with a new
line "\n";
Your GTK app now begins performing fgets reads against the data until fgets
returns a false and does what it needs to do with the data, perhaps loading
it into a grid control, or some such.
The caviate is that anyone who can come up with the correct url (and can
access your database machine), will be able to trigger the extract of data.
If this is not acceptable, then you need to consider other options.
good luck,
Warren Vail
-----Original Message-----
From: Webmaster [mailto:webmaster
sweetphp.com]
Sent: Monday, November 17, 2003 5:31 PM
To: Vail, Warren; 'Jeff McKeon'
Cc: php-general
lists.php.net
Subject: RE: [PHP] Communicating with remote server
Yes, both my server and the remote server have webservers with PHP
installed. I have access to both servers to edit/modify/create files
etc. I don't have SSH on the server's though. I have FTP access, so I
can work with anything that way. I basically just need a relatively
easy way to communicate back and forth between the servers. I just have
no prior experience doing it so I need a little guidance.
Thanks,
Matt
-----Original Message-----
From: Vail, Warren [mailto:Warren.Vail
schwab.com]
Sent: Monday, November 17, 2003 7:09 PM
To: 'Webmaster'; 'Jeff McKeon'
Cc: php-general
lists.php.net
Subject: RE: [PHP] Communicating with remote server
Lot's of options.
Will this access be across the internet, or behind a firewall?
Are you concerned about securing your information from prying eyes?
You seem to be focusing on a script that runs on the remote machine,
does
this machine have a web server as well, or will you be executing PHP as
a
standalone process?
I am taking it for granted that you have PHP installed on the remote
machine?
Do you have access to commands like REXEC, RCP, RSH, SSH on your local
machine, and are the required daemons running on the remote machine?
What platforms are involved at each end?
Just a few questions that may have an impact on your solution...
Warren Vail
-----Original Message-----
From: Webmaster [mailto:webmaster
sweetphp.com]
Sent: Monday, November 17, 2003 2:19 PM
To: 'Jeff McKeon'
Cc: php-general
lists.php.net
Subject: RE: [PHP] Communicating with remote server
Well, I know how to run MySQL queries and connect to the db and things
like that. But I would like to be able to connect to a remote site (ex:
http://my-site.com/functions.php). Here I would like to run functions
from the remote functions.php file and have it connect to it's own
server's db. Then I want to be able to have certain information sent
back to me. Maybe sockets is the best way to do this, but I don't know
much about them. Any advice anyone?
Matt
-----Original Message-----
From: Jeff McKeon [mailto:jmckeon
telaurus.com]
Sent: Monday, November 17, 2003 5:14 PM
To: Matt Palermo
Cc: php-general
lists.php.net
Subject: RE: [PHP] Communicating with remote server
Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK. I would
> like this program to be able to connect to a remote server,
> call some functions that I specify, and return the right
> information (most likely from a MySQL db). I have access to
> the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server
> page and get all the results. I am new to cross-server
> comunication programming, so if anyone knows of a very
> detailed and easy to learn tutorial please send me the link.
> I would appreciate any help you are willing to offer.
>
> Thanks,
>
> Matt
For mysql queries I use this...
function db_connect($dbhost,$dbname,$dbuser,$dbpass) {
global $MYSQL_ERRNO, $MYSQL_ERROR;
$link = mysql_connect($dbhost,$dbname,$dbuser,$dbpass);
if (!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else if(empty($dbname) && !mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link;
}
$link_id=db_connect(dbname,db_user_name,db_user_pass);
Mysql_select_db(dbname, $link_id);
$query="select * from tablename";
$result=mysql_query($query);
While ($query_data=mysql_fetch_row($result))
{
echo $query_data[0],$query_data[1],$query_data[2],etc
}
Jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Vail, Warren wrote:
> The caviate is that anyone who can come up with the correct url (and can
> access your database machine), will be able to trigger the extract of data.
> If this is not acceptable, then you need to consider other options.
>
https connection and some secret string in a get variable or ip address
check will make it secure.
attached mail follows:
Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK. I would like this program
> to be able to connect to a remote server, call some functions that I
> specify, and return the right information (most likely from a MySQL db). I
> have access to the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server page and get all
> the results. I am new to cross-server comunication programming, so if
> anyone knows of a very detailed and easy to learn tutorial please send me
> the link. I would appreciate any help you are willing to offer.
Consider using SOAP or XML-RPC
--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
it is very, very good; and when it is bad,
it is better than nothing."
attached mail follows:
Hello,
I'm trying to use the program execution functions (like exec, system,
passthru, etc) with tcpclient (from Dan Bernstein's ucspi-tcp command
line tools), but get this error in the apache log with all of them:
tcpclient: fatal: unable to set up descriptor 7: file descriptor not
open
Any idea why this descriptor is not accessible? Here's what I'm
running:
Apache/1.3.28 (Darwin) PHP/4.3.2
Thanks!
Bill Shupp
attached mail follows:
On Nov 17, 2003, at 4:49 PM, Bill Shupp wrote:
> Hello,
>
> I'm trying to use the program execution functions (like exec, system,
> passthru, etc) with tcpclient (from Dan Bernstein's ucspi-tcp command
> line tools), but get this error in the apache log with all of them:
>
> tcpclient: fatal: unable to set up descriptor 7: file descriptor not
> open
>
> Any idea why this descriptor is not accessible? Here's what I'm
> running:
>
> Apache/1.3.28 (Darwin) PHP/4.3.2
Ok, I have discovered that this ONLY occurs when I have started a
session with session_start(). So, I'm assuming that session_start is
using file descriptor 7. Is there a way to control this?
Regards,
Bill Shupp
attached mail follows:
I have a friend who is has MCDBA, MCSE and MCSD he had 100% scores for
a couple of exams!
was a die hard fan of ASP.NET until recently when he discovered PHP.
hasn't written any ASP.NET code since. That should tell us something :-)
Mike R wrote:
>I have someone here at my desk arguing that Microsoft's .NET is better than
>PHP - faster to process, easier and quicker to program, etc.
>
>They also (claim) that Microsoft's SQL is much faster and such vs. MySQL.
>
>Any comments to help me defend PHP or to educate me?
>
>:)
>
>-Mike
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
Dan Joseph wrote:
>Hi,
>
> From my experiences, your coworkers are somewhat correct. I found MySQL to
>be as fast in most cases, however in databases with millions of records,
>MySQL started slowing down before the MS SQL did.
>
This is true for inserts but retrievals mysql would still be faster.
>
> As for PHP being slower to program, I disagree. Its about the same, and in
>some cases, PHP might have a few more shortcuts.
>
> Maybe they're using some visual editors to speed them up?
>
>-Dan Joseph
>
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
but still keep HTTP open... and that's running the notorius IIS :-)
Jason Wong wrote:
>On Tuesday 18 November 2003 00:27, Mike R wrote:
>
>
>>Actually, their claim is that Microsoft environments are secure - you just
>>need the proper firewall (that, basically, the problems with Windows boxes
>>has to do with the firewall, not the OS).
>>
>>That one I laughed at.
>>
>>
>
>But it's true, you can solve most of the security problems by tightening up
>the firewall so that nothing goes in or out.
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
you can with myODBC
Mike R wrote:
>You can't interface MySQL with ODBC?
>
>-Mike
>
>
>
>
>>I agree. I've found MS SQL (and MS Access databases) to be extremely fast
>>when well optimised, even with massive databases. As you can
>>interface with
>>them using ODBC I prefer to use MS database backends when my
>>clients already
>>have them installed alongside PHP for Win32.
>>
>>C
>>
>>
>>Hi,
>>
>> From my experiences, your coworkers are somewhat correct. I found
>>MySQL to
>>be as fast in most cases, however in databases with millions of records,
>>MySQL started slowing down before the MS SQL did.
>>
>> As for PHP being slower to program, I disagree. Its about the same,
>>and in
>>some cases, PHP might have a few more shortcuts.
>>
>> Maybe they're using some visual editors to speed them up?
>>
>>-Dan Joseph
>>
>>
>>
>>>-----Original Message-----
>>>From: Mike R [mailto:spycobalt
spyproductions.com]
>>>Sent: Monday, November 17, 2003 11:07 AM
>>>To: php-general
lists.php.net
>>>Subject: [PHP] Microsoft .NET arguement
>>>
>>>
>>>
>>>I have someone here at my desk arguing that Microsoft's .NET is
>>>better than
>>>PHP - faster to process, easier and quicker to program, etc.
>>>
>>>They also (claim) that Microsoft's SQL is much faster and such
>>>
>>>
>>vs. MySQL.
>>
>>
>>>Any comments to help me defend PHP or to educate me?
>>>
>>>:)
>>>
>>>
>>>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
On 11/17/2003 02:46 PM, Uros Gruber wrote:
> Subject: MMCache segmentation faults
>
> ===8<==============Original message text===============
> Hello!
>
> I send this to mmcache
turckware.ru but It was returned. So I'll ask here if somebody have any idea.
You can always try to mail dstogov
users.sourceforge.net .
> I upgrade my php and mmcache (php 4.3.4 and mmcache 2.4.6) and
> I have a lot of
>
> [Mon Nov 17 13:49:17 2003] [notice] child pid 32974 exit signal Segmentation fault (11)
> [Mon Nov 17 13:49:18 2003] [notice] child pid 32767 exit signal Segmentation fault (11)
> [Mon Nov 17 13:49:19 2003] [notice] child pid 33282 exit signal Segmentation fault (11)
> [Mon Nov 17 13:49:20 2003] [notice] child pid 33289 exit signal Segmentation fault (11)
> [Mon Nov 17 13:49:22 2003] [notice] child pid 33291 exit signal Segmentation fault (11)
> [Mon Nov 17 13:49:24 2003] [notice] child pid 33346 exit signal Segmentation fault (11)
>
> messages in my apache error log.
>
> server is FreeBSD 5.1 Release.
>
> my php.ini
>
> zend_extension="/usr/local/lib/php/20020429/mmcache.so"
> mmcache.shm_size="16"
> mmcache.cache_dir="/tmp/mmcache"
> mmcache.enable="1"
> mmcache.optimizer="1"
> mmcache.check_mtime="1"
> mmcache.debug="0"
> mmcache.filter=""
> mmcache.shm_max="0"
> mmcache.shm_ttl="0"
> mmcache.shm_prune_period="0"
> mmcache.shm_only="0"
> mmcache.compress="1"
> mmcache.keys="shm_and_disk"
> mmcache.sessions="shm_and_disk"
> mmcache.content="shm_and_disk"
>
> I delete cache folder when I upgrade. If i remove mmcache from php.ini
> there's no problems. But strange is that pages load normaly.
Have you tried it with the optimizer off?
Anyway, you may want to enable debug to be able to see in the Web server
error log, which scripts are actually crashing. Then you may try
isolating the fault to figure what exactly is the code that make the
server segfault.
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
All,
I'm not new to programing or web development but I am new to creating
dynamic pages.
I've read through a couple books. I've worked through problems and
exercises. Installed and configured the software a few different times
in Win32 and OS X. At this point, I feel I have a good handle on the
environment and lexical structure. What I don't have is a grasp on best
practices. For real sites I'm a little confused on how to implement all
this new knowledge. For example, I've got a site that was static with
bits of CGI to PHP. I was going to generate all the HTML from a PHP
script, but that turned into a mess. So I tried creating the pages is
mostly HTML with little bits of PHP. Placing the logic in another file
and linking the two pages. I'm not really sure if that is the best
approach.
My question, how do you guys build your pages? Do your scripts generate
all the HTML? I'm looking for tips and resources. Remember for my first
site I've embarked on a fairly large site. Code maintenance will be an
issue for me as I need to enhance and fix it later on.
Thanks guys!
Regards,
Adam
attached mail follows:
There's certainly nothing wrong with putting bits of PHP into a primarily
HTML document, but for very large, complicated sites (and you mention that
yours is), you'll probably want to use templates to separate out
presentation and logic.
http://smarty.php.net/
http://sourceforge.net/projects/xtpl/
--
Jason Godesky
jason
tribaldawn.com
http://www.tribaldawn.com/jason/
attached mail follows:
On Mon, 2003-11-17 at 20:47, Jason Godesky wrote:
>
> There's certainly nothing wrong with putting bits of PHP into a primarily
> HTML document, but for very large, complicated sites (and you mention that
> yours is), you'll probably want to use templates to separate out
> presentation and logic.
>
> http://smarty.php.net/
> http://sourceforge.net/projects/xtpl/
And there also:
http://www.interjinn.com
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Adam wrote:
> My question, how do you guys build your pages? Do your scripts
> generate all the HTML? I'm looking for tips and resources. Remember
> for my first site I've embarked on a fairly large site. Code
> maintenance will be an issue for me as I need to enhance and fix it
> later on.
>
The practice I would recommend is to remember to use functions for any
code that is reusable. I create a separate file that encapsulates all my
functions and include that file in all my scripts. That way every
function is available anywhere in the project, and you can always add to
that list. This is just one way you can break down your projects into
more manageable pieces.
- rob
http://www.phpexamples.net
attached mail follows:
At 04:20 18-11-03, you wrote:
>Adam wrote:
>
>>My question, how do you guys build your pages? Do your scripts generate
>>all the HTML? I'm looking for tips and resources. Remember for my first
>>site I've embarked on a fairly large site. Code maintenance will be an
>>issue for me as I need to enhance and fix it later on.
My mistake in coding is that I always start with the parts I know I can do,
then slowly add the other functionality. I would call this an organic way
of coding, and the more additions I make, the more little changes i need to
make to the existing code until it is full of extra conditions. This is
partly because my chef keeps inventing new functionality, but mostly
because I did not know how to write a proper plan (i did try).
I tried my own way, i tried Unified Modeling Language (UML) , but that was
a bit too heavy for a one-person coding project.
Right now I am rigourously reorganising the whole mess, which would not
have been necessary had I made better plan.
The most simple rule is: divide functionality. Do not mix logic with
presentation. Have your SQL part, your logic part and your presentation part.
And of course add loads of comment while you are working. Best for the
thinking process is to first make comments of the steps you want to make,
and only then add the code. I noticed that while writing the comments, I
would adjust my plans.
attached mail follows:
On Tuesday 18 November 2003 06:46, Jonathan Villa wrote:
> Thanks for the info, but I was hoping on getting some information as to
> why the code configuration I posted is not working.
Because it's incorrect. Try:
php_value auto_prepend_file header.inc
php_value auto_append_file footer.inc
--
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
------------------------------------------
/*
May you live in uninteresting times.
-- Chinese proverb
*/
attached mail follows:
PHP server will interpret .php extension files (index.php) as default.
What should I set if I want the PHP server also interpret .html files (e.g. index.html) before send to client?
Thank You !
.---------------------------------------.
| Message Posted by NewsgroupXplorer |
| http://www.newsgroupxplorer.com |
| |
| Your newsreader in your browser. |
`---------------------------------------'
attached mail follows:
On Monday 17 November 2003 18:03, BennyYim wrote:
> PHP server will interpret .php extension files (index.php) as default.
>
> What should I set if I want the PHP server also interpret .html files (e.g.
> index.html) before send to client?
If using apache:
AddType application/x-httpd-php .php .html
--
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
------------------------------------------
/*
Perhaps, after all, America never has been discovered. I myself would
say that it had merely been detected.
-- Oscar Wilde
*/
attached mail follows:
Hello,
I can't use the function rmdir:
Warning: rmdir() has been disabled for security reasons
But I do need to delete a directory with php. How can I do ? Is there
any way to delete an empty directory without using the rmdir function ?
I tried to use the unlink function on the directory, but It does not
work, it only works for files...
Thanks,
Vincent.
PS: list of disabled functions:
get_current_user, php_uname, putenv, set_time_limit, getmyuid, getmypid,
dl, mail, ini_alter, ini_restore, ini_set, exec, passthru, system,
popen, leak, mysql_list_dbs, listen, chown, chmod, chgrp, diskfreespace,
rmdir, realpath, tmpfile, link, imap_mail, email, mb_send_mail
attached mail follows:
ftp_rmdir()
Vincent M. wrote:
> Hello,
>
> I can't use the function rmdir:
> Warning: rmdir() has been disabled for security reasons
>
> But I do need to delete a directory with php. How can I do ? Is there
> any way to delete an empty directory without using the rmdir function ?
>
> I tried to use the unlink function on the directory, but It does not
> work, it only works for files...
>
> Thanks,
> Vincent.
>
> PS: list of disabled functions:
> get_current_user, php_uname, putenv, set_time_limit, getmyuid, getmypid,
> dl, mail, ini_alter, ini_restore, ini_set, exec, passthru, system,
> popen, leak, mysql_list_dbs, listen, chown, chmod, chgrp, diskfreespace,
> rmdir, realpath, tmpfile, link, imap_mail, email, mb_send_mail
>
attached mail follows:
I'm not lucky, there is no ftp access to the server. This can sound a
little strange, but there is no... :(
Marek Kilimajer wrote:
> ftp_rmdir()
>
> Vincent M. wrote:
>
>> Hello,
>>
>> I can't use the function rmdir:
>> Warning: rmdir() has been disabled for security reasons
>>
>> But I do need to delete a directory with php. How can I do ? Is there
>> any way to delete an empty directory without using the rmdir function ?
>>
>> I tried to use the unlink function on the directory, but It does not
>> work, it only works for files...
>>
>> Thanks,
>> Vincent.
>>
>> PS: list of disabled functions:
>> get_current_user, php_uname, putenv, set_time_limit, getmyuid,
>> getmypid, dl, mail, ini_alter, ini_restore, ini_set, exec, passthru,
>> system, popen, leak, mysql_list_dbs, listen, chown, chmod, chgrp,
>> diskfreespace, rmdir, realpath, tmpfile, link, imap_mail, email,
>> mb_send_mail
>>
attached mail follows:
On Mon, Nov 17, 2003 at 09:37:52PM -0500, Vincent M. wrote:
:
: I can't use the function rmdir:
: Warning: rmdir() has been disabled for security reasons
:
: But I do need to delete a directory with php. How can I do ? Is there
: any way to delete an empty directory without using the rmdir function ?
:
: I tried to use the unlink function on the directory, but It does not
: work, it only works for files...
Sounds like your PHP host did a thorough job of securing themselves.
If you can't do it, then you can't do it. Then it's a matter of talking
to your PHP host's admin and convincing him that the feature you need is
worth the effort.
attached mail follows:
Vincent M. wrote:
> I'm not lucky, there is no ftp access to the server. This can sound a
> little strange, but there is no... :(
>
Either talk to your host to change their policy or change the host. I
don't see any reason why rmdir should be disabled.
Or you can use smtp mail class to send mail to root
localhost saying
"Please, remove this directory" ;)
attached mail follows:
Hello...
I'm trying to make a search function for my site. This is how it needs to
work:
First, a user types in a search (ex: niagara falls). All the words then get
seperated or stay together, depending on the what the user selects in the
form. I can figure this out, all I have to do is use the explode() right?
Second, this array needs to search against a description on the database.
What I was thinking is getting the description ($description) and then
exploding that into an array and then comparing all arrays against each
other.
I'm pretty sure there's a way easier way to do this. Could someone enligthin
me?
Greatly appreciate any help in advance,
Dimitri Marshall
attached mail follows:
To reduce the time it takes to process it all you might want to try using LIKE
in your queries. This means your script will only have to process say 50
instead of 10 000 results. (Not saying your DB is this big).
For example:
SELECT page FROM table_name WHERE description LIKE '%$keyword%';
This is all off the top of my head so the syntax might be off a little.
Read some SQL documentation about LIKE for more information.
On Monday 17 November 2003 21:56, Dimitri Marshall wrote:
> Hello...
>
> I'm trying to make a search function for my site. This is how it needs to
> work:
>
> First, a user types in a search (ex: niagara falls). All the words then get
> seperated or stay together, depending on the what the user selects in the
> form. I can figure this out, all I have to do is use the explode() right?
>
> Second, this array needs to search against a description on the database.
> What I was thinking is getting the description ($description) and then
> exploding that into an array and then comparing all arrays against each
> other.
>
> I'm pretty sure there's a way easier way to do this. Could someone
> enligthin me?
>
> Greatly appreciate any help in advance,
> Dimitri Marshall
--
"I have a photographic memory. I just forgot the film" --Unknown
=============================
Ryan Thompson
rthomp
sympatico.ca
http://osgw.sourceforge.net
attached mail follows:
Hi,
Anyone know about imail.....?
attached mail follows:
D. Jame wrote:
>Hi,
>
>Anyone know about imail.....?
>
>
>
>
>
could you be any more vague?
attached mail follows:
Hi All,
I have an array of strings in the following format:
"abcd - rst"
"abcd - uvw"
"abcd - xyz"
"foobar - rst"
"blah - rst"
"googol - uvw"
What I want to do is strip everything from the " - " bit of the string to
the end, _but_ only for the strings that don't start with "abcd"
I was thinking something like the following:
echo ereg_replace("(!abcd) - xyz", "\\1", $str)."\n";
but obviously this doesn't work, otherwise I wouldn't be emailing the
list...
Can anyone help? I need to use ereg_replace() because it's part of our code
library and therefore can't change :(
TIA
Martin
attached mail follows:
On Tue, Nov 18, 2003 at 04:37:52PM +1100, Martin Towell wrote:
:
: I have an array of strings in the following format:
: "abcd - rst"
: "abcd - uvw"
: "abcd - xyz"
: "foobar - rst"
: "blah - rst"
: "googol - uvw"
:
: What I want to do is strip everything from the " - " bit of the string to
: the end, _but_ only for the strings that don't start with "abcd"
:
: I was thinking something like the following:
: echo ereg_replace("(!abcd) - xyz", "\\1", $str)."\n";
: but obviously this doesn't work, otherwise I wouldn't be emailing the
: list...
You can't use "!" because it's not a valid special character in regular
expressions. It's really hard to craft do-not-match-this-word patterns.
You're better off separating the two pieces of logic.
$arr = array(
"abcd - rst",
"abcd - uvw",
"abcd - xyz",
"foobar - rst",
"blah - rst",
"googol - uvw"
);
reset($arr);
while (list($key, $value) = each($arr))
{
if (substr($value, 0, 5) != 'abcd ')
{
$arr[$key] = ereg_replace('^(.*) - .*$', '\1', $value);
}
}
print_r($arr);
attached mail follows:
On Tuesday 18 November 2003 13:37, Martin Towell wrote:
> I have an array of strings in the following format:
> "abcd - rst"
> "abcd - uvw"
> "abcd - xyz"
> "foobar - rst"
> "blah - rst"
> "googol - uvw"
>
> What I want to do is strip everything from the " - " bit of the string to
> the end, _but_ only for the strings that don't start with "abcd"
>
> I was thinking something like the following:
> echo ereg_replace("(!abcd) - xyz", "\\1", $str)."\n";
> but obviously this doesn't work, otherwise I wouldn't be emailing the
> list...
>
> Can anyone help? I need to use ereg_replace() because it's part of our code
> library and therefore can't change :(
May be quicker (definitely easier) to explode() on ' - '.
--
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
------------------------------------------
/*
The giraffe you thought you offended last week is willing to be nuzzled today.
*/
attached mail follows:
On Monday 17 November 2003 23:37,
Martin Towell <martin.towell
world.net> sent a missive stating:
> Hi All,
>
> I have an array of strings in the following format:
> "abcd - rst"
> "abcd - uvw"
> "abcd - xyz"
> "foobar - rst"
> "blah - rst"
> "googol - uvw"
>
> What I want to do is strip everything from the " - " bit of the string to
> the end, _but_ only for the strings that don't start with "abcd"
>
> I was thinking something like the following:
> echo ereg_replace("(!abcd) - xyz", "\\1", $str)."\n";
> but obviously this doesn't work, otherwise I wouldn't be emailing the
> list...
>
> Can anyone help? I need to use ereg_replace() because it's part of our code
> library and therefore can't change :(
>
> TIA
> Martin
Possibly have to do a if statement, ereg for the abcd and then if ture, do
your ereg replace? I can't logically think how that would work in one regex,
since you want to match first and then replace...but my regex skills aren't
top notch either :)
Henrik
--
Henrik Hudson
listsNO
SPAMrhavenn.net
"`If there's anything more important than my ego
around, I want it caught and shot now.'"
--Hitchhikers Guide to the Galaxy
attached mail follows:
On Tue, 2003-11-18 at 02:30, Jason Wong wrote:
> On Tuesday 18 November 2003 13:37, Martin Towell wrote:
>
> > I have an array of strings in the following format:
> > "abcd - rst"
> > "abcd - uvw"
> > "abcd - xyz"
> > "foobar - rst"
> > "blah - rst"
> > "googol - uvw"
> >
> > What I want to do is strip everything from the " - " bit of the string to
> > the end, _but_ only for the strings that don't start with "abcd"
> >
> > I was thinking something like the following:
> > echo ereg_replace("(!abcd) - xyz", "\\1", $str)."\n";
> > but obviously this doesn't work, otherwise I wouldn't be emailing the
> > list...
> >
> > Can anyone help? I need to use ereg_replace() because it's part of our code
> > library and therefore can't change :(
>
> May be quicker (definitely easier) to explode() on ' - '.
The following is untested:
-----------------------------------------------------------
foreach( $myArray as $id => $entry )
{
if( ($pos = strpos( 'abcd' ) !== false && $pos === 0 )
{
$parts = explode( ' - ', $entry );
$myArray[$id] = $parts[0];
}
}
print_r( $myArray );
-----------------------------------------------------------
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Hey List-
Hoping someone can point me in the right direction :)
OS: FreeBSD 4.4, patched
OpenSSL: 0.9.7c
Apache: 1.3.27
PHP: 4.3.4
PayFlow: 3.06
I've compiled PHP with various flags and the Payflow flag,
--with-pfpro=shared,/usr/local and added the extension to the php.ini file.
Running phpinfo() shows that the extension loads and when I do a
pfpro_version() I get 306 spit back at me. The problem is this:
No matter where I do a pfpro_init() it just spits me back to whatever site I'm
coming from in Mozilla and IE just sits and spins it's wheels forever. I
can't find any messages in any error log, anywhere (Apache or PHP) as to what
it's doing or not doing.
If I bypass pfpro_init and just call the process function (pfpro_process) and
it's happy with it's input then it still "freezes" doing the init call
internally.
Running the test.sh script from the CLI works just fine as does passing
arguments to the pfpro binary directly, but I would prefer to work from
within the library and not do system calls.
Any suggestions on where to look? or solutions? Did I just miss a step in
installation?
Thanks.
Henrik
--
Henrik Hudson
listsNO
SPAMrhavenn.net
"`If there's anything more important than my ego
around, I want it caught and shot now.'"
--Hitchhikers Guide to the Galaxy
attached mail follows:
thanks for your soln, I searched the web, and got some readymade soln files
too, I have one question regarding this,
if my php.ini is giving me 'session.save_handler' as 'files' and as server
is a shared server so i may not be able to change it, so what can we do to
resolve this ?
manisha
"Burhan Khalid" <phplist
meidomus.com> wrote in message
news:3FB90094.3010405
meidomus.com...
> Manisha Sathe wrote:
>
> > I hv physically one single server, but with different websites on it
> >
> > like www.aaa.com / www.bbb.com / www.ccc.com
> >
> > Now the problem is about session. What I want is login page at
www.aaa.com
> > only but session is accessible from www.bbb.com and www.ccc.com
> >
> > can it be possible, if yes how ? if no any other work around ?
>
> You can store the session information in a database that can be read
> from all three websites.
>
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
> -----------------------
> "Documentation is like sex: when it is good,
> it is very, very good; and when it is bad,
> it is better than nothing."
attached mail follows:
PHP Questions
1. Explain about session management and cookies ? In PHP how we can maintain
a session
2. What is HTTP tunneling
3. How to enable PHP in Apache server manually?
4. When we upload a file using <INPUT> tag of the type FILE what are global
variables become available for use in PHP
5. Explain SQL injections ? How we can avoid this
6. Write a small script to connect a MYSQL server in PHP
7. Given a class B network with subnet mask of 255.255.248.0 and a packet
addressed to 130.40.32.16 whatis subnet address
8. Using single Apache server can we host multiple sites . If yes how can we
do this if no why it is not possible
9. what is search engine optimization ? In HTML using which tag we can
attain this?
10. Write a function in PHP script to check whether string is a valid email
id or not?
_________________________________________________________________
Garfield on your mobile. Download now. http://server1.msn.co.in/sp03/gprs/
How cool can life get?
attached mail follows:
On Tuesday 18 November 2003 01:12,
"Arivazhagi Govindarajan" <ammu_flash
hotmail.com> sent a missive stating:
> PHP Questions
>
> 1. Explain about session management and cookies ? In PHP how we can
> maintain a session
http://us3.php.net/session
> 3. How to enable PHP in Apache server manually?
http://us3.php.net/manual/en/installation.php
> 4. When we upload a file using <INPUT> tag of the type FILE what are global
> variables become available for use in PHP
http://us2.php.net/features.file-upload
> 5. Explain SQL injections ? How we can avoid this
See various web docs. Try Google or PHP site. PLenty of info.
> 6. Write a small script to connect a MYSQL server in PHP
http://us2.php.net/function.mysql-connect
> 8. Using single Apache server can we host multiple sites . If yes how can
> we do this if no why it is not possible
Yes.
http://httpd.apache.org/docs/ or http://httpd.apache.org/docs-2.0/
> 10. Write a function in PHP script to check whether string is a valid email
> id or not?
Lookup email and regular expression checking. About 10 examples are here as
well:
http://us2.php.net/ereg
Henrik
--
Henrik Hudson
listsNO
SPAMrhavenn.net
"`If there's anything more important than my ego
around, I want it caught and shot now.'"
--Hitchhikers Guide to the Galaxy
attached mail follows:
"Arivazhagi Govindarajan" <ammu_flash
hotmail.com> wrote in message
news:BAY10-F124TyWXc6YkN00004c7a
hotmail.com...
> PHP Questions
This would not be homework or exam questions, right?
rush
--
http://www.templatetamer.com/
attached mail follows:
I am in the beginning phases of developing a support system. I would
like the program to be able to receiving and process e-mails. However,
I am at a loss as to where to start.
The main roadblock, at this point, is how to best receive and process
the e-mail. I have looked at 2 options.
1) Use a cron job to execute a php script every x minutes.
2) Create a script where mail can be piped to. This is a method that I
have used previously with a cgi app called PerlDesk.
While I could develop the first option, the second option is the method
of choice, but I have no clue how to implement that. Would anyone
happen to have any suggestions on where to start? Perhaps, someplace
where I could go for further research?
Thank You,
Jason Williard
attached mail follows:
On Tuesday 18 November 2003 01:21,
"Jason Williard" <jason
janix.net> sent a missive stating:
> 1) Use a cron job to execute a php script every x minutes.
> 2) Create a script where mail can be piped to. This is a method that I
> have used previously with a cgi app called PerlDesk.
>
> While I could develop the first option, the second option is the method
> of choice, but I have no clue how to implement that. Would anyone
> happen to have any suggestions on where to start? Perhaps, someplace
> where I could go for further research?
Although you could use CLI PHP for this, I would use Perl or even better, C.
PHP is really meant to run via a web browser and what you're talking about is
all backend code. Look into playing with procmail and Perl or C.
Henrik
--
Henrik Hudson
listsNO
SPAMrhavenn.net
"`If there's anything more important than my ego
around, I want it caught and shot now.'"
--Hitchhikers Guide to the Galaxy
attached mail follows:
On Tuesday 18 November 2003 15:21, Jason Williard wrote:
> I am in the beginning phases of developing a support system. I would
> like the program to be able to receiving and process e-mails. However,
> I am at a loss as to where to start.
[snip]
> 2) Create a script where mail can be piped to. This is a method that I
> have used previously with a cgi app called PerlDesk.
>
> While I could develop the first option, the second option is the method
> of choice, but I have no clue how to implement that. Would anyone
> happen to have any suggestions on where to start? Perhaps, someplace
> where I could go for further research?
As usual, if you can think of a question, chances are it has already been
asked and answered before. So your first port of call is either google or the
list archives. "php process mail" would be an obviously good search term.
--
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
------------------------------------------
/*
Money cannot buy love, nor even friendship.
*/
attached mail follows:
On Tue, 2003-11-18 at 02:19, Henrik Hudson wrote:
> On Tuesday 18 November 2003 01:21,
> "Jason Williard" <jason
janix.net> sent a missive stating:
>
> > 1) Use a cron job to execute a php script every x minutes.
> > 2) Create a script where mail can be piped to. This is a method that I
> > have used previously with a cgi app called PerlDesk.
> >
> > While I could develop the first option, the second option is the method
> > of choice, but I have no clue how to implement that. Would anyone
> > happen to have any suggestions on where to start? Perhaps, someplace
> > where I could go for further research?
>
> Although you could use CLI PHP for this, I would use Perl or even better, C.
> PHP is really meant to run via a web browser and what you're talking about is
> all backend code. Look into playing with procmail and Perl or C.
Ummm, I've been using PHP for shell based scripts for years now. Are you
telling me all the re-usable power of my InterJinn web scripts is
foolish and that I should recode them as Perl or C? Eeeek, I though the
whole point of CLI was to empower non-web application programming with
PHP.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
> 2) Create a script where mail can be piped to. This is a method that I
> have used previously with a cgi app called PerlDesk.
In answer to Point 2...
If you are in a position to edit your 'aliases file' you can feed email to a
program using PHP quite easily. I am doing it and works quite well.
So, 1st, edit your file (generally in /etc/mail/aliases) and add the line:
testit: "|/usr/local/bin/php /path/to/your/php/file/processmail.php"
(making sure this is the path to php etc)
Below is an example how to capture the mail, the following simply reads the
email into $buffer and emails it, this should hopefully point yu in the
right direction...
<?php
define('STDIN',fopen("php://stdin","r"));
$str = fgets(STDIN);
$fp = popen('cat /dev/fd/0','r');
while(!feof($fp)) {
$lines = fgets($fp,4096)."\n";
}
$handle = STDIN;
while (!feof ($handle)) {
$buffer .= fgets($handle, 4096);
echo $buffer;
}
fclose ($handle);
mail("me
domain.com","Test","Test Test...\n\nOriginal Email:\n\n$buffer");
?>
- Brian M McGarvie - IT Manager (e-loanshop.com).
- www.devdojo.com (Developer Community)
attached mail follows:
Hello,
I am trying to write a simple application using PHP on a Windows 2000
server. There is one text box for input and one search button. Basically
the user would input a file name (for example "help.pdf") and then the php
script would search a directory (for example "c:\help\") and subfolders
for that file. If the file is found, I would like to automatically
display the file using Adobe Acrobat. Ideally I would like to be able to
use wildcards and obtain a list of results linking to the files. Any
ideas on a good way to do this? I am mainly interested in how the search
should work.
Thanks
Jamie
attached mail follows:
PHPDiscuss - PHP Newsgroups and mailing lists wrote:
> Hello,
>
> I am trying to write a simple application using PHP on a Windows 2000
> server. There is one text box for input and one search button. Basically
> the user would input a file name (for example "help.pdf") and then the php
> script would search a directory (for example "c:\help\") and subfolders
> for that file. If the file is found, I would like to automatically
> display the file using Adobe Acrobat. Ideally I would like to be able to
> use wildcards and obtain a list of results linking to the files. Any
> ideas on a good way to do this? I am mainly interested in how the search
> should work.
You could use the filesystem functions and read the directory's contents
into an array and search that array for your file. Look up
http://www.php.net/filesystem
--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
it is very, very good; and when it is bad,
it is better than nothing."
attached mail follows:
hello
Is there a php function close to the *nix diff comand?
(in order to compare 2 multi-lines strings)
thanx
attached mail follows:
I using WinXP + Apache 1.3.24 + PHP 4.3.3
My apache default will interpret .php extension file. (e.g.
index.php)
If I have a PHP page, but I want to use .html file extension (e.g. index.html).
what I need to set to make those html extension page be interpret by server.
I want those .html extension PHP page be interpret.
Thank You !
.---------------------------------------.
| Message Posted by NewsgroupXplorer |
| http://www.newsgroupxplorer.com |
| |
| Your newsreader in your browser. |
`---------------------------------------'
attached mail follows:
That's simple, just modify your Apache httpd.conf on the line where it says something along the lines of:
AddType application/x-httpd-php .php4 .php .php3 .inc
change it to:
AddType application/x-httpd-php .php4 .php .html .php3 .inc
----- Original Message -----
From: BennyYim
To: php-general
lists.php.net
Sent: Tuesday, November 18, 2003 5:46 AM
Subject: [PHP] .html extension PHP page be interpret
I using WinXP + Apache 1.3.24 + PHP 4.3.3
My apache default will interpret .php extension file. (e.g.
index.php)
If I have a PHP page, but I want to use .html file extension (e.g. index.html).
what I need to set to make those html extension page be interpret by server.
I want those .html extension PHP page be interpret.
Thank You !
.---------------------------------------.
| Message Posted by NewsgroupXplorer |
| http://www.newsgroupxplorer.com |
| |
| Your newsreader in your browser. |
`---------------------------------------'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Tue, Nov 18, 2003 at 10:46:48AM -0000, BennyYim wrote:
:
: I using WinXP + Apache 1.3.24 + PHP 4.3.3
:
: My apache default will interpret .php extension file. (e.g.
: index.php)
:
: If I have a PHP page, but I want to use .html file extension (e.g. index.html).
: what I need to set to make those html extension page be interpret by server.
:
: I want those .html extension PHP page be interpret.
Look for the following line in your Apache configuration file and change
it thusly:
AddType application/x-httpd-php .php .html
See the online docs for more specifics:
http://www.php.net/manual/en/install.apache.php
attached mail follows:
> -----Oorspronkelijk bericht-----
> That's simple, just modify your Apache httpd.conf on the line
> where it says something along the lines of:
>
> AddType application/x-httpd-php .php4 .php .php3 .inc
>
> change it to:
>
> AddType application/x-httpd-php .php4 .php .html .php3 .inc
And please, PLEASE remove ".inc" from the list, and add smth like
<Files /.*\.inc/>
Deny from all
</Files>
I'm not sure about the syntax, but believe me .. what I am telling you is
what you want :D:D
Wouter
attached mail follows:
On Mon, 17 Nov 2003 15:30:43 +0000, Curt Zirzow wrote:
> * Thus wrote Arne Rusek (zonk
matfyz.cz):
> Your problem exists here:
>
> Server API => Command Line Interface
> _ENV["SERVER_SOFTWARE"] => Boa/0.94.13
>
> Seeing this tells me your webserver is not configured correctly,
> Boa should not be using the CLI version of php it should be using
> the CGI version.
Thank you, that was it. Boa can't run php directly. So i made php files
executable and added '#!/usr/bin/php4' at the beginning of the script.
Instead of that I should have used the cgi version, as you suggested,
which was /usr/lib/cgi-bin/php4.
Take care.
Arne Rusek
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]