php-general Digest 30 Dec 2002 03:21:26 -0000 Issue 1792
Topics (messages 129580 through 129622):
Re: Warning: 1 is not a valid File-Handle resource - HELP!
129580 by: Rick Emery
129605 by: gamin
Re: Form duplicate post problem
129581 by: Pag
129585 by: John W. Holmes
129586 by: Pag
129589 by: Jason Wong
129590 by: Pag
129592 by: Jason Wong
129594 by: John W. Holmes
129599 by: Pag
129601 by: Michael J. Pawlowsky
129602 by: John W. Holmes
129604 by: Jason Sheets
129606 by: Pag
Formatting text
129582 by: Denis L. Menezes
129583 by: Michael J. Pawlowsky
129584 by: John W. Holmes
129587 by: Denis L. Menezes
129588 by: Michael J. Pawlowsky
129593 by: John W. Holmes
129595 by: Maciek Ruckgaber Bielecki
lstdc++ problem
129591 by: Dmitry Demczuk
Re: IIS Quit Working
129596 by: Stephen
129597 by: John W. Holmes
129598 by: Stephen
129600 by: Michael J. Pawlowsky
Re: Problem with REQUIRE in PHP 4.3.0
129603 by: gamin
Re: php.ini ignored! Re: [PHP] PHP 4.3.0 released
129607 by: Michael Mauch
Embedding image a PHP file
129608 by: empty
129610 by: justin gruenberg
Re: PHP 4.3 unable to load php_domxml.dll in WinXP Apache 2.0.43
129609 by: Dirk Schiefke
Load Data Infile
129611 by: Anthony Ritter
129612 by: Marco Tabini
129614 by: Anthony Ritter
using mail() with .info emails?
129613 by: Joe Popovich
129615 by: Johannes Schlueter
Rookie mail() q's .. can't find answer after RTFM...
129616 by: -<[ Rene Brehmer ]>-
129617 by: Sean Burlington
129618 by: Michael J. Pawlowsky
Dropping Tables
129619 by: Steve Buehler
129620 by: Michael J. Pawlowsky
129622 by: John W. Holmes
imap_set_quota function
129621 by: Roger Thomas
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 ---
The last line cannot be producing the warning; it does not refer to a file.
Please show us the EXACT error message.
Are you certain the file was opened? Did you try to print $stuff after reading it?
Did it have the
info you thought it should?
----- Original Message -----
From: "Phil Powell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, December 29, 2002 3:08 AM
Subject: [PHP] Warning: 1 is not a valid File-Handle resource - HELP!
Ok, I am a bad coder. :( I can't figure this out at all:
$fileID = fopen("nicknames.txt", 'r');
$stuff = fread($fileID, filesize("nicknames.txt")); fclose($fileID);
if (strlen($stuff) > 0) $priorNickNewLine = "\n";
$nicks = explode("\n", $stuff);
The last line produces the Warning.. why? I am trying to read contents from
nicknames.txt and split
according to the newline character so that each nickname is an array element.
What did I do wrong? :(
Phil
--- End Message ---
--- Begin Message ---
"Phil Powell" <[EMAIL PROTECTED]> wrote in message
021801c2af19$e05909d0$2aaf6244@scandinawa1bo6">news:021801c2af19$e05909d0$2aaf6244@scandinawa1bo6...
Ok, I am a bad coder. :( I can't figure this out at all:
$fileID = fopen("nicknames.txt", 'r');
$stuff = fread($fileID, filesize("nicknames.txt")); fclose($fileID);
if (strlen($stuff) > 0) $priorNickNewLine = "\n";
$nicks = explode("\n", $stuff);
<--snip-->
I would recommend you to always check if the file was opened successfully.
Simply add this after your fopen..
if ($fileID === false) { // 3 '=' signs checks
variable type and value
die("Error opening file. $php_errormsg"); // you will need
track_errors = ON in php.ini to use $php_errormsg.
HTN
gamin.
--- End Message ---
--- Begin Message ---
You can still use one page and use a "middle-man" technique. The part
that processes the form input would redirect back to itself after the
data is inserted into the database, thus getting rid of the post data.
So subsequent refreshes of the page will refresh without attempting to
repost the data.
This post is merely for reference and, hopefully, to help out some
other person that runs into the same problem.
I solved my duplicate form post problem using that middle-man
technique you guys mentioned, but i did it in a little more user friendly
way than using a complete page and redirecting back to the original. (thus
preventing some design problems on my specific site)
I used some javascript to open a small window, it has the code to
insert the comment into the database, thanks for the user input and
immediately closes and refreshes the original, showing that last inserted
comment. Works very smoothly, and if the user connection is fast enough, he
doesnt even notice the window.
If anyone needs the code, feel free to email me, ok? I am just not
posting it because its a bit long, and might unnecessarily clutter the
list. :-)
Thanks for all the help, guys, you got me in the right direction.
Pag
--- End Message ---
--- Begin Message ---
> >You can still use one page and use a "middle-man" technique. The part
> >that processes the form input would redirect back to itself after the
> >data is inserted into the database, thus getting rid of the post
data.
> >So subsequent refreshes of the page will refresh without attempting
to
> >repost the data.
>
> This post is merely for reference and, hopefully, to help out
> some
> other person that runs into the same problem.
>
> I solved my duplicate form post problem using that middle-man
> technique you guys mentioned, but i did it in a little more user
friendly
> way than using a complete page and redirecting back to the original.
(thus
> preventing some design problems on my specific site)
>
> I used some javascript to open a small window, it has the
code to
> insert the comment into the database, thanks for the user input and
> immediately closes and refreshes the original, showing that last
inserted
> comment. Works very smoothly, and if the user connection is fast
enough,
> he
> doesnt even notice the window.
>
Also for reference, but I would recommend to everyone that they not rely
on Javascript and simply do all of this in the main window. With Pop-Up
Blockers and different browser versions, Javascript should be avoided if
possible unless you really know what your audience will be using (or
don't care).
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---
Also for reference, but I would recommend to everyone that they not rely
on Javascript and simply do all of this in the main window. With Pop-Up
Blockers and different browser versions, Javascript should be avoided if
possible unless you really know what your audience will be using (or
don't care).
I subscribe to your opinion, i spoke too soon. It seems i cant
pass the form vars to the new javascript window, and i dont have a clue why
not!
Quite simply, if instead of opening a new window, i use the exact
same code on the main window, all the vars are passed, if i use javascript
to open a new window, no php vars are passed on.
So i apologize for my early cry of victory, it quickly turned into
a cry of despair. bah. Any ideas on how to get it working? PHP doesnt pass
vars to javascript new window?
(going for the main window approach for now, thanks john)
Pag
--- End Message ---
--- Begin Message ---
On Sunday 29 December 2002 23:24, Pag wrote:
> This post is merely for reference and, hopefully, to help out some
> other person that runs into the same problem.
>
> I solved my duplicate form post problem using that middle-man
> technique you guys mentioned, but i did it in a little more user friendly
> way than using a complete page and redirecting back to the original. (thus
> preventing some design problems on my specific site)
>
> I used some javascript to open a small window, it has the code to
> insert the comment into the database, thanks for the user input and
> immediately closes and refreshes the original, showing that last inserted
> comment. Works very smoothly, and if the user connection is fast enough, he
> doesnt even notice the window.
Maybe I'm missing something here but I'm not sure why you consider it more
user friendly to pop-up a window (and have it disappear automatically). If I
was a user I would be thinking "what the hell was that?". And if their
connection was fast enough that they don't even notice the window pop-up &
disappear, and just see the main page refresh how different is that to the
'one page and use a "middle-man" technique'?
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
If *I* had a hammer, there'd be no more folk singers.
*/
--- End Message ---
--- Begin Message ---
Maybe I'm missing something here but I'm not sure why you consider it more
user friendly to pop-up a window (and have it disappear automatically). If I
was a user I would be thinking "what the hell was that?". And if their
connection was fast enough that they don't even notice the window pop-up &
disappear, and just see the main page refresh how different is that to the
'one page and use a "middle-man" technique'?
Ok, i admit my donkeyness. :-P It takes the same time to popup,
close and refresh, than it does to redirect and refresh.
One thing that popup would prevent would be the browser history, i
mean, if that popup method worked, if the user clicked on the "back"
browser button, it would take him to where he came from. If i use that
redirect method, the back button takes him to the redirect. Still trying to
figure that one out. Would be nice to make the browser history "forget"
that redirect. :-P
But you are right, Jason, time wise i was wrong in going for the
popup, not to mention those other very relevant facts john mentioned too.
Pag
--- End Message ---
--- Begin Message ---
On Monday 30 December 2002 01:40, Pag wrote:
> One thing that popup would prevent would be the browser history, i
> mean, if that popup method worked, if the user clicked on the "back"
> browser button, it would take him to where he came from. If i use that
> redirect method, the back button takes him to the redirect. Still trying to
> figure that one out. Would be nice to make the browser history "forget"
> that redirect. :-P
I don't think a server redirect shows up on the browser's history list! Try
it.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Politics, as a practice, whatever its professions, has always been the
systematic organisation of hatreds.
-- Henry Adams, "The Education of Henry Adams"
*/
--- End Message ---
--- Begin Message ---
> > One thing that popup would prevent would be the browser
> history, i
> > mean, if that popup method worked, if the user clicked on the "back"
> > browser button, it would take him to where he came from. If i use
that
> > redirect method, the back button takes him to the redirect. Still
trying
> to
> > figure that one out. Would be nice to make the browser history
"forget"
> > that redirect. :-P
>
> I don't think a server redirect shows up on the browser's history
list!
> Try
> it.
Yeah, you should be using a header() redirect, not a javascript or META
REFRESH redirect...
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---
Yeah, you should be using a header() redirect, not a javascript or META
REFRESH redirect...
Well, i tried, but i get an error saying that all the headers were
already sent to the browser. :-P
I used:
header('Location: http://www.blahblah.com etc');
I placed this header right after all the database writes.
Pag
--- End Message ---
--- Begin Message ---
2 ways around that.. make sure you send that before any other ouput... Even empty
lines etc.... In other words nothing before <?php and nothing after ?> Not ever a
carriage return.
or start of with ob_start() and end with ob_end_flush();
*********** REPLY SEPARATOR ***********
On 29/12/2002 at 7:12 PM Pag wrote:
>>
>>Yeah, you should be using a header() redirect, not a javascript or META
>>REFRESH redirect...
>
> Well, i tried, but i get an error saying that all the headers
>were
>already sent to the browser. :-P
> I used:
>
> header('Location: http://www.blahblah.com etc');
>
>
> I placed this header right after all the database writes.
>
> Pag
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> >Yeah, you should be using a header() redirect, not a javascript or
META
> >REFRESH redirect...
>
> Well, i tried, but i get an error saying that all the headers
> were
> already sent to the browser. :-P
> I used:
>
> header('Location: http://www.blahblah.com etc');
>
>
> I placed this header right after all the database writes.
Well, yeah, the idea is that you don't output anything on the
"middle-man" page, only do your inserts and that's it.
The error message tells you exactly where the output is starting, if
that's a mystery to you (output started in file.php:2 means line 2 of
file.php).
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---
You can also enable output buffering on your middle page, this will
allow you to output data and set cookies, send headers, etc at any point
in your script.
You can enable output buffering globally with php.ini, with an .htaccess
for specific directories or use the output buffering functions to enable
them for just a script or even part of a script.
Jason
On Sun, 2002-12-29 at 12:29, John W. Holmes wrote:
> > >Yeah, you should be using a header() redirect, not a javascript or
> META
> > >REFRESH redirect...
> >
> > Well, i tried, but i get an error saying that all the headers
> > were
> > already sent to the browser. :-P
> > I used:
> >
> > header('Location: http://www.blahblah.com etc');
> >
> >
> > I placed this header right after all the database writes.
>
> Well, yeah, the idea is that you don't output anything on the
> "middle-man" page, only do your inserts and that's it.
>
> The error message tells you exactly where the output is starting, if
> that's a mystery to you (output started in file.php:2 means line 2 of
> file.php).
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Got it to work. I removed everything except the PHP script. Works like a
charm, no problem on the browser back button.
Great help from you guys. Thanks a lot!
Pag
--- End Message ---
--- Begin Message ---
Hello friends,
I have to put results of various departments in our school website. All results will
go in the Mysql database. The problem is formatting the output. I have output
something like this where the numbers shown are student marks :
Quote
Passed with Grade A :
Adm nos : 8177 9822 1750 0059
Passed with Grade B :
Adm nos : 6614 8375 0837 1647 5490 3758 7388 7799
Passed with Grade C :
Adm nos : 9968 0298 1297 1254 4208 4911 6194 9903
Unquote
I made a multiline textboxes and used PHP script and input this in a LONGTEXT field in
MySQL. Then I used PHP to output this field in a webpage. The formatting, carriage
return, tabs etc are lost. Formatting is very essential in this document for us.
Can someone tell me how to do this?
Thanks
Denis
--- End Message ---
--- Begin Message ---
Two ways to do this...
One just use
echo "<pre>";
for($i=0; $i < sql->rows; i++){
echo $values['grade'];
echo $values['admno'];
}
echo "</pre>;
or create a table
<table>
for($i=0; $i < sql->rows; i++){
<tr>
<td>$value['grade']</td><td>$value['grade2']</td><td>$value['grade3']</td><td>$value['grade4']</td>
</tr>
}
</table>
*********** REPLY SEPARATOR ***********
On 29/12/2002 at 11:39 PM Denis L. Menezes wrote:
>Hello friends,
>
>I have to put results of various departments in our school website. All
>results will go in the Mysql database. The problem is formatting the
>output. I have output something like this where the numbers shown are
>student marks :
>
>Quote
>
>Passed with Grade A :
>Adm nos : 8177 9822 1750 0059
>
>Passed with Grade B :
>Adm nos : 6614 8375 0837 1647 5490 3758 7388 7799
>
>Passed with Grade C :
>Adm nos : 9968 0298 1297 1254 4208 4911 6194 9903
>
>Unquote
>
>I made a multiline textboxes and used PHP script and input this in a
>LONGTEXT field in MySQL. Then I used PHP to output this field in a
>webpage. The formatting, carriage return, tabs etc are lost. Formatting is
>very essential in this document for us.
>
>Can someone tell me how to do this?
>
>Thanks
>Denis
--- End Message ---
--- Begin Message ---
> I have to put results of various departments in our school website.
All
> results will go in the Mysql database. The problem is formatting the
> output. I have output something like this where the numbers shown are
> student marks :
>
> Quote
>
> Passed with Grade A :
> Adm nos : 8177 9822 1750 0059
>
> Passed with Grade B :
> Adm nos : 6614 8375 0837 1647 5490 3758 7388 7799
>
> Passed with Grade C :
> Adm nos : 9968 0298 1297 1254 4208 4911 6194 9903
>
> Unquote
>
> I made a multiline textboxes and used PHP script and input this in a
> LONGTEXT field in MySQL. Then I used PHP to output this field in a
> webpage. The formatting, carriage return, tabs etc are lost.
Formatting is
> very essential in this document for us.
Your problem is that HTML does not recognize newline or tab characters.
The easy fix is to just surround the line by <pre> which will cause the
newline and tab elements to show up.
The hard fix, but nicer looking one, is to output your data in a table.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---
Thanks John and Michael.
Please note that the following is my code :
Quote :
if ($result=mysql_query($sql)) {
$numofrows=mysql_num_rows($result);
Print "Greengrass database has found the following result that matches
your search";
print " <br>\n";
print " <br>\n";
while($row=mysql_fetch_array($result)){
Print " Identity : ".$row[GGID]."<br>\n"." ";
Print " Organisation name : ".$row[OrgName]." <br>\n"."";
Print " Organisation country : ".$row[OrgCountry]." <br>\n"."";
Print " Organisation Address : ".$row[OrgAddress]."<br>\n"." ";
Print " Results : ".$row[Results]."<br>\n";
print " <br>\n";
print " <br>\n";
}
Unquote.
In the above code, I want to format the text in only one field and that is
the field named "Results".
Where do I put the <PRE> </PRE> tags for formatting the text contained in
the mysql field "Results"?
Thanks
Denis
----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Denis L. Menezes'" <[EMAIL PROTECTED]>; "'PHP general list'"
<[EMAIL PROTECTED]>
Sent: Monday, December 30, 2002 12:13 AM
Subject: RE: [PHP] Formatting text
> > I have to put results of various departments in our school website.
> All
> > results will go in the Mysql database. The problem is formatting the
> > output. I have output something like this where the numbers shown are
> > student marks :
> >
> > Quote
> >
> > Passed with Grade A :
> > Adm nos : 8177 9822 1750 0059
> >
> > Passed with Grade B :
> > Adm nos : 6614 8375 0837 1647 5490 3758 7388 7799
> >
> > Passed with Grade C :
> > Adm nos : 9968 0298 1297 1254 4208 4911 6194 9903
> >
> > Unquote
> >
> > I made a multiline textboxes and used PHP script and input this in a
> > LONGTEXT field in MySQL. Then I used PHP to output this field in a
> > webpage. The formatting, carriage return, tabs etc are lost.
> Formatting is
> > very essential in this document for us.
>
> Your problem is that HTML does not recognize newline or tab characters.
>
> The easy fix is to just surround the line by <pre> which will cause the
> newline and tab elements to show up.
>
> The hard fix, but nicer looking one, is to output your data in a table.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
--- End Message ---
--- Begin Message ---
> if ($result=mysql_query($sql)) {
> $numofrows=mysql_num_rows($result);
> Print "Greengrass database has found the following result that matches
>your search";
> print " <br>\n";
> print " <br>\n";
Add this line here ---------------> print "<pre>\n";
No longer need the BRs below--------------->
> while($row=mysql_fetch_array($result)){
> Print " Identity : ".$row[GGID]."\n"." ";
> Print " Organisation name : ".$row[OrgName]." \n"."";
> Print " Organisation country : ".$row[OrgCountry]." \n"."";
> Print " Organisation Address : ".$row[OrgAddress]."\n"." ";
> Print " Results : ".$row[Results]."\n";
> print "\n";
> print "\n";
> }
Add this line here ---------------> print "<pre>\n";
--- End Message ---
--- Begin Message ---
> Please note that the following is my code :
> Quote :
>
> if ($result=mysql_query($sql)) {
> $numofrows=mysql_num_rows($result);
> Print "Greengrass database has found the following result that
> matches
> your search";
> print " <br>\n";
> print " <br>\n";
> while($row=mysql_fetch_array($result)){
> Print " Identity : ".$row[GGID]."<br>\n"." ";
> Print " Organisation name : ".$row[OrgName]." <br>\n"."";
> Print " Organisation country : ".$row[OrgCountry]." <br>\n"."";
> Print " Organisation Address : ".$row[OrgAddress]."<br>\n"." ";
> Print " Results : ".$row[Results]."<br>\n";
> print " <br>\n";
> print " <br>\n";
> }
>
> Unquote.
>
> In the above code, I want to format the text in only one field and
that is
> the field named "Results".
> Where do I put the <PRE> </PRE> tags for formatting the text contained
in
> the mysql field "Results"?
How about around $row[Results]?
print " Results : <pre>".$row['Results']."</pre><br>\n";
Note the addition of the single quotes, which you should get in the
habit of using (so you don't get Undefined Constant errors on a machine
with a stricter error_reporting() level).
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---
have alook at this one, i have one prob, dont know how your 'Results'
field does look like so i used ' '(or space) separator
hope it helps :-)
<?php
if ($result=mysql_query($sql))
{
$numofrows=mysql_num_rows($result);
Print "Greengrass database has found the following result that matches
your search";
print " <br>\n";
print " <br>\n";
}
$content = "<table>";
while($row=mysql_fetch_array($result))
{
$content .= "<tr><td><b>Identity : </b>".$row['GGID']."</td></tr>\n"
.= "<tr><td><b>Organisation name :</b>
".$row['OrgName']."</td></tr>\n"
.= "<tr><td><b>Organisation country :
</b>".$row['OrgCountry']." </td></tr>\n"
.= "<tr><td><b>Organisation Address :
</b>".$row['OrgAddress']."</td></tr>\n";
$content .="<tr><td><table><tr><td><b>Results:</b></td>";
// sorry, dont know which separator you can use exactly, i lost your
previous code
$results = explode(' ',$row['Results']);
foreach($results as $value)
{
$content .="<td>$value</td>";
}
$content .="</tr></table></td></tr></table><br />";
}
?>
------------------------------------------------------------------
"Few are those who see with their own eyes and feel with their own
hearts."
Albert Einstein
-----------------------------------------------------------------
Maciek Ruckaber Bielecki
--- End Message ---
--- Begin Message ---
Hi there,
I'm trying to get PHP 4.3.0 compiled on a SuSE Linux 8.0 box.
./configure goes well but when I try the make command, I get the following
error message: php /usr/i486-suse-linux/bin/ld: cannot find -lstdc++, and
the installation fails. The lstdc++ is in the library libstdc, which is
under /usr/lib.
Does anyone knows how to solve this?
Thanks and cheers
--
Dmitry
--- End Message ---
--- Begin Message ---
Ok, I reinstalled IIS 5 and PHP 4.3 and it's working but the sessions
aren't. I get this error:
Warning: session_start() [function.session-start]:
open(/tmp\sess_b400575a818f9bb0361b06dad912410c, O_RDWR) failed: No such
file or directory (2) in c:\inetpub\wwwroot\pcu\index.php on line 1
I haven't edited the php.ini file yet but I'm not sure what to set it to.
Right now it says this:
session.save_path = /tmp
What should it be for Windows XP Pro?
----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 29, 2002 3:16 AM
Subject: Re: [PHP] IIS Quit Working
: On Sunday 29 December 2002 09:14, Stephen wrote:
: > Since I like new things and all, I decided to download and install PHP
4.3.
: > Before, I had the latest (4.2.3) and IIS worked fine. But then, after
: > uninstalling PHP and installing the new one, it just quit working. I go
to
: > http://localhost/ and nothing comes up except a "This page cannot be
: > displayed" thing since I'm using IE. Any ideas why this is happening?
:
: Turn on error reporting and log to file and examine it for any clues.
:
: --
: Jason Wong -> Gremlins Associates -> www.gremlins.biz
: Open Source Software Systems Integrators
: * Web Design & Hosting * Internet & Intranet Applications Development *
:
: /*
: You can tell how far we have to go, when FORTRAN is the language of
: supercomputers.
: -- Steven Feiner
: */
:
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, visit: http://www.php.net/unsub.php
:
:
:
--- End Message ---
--- Begin Message ---
> Ok, I reinstalled IIS 5 and PHP 4.3 and it's working but the sessions
> aren't. I get this error:
>
>
> Warning: session_start() [function.session-start]:
> open(/tmp\sess_b400575a818f9bb0361b06dad912410c, O_RDWR) failed: No
such
> file or directory (2) in c:\inetpub\wwwroot\pcu\index.php on line 1
>
> I haven't edited the php.ini file yet but I'm not sure what to set it
to.
> Right now it says this:
>
> session.save_path = /tmp
>
> What should it be for Windows XP Pro?
It can be any directory that IIS can write to.
c:/php/sessions/ (if that folder exists)
works just fine. The IUSR_<computername> user on your computer must have
permission to write to that directory.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---
I found on the official site that C:\WINDOWS\Temp works well too...
----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Stephen'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, December 29, 2002 2:05 PM
Subject: RE: [PHP] IIS Quit Working
: > Ok, I reinstalled IIS 5 and PHP 4.3 and it's working but the sessions
: > aren't. I get this error:
: >
: >
: > Warning: session_start() [function.session-start]:
: > open(/tmp\sess_b400575a818f9bb0361b06dad912410c, O_RDWR) failed: No
: such
: > file or directory (2) in c:\inetpub\wwwroot\pcu\index.php on line 1
: >
: > I haven't edited the php.ini file yet but I'm not sure what to set it
: to.
: > Right now it says this:
: >
: > session.save_path = /tmp
: >
: > What should it be for Windows XP Pro?
:
: It can be any directory that IIS can write to.
:
: c:/php/sessions/ (if that folder exists)
:
: works just fine. The IUSR_<computername> user on your computer must have
: permission to write to that directory.
:
: ---John W. Holmes...
:
: PHP Architect - A monthly magazine for PHP Professionals. Get your copy
: today. http://www.phparch.com/
:
:
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, visit: http://www.php.net/unsub.php
:
:
:
--- End Message ---
--- Begin Message ---
Wherever you want them... C:\windows\temp if you have that.
win??? does not have a /tmp directory link *nix boxes do, so just give it a valid
directory to write to where you don;t mind having a bunch of session files.
>
>session.save_path = /tmp
>
>What should it be for Windows XP Pro?
>
>
>----- Original Message -----
>From: "Jason Wong" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, December 29, 2002 3:16 AM
>Subject: Re: [PHP] IIS Quit Working
>
>
>: On Sunday 29 December 2002 09:14, Stephen wrote:
>: > Since I like new things and all, I decided to download and install PHP
>4.3.
>: > Before, I had the latest (4.2.3) and IIS worked fine. But then, after
>: > uninstalling PHP and installing the new one, it just quit working. I go
>to
>: > http://localhost/ and nothing comes up except a "This page cannot be
>: > displayed" thing since I'm using IE. Any ideas why this is happening?
>:
>: Turn on error reporting and log to file and examine it for any clues.
>:
>: --
>: Jason Wong -> Gremlins Associates -> www.gremlins.biz
>: Open Source Software Systems Integrators
>: * Web Design & Hosting * Internet & Intranet Applications Development *
>:
>: /*
>: You can tell how far we have to go, when FORTRAN is the language of
>: supercomputers.
>: -- Steven Feiner
>: */
>:
>:
>: --
>: PHP General Mailing List (http://www.php.net/)
>: To unsubscribe, visit: http://www.php.net/unsub.php
>:
>:
>:
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
"Bi®‰øáÎ ë‰ërÏ èÊ" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I try to compile PHP 4.3.0 on OpenBSD 3.1. Compilation is OK, PHP
> runs, but not work REQUIRE and INCLUDE
>
> Fatal error: main() [function.main]: Failed opening required
'./libraries/grab_globals.lib.php' (include_path='.:/usr/local/lib/php')
>
You could try adding the path of the grab_globals.lib.php (or that of all of
all the lib files) in the php.ini file in the directive include_path like
this :
include_path =
".:/usr/local/lib/php:/some/other/path:/absoute/path/to/your/lib/dir"
I dont yet have PHP 4.3.0 so this is from ver 4.0.6
HTH
gamin.
--- End Message ---
--- Begin Message ---
In php.dev Omer K <[EMAIL PROTECTED]> wrote:
> redhat, apache2.0.43 (as dso). compiles and runs without a problem
>
> php4.3.0release fails to utilize php.ini settings. ignores changes to the
> ini file.
>
> ./configure --with-config-file-path=/usr/local/apache2/conf/php.ini --with-a
> pxs2=/usr/local/apache2/bin/apxs --with-mysql (got no errors)
Does it help if you use --with-config-file-path=/usr/local/apache2/conf
instead?
Regards...
Michael
--- End Message ---
--- Begin Message ---
Hi
Anybody knows how to embed a image file to a php file, not as html;
for example;
<img src="yy.php" />
embedding a image file in yy.php file.
Thanks everybody
--- End Message ---
--- Begin Message ---
yy.php should contain
<?php
header("Content-type: image/jpeg"); /* or gif or whatever... you can
also take a look at getimagesize() to get the type of the image
automatically */
readfile(THE FILE);
?>
it's extremely important that there is no whitespace before the <?php
tag and after the ?> tag.
empty wrote:
Hi
Anybody knows how to embed a image file to a php file, not as html;
for example;
<img src="yy.php" />
embedding a image file in yy.php file.
Thanks everybody
--- End Message ---
--- Begin Message ---
Same applies here using
XP pro SP1, apache 1.3.27
no dll will load even if the extensions path is set to the correct dir
in this case
J:\php-4.3.0\extensions - where they reside
dirk
On Sun, 29 Dec 2002 14:38:51 -0000, [EMAIL PROTECTED] (Rui Costa) wrote:
> hi,
>
> Windows XP, Apache 2.0.43(Win32) with PHP 4.3 can't load DLL
> 'php_domxml.dll'.
> it pops-up: Unknown(): unable to load dll'C:\php\extensions\php_domxml.dll'
> if I use the old 'php_domxml.dll' from PHP 4.2.4, it works fine. I'm using
> libxml2-2.4.30, expat 1.95.4.
>
> by the way, 'libxml2.dll' is not packed in the PHP 4.3 Windows distribution,
> although it mentions that it does in the PHP documentation.
>
> thanks in advance
> rui
>
>
--- End Message ---
--- Begin Message ---
Off topic but I hope somebody can help.
Using MS Win98 / mySQL.
I'm trying to use LOAD DATA INFILE and coming up empty.
My text file is named:
....................
test.txt
..................
and is stored in C:\TextFiles
on the command line I type:
..............................
mysql> LOAD DATA INFILE "C:\TextFiles\test.txt" INTO TABLE tony;
...............................
I get:
ERROR 1105 File c:\TextFile\ est.txt not found (Errcode:2)
\\please note that the "t" in test is not there.
Any help would be greatly appreciated.
Happy holidays,
Tony Ritter
--- End Message ---
--- Begin Message ---
I'm not sure how MySQL works under Windows, but you should either use
double backslashes (\\) instead of single backslashes or use forward
slashes (/) instead. MySQL is trying to escape your string.
Cheers,
Marco
--
------------
php|architect - The Magazine for PHP Professionals
The monthly magazine dedicated to the world of PHP programming
Check us out on the web at http://www.phparch.com!
--- Begin Message ---
Off topic but I hope somebody can help.
Using MS Win98 / mySQL.
I'm trying to use LOAD DATA INFILE and coming up empty.
My text file is named:
....................
test.txt
..................
and is stored in C:\TextFiles
on the command line I type:
..............................
mysql> LOAD DATA INFILE "C:\TextFiles\test.txt" INTO TABLE tony;
...............................
I get:
ERROR 1105 File c:\TextFile\ est.txt not found (Errcode:2)
\\please note that the "t" in test is not there.
Any help would be greatly appreciated.
Happy holidays,
Tony Ritter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- End Message ---
--- Begin Message ---
"Marco Tabini" <[EMAIL PROTECTED]> wrote in message:
> I'm not sure how MySQL works under Windows, but you should either use
> double backslashes (\\) instead of single backslashes or use forward
> slashes (/) instead. MySQL is trying to escape your string.
>
> Cheers,
> Marco
............................................
Thanks Marco.
C:\\TextFiles\\test.txt
works now
Happy new year to you and yours...
TR
--- End Message ---
--- Begin Message ---
Im trying to send email using mail() to a .info email address and get an
error message. I assume the function parses the email address and doesnt
accept anything that isnt the customary .net, .com, etc. addresses. How can
I get around this?
Thanks
joe Popovich
_________________________________________________________________
The new MSN 8: smart spam protection and 3 months FREE*.
http://join.msn.com/?page=features/junkmail&xAPID=42&PS=47575&PI=7324&DI=7474&SU=
http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_smartspamprotection_3mf
--- End Message ---
--- Begin Message ---
On Sunday 29 December 2002 23:45, Joe Popovich wrote:
> Im trying to send email using mail() to a .info email address and get an
> error message. I assume the function parses the email address and doesnt
> accept anything that isnt the customary .net, .com, etc. addresses. How can
> I get around this?
Usually it should work. Maybe a spam-filter from your provider or sth. like
that. What kind of error message do you recieve?
johannes
--- End Message ---
--- Begin Message ---
Hi y'all
I'm probably trying to do something ridicolously trivial, but here goes:
I'm building a form for sending mail of my website. The idea is simply
that people plop in their address, the message, and pick a subject line,
and then click send.
It will then show how the message will look, and people will then have the
option to either correct it, send it there and then, or just dump the
whole enchilada...
Q 1:
Well, building the form and making the page preview the message is the
easy part. But how do I make the page retain the message so that I can 1.
actually send the thing after the second submit, and 2. make it fill out
the form when user wish to alter message (or there's an error) ???
This is the code for the preview part (HTML + PHP):
<span class="txt">This is the message as it will look with all
headers:</span>
<pre><?php
$to = "[EMAIL PROTECTED]";
$from = "Metalbunny website <[EMAIL PROTECTED]>";
$replyto = $HTTP_POST_VARS['sender'];
$subject = $HTTP_POST_VARS['subject'];
$message = $HTTP_POST_VARS['message'];
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/ascii;
charset=iso-8859-1\r\n";
$headers .= "From: ".$from."\r\n";
$headers .= "Reply-to: ".$replyto."\r\n";
echo("To: ".$to."\n");
echo("From: ".$from."\n");
echo("Reply-to: ".$replyto."\n");
echo("Subject: ".$subject."\n");
echo("X-Mailer: PHP/".phpversion()."\n");
echo("MIME-version: 1.0\n");
echo("Content-type: text/ascii; charset=iso-8859-1\n");
echo("\n".$message);
?>
</pre><br>
<br>
<span class="txt">Do you wish to send this message?</span><br>
<form method="post">
<button name="send" value="true" type="submit">Yes, send
it</button>
<button name="correct" value="true" type="submit">Nah, let me
correct it</button>
<button name="cancel" value="true" type="submit">Never
mind...</button>
</form>
The first button is to actually send the message, and show the "Thank you"
page, the second is to reload the form and fill out the fields. Haven't
figured out how to work the last button.
Q 2:
The manual doesn't really say it that clearly, but do I need to have the
content-type field when the message is plain text already?
And should I be adding a Date: field, or does the mail() function figure
that out itself?
My incoming mail server does not accept messages without a date field, so
if I need to add it, I'd really like to know. It also doesn't like
messages with more than 1 of each field...(except received-by).
TIA
Rene
--
Rene Brehmer
This message was written on 100% recycled spam.
Come see! My brand new site is now online!
http://www.metalbunny.net
--- End Message ---
--- Begin Message ---
-<[ Rene Brehmer ]>- wrote:
Q 1:
Well, building the form and making the page preview the message is the
easy part. But how do I make the page retain the message so that I can 1.
actually send the thing after the second submit, and 2. make it fill out
the form when user wish to alter message (or there's an error) ???
either put the fields you want as hidden fields in the preview page
or
store them as session variables
Q 2:
The manual doesn't really say it that clearly, but do I need to have the
content-type field when the message is plain text already?
plain text is the default
And should I be adding a Date: field, or does the mail() function figure
that out itself?
I'm not sure - have you tried it ?
My incoming mail server does not accept messages without a date field, so
if I need to add it, I'd really like to know. It also doesn't like
messages with more than 1 of each field...(except received-by).
just look at an email in your inbox and copy the format of the date field.
--
Sean :)
--- End Message ---
--- Begin Message ---
You will need to edit it for your server, remove some stuff etc...
But this should get you going...
<HTML>
<HEAD>
<TITLE>RC Online Canada - Feedback Form</TITLE>
<link href="../style.html" rel="stylesheet" type="text/css">
</HEAD>
<body>
<center>
<H1>Contact RC Online Canada</H1>
</center>
<p>
<center>
<img src="../images/bpix.gif" height="2" width="80%">
</center>
<p>
<center>
<?php
require("../lib/util.php");
function is_valid_email($email) {
if(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $email)) {
return 1;
} else {
return 0;
}
}
if (isset($_POST['action'])) {
$sql = new MySQL_class;
$sql->Create("rconline_ca");
// Lets get some info on who we have
$sql->QueryRow("SELECT contact_fname, contact_lname, contact_email FROM
club_info WHERE TRIM(LOWER(uname)) LIKE TRIM(LOWER('$_SERVER[PHP_AUTH_USER]'))");
if ($sql->rows == 0) {
ErrorMsg("$_SERVER[PHP_AUTH_USER] was not found in the database");
Exit();
}
$row=$sql->data;
if (!(is_valid_email($row[contact_email]))) {
ErrorMsg("Invalid e-mail address '$row[contact_email]' in database.
Please update you information before using this service.");
Exit();
}
$frommail = strtolower(trim($row[contact_email]));
$fromname = "$row[contact_fname] $row[contact_lname]";
ini_set("sendmail_path", "/usr/lib/sendmail -t -i");
ini_set("sendmail_from", $frommail);
$tomail = "[EMAIL PROTECTED]";
$toname = "Webmaster";
$message = "$_POST[comment]\n\n";
$subject = "$_POST[subject]";
$headers= "MIME-Version: 1.0\r\n";
$headers.= "From: $fromname <$frommail>\r\n";
if ($_POST[cc]){
$headers.= "Cc: $fromname <$frommail>\r\n";
}
$headers.= "Reply-To: $fromname <$frommail>\r\n";
$headers.= "X-Mailer: R/C Online Canada WebMail v1.B\r\n";
$headers.= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers.= "X-Priority: 1\r\n";
$headers.= "X-MSMail-Priority: High\r\n";
if (mail("$toname <$tomail>", $subject, $message, $headers))
{
echo "<p><b>Your comments have been sent</b></p>";
echo "<p>Thank you for your interest in RC Online Canada</p>";
if ($_POST[cc]){
echo "<p>A copy has also been sent to: $fromname
$frommail</p>\r\n";
}
}else{
echo "Failed to send e-mail.";
echo "<p>";
echo "Please contact [EMAIL PROTECTED]";
echo "<p> <FORM><INPUT TYPE=\"Button\" VALUE=\"Back\"
onClick=\"history.go(-1)\"></FORM>";
}
} else {
echo "<form action=\"$PHP_SELF\" method=\"post\">";
echo "<input type=\"hidden\" name=\"action\" value=\"1\">";
echo "<p>";
echo "<table>";
echo "<tr><td>";
echo "Subject: </td><td>";
echo "<select name=\"subject\">\n";
echo " <option>Bug Report</option>\n";
echo " <option>General Comment</option>\n";
echo " <option selected>New Forum Request</option>\n";
echo " <option>Feature Request</option>\n";
echo "</select>\n";
echo "</td></tr>\n";
echo "<tr>";
echo "<td valign=\"top\">Message:</td>";
echo "<td><textarea name=\"comment\" cols=\"60\"
rows=\"10\"></textarea></td>";
echo "</tr>";
echo "<tr><td>";
echo "Copy to myself: </td><td>";
echo "<input name=\"cc\" type=\"checkbox\" value=\"1\" checked>\n";
echo "</td></tr>\n";
echo "</table>";
echo "<p>";
echo "<center>";
echo "<img src=\"/images/bpix.gif\" height=\"2\" width=\"80%\">";
echo "</center>";
echo "<p>";
echo "<input type=\"submit\" value=\"Submit\">";
echo "</form>";
}
?>
</center>
</BODY>
</HTML>
*********** REPLY SEPARATOR ***********
On 30/12/2002 at 1:30 AM -<[ Rene Brehmer ]>- wrote:
>Hi y'all
>
>I'm probably trying to do something ridicolously trivial, but here goes:
>
>I'm building a form for sending mail of my website. The idea is simply
>that people plop in their address, the message, and pick a subject line,
>and then click send.
>
--- End Message ---
--- Begin Message ---
I have researched this and can't find an answer. Maybe I am just looking
in the wrong places or not putting the correct keywords into the search
engines. So any help would be greatly appreciated. I am using MySQL with PHP.
I have some PHP scripts that create tables in a database that are meant to
be temporary but can't actually create "TEMPORARY" tables to do the
job. That isn't the problem in itself. The problem is that sometimes if
the script is stopped prematurely, it doesn't get to the drop table
function in it. All of the tables that are created for this start with an
"a" and follow with a random number. What I need to do is to create a
script that I can run that will delete all tables that start with an "a" in
the database. Again, since the table name is randomly generated except for
the starting "a", I will need the script to find them and drop them.
Has anybody done this before? I would sure appreciate some help here.
Thanks
Steve
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
ow3
--- End Message ---
--- Begin Message ---
Basically just do a a php script the sends the sql "show tables";
Then do a strchr() to see if "a" is the first letter in the resuts and if so do a
delete table.
Just yo play safe do a dump of your db first.
Cheers,
Mike
*********** REPLY SEPARATOR ***********
On 29/12/2002 at 7:57 PM Steve Buehler wrote:
>I have researched this and can't find an answer. Maybe I am just looking
>in the wrong places or not putting the correct keywords into the search
>engines. So any help would be greatly appreciated. I am using MySQL with
>PHP.
> I have some PHP scripts that create tables in a database that are meant
>to
>be temporary but can't actually create "TEMPORARY" tables to do the
>job. That isn't the problem in itself. The problem is that sometimes if
>the script is stopped prematurely, it doesn't get to the drop table
>function in it. All of the tables that are created for this start with an
>"a" and follow with a random number. What I need to do is to create a
>script that I can run that will delete all tables that start with an "a"
>in
>the database. Again, since the table name is randomly generated except
>for
>the starting "a", I will need the script to find them and drop them.
> Has anybody done this before? I would sure appreciate some help here.
>
>Thanks
>Steve
>
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
>ow3
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> Basically just do a a php script the sends the sql "show tables";
>
> Then do a strchr() to see if "a" is the first letter in the resuts and
if
> so do a delete table.
>
> Just yo play safe do a dump of your db first.
Or even better, use SHOW TABLES LIKE 'a%' to just get the a* tables and
drop each one.
How do you know whether it's an "active" a* table or not? Will you be
dropping a table that someone is actually using?
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---
an excerpt from php man pages says that:
"This function requires the imap_stream to have been opened as the mail
administrator account. It will not work if opened as any other user.
...
...
$mbox = imap_open ("{your.imap.host:143}", "mailadmin", "password");
"
my question is, where do i set this admin called 'mailadmin' with password
'password'. do i set it in courier/uw for example?
--
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---