php-windows Digest 2 Apr 2003 05:26:24 -0000 Issue 1664
Topics (messages 19229 through 19241):
Re: Simple Answer, but I can't see it....
19229 by: skate
19230 by: skate
Subject: + character in a command line argument
19231 by: Max Graham
19232 by: mmy
19237 by: Sven Schnitzke
Output to Excel File
19233 by: Chris and Trish Kaelin
19235 by: Isetro Savi
19236 by: skate
Subject: [PHP-WIN] Simple Answer, but I can't see it....
19234 by: Neil Smith
Re: Sending Mail with PHP
19238 by: Manuel Lemos
what win32 SMTP are you using with php?
19239 by: Leo G. Divingracia III
19240 by: Scott Carr
I really don't understand this?
19241 by: ODCS
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 ---
okay, after your <form method="post" action="SessionLogin.php">
kill the </form>
that's the bit that'll be breaking it...
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 6:13 PM
Subject: Re: [PHP-WIN] Simple Answer, but I can't see it....
> This is the some of the code that is contained within the PHP page...
>
> <?php
>
> if (isset( $_POST[ "username"] )) {
> code here....
> }
> ?>
> more HTML & PHP etc...
>
> <?PHP $self = $_SERVER[ 'PHP_SELF' ]; ?>
> <form method="post" action="SessionLogin.php"></form>
> <input type="text" name="username" maxlength="20"/>
> <input type="password" name="password" maxlength="20"/>
> <input type="submit" value="Submit"/>
> </form>
> ?>
> More HTML etc...
>
> When the submit button is pressed the nothing happens.
>
> Tryst
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
if you simply hit return, it "should" submit the first form in IE, so you
may well have been doing this, but pressing submit other times...
it's one of those annoying little things that you kick yourself for not
noticing :)
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 6:47 PM
Subject: Re: [PHP-WIN] Simple Answer, but I can't see it....
> Excellent.
>
> Stupid me, I should have noticed it :-s
>
> Strange, though, 'cause it was calling other pages that I specified within
> the 'action' attribute.
>
> Tryst
>
--- End Message ---
--- Begin Message ---
Have you tried replacing the + with %2B?
Having never tried this before myself, this is sort of a shot in the dark
... but I figured it might give you an idea as to where to go from
> Message-ID: <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> From: "mmy" <[EMAIL PROTECTED]>
> Date: Sun, 30 Mar 2003 11:30:22 +0200
> Subject: + character in a command line argument
>
> Hi!
>
> I'm using PHP 4.3.1, IE 5.5, Win ME
>
> I'm trying to use php through DOS command line.
>
> Running the very basic script
>
> $argv = $_SERVER['argv'];
> var_dump($argv);
>
> I noticed that the command line arguments are split at a + character, even
> if between double quotes.
>
> for instance
>
> php test.php a+b
>
> or
>
> php test.php "a+b"
>
> both return 3 arguments, "test.php", "a" and "b".
>
> I don't know if it is a DOS or php problem (though if you name a file
> a+b.txt, the DOS command type a+b.txt runs correctly, which seems to
> exonerate DOS...).
>
> My questions are more practical : does anybody knows how to pass a + in an
> argument?? Are there other characters that are special in addition to "
and
> + ??
>
> Thanks in advance
--- End Message ---
--- Begin Message ---
Thanks for the try!
No, I did not up to now. Unfortunately, the result of the test is that this
is taken as face value (the 3 characters). However, % has indeed some
syntactic use: it is an escape for the double quote (%" yields a double
quote, and no split), and for itslef (%% yields %), but not for antislash.
In-between, I found that antislash is an escape for the double quote, but
not for % or \. \2b is seen as the three characters...
Still nothing to escape the +...
This is really weird!
I can't believe that this is specified nowhere! For DOS command lines, or
Windows command line, I found 10's of sites listing the commands, but never
the basic syntax!
"Max Graham" <[EMAIL PROTECTED]> a écrit dans le message news:
[EMAIL PROTECTED]
> Have you tried replacing the + with %2B?
>
> Having never tried this before myself, this is sort of a shot in the dark
> ... but I figured it might give you an idea as to where to go from
>
>
> > Message-ID: <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > From: "mmy" <[EMAIL PROTECTED]>
> > Date: Sun, 30 Mar 2003 11:30:22 +0200
> > Subject: + character in a command line argument
> >
> > Hi!
> >
> > I'm using PHP 4.3.1, IE 5.5, Win ME
> >
> > I'm trying to use php through DOS command line.
> >
> > Running the very basic script
> >
> > $argv = $_SERVER['argv'];
> > var_dump($argv);
> >
> > I noticed that the command line arguments are split at a + character,
even
> > if between double quotes.
> >
> > for instance
> >
> > php test.php a+b
> >
> > or
> >
> > php test.php "a+b"
> >
> > both return 3 arguments, "test.php", "a" and "b".
> >
> > I don't know if it is a DOS or php problem (though if you name a file
> > a+b.txt, the DOS command type a+b.txt runs correctly, which seems to
> > exonerate DOS...).
> >
> > My questions are more practical : does anybody knows how to pass a + in
an
> > argument?? Are there other characters that are special in addition to "
> and
> > + ??
> >
> > Thanks in advance
>
--- End Message ---
--- Begin Message ---
Hi,
> mmy [SMTP:[EMAIL PROTECTED] wrote on tuesday, april 1, 2003 21:45
>
> ..., but never
> the basic syntax!
>
This is M$ of its earliest days, there is no such thing like a
"basic syntax".
"+" is special to DOS at least with the copy command in that
"copy a+b.txt" means:
take file "a" and file "b.txt" and concatenate them giving file a.
But you have already tried type ...
A file named "a+b.txt" is legal with WIN95 and later but not with DOS.
A file named "a+b.txt" is fed to DOS with its "short name" (e.g. A_B~1.TXT).
You can see this with the dir command.
In old DOS manuals you could find the allowable characters for file names.
But this is garbage anyway because it held true for the command line only.
Programmatically you could at all times take any ASCII code for a
character in a file name (including zero, btw...). If you knew what you were
doing. And there had not been any warranty that third parties counted the
result for a valid file name. And sometimes this was intended...
Back to your problem: the treatment of + on the command line has been
changed recently. My versions PHP 4.4-dev, PHP 4.3.0RC1 e.g. have
$GLOBALS['argv'] as an array, one entry being "a+b.txt", quoted or not.
CMDLINE reads: plus.php "a+b.txt"
PHP 4.2.2 has three entrys, one being a and one being b.txt,
whereas PHP 4.3.2-RC has argc, argv only in the CLI build.
CMDLINE reads: plus.php \"a+b.txt\"
So to solve your problem you should settle for filenames without a plus
sign in it. It's bad with *nix anyway. If you lack that option take a modern
version of PHP, quote the filenames and pray.
--
Sven Schnitzke
> -----Ursprüngliche Nachricht-----
> Von: mmy [SMTP:[EMAIL PROTECTED]
> Gesendet am: Dienstag, 1. April 2003 21:45
> An: [EMAIL PROTECTED]
> Betreff: [PHP-WIN] Re: Subject: + character in a command line argument
>
> Thanks for the try!
>
>...
>
> Still nothing to escape the +...
> "Max Graham" <[EMAIL PROTECTED]> a écrit dans le message news:
> [EMAIL PROTECTED]
> > Have you tried replacing the + with %2B?
> >
> > Having never tried this before myself, this is sort of a shot in the dark
> > ... but I figured it might give you an idea as to where to go from
> >
> >
> > > Message-ID: <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > > From: "mmy" <[EMAIL PROTECTED]>
> > > Date: Sun, 30 Mar 2003 11:30:22 +0200
> > > Subject: + character in a command line argument
> > >
> > > Hi!
> > >
> > > I'm using PHP 4.3.1, IE 5.5, Win ME
> > >
> > > I'm trying to use php through DOS command line.
> > >
> > > Running the very basic script
> > >
> > > $argv = $_SERVER['argv'];
> > > var_dump($argv);
> > >
> > > I noticed that the command line arguments are split at a + character,
> even
> > > if between double quotes.
> > >
> > > for instance
> > >
> > > php test.php a+b
> > >
> > > or
> > >
> > > php test.php "a+b"
> > >
> > > both return 3 arguments, "test.php", "a" and "b".
> > >
> > > I don't know if it is a DOS or php problem (though if you name a file
> > > a+b.txt, the DOS command type a+b.txt runs correctly, which seems to
> > > exonerate DOS...).
> > >
> > > My questions are more practical : does anybody knows how to pass a + in
> an
> > > argument?? Are there other characters that are special in addition to "
> > and
> > > + ??
> > >
> > > Thanks in advance
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
At my job, we are using ColdFusion with an Oracle database, and one the
things we do is output data in a HTML table using contentType =
"application/msexcel", which creates a MS Excel spreadsheet.
The two web sites I am running from home are PHP with an mySQL database. Is
there a similar method in PHP ot create a MS Excel spreadsheet?
Chris Kaelin
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
--- End Message ---
--- Begin Message ---
There is not an easy way that I know of, however, you do have some
alternatives. I believe outputting data in html tables and setting the
content-type and name properly will work. This is somewhat messy and
doesn't allow you to do much with the data, however.
Another method I have used and the best way I found to do it was to
write the data in xml format. I don't know if there is any good
documentation for that, but if you save a spreadsheet as a web page
from excel, you should be able to reverse engineer what you need from
that. By using xml, you can also specify a lot of things you
otherwise wouldn't be able to such as column width, print size, and
more.
Good luck, and feel free to let me know if you need more detailed info.
isetro
On Tue, Apr 01, 2003 at 04:58:20PM -0500, Chris and Trish Kaelin wrote:
> At my job, we are using ColdFusion with an Oracle database, and one the
> things we do is output data in a HTML table using contentType =
> "application/msexcel", which creates a MS Excel spreadsheet.
>
> The two web sites I am running from home are PHP with an mySQL database.
> Is there a similar method in PHP ot create a MS Excel spreadsheet?
>
> Chris Kaelin
>
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
if your running it on a windows box with excel installed, then you can use a
COM object and export directly to an Excel (.xls) file. i've done this, and
can supply some cool codes if needed.
this stuff is pretty simple, and very cool when you get it working.
another alternative is to export in comma seperated file which doesn't
require any addon's, and a .csv file will drop straight into excel with no
real problems.
if you want some COM code pointers tho and it's an option for your server,
give me a shout and i'll post what i've written...
----- Original Message -----
From: "Chris and Trish Kaelin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 10:58 PM
Subject: [PHP-WIN] Output to Excel File
> At my job, we are using ColdFusion with an Oracle database, and one the
> things we do is output data in a HTML table using contentType =
> "application/msexcel", which creates a MS Excel spreadsheet.
>
> The two web sites I am running from home are PHP with an mySQL database.
Is
> there a similar method in PHP ot create a MS Excel spreadsheet?
>
> Chris Kaelin
>
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Very simple answer : basic HTML suggests that you don't close your form
tags before the input tags. Remove the close form tag you have added
immediately after the open form tag and you will see what I mean. You use
dreamweaver, don't you ?
Another pair of eyes is a wonderful thing ;-)
Cheers,
Neil.
<?PHP $self = $_SERVER[ 'PHP_SELF' ]; ?>
<form method="post" action="SessionLogin.php"></form>
????!
<input type="text" name="username" maxlength="20"/>
<input type="password" name="password" maxlength="20"/>
<input type="submit" value="Submit"/>
</form>
?>
More HTML etc...
When the submit button is pressed the nothing happens.
Tryst
--- End Message ---
--- Begin Message ---
Hello,
On 03/31/2003 03:16 PM, Listuser wrote:
My ISP requires email authentication when sending emails, is the a way to
set this up in PHP.
The mail function does not support authentication.
You may want to try this class for composing and sending messages that
comes with a sub-class for sending directly via SMTP and supports
authentication.
If you do not want to change your program much, you can use a script
that comes with the class that provides a class wrapper function named
smtp_mail() that emulates the mail() function but lets you specify the
authentication credentials:
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
so far, i tried 2: pegasus mail and mail enable. both are free. all i
need are basic send out from LOCALHOST, but i cant seem to configure
them correctly. can anyone help me out?
what open source or free SMTP server are you using? can i see the
config/setup files?
again, all i need is to have php send out mail (actually, phpBB also).
and i need the strictest setting for anti spam stuff.
thanks...
--
Leo G. Divinagracia III
[EMAIL PROTECTED]
zzzzz
--- End Message ---
--- Begin Message ---
Try http://www.xmailserver.org
It has several setup programs for it. Very small footprint. (around ~900kb zip.)
Pretty cool.
--
Scott Carr
Documentation Maintainer
http://documentation.openoffice.org
OpenOffice.org
Quoting "Leo G. Divingracia III" <[EMAIL PROTECTED]>:
> so far, i tried 2: pegasus mail and mail enable. both are free. all i
> need are basic send out from LOCALHOST, but i cant seem to configure
> them correctly. can anyone help me out?
>
> what open source or free SMTP server are you using? can i see the
> config/setup files?
>
> again, all i need is to have php send out mail (actually, phpBB also).
> and i need the strictest setting for anti spam stuff.
>
> thanks...
>
> --
> Leo G. Divinagracia III
> [EMAIL PROTECTED]
>
> zzzzz
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--- End Message ---
--- Begin Message ---
I have spent the last 8 hours (seriously) trying to figure out this stupid
piece of code, and it's just beyond me why it doesn't work. I hope someone
here can help, or even follow the code.
I have a form where the user inputs information - the code below is the
error checking for one of the fields. The first IF statement just checks
that the filed is not empty.
The first ELSEIF checks a function to see if the user is already in the
mysql database and returns the letter T, D or S. ** This part works fine.
If the first ELSIF is not = to T then the second ELSEIF is checked to see if
the letter returned is D. I have checked over and over and over and over and
the letter D is being returned (I have checked the third ELSEIF and it is
the same). It appears like they are just being ignored.
Either I am just not getting the concept, or there is something seriously
weird going on.
Any help in solving this mystery is truely appreciated.
if (empty($form["name"])) { $error["name"] = "*"; $message["name"] =
"Required field!";
}
elseif($duplicate = duplicate_name($form["name"]) == "T") {
$error["name"] = "*"; $message["name"] = "Screen name already used!";
}
elseif ($duplicate == "D") {
$error["name"] = "*"; $message["name"] = "Database error - Please try
again in a few moments!";
}
elseif ($duplicate == "S") {
$error["name"] = "*"; $message["name"] = "Server error - Please try
again in a few moments!";
}
function duplicate_name($name) {
if (!($connect = @mysql_connect($serverhost,$serveruser,$serverpass))) {
**** These are all defined above - not included here.
$server_error = "S";
}
if ([EMAIL PROTECTED]($databasename)) {
$server_error = "D";
}
if($server_error) { $duplicate = $server_error;
}
else
{
$query = "SELECT name FROM $tablename WHERE name = '$name'";
if(!$query) { $duplicate = "D"; }
else {
$result = mysql_query($query);
$line = mysql_fetch_array($result);
if($line['name'] == $name) { $duplicate = "T"; }
mysql_free_result($result);
mysql_close($connect);
}
}
echo $duplicate; ***** This shows that the variable $duplicate contains
T, D, or S.
return($duplicate);
}
--- End Message ---