php-windows Digest 2 Nov 2002 20:50:34 -0000 Issue 1420
Topics (messages 16687 through 16695):
Re: Please Guide me ( Unix and Windows Severs)
16687 by: Cam Dunstan
Re: uploading help please
16688 by: toby z
16689 by: Miha Nedok
Re: Login from another page (pardon me :$)
16690 by: toby z
Passing parameters to a perl script
16691 by: DaMouse
2 Issues for Mail() in Win/PHP4-
16692 by: Marie Monday
16693 by: Stephen Edmonds
16694 by: Charles P. Killmer
Re: PHP 4.3.0pre2
16695 by: George Nicolae
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 ---
raheel,
Script wise you should have no dramas at all running them on unix box (or
linux). Just ftp them straight across and let em rip. the only changes
would be of course logging onto a different database server perhaps. Most
environments typically do not have session_autostart set to on (1) by
default though it it is by no means unheard of. Unfortunately you cannot
start a session in your scripts conditionally, that is you can`t have
"session_start() inside an IF statement, it has to be on the first line of
your script. there are tiny number of rarely used functions that do work
in unix but not in windows, doubt if this will effect you.
good luck - CD
----- Original Message -----
From: "Raheel Hussain" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 02, 2002 5:39 PM
Subject: [PHP-WIN] Please Guide me ( Unix and Windows Severs)
>
> hi,
> I m working on a site which is to be hosted on a unix or linux server, but
the idea which i don't have
> is the difference between the unix/linux and windows server,
> i wonder there is no difference in the php scripts, but the only
difference will be the configuration of
> php on windows and unix/linux.
>
> plz correct me if i m wrong
>
> the other confusion which i have in my mind is , the standard
configuration of php in various
> windows and Linux/Unix servers about the "session.auto_start" is it set to
1 or 0
>
> this is i m asking because i have never hosting a site designed in php but
a lot of sites in ASP
> , in asp there is always session is autostart. so ,
> If i m developing a site on my local sever ( My PC ) with the
configuration of session.auto_start=1
> then if i host it, it might create error, because
> when i set ( session.auto_start=0) and wrote session_start(); on each page
explicitly, it was creating
> a lot of errors, so i set (session.auto_start=1) and worked fine.
>
> plz guide me.
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> HotJobs - Search new jobs daily now
--- End Message ---
--- Begin Message ---
hi marcelo
1st
i don think u can upload 2 filez simultaneosly
2nd
<form enctype=\"multipart/form-data\" action=up.php
method=post>
is what u do when u wanna upload A file
3rd
when u see Array displayed istead ur variable it means
the variable aint bein piked by the page or the query
check ur code and the variables passed
hope i ve helped ....
good luck
toby
--- marcelo <[EMAIL PROTECTED]> wrote: > Hi
need some help please
>
> What is wrong with my code?
>
> it is supposed to upload 2 files but instead gives
> me this error
>
> Warning: Unable to open 'Array' for reading
>
> The code:
>
> <html>
> <head>
> <title>O Leme upload</title>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
> </head>
>
> <body>
>
> <?php
>
>
>
> $PHP_SELF = $_SERVER['PHP_SELF'];
> $page = $_REQUEST['page'];
> $origem = $_FILES['origem'];
> $origem2 = $_FILES['origem2'];
>
>
>
> switch($page)
> {
> case "um":
> um($origem ,$origem2);
> break;
> case "dois":
> dois($origem, $origem2);
> break;
>
> default:
> um($origem ,$origem2);
> break;
> }
>
> function um($origem ,$origem2)
>
>
> {
>
> ?>
>
>
>
> <title>Jornal O Leme</title>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
> </head>
>
> <body bgcolor="#006699">
> <table width="100%" border="0" cellpadding="0"
> cellspacing="0">
> <!--DWLayoutTable-->
> <tr>
> <td width="100%" height="70" valign="top"><img
> src="test.jpg"
> width="600" height="120">
> </td>
> </tr>
> <tr>
> <td height="262" valign="top"><p> </p>
> <form method="post" action="<?php $PHP_SELF
> ?>"
> enctype="multipart/form-data">
> <table width="75%" border="0" align="center"
> bgcolor="#FFFFFF">
> <tr>
> <td width="23%"><div
> align="center"><font face="BankGothic Md
> BT">
> </font></div></td>
> <td width="77%" bgcolor="#FFFFFF">
> </td>
> </tr>
> <tr>
> <td><div align="center"></div></td>
> <td bgcolor="#FFFFFF"> </td>
> </tr>
> <tr>
> <td><div align="center"></div></td>
> <td bgcolor="#FFFFFF"> </td>
> </tr>
> <tr>
> <td><div align="left"><strong>Imagem
> pequena</strong></div></td>
> <td bgcolor="#FFFFFF"> <input
> type=hidden name=MAX_FILE_SIZE
> value=102400>
> <input type="File" name="origem">
> </td>
> </tr>
> <tr>
> <td><div align="left"><strong>Imagem
> grande</strong></div></td>
> <td bgcolor="#FFFFFF"><input type=hidden
> name=MAX_FILE_SIZE
> value=102400>
> <input type="File" name="origem2">
> </td>
> </tr>
> <tr>
> <td><div align="center"></div></td>
> <td bgcolor="#FFFFFF"> </td>
> </tr>
> <tr>
> <td> </td>
> <td> </td>
> </tr>
> </table>
> <p align="center">
> <input name="submit" type="submit"
> value="Adicionar">
> <input type="hidden" name="page" value="dois">
> </form></p>
> </td>
> </tr>
> <tr>
> <td height="81" valign="top"><div
> align="center">
> <p> </p>
> <p>
> <?php
>
> include ('menu.php');
>
> ?>
> </p>
> </div></td>
> </tr>
> </table>
>
>
> <?php
>
>
>
> }
>
>
>
>
> function dois($origem, $origem2)
>
>
> {
> set_time_limit(60);
>
$path=(dirname($PATH_TRANSLATED))."../primeirapagina/";
> $origem_name="pppv2.jpg";
> $dest= $path.$origem_name;
>
> if (($origem <> "none") && ($origem <> "")){
> if (copy($origem,$dest)){;
>
> } else {
> echo "directoria sem direitos de escrita
> <br>";
> }
> unlink ($origem);
> }
>
> set_time_limit(60);
>
$path2=(dirname($PATH_TRANSLATED))."../primeirapagina/";
> $origem2_name="ppv2.jpg";
> $dest2= $path2.$origem2_name;
>
> if (($origem2 <> "none") && ($origem2 <> "")){
> if (copy($origem2,$dest2)){;
>
> } else {
> echo "directoria sem direitos de escrita
> <br>";
> }
> unlink ($origem2);
> }
>
>
>
>
> }
>
>
>
>
>
> ?>
> </body>
> </html>
>
>
>
>
>
=== message truncated ===
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
Yes u can upload multiple files at once.
In the form you must use:
<input type="file" name="userfile[]">.
Se userfile[] like an array.
In the form tag:
enctype="multipart/form-data"
The PHP script which recieves the file:
Just walk the $userfile array and copy the file or move.
Sample:
for ($i=0;$i<count($userfile);$i++){
$mydest = "/some/path" . $userfile_name[$i];
copy($userfile[$i],$mydest);
}
This should work fine.
-Mike
On Sat, 2 Nov 2002, [iso-8859-1] toby z wrote:
> Date: Sat, 2 Nov 2002 11:40:32 +0000 (GMT)
> From: "[iso-8859-1] toby z" <[EMAIL PROTECTED]>
> To: marcelo <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] uploading help please
>
> hi marcelo
>
> 1st
> i don think u can upload 2 filez simultaneosly
>
>
> 2nd
> <form enctype=\"multipart/form-data\" action=up.php
> method=post>
> is what u do when u wanna upload A file
>
>
> 3rd
> when u see Array displayed istead ur variable it means
> the variable aint bein piked by the page or the query
>
>
> check ur code and the variables passed
>
> hope i ve helped ....
>
> good luck
>
> toby
>
> --- marcelo <[EMAIL PROTECTED]> wrote: > Hi
> need some help please
> >
> > What is wrong with my code?
> >
> > it is supposed to upload 2 files but instead gives
> > me this error
> >
> > Warning: Unable to open 'Array' for reading
> >
> > The code:
> >
> > <html>
> > <head>
> > <title>O Leme upload</title>
> > <meta http-equiv="Content-Type" content="text/html;
> > charset=iso-8859-1">
> > </head>
> >
> > <body>
> >
> > <?php
> >
> >
> >
> > $PHP_SELF = $_SERVER['PHP_SELF'];
> > $page = $_REQUEST['page'];
> > $origem = $_FILES['origem'];
> > $origem2 = $_FILES['origem2'];
> >
> >
> >
> > switch($page)
> > {
> > case "um":
> > um($origem ,$origem2);
> > break;
> > case "dois":
> > dois($origem, $origem2);
> > break;
> >
> > default:
> > um($origem ,$origem2);
> > break;
> > }
> >
> > function um($origem ,$origem2)
> >
> >
> > {
> >
> > ?>
> >
> >
> >
> > <title>Jornal O Leme</title>
> > <meta http-equiv="Content-Type" content="text/html;
> > charset=iso-8859-1">
> > </head>
> >
> > <body bgcolor="#006699">
> > <table width="100%" border="0" cellpadding="0"
> > cellspacing="0">
> > <!--DWLayoutTable-->
> > <tr>
> > <td width="100%" height="70" valign="top"><img
> > src="test.jpg"
> > width="600" height="120">
> > </td>
> > </tr>
> > <tr>
> > <td height="262" valign="top"><p> </p>
> > <form method="post" action="<?php $PHP_SELF
> > ?>"
> > enctype="multipart/form-data">
> > <table width="75%" border="0" align="center"
> > bgcolor="#FFFFFF">
> > <tr>
> > <td width="23%"><div
> > align="center"><font face="BankGothic Md
> > BT">
> > </font></div></td>
> > <td width="77%" bgcolor="#FFFFFF">
> > </td>
> > </tr>
> > <tr>
> > <td><div align="center"></div></td>
> > <td bgcolor="#FFFFFF"> </td>
> > </tr>
> > <tr>
> > <td><div align="center"></div></td>
> > <td bgcolor="#FFFFFF"> </td>
> > </tr>
> > <tr>
> > <td><div align="left"><strong>Imagem
> > pequena</strong></div></td>
> > <td bgcolor="#FFFFFF"> <input
> > type=hidden name=MAX_FILE_SIZE
> > value=102400>
> > <input type="File" name="origem">
> > </td>
> > </tr>
> > <tr>
> > <td><div align="left"><strong>Imagem
> > grande</strong></div></td>
> > <td bgcolor="#FFFFFF"><input type=hidden
> > name=MAX_FILE_SIZE
> > value=102400>
> > <input type="File" name="origem2">
> > </td>
> > </tr>
> > <tr>
> > <td><div align="center"></div></td>
> > <td bgcolor="#FFFFFF"> </td>
> > </tr>
> > <tr>
> > <td> </td>
> > <td> </td>
> > </tr>
> > </table>
> > <p align="center">
> > <input name="submit" type="submit"
> > value="Adicionar">
> > <input type="hidden" name="page" value="dois">
> > </form></p>
> > </td>
> > </tr>
> > <tr>
> > <td height="81" valign="top"><div
> > align="center">
> > <p> </p>
> > <p>
> > <?php
> >
> > include ('menu.php');
> >
> > ?>
> > </p>
> > </div></td>
> > </tr>
> > </table>
> >
> >
> > <?php
> >
> >
> >
> > }
> >
> >
> >
> >
> > function dois($origem, $origem2)
> >
> >
> > {
> > set_time_limit(60);
> >
> $path=(dirname($PATH_TRANSLATED))."../primeirapagina/";
> > $origem_name="pppv2.jpg";
> > $dest= $path.$origem_name;
> >
> > if (($origem <> "none") && ($origem <> "")){
> > if (copy($origem,$dest)){;
> >
> > } else {
> > echo "directoria sem direitos de escrita
> > <br>";
> > }
> > unlink ($origem);
> > }
> >
> > set_time_limit(60);
> >
> $path2=(dirname($PATH_TRANSLATED))."../primeirapagina/";
> > $origem2_name="ppv2.jpg";
> > $dest2= $path2.$origem2_name;
> >
> > if (($origem2 <> "none") && ($origem2 <> "")){
> > if (copy($origem2,$dest2)){;
> >
> > } else {
> > echo "directoria sem direitos de escrita
> > <br>";
> > }
> > unlink ($origem2);
> > }
> >
> >
> >
> >
> > }
> >
> >
> >
> >
> >
> > ?>
> > </body>
> > </html>
> >
> >
> >
> >
> >
> === message truncated ===
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
pardon my ignorance guyz but what on earth is BBS ????
pretty embaressed
toby .....
--- "Douglas F. Keim" <[EMAIL PROTECTED]> wrote:
> I installed php, mysql and phpbb on my web site.
> The bbs is great and a
> wonderful way to communicate with clients and
> family.
>
> However, there is an area on my web that I have
> password protected earlier
> with a MS Access database. Now I have two databases
> to maintain and two
> areas that I have to set up users. Though
> relatively easy to do, it is a
> duplication of effort.
>
> What I think that I would like to do is use one or
> the other for both
> functions. Since the BBS is working so well in the
> PHP world, I am leaning
> towards MySQL as the preferred database of choice.
>
> My question is this.
>
> How do I access the mysql database from a web page
> that is not going to go
> into the bbs?
>
> I would also like to allow a user to update his/her
> own profile. Maybe even
> change their own password on occasion if they would
> like.
>
> Anyone help?
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
I've got this script called sendmail.pl and I'll
give no prizes guessing what it does but I want the fields from one form to
be passed to it via php my current code is just
virtual("cgi-bin/sendmail.pl"); but that doesn't
post the $_POST paremeters I need to send in my email
![O]() Ensign Baker HCO
Officer USS Atlantis
|
--- End Message ---
--- Begin Message ---
I'm a PHP newbie and have just installed php4.2.3 on WinNT 4.0 w/ IIS4.0
Already have set the SMTP and sendmail_from in php.ini.
1). Mail function sends mail, except that none of the html form
variables are parsed into the email body $message.
The script works fine run from another hosted (apache) webserver. Is
a config or script issue?
2). Received email message does not include the sender's email address
from $txtemail form variable.
Instead, it places their email address from the form in the message body
first line.
It is using the php.ini sendmail_from address.
<?php
{
$recipient="[EMAIL PROTECTED]";
$subject="Need Help";
$message="$txtname submitted a helpdesk request by web form.
A computer tech needs to contact $txtname shortly at $txtphone or by
email at $txtemail regarding $txtproblem";
$sender=$txtemail;
mail(trim($recipient), trim($subject), $message, trim($sender));
}
?>
TIA,
~marie
--- End Message ---
--- Begin Message ---
well for a start I suggest spaces... makes a code easier to understand
$subject = "Need Help";
I am not sure if that actually affects the variable... anyway
mail($Email_To, $Email_Subject, $Email_Message,
"From: [EMAIL PROTECTED]\r\n"
."Reply-To: [EMAIL PROTECTED]\r\n")
OR DIE( "Unable to send email" );
Thats an example of mail(); lifted from one of my scripts. As you can see,
the additional headers (Such as who the email is from) have to be writen as
"From: [EMAIL PROTECTED]\r\n". In your case, something like
$Email_From = "\"From: ".trim($sender)."\r\n\"";
should give you "From: $sender" as is needed.
As for using variables in the message... I suggest putting the variables
'outside' the message body.
EG: $Message = "Hello, this is my variable".$variable."\n\nIts nice";
I can't think of a good way to explain this... so think of ".$variable." as
a way of making php parse $variable. It can also be used with functions, so
is quite handy to know
Oh well, I tried. Sorry its not a bit clearer
Stephen
----- Original Message -----
From: "Marie Monday" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 02, 2002 3:52 PM
Subject: [PHP-WIN] 2 Issues for Mail() in Win/PHP4-
> I'm a PHP newbie and have just installed php4.2.3 on WinNT 4.0 w/ IIS4.0
>
> Already have set the SMTP and sendmail_from in php.ini.
> 1). Mail function sends mail, except that none of the html form
> variables are parsed into the email body $message.
> The script works fine run from another hosted (apache) webserver. Is
> a config or script issue?
> 2). Received email message does not include the sender's email address
> from $txtemail form variable.
> Instead, it places their email address from the form in the message body
> first line.
> It is using the php.ini sendmail_from address.
>
> <?php
> {
> $recipient="[EMAIL PROTECTED]";
> $subject="Need Help";
> $message="$txtname submitted a helpdesk request by web form.
> A computer tech needs to contact $txtname shortly at $txtphone or by
> email at $txtemail regarding $txtproblem";
> $sender=$txtemail;
> mail(trim($recipient), trim($subject), $message, trim($sender));
> }
> ?>
>
> TIA,
> ~marie
>
>
----------------------------------------------------------------------------
----
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Also check and make sure that you have register_globals set to on in php.ini Some
argue that you shouldn't use that though.
Charles Killmer
-----Original Message-----
From: Stephen Edmonds [mailto:stephen.edmonds5@;btinternet.com]
Sent: Saturday, November 02, 2002 10:12 AM
To: PHP Helplist Windows; Marie Monday
Subject: Re: [PHP-WIN] 2 Issues for Mail() in Win/PHP4-
well for a start I suggest spaces... makes a code easier to understand
$subject = "Need Help";
I am not sure if that actually affects the variable... anyway
mail($Email_To, $Email_Subject, $Email_Message,
"From: [EMAIL PROTECTED]\r\n"
."Reply-To: [EMAIL PROTECTED]\r\n")
OR DIE( "Unable to send email" );
Thats an example of mail(); lifted from one of my scripts. As you can see,
the additional headers (Such as who the email is from) have to be writen as
"From: [EMAIL PROTECTED]\r\n". In your case, something like
$Email_From = "\"From: ".trim($sender)."\r\n\"";
should give you "From: $sender" as is needed.
As for using variables in the message... I suggest putting the variables
'outside' the message body.
EG: $Message = "Hello, this is my variable".$variable."\n\nIts nice";
I can't think of a good way to explain this... so think of ".$variable." as
a way of making php parse $variable. It can also be used with functions, so
is quite handy to know
Oh well, I tried. Sorry its not a bit clearer
Stephen
----- Original Message -----
From: "Marie Monday" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 02, 2002 3:52 PM
Subject: [PHP-WIN] 2 Issues for Mail() in Win/PHP4-
> I'm a PHP newbie and have just installed php4.2.3 on WinNT 4.0 w/ IIS4.0
>
> Already have set the SMTP and sendmail_from in php.ini.
> 1). Mail function sends mail, except that none of the html form
> variables are parsed into the email body $message.
> The script works fine run from another hosted (apache) webserver. Is
> a config or script issue?
> 2). Received email message does not include the sender's email address
> from $txtemail form variable.
> Instead, it places their email address from the form in the message body
> first line.
> It is using the php.ini sendmail_from address.
>
> <?php
> {
> $recipient="[EMAIL PROTECTED]";
> $subject="Need Help";
> $message="$txtname submitted a helpdesk request by web form.
> A computer tech needs to contact $txtname shortly at $txtphone or by
> email at $txtemail regarding $txtproblem";
> $sender=$txtemail;
> mail(trim($recipient), trim($subject), $message, trim($sender));
> }
> ?>
>
> TIA,
> ~marie
>
>
----------------------------------------------------------------------------
----
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
take a look at http://lxr.php.net/source/php4/ChangeLog
--
Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com - Professional Web Design
www.PaginiWeb.com
"Erythros" <[EMAIL PROTECTED]> wrote in message
news:20021031140806.81177.qmail@;pb1.pair.com...
> were can i find info about PHP 4.3.0pre2?
>
>
--- End Message ---