php-general Digest 13 Jul 2003 02:10:15 -0000 Issue 2172
Topics (messages 154956 through 154984):
Re: imagecreate() error
154956 by: Philip Olson
154971 by: Michelle Bernard
Re: Configuration Problems
154957 by: Philip Olson
Re: REGULAR EXPRESSION HELP
154958 by: John W. Holmes
Is it possible to test an uploaded file to check the type?
154959 by: Dan Anderson
154961 by: Jason Wong
How can I clean uploaded files from /tmp in safe mode?
154960 by: Dan Anderson
154962 by: Jason Wong
154964 by: Dan Anderson
0x0A after download using a PHP script
154963 by: news.verizon.net
154968 by: Alexander Vilens
0x0A after download using a PHP script (repost)
154965 by: news.verizon.net
PHP list posting confirmation for [EMAIL PROTECTED]
154966 by: Alexander Vilens
connect between PHP?
154967 by: Schna
Looking for experienced PHP programmer in the Memphis, TN area
154969 by: Michael Sims
connecting to access database
154970 by: pehepe php
154974 by: Simon Fredriksson
Need PHP on Win2000 Pro
154972 by: John A. Thomason
154975 by: John Nichel
154977 by: Haplo
Writing to file with function
154973 by: Jason Giangrande
154978 by: Jason Giangrande
Re: Mailing list server with PHP frontend
154976 by: Manuel Lemos
Parsing a file (fopen) and replacing text...
154979 by: Quiller
154980 by: Justin Farnsworth
OK, So I am new to these List. Win2000 help!
154981 by: John A. Thomason
touch file on shared web server?
154982 by: Paul O'Neil
Newbie Directory question
154983 by: brian.bhtsystems.com
Code and Good Design Methods
154984 by: Dan J. Rychlik
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hello Michelle-
a) Only enable one GD dll, so use php_gd2.dll.
b) Consider using imagecreatetruecolor() instead but
either will work.
c) When asking support questions, it's important to
say exactly what version, although in this case
we know it's 4.3.0-1 as php_gd.dll was removed in
PHP 4.3.2
Anyway, enable just one dll and it should work. Be sure
to restart the web server afterwards.
Regards,
Philip
On Sat, 12 Jul 2003, Michelle Bernard wrote:
> Hi there,
>
> I am running PHP 4.3 something or other, I have enabled php_gd.dll and
> php_gd2.dll, pointed the extension directory to the right place, looked at
> the phpinfo and it has the correct information about the gd's being enabled,
> I have tried reintalling apache and php...but still get errors on all simple
> scripts that i have tried...
>
> this is the error I get..
>
> Fatal error: Call to undefined function: imagecreate()
>
> any suggestions or tips?
>
> Thank you!!!
>
> Sincerely
> Michelle
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi Philip,
Thanks for your response, I tried those steps, still no go, getting that
same error....
"Philip Olson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello Michelle-
>
> a) Only enable one GD dll, so use php_gd2.dll.
> b) Consider using imagecreatetruecolor() instead but
> either will work.
> c) When asking support questions, it's important to
> say exactly what version, although in this case
> we know it's 4.3.0-1 as php_gd.dll was removed in
> PHP 4.3.2
>
> Anyway, enable just one dll and it should work. Be sure
> to restart the web server afterwards.
>
> Regards,
> Philip
>
>
> On Sat, 12 Jul 2003, Michelle Bernard wrote:
>
> > Hi there,
> >
> > I am running PHP 4.3 something or other, I have enabled php_gd.dll and
> > php_gd2.dll, pointed the extension directory to the right place, looked
at
> > the phpinfo and it has the correct information about the gd's being
enabled,
> > I have tried reintalling apache and php...but still get errors on all
simple
> > scripts that i have tried...
> >
> > this is the error I get..
> >
> > Fatal error: Call to undefined function: imagecreate()
> >
> > any suggestions or tips?
> >
> > Thank you!!!
> >
> > Sincerely
> > Michelle
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
--- End Message ---
--- Begin Message ---
Here's a faq:
http://www.faqts.com/knowledge_base/view.phtml/aid/15670/fid/30
You need to upgrade your old DCOM.
Regards,
Philip
On Sat, 12 Jul 2003, Arun wrote:
> I have installed Apache 2.0.47 and php 4.3.2 in Windows 98. Downloaded the
> php in the .zip format.
>
> The Apache server works properly without the inclusion of php.
> The problem is apache dosent even start with php in the SAPI mode,it gives a
> error stating that:
>
> "One of the device attached to the system isnt functioning properly"
> (or)
> "Library files missing"
>
> and in the CGI mode the apache server starts and it executes the .html files
> but it dosent execute the .php file or the .html files with php commands
> giving an error statement:
>
> "Internal Server Error
> The server encountered an internal error or misconfiguration and was unable
> to complete your request."
> with a dialog box message stating that
> "The PHP4TS.DLL file is linked to missing export OLEAUT32.DLL:77."
> (I do have the OLEAUT32.DLL file in the same folder as the PHP4TS.DLL file)
>
> I have copied all the .dlls and php.ini to their respective places as given
> in the manual but still dosent work.
> I am hoping some one could give me a suggestion or a solution to my problem.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
John wrote:
I need to match a pattern, not in a single-line but from a HTML page, which
obviously has loads of lines. I need to match 2 lines from this HTML page:
1) <HTML><TITLE>FirstVariable - Second Variable</TITLE></HTML>........
2) <TABLE><TD><TR>(newline)
ThirdVariable</TR></TD></TABLE>...
I tried this code:
1) preg_match("/<HTML><TITLE>(\S+) - (\S+)</TITLE></HTML>/", $html_page,
$variables);
2) preg_match("/<TABLE><TD><TR>\n(\S+)</TR></TD></TABLE>/", $html_page,
$variables);
The first 2 variables are matched into the $variables array but not the
third one. Sometimes when the third one is matched, it starts from where I
want it to start but takes all the text to the end of the HTML document!
Your "newline" may be \r\n or \r instead of just \n.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
make sure it is of a certain format? I want to allow a user to only
upload jpegs or mpegs, and want to check what format the file is in.
Thanks in advance,
Dan Anderson
--- End Message ---
--- Begin Message ---
On Sunday 13 July 2003 01:24, Dan Anderson wrote:
> Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
> make sure it is of a certain format? I want to allow a user to only
> upload jpegs or mpegs, and want to check what format the file is in.
If on un*x you can use the 'file' program. Also search on freshmeat.net, I
believe there is a php-based program which gives info on the common media
type files.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Beauty, n.:
The power by which a woman charms a lover and terrifies a husband.
-- Ambrose Bierce
*/
--- End Message ---
--- Begin Message ---
I am running a script which accepts uploaded files in safe mode. Is
there a way to get rid of all files stored in /tmp using PHP or do I
need to run a cron jobbed script to delete files of the form "php*"?
Thanks in advance,
Dan Anderson
--- End Message ---
--- Begin Message ---
On Sunday 13 July 2003 01:26, Dan Anderson wrote:
> I am running a script which accepts uploaded files in safe mode. Is
> there a way to get rid of all files stored in /tmp using PHP or do I
> need to run a cron jobbed script to delete files of the form "php*"?
Uploaded files should automatically be purged when script ends. What are you
trying to do?
--
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
------------------------------------------
/*
hangover, n.:
The wrath of grapes.
*/
--- End Message ---
--- Begin Message ---
> Uploaded files should automatically be purged when script ends. What are you
> trying to do?
Ahhhh...thank you....I didn't realize they were deleted when the script
ended.
-Dan
--- End Message ---
--- Begin Message ---
Hi.
I've a script to download a file. The script adds the 1st byte 0x0A to the
downloaded file no matter what I do:
if ($file = fopen($path, 'rb')) {
while(!feof($file) and (connection_status()==0)) {
print(fread($file, 1024*8));
flush();
}
}
Even, when I comment out the loop, my file contains this single byte 0x0A.
Please Help!
Thank you,
Alex
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi there.
I had to use ob_clean() function to discard the contents of the output
buffer which had this byte 0x0A.
Thank you,
Alex.
--- End Message ---
--- Begin Message ---
Hi there again.
Sorry for reposting, did not realize outlook express put "News.Verizon.Net"
on the "From" field.
I've a script to download a file. The script adds the 1st byte 0x0A to the
downloaded file no matter what I do:
if ($file = fopen($path, 'rb')) {
while(!feof($file) and (connection_status()==0)) {
print(fread($file, 1024*8));
flush();
}
}
Even, when I comment out the loop, my file contains this single byte 0x0A.
Please Help!
Thank you,
Alex.
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
[confirm: d4f4e96b28db80982ba1cdf3572dbcee [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hey all
Im using PHP running as chat bot and running on Linux.
I really need use relay message between two PHP that running on same time.
(multiple PHP running on one server)
Is it possible that PHP running connect or value message to other PHP
running?
Thanks :)
--- End Message ---
--- Begin Message ---
Hi,
Sorry if this is frowned upon, but my company is looking for another
PHP developer, and I figured I'd post the job ad here. We haven't had
much luck finding PHP people in the past so I was hoping maybe I'd
catch some eyes of people who maybe aren't necessarily actively
looking for a new job. The job ad is below, please email resumes and
sample code from a recent project (or questions about the position)
to "michaels at crye-leike dot com". Thanks for looking, here's the
ad:
-----------------------
Crye-Leike, Realtors, the leading real estate company in the
Mid-South, seeks an experienced web developer. Our current environment
utilizes both Linux /Apache/PHP and NT/IIS/ASP.
This position requires strong technical knowledge in a server-side
scripting technology such as PHP (preferred) /JSP/Perl/ASP. Knowledge
of SQL queries, stored procedures and database design required. Must
have experience in HTML/CSS and familiarity with HTTP and networking
concepts. Graphic design and user-interface skills are desired.
Experience with CVS and Linux/Unix shell environments a plus.
The successful candidate will have at least 1 year of development
experience, and the motivation and desire to learn new technologies.
Must be able to analyze business requirements and specifications,
develop, enhance, test and troubleshoot applications independently and
with a team. May own responsibility for entire projects. Will also be
required to support existing applications.
Send resume including sample code from a recent project. Resumes
without sample code will not be considered. Applicants may be tested
for proficiency.
--- End Message ---
--- Begin Message ---
How can we connect microsoft access database(*.mdb) or excel(*.xls) with
php?
What are the codes which achieve this?
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
--- End Message ---
--- Begin Message ---
If you're using a windows platform, an easy way out is using ODBC.
Besides that there are a few classes out there, but I've not found any
that were good enough, or they were commercial.
//Simon
Pehepe Php wrote:
How can we connect microsoft access database(*.mdb) or excel(*.xls) with
php?
What are the codes which achieve this?
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
--- End Message ---
--- Begin Message ---
Hello,
I need some advice on getting PHP 4 up and running on my Windows 2000
Professional. I have followed all of the instructions in the installation
file, but when I try to run a PHP as a batch from the command prompt, all I
get is the file listed. Help!
John A. Thomason
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
John A. Thomason wrote:
Hello,
I need some advice on getting PHP 4 up and running on my Windows 2000
Professional. I have followed all of the instructions in the installation
file, but when I try to run a PHP as a batch from the command prompt, all I
get is the file listed. Help!
John A. Thomason
[EMAIL PROTECTED]
Apache, IIS, something else?
--- End Message ---
--- Begin Message ---
Hi,
I use Nusphere, it has PHP, MySql and Apache and I use it for non-production
only!
There is also a program out there called phptriad to.
Haplo
----- Original Message -----
From: "John Nichel" <[EMAIL PROTECTED]>
To: "John A. Thomason" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, July 12, 2003 6:21 PM
Subject: Re: [PHP] Need PHP on Win2000 Pro
> John A. Thomason wrote:
> > Hello,
> >
> > I need some advice on getting PHP 4 up and running on my Windows 2000
> > Professional. I have followed all of the instructions in the
installation
> > file, but when I try to run a PHP as a batch from the command prompt,
all I
> > get is the file listed. Help!
> >
> > John A. Thomason
> > [EMAIL PROTECTED]
>
> Apache, IIS, something else?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
I have written this function to rewrite the contents of a text file
after it's been updated. I store lines of data in an array and then
implode them into one string. The problem is that I'm getting an extra
line break (in other words a blank line is showing up in my text file)
after I modify a particular line. I checked the imploded string with
var_dump and don't see any line breaks besides the ones that separate
each line. Anyone have any ideas as to why I'm getting an extra line
break? The function is below with the code that calls it below that.
Jason
// Rewrite data file from array of file lines
function rewrite_file($lines) {
$filecontents = implode("\n", $lines);
$fh = fopen("data.txt", "w") or die("Could not open file.");
flock($fh, LOCK_EX);
if (fwrite($fh, $filecontents) == -1) {
die("File could not be written to.");
}
ftruncate($fh, ftell($fh)) or die("Error.");
flock($fh, LOCK_UN);
fclose($fh) or die("Error.");
}
<-###########################################################->
$uid = $_POST['id'];
$title = stripslashes(strip_tags(trim($_POST['title'])));
$name = array_search($username, $full_name);
$email = array_search($username, $user_email);
$date = $_POST['date'];
$category = $_POST['category'];
$article = stripslashes(trim($_POST['article']));
$data_array = array($uid, $title, $name, $email, $date, $category,
$article);
$data_line = implode($separator, $data_array)."\n";
$filelines = return_lines(); // Reads file and returns array of it's
lines.
for ($i = 0; $i <= count($filelines); $i++) { // loop through array in
order
if (strstr($filelines[$i], $uid) != FALSE) {
$data_pos = array_search($filelines[$i], $filelines);
array_splice($filelines, $data_pos, 1, $data_line);
}
}
rewrite_file($filelines);
--- End Message ---
--- Begin Message ---
Never mind everyone, I figured it out. In this line:
$data_line = implode($separator, $data_array)."\n";
I was adding a newline when I didn't need too.
Jason
On Sat, 2003-07-12 at 17:03, Jason Giangrande wrote:
> I have written this function to rewrite the contents of a text file
> after it's been updated. I store lines of data in an array and then
> implode them into one string. The problem is that I'm getting an extra
> line break (in other words a blank line is showing up in my text file)
> after I modify a particular line. I checked the imploded string with
> var_dump and don't see any line breaks besides the ones that separate
> each line. Anyone have any ideas as to why I'm getting an extra line
> break? The function is below with the code that calls it below that.
>
> Jason
>
> // Rewrite data file from array of file lines
> function rewrite_file($lines) {
> $filecontents = implode("\n", $lines);
> $fh = fopen("data.txt", "w") or die("Could not open file.");
> flock($fh, LOCK_EX);
> if (fwrite($fh, $filecontents) == -1) {
> die("File could not be written to.");
> }
> ftruncate($fh, ftell($fh)) or die("Error.");
> flock($fh, LOCK_UN);
> fclose($fh) or die("Error.");
> }
>
> <-###########################################################->
>
> $uid = $_POST['id'];
> $title = stripslashes(strip_tags(trim($_POST['title'])));
> $name = array_search($username, $full_name);
> $email = array_search($username, $user_email);
> $date = $_POST['date'];
> $category = $_POST['category'];
> $article = stripslashes(trim($_POST['article']));
>
> $data_array = array($uid, $title, $name, $email, $date, $category,
> $article);
> $data_line = implode($separator, $data_array)."\n";
>
> $filelines = return_lines(); // Reads file and returns array of it's
> lines.
> for ($i = 0; $i <= count($filelines); $i++) { // loop through array in
> order
> if (strstr($filelines[$i], $uid) != FALSE) {
> $data_pos = array_search($filelines[$i], $filelines);
> array_splice($filelines, $data_pos, 1, $data_line);
> }
> }
> rewrite_file($filelines);
>
--- End Message ---
--- Begin Message ---
Hello,
On 07/11/2003 08:47 PM, Juan Nin wrote:
I want to know if anyone knows about a good mailing list manager that has
got a PHP administration frontend
I've found many PHP scripts for sending newsletters and announcementes, but
that's it's not what I want
I want a system like Mailman, Sympa or Majordomo (the mailing list server
may be programmed in Perl or whatever), but it must provide a PHP frontend
for administration, subscription, etc
You may want to try this class for creating lists with the ezmlm mailing
list manager. It has support for creating and editing the lists
properties and even has a SOAP interface for accessing the subscriptions
from remote machines.
http://www.phpclasses.org/ezmlmmanager
It would be great if messages are stored in a database like MySQL and it
must be free software
Does this exist??
ezmlm has MySQL bindings for managing the subscription records. The
messages are stored in disk files though.
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
This is for a very inefficient skin script I'm writing; the CMS I am using
is based in PHP but generates static files, so in order to change skins I am
opening the page in question and loading it into $url. From there I do an
ereg and take out what I need. The script itself can be found:
http://equiller.com/skins/skin.txt
And an example of it in use:
http://equiller.com/skins/skin.php?url=http://equiller.com/markviii.htm&skin
=tan
What I need to do to complete this is to format my navigation depending on
the skin being used. The navigation files are staticly generated as nav.htm
in each area. Now, an easy way would just take:
< div id=nav001><a href=#>navigation peice</a></div>
< div id=nav002><a href=#>navigation peice</a></div>
< div id=nav003><a href=#>navigation peice</a></div>
< div id=nav004><a href=#>navigation peice</a></div>
Then take each peice out, put some code around it and transform it into:
<table cellpadding=0 cellspacing=2 border=1>
<tr>
<td id=nav001><a href=#>navigation peice</a></td></tr>
<tr>
<td id=nav002><a href=#>navigation peice</a></td></tr>
<tr>
<td id=nav003><a href=#>navigation peice</a></td></tr>
<tr>
<td id=nav004><a href=#>navigation peice</a></td></tr>
</table>
Is this possible? Is there any easier, less server-intensive way to do what
I am attempting? Thanks for anyone's help!
- Quiller
equiller.com
aijalon.net
--- End Message ---
--- Begin Message ---
Quiller wrote:
You can certainly do this with regular expressions, rewriting
your source file.
Why don't you just use Smarty templates and be over with it?
_justin
>
> This is for a very inefficient skin script I'm writing; the CMS I am using
> is based in PHP but generates static files, so in order to change skins I am
> opening the page in question and loading it into $url. From there I do an
> ereg and take out what I need. The script itself can be found:
>
> http://equiller.com/skins/skin.txt
>
> And an example of it in use:
>
> http://equiller.com/skins/skin.php?url=http://equiller.com/markviii.htm&skin
> =tan
>
> What I need to do to complete this is to format my navigation depending on
> the skin being used. The navigation files are staticly generated as nav.htm
> in each area. Now, an easy way would just take:
>
> < div id=nav001><a href=#>navigation peice</a></div>
> < div id=nav002><a href=#>navigation peice</a></div>
> < div id=nav003><a href=#>navigation peice</a></div>
> < div id=nav004><a href=#>navigation peice</a></div>
>
> Then take each peice out, put some code around it and transform it into:
>
> <table cellpadding=0 cellspacing=2 border=1>
> <tr>
> <td id=nav001><a href=#>navigation peice</a></td></tr>
> <tr>
> <td id=nav002><a href=#>navigation peice</a></td></tr>
> <tr>
> <td id=nav003><a href=#>navigation peice</a></td></tr>
> <tr>
> <td id=nav004><a href=#>navigation peice</a></td></tr>
> </table>
>
> Is this possible? Is there any easier, less server-intensive way to do what
> I am attempting? Thanks for anyone's help!
>
> - Quiller
> equiller.com
> aijalon.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Justin Farnsworth
Eye Integrated Communications
321 South Evans - Suite 203
Greenville, NC 27858 | Tel: (252) 353-0722
--- End Message ---
--- Begin Message ---
The following is my output in the command prompt window(DOS Prompt?)
C:\PHP>hello.php
Content-type: text/html
X-Powered-By: PHP/4.3.2
!#C:\php\;
echo"Hello World!";
if ($foo):
echo "yep\n";
elseif ($bar):
echo "almost\n";
else:
echo "nope\n";
endif;
phpinfo();
C:\PHP>
And the following is the PHP code to generate it.
!#C:\php\;
echo"Hello World!";
if ($foo):
echo "yep\n";
elseif ($bar):
echo "almost\n";
else:
echo "nope\n";
endif;
phpinfo();
Now, I know that the variables are not set, so they should be false, but the
output just displays a "listing" of the code and doesn't process it. In the
documentation, it states that PHP can be run from the command prompt, like a
batch file. Now what am I doing wrong.
I do have it working correctly with an Apache server, that I am using
backend.
and my install dir is "C:\php", and it is listed first in the path.
John A. Thomason
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
you can only TOUCH a file that you own. Usually PHP is *nobody*. Is there a
way for a script to create a file on the web server?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.498 / Virus Database: 297 - Release Date: 7/8/2003
--- End Message ---
--- Begin Message ---
I'm wondering if there is a way to have your php development files in
another directory other than htdocs when using apache. Similar to the
virtual directories IIS uses.
I have a dedicated hard drive for all of my development files seperate from
the drive apache is on. I do work in Cold Fusion and ASP as well as PHP and
would like to keep everything on one drive.
Thanks in advance for any help you can give.
Brian
--- End Message ---
--- Begin Message ---
I am reading PHP and MySQL web development 2nd edition book. Chapter 6 talks about
displaying dynamic web content using class objects. For the type of project that I am
building, this is not optimal. How do I keep my self from having html mixed with my
PHP code? In other words how do I serperate the two. I need to concentrate on
writing good code and not designing a nice looking website. (someone else is going to
do that)
Can I assign include() statements to a variable ? How would you guys accomplish this?
Thanks so much in advance,
Daniel
--- End Message ---