Re: [PHP] IMAP/POP3/OUTLOOK Question

2001-05-14 Thread jdwright



Hiya,

Correct me if I'm wrong, but I think it just keeps a record of the e-mails it's
downloaded. If you run the command 'UIDL' on a telnet session into a POP server,
you will get the Unique ID for every e-mail in your inbox. All Outlook does is
compare this to the list of e-mails it knows it's downloaded, and then download
the one's it doesn't have a record on. At least something like that anyway.

It's also why if Outlook or the computer crash in the middle of a download of
e-mails, it'll download 'em again (As it's lost the list! :( ).

Hope that helps.


Jonathan Wright..



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] explode won't explode

2001-04-27 Thread jdwright



Hiya,

 I have the following code that doesn't seem to explode. I'm trying to make
 a field that looks like 21,23,25,27 or small,medium,large,x-large into a
 pulldown menu with the individual item broken out.

 if (($size != )  ($size != n/a)) {
$sizearry = explode(,, $size);
while (list($key,$value) = each($sizearry)) {
$size_option_block .= option value=\$value\$size/option\n;
 }

I think you've used the wrong varaible between option/option. You should
have $value, but you've put in the original variable: $size.

 The interesting thing (and probably the problem) is that I have very similar
 code just before it that works fine. Here's the code that appears just
 before and works.

 if (($color != )  ($color != n/a)) {
$colorarry = explode(,, $color);
while (list($key,$value) = each($colorarry)) {
$color_option_block .= option value=\$value\$value/option\n;
 }

 I'm not that familiar with explode. Are my $key and $value variables
 conflicting?


 .
 Tom Beidler
 Orbit Tech Services
 805.682.8972 (phone)
 805.682.5833 (fax)
 [EMAIL PROTECTED]
 http://www.orbittechservices.com/
 .



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Apache/mod_rewrite for User Tracking

2001-02-12 Thread jdwright



I'm not sure how off-topic this may be, but I'll carry on anyway...

I wan't to create a user tracking system on the web site, that I can use in PHP.
I've had a look at mod_rewrite, and would like to implemet something like the
following:

I have a few scripts, say 'home', 'search', 'help', etc. and all are force
mapped onto PHP 4. If someone calls this scripts (without entering the site
through the front door), then they are sent back, set a user tracking value, and
sent back to the page. Before now, I have cookies and IP address for user
tracking. If someone could accept a cookie (I used a self-referring script to
check) then they are given a cookie, and they can be tracked. They can also be
tracked over many visits with a cookie.

If they don't then I make a note of their IP address, and their address is used.
With IP addresses, you can't record return visits, so it just tracks one visit.
With some ISP's they seam to use variying IP addresses, so then each page
checked for a valid user, they didn't find one, and forwarded then back to
'index' to set a user session, and come back. But they seamed (to the
server/PHP) to have different IP's over these steps, and the visitor was locked
into a HTTP Redirect cycle (until the broswer stop with a fail).

What I would like to do now is track the user with the URL. When someone calls
the site, (ether through the front door, or sent back to get an ID), they are
given an ID like so: 'KjsiHdbEyu8G645Dus96Sy54GD'. They are then sent to say,
http://localhost/KjsiHdbEyu8G645Dus96Sy54GD/home.

Using mod_rewrite, I can then get the tracking var (KjsiHdbEyu8G645Dus96Sy54GD),
and rewrite the URL to http://localhost/home, and call the script. I know this
is possible. Something like /^\/([a-zA-Z0-9]{80})\/(.*)/$1?$2/ could work for
the rewrite rule, but rather than use $HTTP_SERVER_VARS["QUERY_STRING"] to get
the var, as I use a GET vars for some functions, could I get a var which is sent
to Apache, and then PHP accesses the var from there, and the rest is as normal?

That's what I would prefer to do, but I'm not sure if it's possible (and
explained it well enough). If I had to do something like
/^\/([a-zA-Z0-9]{80})\/(.*)/$1?$2/ I would just have to develop to that instead.
Failing that, any suggestions?

Thanks in advance..

Jonathan Wright..
Webmaster
http://www.kjtoombs.co.uk/
(http://www.kjtoombs.co.uk/home)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] HELP WITH UPLOAD REQUIRED!!!!!!!!

2001-01-16 Thread jdwright



Mike,

I haven't had a problem. I'm using Apache 1.3.14 with PHP 4.0.3pl1 + 4.0.4. I
use the same code on 3 computers (depending on where I am when I'm working on
it. Normally it's Win95, but Win2k and WinNT are used as well.

The snippet of code I use is:

--code 1-
list($scriptBase, ) = explode($HTTP_SERVER_VARS["SCRIPT_NAME"],
$HTTP_SERVER_VARS["SCRIPT_FILENAME"]);
-

--code 2-
{ $j=0;
  for ($i=1;$i6;$i++)
  { $addnewName = "photo" . $i;
$addnewSize = "photo" . $i . "_size";

if (${$addnewSize}  0)
  { copy(${$addnewName}, 'temp/'.$SessionID.'.'.++$j.'.jpg');
$addnewSession['photo'.$j] = 'temp/'.$SessionID.'.'.$j.'.jpg';
unlink (${$addnewName});
  }
  }
  $addnewSession["photos"] = $j;
}
-

--code 3-
for ($i=1;$i=$addnewSession["photos"];$i++)
  { if (!@copy($addnewSession["photo".$i],
$scriptBase."/images/property/".$addnewPropertyID.",".$i.".jpg"))
  { $addnewFileErrors .= " c".$i; }
if (!@unlink($addnewSession["photo".$i]))
  { $addnewFileErrors .= " d".$i; }
  }
-

The first line just sets $scriptBase as the base of the web site (so I can use
it anywhere, 'cause moving computers may mean different locations, and as all
the needs of the site is below the site's root, then I just need to work out
where the base of the site is.

The next set of code is to move the files to a temp location (until the script
deals with them in the third chunk). Someone can upload up to five photos, so
this will just go thru each of them, and if there's a file (I know it a photo -
the check was done earlier), 'cause it's size is greater than zero, then move
it. This code will also group together the photos (if someone uploaded a file in
 photo1, photo3 and photo4, then 3 will become 2 and so on, so the photos end up
 as 1, 2, and 3). It also stores the photo's location in the session var, as
well as the number of photos.

The second lot just moves them to their final location.

I haven't tested this code on Linux/Unix servers, but I know it works on
Windows/Apache using PHP 4.0.3 and PHP 4.0.4, irrespective on the operating
system and where the files are located. See if that helps. I don't know why
yours shouldn't work, but I've posted my code so you can see and work with it to
 help yours.



At 09:36 PM 1/15/01, you wrote:
I am trying to allow various users to upload their own picture.  What I
would like to happen is to have the copy statement rename the .jpg
image to the username.  For example, if the username is mike, then I want
the picture to be renamed mike.jpg

The following is a snippet of code:

?PHP
print "$CUserName" //ensures name is carried over from session

if(copy($userfile,"c:/phpweb/userpics/$CUserName.jpg"))
 {
 print "Your picture has been uploaded!";
 }
else
 {
 print "Error";
 }

unlink($userfile)
?

The errors I get are as follows:
Warning: unable to open " for reading: Permission denied in
c:\phpweb/fuploadconfirm.php on line 15
Warning: Unlink failed (No such file or directory) in
c:\phpweb/fuploadconfirm.php on line 31

Line 15 is the if copy($userfile) line in the above code

AND

Line 31 is the unlink statement at the end.

Thanks,
Mike


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
__
Jonathan Wright (DjNA)
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]