php-windows Digest 20 Jan 2003 18:55:08 -0000 Issue 1546
Topics (messages 17985 through 17995):
encrypt a string with pgp...
17985 by: Ermelir
Re: PHP Search
17986 by: Radovan Radic
Bar code reader
17987 by: Sichta Daniel
17988 by: Luis Ferro
Re: Apahce Windows problems
17989 by: toby z
Re: arrays and nested arrays and loops and databases...
17990 by: H Marc Bower
Moving an uploaded file keeps failing
17991 by: Matt Babineau
17992 by: Stephen Edmonds
17993 by: Chris Kranz
17994 by: Matt Babineau
Odd for loop behavior.
17995 by: Sterling Anderson
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
hello everybody,
I'm new on this mailing list and I hope you can help me. I search to encrypt
a string with the algorithm of pgp, for sending me a email and I can decrypt
it easyly.
but pgp under windows cannot be execute with a command line.
Have you a solution about it?
thanks
ermelir
_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France
--- End Message ---
--- Begin Message ---
Thanks for the answers and tips.
I think i am gonna quit this project and try to get some easier.
Maybe regular expr. could help, but some designers dont use <td>...</td> but
only <td> so i could have much problems about it.
Thanks again, i was hoping this could be easier:(
Radovan
"Radovan Radic" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all
>
> I got (i think) heavy task for my school project. I
> hope someone can help
> me.
> Script needs to find key words (for example: computer,
> science)
> It should search in url or mail
> Script should find words within meta-tags (i know how
> to do it) and:
> In the body of html (url or email) but only if the
> words are different color
> than the background!
> BG could be table, tr, td, body...
> Do i need to parse it, how can i obtain color of the
> found text, is preg()
> helpful...?
>
> Could anyone help me with the tips
>
> Thx,
> Radovan
>
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
Hi,
cfg: w2k, MSSQL, php4.2
Any idea how to read %subject% ?
THX
Ing. Daniel Šichta
EIF AS TIS
SWH s.r.o.
Bytčická 2
010 01 Žilina
tel.: +421 41 505 5889
fax: +421 41 505 5809
<mailto:[EMAIL PROTECTED]>
<http://www.swh.sk/>
ICQ:84700861
--- End Message ---
--- Begin Message ---
Please refrase the question... and be more precise on what is the problem.
By bar code reader you mean what? What hardware are you trying to use
(both reader and computer)? What do you intend to do and what seams to
be missing?
If i recall correctly, all bar code readers just add to the keyboard
signal the codes that you scan with the reader.
Controlling where the output goes in a web application can only be made
at the client side (ie. the browser). Without further details is very
complex or even impossible to help you...
Cheers...
Luis Ferro
Teladigital.net
Sichta Daniel wrote:
Hi,
cfg: w2k, MSSQL, php4.2
Any idea how to read %subject% ?
THX
Ing. Daniel Šichta
EIF AS TIS
SWH s.r.o.
Bytčická 2
010 01 Žilina
tel.: +421 41 505 5889
fax: +421 41 505 5809
<mailto:[EMAIL PROTECTED]>
<http://www.swh.sk/>
ICQ:84700861
---
[This E-mail scanned for viruses by Declude Virus]
--- End Message ---
--- Begin Message ---
u forgot to attach the files
n attach ur code too
if ud like to share it with us that is ....
toby ....
__________________________________________________
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 ---
This worked wonderfully. Thanks, Dash.
----- Original Message -----
From: "Dash McElroy" <[EMAIL PROTECTED]>
Subject: Re: [PHP-WIN] arrays and nested arrays and loops and databases...
> If I understand correctly, you want to have an array containing an array
> with people's email address and name from your db like this:
>
> $to[0]['address'] = [EMAIL PROTECTED]
> $to[0]['name'] = Bob Smith
> $to[1]['address'] = [EMAIL PROTECTED]
> $to[1]['name'] = John Jones
>
> (the above is obviously not valid PHP...)
>
> I would do something like this:
>
> $to = array();
> $query = "select email, fullname from tablename where updateannounce = 1";
> $result = mysql_query($query);
> while ($output = mysql_fetch_array($result)) {
> $to[] = array('address' => $output['address'],
> 'name' => $output['name']);
> }
>
> assuming, of course, that your database column names are 'address' and
> 'name'.
>
> This should work, but I may have borked something up on the name based
> arrays.
>
> -Dash
> On Sat, 18 Jan 2003, H Marc Bower wrote:
>
> > Well... I can usually puzzle myself through these things, but I figured
> > it's time to ask the list. :) It may be a simple thing that I'm
missing,
> > but here's what I have.
> >
> > The structure that I'm trying to modify is as follows:
> >
> > $to = array(
> > array(
> > 'address'=>'[EMAIL PROTECTED]',
> > 'name'=>'Bob Smith'
> > ),
> > array(
> > 'address'=>'[EMAIL PROTECTED]',
> > 'name'=>'John Jones'
> > )
> > );
> >
> > That said, I have a database of names and email addresses which I want
to
> > insert into this structure, but in a loop since I don't want to have an
> > array() section for each one, not knowing how many are going to be in
the
> > list at the time this script is run. I want to loop the 'sub' array()
> > statements so that I can build up the main array(). I use mysql as
follows:
> >
> > $query = "select email, fullname from tablename where updateannounce =
1";
> > $result = mysql_query($query);
> > while ($output = mysql_fetch_array($result))
> > {
> > //This is where I want the loop of arrays to appear, so I can
> > dynamically insert the email and fullname fields into the obvious spots
> > }
> >
> >
> > I need to figure out how to do this, essentially:
> >
> > $to = array(<loop to fill other array() statements>);
> >
> > I don't know how to get that loop to work inside the overall array()
> > statement, though... any assistance would be greatly appreciated.
> >
> > Thank you,
> >
> > Marc
--- End Message ---
--- Begin Message ---
Here is the error:
PHP Warning: move_uploaded_file(/) [function.move-uploaded-file
<http://www.php.net/function.move-uploaded-file> ]: failed to create
stream: No such file or directory in
D:\wwwroot\kingmanchamber\secure-area\administration\upload\file_upload.
php on line 22 PHP Warning: move_uploaded_file()
[function.move-uploaded-file
<http://www.php.net/function.move-uploaded-file> ]: Unable to move
'd:\Temp\php443.tmp' to '/' in
D:\wwwroot\kingmanchamber\secure-area\administration\upload\file_upload.
php on line 22
Here is the code:
<form enctype="multipart/form-data" action="<? echo
$_SERVER['SCRIPT_NAME'];?>" method="post">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
<?
if ($_SERVER['REQUEST_METHOD'] == "POST") {
echo $_FILES['userfile']['name'] . "<BR>";
echo $_FILES['userfile']['tmp_name'] . "<BR>";
move_uploaded_file($_FILES['userfile']['tmp_name'], "/");
}
?>
I am running this on a winxp pro machine iis 5.1, php 4.3.0 running as a
CGI.
This code is pretty much from the PHP.net site, so I am a tad baffled on
this one.
-Matt
--- End Message ---
--- Begin Message ---
Currently from what I can see there are a few problems:
The Form:
<form enctype="multipart/form-data" action="<? echo
$_SERVER['SCRIPT_NAME'];?>" method="post">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
action is not essential if the form is sending to itself (okay, maybe thats
just me being lazy :p). However, you missed out a vital field
<input type="hidden" name="MAX_FILE_SIZE" value="Maximum file size in
bytes">
This needs to appear just before the file upload input. It tells PHP what
the biggest size of file to accept is. Without it, no file will be uploaded!
Remember to change the value to an actual number
Upload Script
You should be using $_FILES array when uploading a file.
$_FILES["userfile"]["name"] - Orginal name of the file uploaded, given by
the user
$_FILES["userfile"]["error"] - Variable that contains an error report. If
something goes wrong, a number will get put in here.
0 - Upload was okay
1 - The uploaded file exceeds the upload_max_filesize directive in php.ini.
2 - The uploaded file exceeds the MAX_FILE_SIZE directive that was specified
in the html form.
3 - The uploaded file was only partially uploaded
4 - No file was uploaded
$_FILES["userfile"]["tmp_name"] - This contains the location and name of the
file which was uploaded
$_FILES['userfile']['type'] - The type of file that was uploaded (See link
below for more info!)
$_FILES['userfile']['size'] - The size of the newly uploaded file
For more infomation visit
http://www.php.net/manual/en/features.file-upload.php
It is important to check the error number before you try to move the file.
Also, rather than checking for 'post', check for $_FILES['userfile']['name']
If you still have problems, email the list again with your error
message/code. Good luck
Stephen
----- Original Message -----
From: "Matt Babineau" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 4:55 PM
Subject: [PHP-WIN] Moving an uploaded file keeps failing
> Here is the error:
>
> PHP Warning: move_uploaded_file(/) [function.move-uploaded-file
> <http://www.php.net/function.move-uploaded-file> ]: failed to create
> stream: No such file or directory in
> D:\wwwroot\kingmanchamber\secure-area\administration\upload\file_upload.
> php on line 22 PHP Warning: move_uploaded_file()
> [function.move-uploaded-file
> <http://www.php.net/function.move-uploaded-file> ]: Unable to move
> 'd:\Temp\php443.tmp' to '/' in
> D:\wwwroot\kingmanchamber\secure-area\administration\upload\file_upload.
> php on line 22
>
> Here is the code:
>
> <form enctype="multipart/form-data" action="<? echo
> $_SERVER['SCRIPT_NAME'];?>" method="post">
> Send this file: <input name="userfile" type="file">
> <input type="submit" value="Send File">
> </form>
>
> <?
> if ($_SERVER['REQUEST_METHOD'] == "POST") {
> echo $_FILES['userfile']['name'] . "<BR>";
> echo $_FILES['userfile']['tmp_name'] . "<BR>";
>
> move_uploaded_file($_FILES['userfile']['tmp_name'], "/");
>
> }
> ?>
>
> I am running this on a winxp pro machine iis 5.1, php 4.3.0 running as a
> CGI.
>
> This code is pretty much from the PHP.net site, so I am a tad baffled on
> this one.
>
> -Matt
>
--- End Message ---
--- Begin Message ---
Dunno if it's just me, but you don't NEED the MAX_FILE_SIZE form item. I
never use it, I always define max file sizes and types in a separate
config file. My uploads work just fine.
Sorry, don't mean to nit pick :)
In your upload script, try defining where you actually want it copies to
as an absolute directory. Windows doesn't handle relative file copies
too well. It's caught me out on that a few times. TBH, not sure on all
the syntax, as I do things very differently... a lot simpler to be
honest...
Good luck...
chris kranz
fatcuban.com
-----Original Message-----
From: Stephen Edmonds [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 20, 2003 5:26 PM
To: Matt Babineau
Cc: PHP Windows Helplist
Subject: Re: [PHP-WIN] Moving an uploaded file keeps failing
Currently from what I can see there are a few problems:
The Form:
<form enctype="multipart/form-data" action="<? echo
$_SERVER['SCRIPT_NAME'];?>" method="post">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
action is not essential if the form is sending to itself (okay, maybe
thats
just me being lazy :p). However, you missed out a vital field
<input type="hidden" name="MAX_FILE_SIZE" value="Maximum file size in
bytes">
This needs to appear just before the file upload input. It tells PHP
what
the biggest size of file to accept is. Without it, no file will be
uploaded!
Remember to change the value to an actual number
Upload Script
You should be using $_FILES array when uploading a file.
$_FILES["userfile"]["name"] - Orginal name of the file uploaded, given
by
the user
$_FILES["userfile"]["error"] - Variable that contains an error report.
If
something goes wrong, a number will get put in here.
0 - Upload was okay
1 - The uploaded file exceeds the upload_max_filesize directive in
php.ini.
2 - The uploaded file exceeds the MAX_FILE_SIZE directive that was
specified
in the html form.
3 - The uploaded file was only partially uploaded
4 - No file was uploaded
$_FILES["userfile"]["tmp_name"] - This contains the location and name of
the
file which was uploaded
$_FILES['userfile']['type'] - The type of file that was uploaded (See
link
below for more info!)
$_FILES['userfile']['size'] - The size of the newly uploaded file
For more infomation visit
http://www.php.net/manual/en/features.file-upload.php
It is important to check the error number before you try to move the
file.
Also, rather than checking for 'post', check for
$_FILES['userfile']['name']
If you still have problems, email the list again with your error
message/code. Good luck
Stephen
----- Original Message -----
From: "Matt Babineau" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 4:55 PM
Subject: [PHP-WIN] Moving an uploaded file keeps failing
> Here is the error:
>
> PHP Warning: move_uploaded_file(/) [function.move-uploaded-file
> <http://www.php.net/function.move-uploaded-file> ]: failed to create
> stream: No such file or directory in
>
D:\wwwroot\kingmanchamber\secure-area\administration\upload\file_upload.
> php on line 22 PHP Warning: move_uploaded_file()
> [function.move-uploaded-file
> <http://www.php.net/function.move-uploaded-file> ]: Unable to move
> 'd:\Temp\php443.tmp' to '/' in
>
D:\wwwroot\kingmanchamber\secure-area\administration\upload\file_upload.
> php on line 22
>
> Here is the code:
>
> <form enctype="multipart/form-data" action="<? echo
> $_SERVER['SCRIPT_NAME'];?>" method="post">
> Send this file: <input name="userfile" type="file">
> <input type="submit" value="Send File">
> </form>
>
> <?
> if ($_SERVER['REQUEST_METHOD'] == "POST") {
> echo $_FILES['userfile']['name'] . "<BR>";
> echo $_FILES['userfile']['tmp_name'] . "<BR>";
>
> move_uploaded_file($_FILES['userfile']['tmp_name'], "/");
>
> }
> ?>
>
> I am running this on a winxp pro machine iis 5.1, php 4.3.0 running as
a
> CGI.
>
> This code is pretty much from the PHP.net site, so I am a tad baffled
on
> this one.
>
> -Matt
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Thanks Stephen, I'll try this out now!
--> -----Original Message-----
--> From: Stephen Edmonds [mailto:[EMAIL PROTECTED]]
--> Sent: Monday, January 20, 2003 12:26 PM
--> To: Matt Babineau
--> Cc: PHP Windows Helplist
--> Subject: Re: [PHP-WIN] Moving an uploaded file keeps failing
-->
-->
--> Currently from what I can see there are a few problems:
-->
--> The Form:
-->
--> <form enctype="multipart/form-data" action="<? echo
--> $_SERVER['SCRIPT_NAME'];?>" method="post"> Send this file:
--> <input name="userfile" type="file"> <input type="submit"
--> value="Send File"> </form>
-->
--> action is not essential if the form is sending to itself
--> (okay, maybe thats just me being lazy :p). However, you
--> missed out a vital field
-->
--> <input type="hidden" name="MAX_FILE_SIZE" value="Maximum
--> file size in bytes">
-->
--> This needs to appear just before the file upload input. It
--> tells PHP what the biggest size of file to accept is.
--> Without it, no file will be uploaded! Remember to change
--> the value to an actual number
-->
--> Upload Script
-->
--> You should be using $_FILES array when uploading a file.
-->
--> $_FILES["userfile"]["name"] - Orginal name of the file
--> uploaded, given by the user
-->
--> $_FILES["userfile"]["error"] - Variable that contains an
--> error report. If something goes wrong, a number will get
--> put in here. 0 - Upload was okay 1 - The uploaded file
--> exceeds the upload_max_filesize directive in php.ini. 2 -
--> The uploaded file exceeds the MAX_FILE_SIZE directive that
--> was specified in the html form. 3 - The uploaded file was
--> only partially uploaded 4 - No file was uploaded
-->
--> $_FILES["userfile"]["tmp_name"] - This contains the
--> location and name of the file which was uploaded
-->
--> $_FILES['userfile']['type'] - The type of file that was
--> uploaded (See link below for more info!)
-->
--> $_FILES['userfile']['size'] - The size of the newly uploaded file
-->
--> For more infomation visit
--> http://www.php.net/manual/en/features.file-upload.php
-->
--> It is important to check the error number before you try to
--> move the file. Also, rather than checking for 'post', check
--> for $_FILES['userfile']['name']
-->
--> If you still have problems, email the list again with your
--> error message/code. Good luck
-->
--> Stephen
-->
-->
--> ----- Original Message -----
--> From: "Matt Babineau" <[EMAIL PROTECTED]>
--> To: <[EMAIL PROTECTED]>
--> Sent: Monday, January 20, 2003 4:55 PM
--> Subject: [PHP-WIN] Moving an uploaded file keeps failing
-->
-->
--> > Here is the error:
--> >
--> > PHP Warning: move_uploaded_file(/) [function.move-uploaded-file
--> > <http://www.php.net/function.move-uploaded-file> ]:
--> failed to create
--> > stream: No such file or directory in
--> >
--> D:\wwwroot\kingmanchamber\secure-area\administration\upload\
--> file_uploa
--> > d.
--> > php on line 22 PHP Warning: move_uploaded_file()
--> > [function.move-uploaded-file
--> > <http://www.php.net/function.move-uploaded-file> ]: Unable to move
--> > 'd:\Temp\php443.tmp' to '/' in
--> >
--> D:\wwwroot\kingmanchamber\secure-area\administration\upload\
--> file_upload.
--> > php on line 22
--> >
--> > Here is the code:
--> >
--> > <form enctype="multipart/form-data" action="<? echo
--> > $_SERVER['SCRIPT_NAME'];?>" method="post"> Send this file: <input
--> > name="userfile" type="file"> <input type="submit"
--> value="Send File">
--> > </form>
--> >
--> > <?
--> > if ($_SERVER['REQUEST_METHOD'] == "POST") {
--> > echo $_FILES['userfile']['name'] . "<BR>";
--> > echo $_FILES['userfile']['tmp_name'] . "<BR>";
--> >
--> > move_uploaded_file($_FILES['userfile']['tmp_name'], "/");
--> >
--> > }
--> > ?>
--> >
--> > I am running this on a winxp pro machine iis 5.1, php
--> 4.3.0 running as
--> > a CGI.
--> >
--> > This code is pretty much from the PHP.net site, so I am a
--> tad baffled
--> > on this one.
--> >
--> > -Matt
--> >
-->
-->
-->
--> --
--> PHP Windows Mailing List (http://www.php.net/)
--> To unsubscribe, visit: http://www.php.net/unsub.php
-->
-->
--- End Message ---
--- Begin Message ---
I have the following code:
for($x = 0; $x < sizeof($traits); $x++) {
echo '<tr>'
. '<td align="right" class="header">' . $traits[$x]['traitname'] . $x .
'</td>'
. '<td align="center" class="text"><input type="radio" name="' .
$traits[$x]['traitid'] . '" value="1"> 1</td>'
. '<td align="center" class="text"><input type="radio" name="' .
$traits[$x]['traitid'] . '" value="2"> 2</td>'
. '<td align="center" class="text"><input type="radio" name="' .
$traits[$x]['traitid'] . '" value="3"> 3</td>'
. '<td align="center" class="text"><input type="radio" name="' .
$traits[$x]['traitid'] . '" value="4"> 4</td>'
. '</tr>';
}
The array this code is using looks like this:
Array (
[0] => Array ( [traitid] => 1 [traitname] => Ideas )
[1] => Array ( [traitid] => 3 [traitname] => Voice )
[2] => Array ( [traitid] => 5 [traitname] => Fluency )
)
Here is the HTML:
<tr>
<td align="right" class="header">Ideas0</td>
<td align="center" class="text">
<input type="radio" name="1" value="1"> 1
</td>
<td align="center" class="text">
<input type="radio" name="1" value="2"> 2
</td>
<td align="center" class="text">
<input type="radio" name="1" value="3"> 3
</td>
<td align="center" class="text">
<input type="radio" name="1" value="4"> 4
</td>
</tr>
<tr>
<td align="right" class="header">1</td>
<td align="center" class="text">
<input type="radio" name="" value="1"> 1
</td>
<td align="center" class="text">
<input type="radio" name="" value="2"> 2
</td>
<td align="center" class="text">
<input type="radio" name="" value="3"> 3
</td>
<td align="center" class="text">
<input type="radio" name="" value="4"> 4
</td>
</tr>
<tr>
<td align="right" class="header">Voice2</td>
<td align="center" class="text">
<input type="radio" name="3" value="1"> 1
</td>
<td align="center" class="text">
<input type="radio" name="3" value="2"> 2
</td>
<td align="center" class="text">
<input type="radio" name="3" value="3"> 3
</td>
<td align="center" class="text">
<input type="radio" name="3" value="4"> 4
</td>
</tr>
<tr>
<td colspan="5">
<input type="submit" value="Submit" class="formfield">
<input type="reset" value="Cancel" class="formfield">
</td>
</tr>
As you can see, where value [1] of the arrray is supposed to be it is
inserting nothing. But for value [2] it is inserting [1]'s data. I'm
hoping someone can take a look at this and point out where I may have gone
wrong. The really odd thing is this code seems to work with different
data. For example, if I have a 6 field array it properly inserts [0] to
[5].
Thanks for any input.
^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^
Sterling Anderson -- [EMAIL PROTECTED]
http://sterlinganderson.net
Human female: "The sheer drama of this election has driven voter turnout to
it's highest level in centuries, six percent."
Morbo: "Exit poll show evil underdog Richard Nixon trailing with
estimated zero votes."
Human female: "The time is 7:59 and the robot polls are now opening. And
robot votes are now in. Nixon has won."
Morbo: "Morbo congratulates our gargantuan cyborg president. May death
come quickly to his enemies."
^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^
--- End Message ---