php-windows Digest 13 Nov 2002 06:56:25 -0000 Issue 1437

Topics (messages 16894 through 16911):

Re: update tablename
        16894 by: Dash McElroy

incrementation error
        16895 by: damouse
        16897 by: damouse
        16898 by: damouse

IIS 5.0 and cache
        16896 by: Step Schwarz
        16899 by: Step Schwarz
        16900 by: Dash McElroy

Re: Sending mail is so slooooooow
        16901 by: Manuel Lemos
        16904 by: Dash McElroy
        16910 by: Manuel Lemos

Session, no have increment of page views
        16902 by: Marcelo Laia

Re: PDF Files...
        16903 by: Jeff Pearson

Re: Php Setup - begginer
        16905 by: Cam Dunstan

Re: PHP and Windows 98
        16906 by: Cam Dunstan

Problem with sessions
        16907 by: Charlie Fowler
        16909 by: Dash McElroy

Re: [PHP] Problem with sessions
        16908 by: Ernest E Vogelsinger

php with mssql
        16911 by: soff

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 ---
$query = "ALTER TABLE `foo` RENAME `bar`";
$result = mysql_query($query);

Obviously you need to be connected to the database first, and should also do
error checking after to make sure the table was in fact renamed.

p.s. I use phpMyAdmin to find out how to do stuff I don't yet know. Good
Software.

-Dash

-----Original Message-----
From: Rodrigo San Martin [mailto:rodrigo@;stud.ntnu.no] 
Sent: Tuesday, November 12, 2002 12:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] update tablename


Hi.
I want to change a tablename in my database. How do i do that? I want to do
it from a webpage so i need to use php.





------------------------------------------
Rodrigo San Martin
Institutt for datateknologi og informatikk

http://www.idi.ntnu.no/~rodrigo




-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
the following script is supposed to write a file and make a dir for a corrosponding 
forum the only problem is it keeps coming out as
1:bbs
1:bbs2
1:bbs21
instead of
1:bbs
2:bbs2
3:bbs21
any ideas?
<?php
if(!file_exists("./forum/"))
{
mkdir("./forum/", 0777);
}
 
if($_POST['dir'] == "")
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="dir" id="dir" />
<input type="submit" />
</form>
<?php
} else {
if(!file_exists("./forum/".$_POST['dir']."/"))
 {
  mkdir("./forum/".$_POST['dir']."/", 0777);
  echo "forum made";
 }
else
 {
  echo "forum already there";
 }
$forums = file("./forum/forums.xm");
for($f=0;$f<count($forums);$f++)
{
 $forums[$f] = explode(":",$forums[$f]);
 $forums[$f] = $forums[$f][0];
 settype($forums[$f],"integer");
}
natsort($forums);
$forums = $forums[count($forums)-1];
$forums = explode(":","",$forums);
$forums = $forums[0];
settype($forums,"integer");
$forums++;
if($fs=fopen("./forum/forums.xm","a"))
 {
  fwrite($fs,$forums.":".$_POST['dir']."\n");
  fclose($fs);
 }
}
?>


--- End Message ---
--- Begin Message ---
the following script is supposed to write a file and make a dir for a corrosponding 
forum the only problem is it keeps coming out as
1:bbs
1:bbs2
1:bbs21
instead of
1:bbs
2:bbs2
3:bbs21
any ideas?
<?php
if(!file_exists("./forum/"))
{
mkdir("./forum/", 0777);
}

if($_POST['dir'] == "")
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="dir" id="dir" />
<input type="submit" />
</form>
<?php
} else {
if(!file_exists("./forum/".$_POST['dir']."/"))
 {
  mkdir("./forum/".$_POST['dir']."/", 0777);
  echo "forum made";
 }
else
 {
  echo "forum already there";
 }
$forums = file("./forum/forums.xm");
for($f=0;$f<count($forums);$f++)
{
 $forums[$f] = explode(":",$forums[$f]);
 $forums[$f] = $forums[$f][0];
 settype($forums[$f],"integer");
}
natsort($forums);
$forums = $forums[count($forums)-1];
$forums = explode(":","",$forums);
$forums = $forums[0];
settype($forums,"integer");
$forums++;
if($fs=fopen("./forum/forums.xm","a"))
 {
  fwrite($fs,$forums.":".$_POST['dir']."\n");
  fclose($fs);
 }
}
?>
--- End Message ---
--- Begin Message ---
the following script is supposed to write a file and make a dir for a corrosponding 
forum the only problem is it keeps coming out as
1:bbs
1:bbs2
1:bbs21
instead of
1:bbs
2:bbs2
3:bbs21
any ideas?
<?php
if(!file_exists("./forum/"))
{
mkdir("./forum/", 0777);
}

if($_POST['dir'] == "")
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="dir" id="dir" />
<input type="submit" />
</form>
<?php
} else {
if(!file_exists("./forum/".$_POST['dir']."/"))
 {
  mkdir("./forum/".$_POST['dir']."/", 0777);
  echo "forum made";
 }
else
 {
  echo "forum already there";
 }
$forums = file("./forum/forums.xm");
for($f=0;$f<count($forums);$f++)
{
 $forums[$f] = explode(":",$forums[$f]);
 $forums[$f] = $forums[$f][0];
 settype($forums[$f],"integer");
}
natsort($forums);
$forums = $forums[count($forums)-1];
$forums = explode(":","",$forums);
$forums = $forums[0];
settype($forums,"integer");
$forums++;
if($fs=fopen("./forum/forums.xm","a"))
 {
  fwrite($fs,$forums.":".$_POST['dir']."\n");
  fclose($fs);
 }
}
?>
--- End Message ---
--- Begin Message ---
Hi all,

I recently deployed a site using PHP 4.2.3 / MySQL 3.23 to a Windows 2000
server.  Site worked fine while we were testing but now that we've opened
the flood gates and told the world we're having an issue with old data
coming up and with session variables simply not working anymore.

- All of the pages on the site begin with this bit of code:
//prevent cache and kickstart the session
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 1 Jan 1990 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
session_start();

- We've set IIS to "Enable Content Expiration" and "Expire Immediately" but
it seems to have had no effect.

- PHP is installed as an ISAPI module.

Any tips and tricks you can suggest would come in handy as I am new to the
world of IIS!

Thank you,
Step

--- End Message ---
--- Begin Message ---
> - PHP is installed as an ISAPI module.

Oops.. I'm sorry.  It's actually the CGI that's installed with the "PHP
4.2.3 installer" download.

Thanks,
-Step

--- End Message ---
--- Begin Message ---
Step,

Have you looked at the headers that are being received by the client? A good
tool for this is Sam Spade (www.samspade.org) if you don't already have one.

Another idea to try is this:
http://www.php.net/manual/en/function.session-cache-limiter.php. I haven't
had to use this, but it seems to do a lot of what you are trying to do
automatically.

-Dash

-----Original Message-----
From: Step Schwarz [mailto:step@;closethipster.com] 
Sent: Tuesday, November 12, 2002 11:27 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] IIS 5.0 and cache


> - PHP is installed as an ISAPI module.

Oops.. I'm sorry.  It's actually the CGI that's installed with the "PHP
4.2.3 installer" download.

Thanks,
-Step


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello,

On 11/12/2002 05:50 PM, rich wrote:
PHP 4.2.3 on Windows.  I'm doing a simple query and then emailing each user
returned by the query within the loop:

mail($to, $subject, $message, $headers);

The problem is that it is so slow.....it times out after 60 or so emails,
even though I have set_time_limit( 2000 ).  Any way to speed this up?  Each
email must be unique, with query data embedded, so I can't just send one
single email to all recipients.
You most likely have a reverse DNS record missing problem.

What is the address of the machine that you are using PHP to send the messages?


--

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
I've had speed issues when using mail() on a win32 machine that has the
php.ini set towards an Exchange 5.5 server. It seems to take a while to open
the connection, verify, send it and then close the connection. I haven't
traced the problem though, and it's not much of an issue considering my
production code runs on linux with instant access to sendmail.

Although reverse DNS could very well be an issue in this case too...

-Dash

-----Original Message-----
From: Manuel Lemos [mailto:mlemos@;acm.org] 
Sent: Tuesday, November 12, 2002 12:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: Sending mail is so slooooooow


Hello,

On 11/12/2002 05:50 PM, rich wrote:
> PHP 4.2.3 on Windows.  I'm doing a simple query and then emailing each
user
> returned by the query within the loop:
> 
> mail($to, $subject, $message, $headers);
> 
> The problem is that it is so slow.....it times out after 60 or so emails,
> even though I have set_time_limit( 2000 ).  Any way to speed this up?
Each
> email must be unique, with query data embedded, so I can't just send one
> single email to all recipients.

You most likely have a reverse DNS record missing problem.

What is the address of the machine that you are using PHP to send the 
messages?


-- 

Regards,
Manuel Lemos


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello,

On 11/12/2002 08:23 PM, rich wrote:
Hmmm, I don't think so.  I'd rather not give out addresses of course, but
it's the same SMTP server I use for my own email (company mail server).  The
messages get sent out OK.  But the process of connecting and sending each
message is so slow that I have to run my process in four or five bursts,
picking up each time where I left off.

How would it be a reverse DNS issue?
If you try nslookup on the IP of the machine you are using and it does not resolve, that seems to be the problem.

Regards,
Manuel Lemos


"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
news:3DD16B05.6050709@;acm.org...

Hello,

On 11/12/2002 05:50 PM, rich wrote:

PHP 4.2.3 on Windows.  I'm doing a simple query and then emailing each

user

returned by the query within the loop:

mail($to, $subject, $message, $headers);

The problem is that it is so slow.....it times out after 60 or so

emails,

even though I have set_time_limit( 2000 ).  Any way to speed this up?

Each

email must be unique, with query data embedded, so I can't just send one
single email to all recipients.
You most likely have a reverse DNS record missing problem.

What is the address of the machine that you are using PHP to send the
messages?

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

I execute a script (session_test.php) to test the
session_type and I receive the following:

Session Test 
If sessions are configured properly in your PHP
installation, then you should see a session id below,
and the "page views" number should increase every time
you reload the page. Clicking "start over" should
reset the page view number back to 1. 
If this does not work, then you most likely have a
configuration issue with your PHP installation.
Gallery will not work properly until PHP's session
management is configured properly. 

Your session id is aba07672267be914400981efe1e10614 
Page views in this session 1 

Start over 
Return to the Diagnostics Page

This result seems to be correct, but it is not.

When I execute a reload of the page, there is NO
increment in the page views, indicating that something
is wrong.

To verify this, I executed a script of test of PHP
(phpinfo.php).

Next, I place a copy of the result of PHPInfo, section
of sessions.

session
Session Support enabled 

Directive Local Value Master Value 
session.auto_start Off Off 
session.cache_expire 180 180 
session.cache_limiter nocache nocache 
session.cookie_domain no value no value 
session.cookie_lifetime 0 0 
session.cookie_path / / 
session.cookie_secure Off Off 
session.entropy_file no value no value 
session.entropy_length 0 0 
session.gc_maxlifetime 1440 1440 
session.gc_probability 1 1 
session.name PHPSESSID PHPSESSID 
session.referer_check no value no value 
session.save_handler files files 
session.save_path /tmp /tmp 
session.serialize_handler php php 
session.use_cookies On On 
session.use_trans_sid 1 1 

Thanks Very Much for any helps.

Marcelo

_______________________________________________________________________
Yahoo! GeoCities
Tudo para criar o seu site: ferramentas fáceis de usar, espaço de sobra e acessórios.
http://br.geocities.yahoo.com/
--- End Message ---
--- Begin Message ---
If you are running on Windows, ActivePDF (www.activepdf.com) works pretty
well and will do what you want it to do.

Jeff Pearson
Advanced Digital Technology



"Jim Hunter" <[EMAIL PROTECTED]> wrote in message
news:3D576EE5.000010.00832@;WORKSTATION...
There are two major PDF libraries available. One from www.pdflib.com and one
from www.fastio.com. The PDFLib is supposed to be better supportive of PHP.
You can create PDF, but I'm not sure how much editing of one you are going
to be able to do, perhaps you can. And you can definitely use a form to get
data from to create a PDF. Check out Larry Ullmans book, Advanced PHP for
the WWW (ISBN: 0-201-77597-2). It has an entire chapter devoted to creating
and manipulating PDFs.

Jim Hunter
Diamond Computing

-------Original Message-------

From: Brian McGarvie
Date: Monday, August 12, 2002 01:08:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] PDF Files...

Looking for some insight into which is the best PDF library to use,
commercial/non-commercial.

If possible I would like to be able to;

* edit a PDF file,
* use an existing PDF file to insert text into form fields,
* create and fill PDF documents with form fields.

Any advice as to which of the above is possible/not possible and if not any
ways to *mimic* anything.

TIA...



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

.


--- End Message ---
--- Begin Message ---
Hey Rob,
Its tough getting started, even with the manual at your side, but you will
make it.  Lots of folk do fine with IIS but I suspect Apache is less
bothersome - one or two small additions to the config file and you are up
and away.  If you change to Apache and still have problems, mail me for an
example config and other stuff including an automatic setup of the whole kit
and kaboodle (mySQL, Apache PHP) and I shall send it to you direct.





----- Original Message -----
From: "Rob" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 07, 2002 8:55 AM
Subject: [PHP-WIN] Php Setup - begginer


> Hello,
>
> I'm wanting to learn php, but am having trouble setting up my computer so
> that I can use it. I know that you need to have a server with php enabled.
> I'm using a single PC with Windows XP, and have IIS installed. I have also
> downloaded the latest version of php and installed that too. Still though,
I
> can't seem to get it working, I'm not sure if its the php, the server or
> just my stupidity. Does anyone know how to do this? (I guess so
considering
> this is php.windows). Or, does anyone know a good web site that explains
how
> to set it all up. I've tried using the php manual and some php books, but
> they don't really focus on how to get the whole thing working together,
and
> I find them particularly vague when explaining the server thing.
>
> Also, is IIS the best solution or is there something a bit easier, like
the
> Microsoft Personal Server or Apache?...I don't really know much about
> these...but then I don't really know much about IIS either. I'm a
> server/networking novice you might say.
>
> Cheers for any help in advance.
>
> Rob
> email: [EMAIL PROTECTED]
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Dean
A PHP APache mySQL combo works fine on a win98SE box, probably the least
troublesome of all.   While win98 is not a serious or secure platform for
WWW or business intranet, for home development its quick and easy.  Are you
saying your scripts don`t work at all or just  won`t add records to mysql
tables?  What error messages if any?    Do you see errors like "not a valid
mySQL resource" or some such?



----- Original Message -----
From: "Dean Hayes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 12, 2002 10:38 PM
Subject: [PHP-WIN] PHP and Windows 98


> HI,
>
> I am trying to run scripts on a windows 98SE based system running apache
> 1.3.2 and PHP 4.2 The problems i have is that the php scripts will not run
> correctly and when called in a MySQL database it will not add or alter.
Can
> anybody help short of gettin a new O.S will a different server or database
> help???
>
> Thanks
>
> Dean Hayes
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Can some one help me with this little issue ... I am trying out some prewritten scripts curtesy of SAMS PHP and MYSQL Web Development, Ch24 - User Authenication & Personalisation on my server setup

The Configuartion for my development environment is Apache 2.39, Win 2000, PHP 4.2.3

The Ini file has the following session settings (as taken from PHPInfo.php):


session

Session Support enabled


Directive Local Value Master Value
session.auto_start
Off Off
session.cache_expire
180 180
session.cache_limiter
nocache nocache
session.cookie_domain
no value no value
session.cookie_lifetime
0 0
session.cookie_path
/ /
session.cookie_secure
Off Off
session.entropy_file
no value no value
session.entropy_length
0 0
session.gc_maxlifetime
1440 1440
session.gc_probability
1 1
session.name
PHPSESSID PHPSESSID
session.referer_check
no value no value
session.save_handler
files files
session.save_path
.c:/php/sessions/tmp .c:/php/sessions/tmp
session.serialize_handler
php php
session.use_cookies
On On
session.use_trans_sid
0 0


The error occurs after the registration page is submitted with the following using the function session_start() on the register page.:

Warning: open(.c:/php/sessions/tmp\sess_fa42372dcdbde0e457309f134d71827f, O_RDWR) failed: Invalid argument (22) in C:\Program Files\Apache Group\Apache2\htdocs\SAMS\Chapter24\member.php on line 5

I believe the problem is in my PHP setup and not the script. The Invalid arguement is the trigger for the config error to be initaited but I am not sure how to edit the php.ini file. I want to ensure that session are started when the server is started. I am also unsure of the function and terminology of

session.save_handler
files files


with the use of "files". Is this the correct default. Also is this the correct session save path:

session.save_path
.c:/php/sessions/tmp .c:/php/sessions/tmp


What is wrong, please help.

Charlie
--- End Message ---
--- Begin Message ---
Look at your session.save_path line:

session.save_path
.c:/php/sessions/tmp .c:/php/sessions/tmp

Change this to c:\php\sessions\tmp and you'll find yourself without a
problem (as long as that directory exists. The dot in front of the pathname
is most likely failing the script.

session.save_path = c:\temp

That's mine.

-Dash

-----Original Message-----
From: Charlie Fowler [mailto:charlie@;rahinston.com] 
Sent: Tuesday, November 12, 2002 3:20 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [PHP-WIN] Problem with sessions


Hi all,,

Can some one help me with this little issue ... I am trying out some 
prewritten scripts curtesy of SAMS PHP and MYSQL Web Development, Ch24 - 
User Authenication & Personalisation on my server setup

The Configuartion for my development environment is Apache 2.39, Win 
2000, PHP 4.2.3

The Ini file has the following session settings (as taken from PHPInfo.php):


    session

Session Support enabled


Directive Local Value Master Value
session.auto_start
Off Off
session.cache_expire
180 180
session.cache_limiter
nocache nocache
session.cookie_domain
no value no value
session.cookie_lifetime
0 0
session.cookie_path
/ /
session.cookie_secure
Off Off
session.entropy_file
no value no value
session.entropy_length
0 0
session.gc_maxlifetime
1440 1440
session.gc_probability
1 1
session.name
PHPSESSID PHPSESSID
session.referer_check
no value no value
session.save_handler
files files
session.save_path
.c:/php/sessions/tmp .c:/php/sessions/tmp
session.serialize_handler
php php
session.use_cookies
On On
session.use_trans_sid
0 0


The error occurs after the registration page is submitted with the 
following using the function session_start() on the register page.:

Warning: 
open(.c:/php/sessions/tmp\sess_fa42372dcdbde0e457309f134d71827f, O_RDWR) 
failed: Invalid argument (22) in C:\Program Files\Apache 
Group\Apache2\htdocs\SAMS\Chapter24\member.php on line 5

I believe the problem is in my PHP setup and not the script. The Invalid 
arguement is the trigger for the config error to be initaited but I am 
not sure how to edit the php.ini file. I want to ensure that session are 
started when the server is started. I am also unsure of  the function 
and terminology of

session.save_handler
files files


with the use of "files". Is this the correct default. Also is this the 
correct session save path:

session.save_path
.c:/php/sessions/tmp .c:/php/sessions/tmp


What is wrong, please help.

Charlie
--- End Message ---
--- Begin Message ---
At 00:19 13.11.2002, Charlie Fowler said:
--------------------[snip]--------------------
>.c:/php/sessions/tmp .c:/php/sessions/tmp
>
>open(.c:/php/sessions/tmp\sess_fa42372dcdbde0e457309f134d71827f, O_RDWR) 
>failed: Invalid argument (22) in C:\Program Files\Apache 
>Group\Apache2\htdocs\SAMS\Chapter24\member.php on line 5
--------------------[snip]-------------------- 

I believe the dot before the "c:" is the culprit. Remove it, restart Apache
and retry.


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
hello,

  I am trying to connect mssql with php, when I use mssql_pconnect(), It
will fail to connect when the amount of visitors becomes large. But,
when I use mssql_connect(), I can only run SELECT quern, while the
INSERT/UPDATE staments doesn't work. Can somebody tell me why? thanks
and sorry for my poor English :P
-- 
Welcome to http://www.soff.net


--- End Message ---

Reply via email to