[PHP] upload image

2006-08-24 Thread Sonja

Hi,

I have problems with uploading image, here is the code

if(isset($_POST['txtTitle']))
{
$albumId   = $_POST['cboAlbum'];
$imgTitle  = $_POST['txtTitle'];
$imgDesc   = $_POST['mtxDesc'];

$images= uploadImage('fleImage', GALLERY_IMG_DIR);

if ($images['image'] == '' && $images['thumbnail'] == '') {
echo "Error uploading file";
exit;
}

$image = $images['image'];
$thumbnail = $images['thumbnail'];

if (!get_magic_quotes_gpc()) {
$albumName  = addslashes($albumName);
$albumDesc  = addslashes($albumDesc);
$imgPath= addslashes($imgPath);
}  

$sql = "INSERT INTO tbl_image (im_album_id, im_title, im_description,
im_image, im_thumbnail, im_date) 
VALUES ($albumId, '$imgTitle', '$imgDesc', '$image', 
'$thumbnail',
NOW())";

mysql_query($sql) or die('Error, add image failed : ' . mysql_error()); 
   

echo
"window.location.href='index.php?page=list-image&album=$albumId';";
exit;
} 

when I upload a picture return me error uploadin image.

Thanks  

-- 
View this message in context: 
http://www.nabble.com/upload-image-tf2157181.html#a5959218
Sent from the PHP - General forum at Nabble.com.

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



RE: [PHP] upload image

2006-08-24 Thread Peter Lauri
Maybe this will help you:

$name = mysql_escape_string($_POST['doc_filename'][$key]);
$author = mysql_escape_string($_POST['doc_filename_author'][$key]);
$filename = mysql_escape_string($value);
$filetype = mysql_escape_string($_FILES['doc_attach']['type'][$key]);
$filesize = mysql_escape_string($_FILES['doc_attach']['size'][$key]);
$filedata = addslashes (fread(fopen
($_FILES['doc_attach']['tmp_name'][$key], "r"),
filesize($_FILES['doc_attach']['tmp_name'][$key])));


$Query = "INSERT INTO filestorage (name, author, filename, filetype,
filesize, filedata) VALUES ('$name', '$author', '$filename', '$filetype',
'$filesize', '{$filedata}')";

/Peter



-Original Message-
From: Sonja [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 24, 2006 2:38 PM
To: php-general@lists.php.net
Subject: [PHP] upload image


Hi,

I have problems with uploading image, here is the code

if(isset($_POST['txtTitle']))
{
$albumId   = $_POST['cboAlbum'];
$imgTitle  = $_POST['txtTitle'];
$imgDesc   = $_POST['mtxDesc'];

$images= uploadImage('fleImage', GALLERY_IMG_DIR);

if ($images['image'] == '' && $images['thumbnail'] == '') {
echo "Error uploading file";
exit;
}

$image = $images['image'];
$thumbnail = $images['thumbnail'];

if (!get_magic_quotes_gpc()) {
$albumName  = addslashes($albumName);
$albumDesc  = addslashes($albumDesc);
$imgPath= addslashes($imgPath);
}  

$sql = "INSERT INTO tbl_image (im_album_id, im_title,
im_description,
im_image, im_thumbnail, im_date) 
VALUES ($albumId, '$imgTitle', '$imgDesc', '$image',
'$thumbnail',
NOW())";

mysql_query($sql) or die('Error, add image failed : ' . mysql_error());


echo
"

[PHP] How to deal with errors in forms

2006-08-24 Thread Merlin

Hi there,

I do have a form where there is also a field with max 2000 characters 
the user can put in.


Now before processing the data with php, I do a checkin the script for 
certain criterias if something lookes wrong I do redirect him to the 
original form with inserting the data he has entered. I do this via GET

e.g.: ?title=test&body=blablub

That works fine with one exception. If the user does enter 2000 
characters (or a lot c.) they do get transfered via URL as well and that 
is not possible. Firfox for example then simply displays a blank page!!! 
It would be fine if he would return with just a few less characters, but 
at least display the error message I am providing.


Now, 2 questions:
1) Does anybody know why firefox is shoing a blank page? If the URL does 
contain less characters, lets say 100 everything works fine.
2) How could I possibly save his entry? Maybe with the help of a cookie? 
But then, I do redirect to the page. So I do send a header. As far as I 
know this only once possible?

For example:
setcookie('bla test');	 
HEADER("Location:".$data[rurl]."?error=".$error.$parameter);


I would rather not like to use the help of a database.

Any ideas?

Regards,

Merlin

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



[PHP] Re: upload image

2006-08-24 Thread Mourad Boulahboub
Hi sonja,



Sonja schrieb am 24.08.2006 09:38:
> Hi,
> 
> I have problems with uploading image, here is the code
> 
> if(isset($_POST['txtTitle']))
> {
>   $albumId   = $_POST['cboAlbum'];
>   $imgTitle  = $_POST['txtTitle'];
>   $imgDesc   = $_POST['mtxDesc'];
> 
>   $images= uploadImage('fleImage', GALLERY_IMG_DIR);

how does the function uploadImage looks like?


>   if ($images['image'] == '' && $images['thumbnail'] == '') {
>   echo "Error uploading file";
>   exit;
>   }

the error comes from this if-clause that is depending from the function
above.

regards
Mourad

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



[PHP] Re: How to deal with errors in forms

2006-08-24 Thread Mourad Boulahboub
Hi Merlin,

try with sessions. in this case you don't have to append something to
the URL as parameters

Merlin schrieb am 24.08.2006 11:40:
> Hi there,
> 
> I do have a form where there is also a field with max 2000 characters 
> the user can put in.
> 
> Now before processing the data with php, I do a checkin the script for 
> certain criterias if something lookes wrong I do redirect him to the 
> original form with inserting the data he has entered. I do this via GET
> e.g.: ?title=test&body=blablub
> 
> That works fine with one exception. If the user does enter 2000 
> characters (or a lot c.) they do get transfered via URL as well and that 
> is not possible. Firfox for example then simply displays a blank page!!! 
> It would be fine if he would return with just a few less characters, but 
> at least display the error message I am providing.
> 
> Now, 2 questions:
> 1) Does anybody know why firefox is shoing a blank page? If the URL does 
> contain less characters, lets say 100 everything works fine.
> 2) How could I possibly save his entry? Maybe with the help of a cookie? 
> But then, I do redirect to the page. So I do send a header. As far as I 
> know this only once possible?
> For example:
> setcookie('bla test'); 
> HEADER("Location:".$data[rurl]."?error=".$error.$parameter);
> 
> I would rather not like to use the help of a database.
> 
> Any ideas?
> 
> Regards,
> 
> Merlin
> 

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



[PHP] cURL and sending an POST with an @ as first char.

2006-08-24 Thread Mathijs

Hello there,

I Have a question about cURL and sending POST data.

I have an array with values which are needed for an POST.
There is one value which starts with an @.
This gives me a error: ErrorNo.: 26, ErrorMsg: 'failed creating formpost 
data'.


This is becouse an @ at the start of a value is treated as an File 
upload or something.


I realy need this to be an @ at the start, and i can't add an space 
infront of it.


How can i fix this.
Tryed searching cURL's website didn't found anything (yet).

Thx in advance.

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



Re: [PHP] upload image

2006-08-24 Thread Sonja

Hi,
It looks like:

function uploadImage($inputName, $uploadDir)
{
$image = $_FILES[$inputName];
$imagePath = '';
$thumbnailPath = '';

// if a file is given
if (trim($image['tmp_name']) != '') {
$ext = substr(strrchr($image['name'], "."), 1); 

// generate a random new file name to avoid name conflict
// then save the image under the new file name
$imagePath = md5(rand() * time()) . ".$ext";
$result= move_uploaded_file($image['tmp_name'], $uploadDir .
$imagePath);

if ($result) {
// create thumbnail
$thumbnailPath =  md5(rand() * time()) . ".$ext";
$result = createThumbnail($uploadDir . $imagePath, 
$uploadDir .
'thumbnail/' . $thumbnailPath, THUMBNAIL_WIDTH);

// create thumbnail failed, delete the image
if (!$result) {
unlink($uploadDir . $imagePath);
$imagePath = $thumbnailPath = '';
} else {
$thumbnailPath = $result;
}   
} else {
// the image cannot be uploaded
$imagePath = $thumbnailPath = '';
}

}


return array('image' => $imagePath, 'thumbnail' => $thumbnailPath);
}


Mourad Boulahboub wrote:
> 
> Hi sonja,
> 
> 
> 
> Sonja schrieb am 24.08.2006 09:38:
>> Hi,
>> 
>> I have problems with uploading image, here is the code
>> 
>> if(isset($_POST['txtTitle']))
>> {
>>  $albumId   = $_POST['cboAlbum'];
>>  $imgTitle  = $_POST['txtTitle'];
>>  $imgDesc   = $_POST['mtxDesc'];
>> 
>>  $images= uploadImage('fleImage', GALLERY_IMG_DIR);
> 
> how does the function uploadImage looks like?
> 
> 
>>  if ($images['image'] == '' && $images['thumbnail'] == '') {
>>  echo "Error uploading file";
>>  exit;
>>  }
> 
> the error comes from this if-clause that is depending from the function
> above.
> 
> regards
> Mourad
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/upload-image-tf2157181.html#a5961434
Sent from the PHP - General forum at Nabble.com.

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



[PHP] Re: cURL and sending an POST with an @ as first char.

2006-08-24 Thread Mathijs

Mathijs wrote:

Hello there,

I Have a question about cURL and sending POST data.

I have an array with values which are needed for an POST.
There is one value which starts with an @.
This gives me a error: ErrorNo.: 26, ErrorMsg: 'failed creating formpost 
data'.


This is becouse an @ at the start of a value is treated as an File 
upload or something.


I realy need this to be an @ at the start, and i can't add an space 
infront of it.


How can i fix this.
Tryed searching cURL's website didn't found anything (yet).

Thx in advance.


It seems that i have found a fix.
I Now check if it starts with an "@" and the replaces it with "\@".
Then it will send normaly :).

If anyone has an other sulution, please tell me.

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



[PHP] Copying IPTC data

2006-08-24 Thread Dotan Cohen

I have a bunch of pictures that I need to copy IPTC data from one
field to another. I can read the first field (#118) with iptcparse,
but I cannot get iptcembed to write to the second field (#025). The
manual says "This function is currently not documented; only the
argument list is available." and the comments were not enough to get
me moving. Could someone provide a working example of writing to a
single IPTC field with iptcembed? I'm sure that I could pick it up
from there. Thanks.

Dotan Cohen
http://what-is-what.com

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



[PHP] Re: upload image

2006-08-24 Thread Mourad Boulahboub
Hi Sonja,


Sonja schrieb am 24.08.2006 12:36:
> Hi,
> It looks like:
> 
>   $result= move_uploaded_file($image['tmp_name'], $uploadDir .
> $imagePath);

is $uploadDir writeable to the webserver!? check this first.
if it is

>   
>   if ($result) {
>   // create thumbnail
>   $thumbnailPath =  md5(rand() * time()) . ".$ext";
>   $result = createThumbnail($uploadDir . $imagePath, 
> $uploadDir .
> 'thumbnail/' . $thumbnailPath, THUMBNAIL_WIDTH);

check $uploadDir/thumbnail for permissions. This directory also have to
be writeable.

>   if (!$result) {
>   unlink($uploadDir . $imagePath);
>   $imagePath = $thumbnailPath = '';

in case the thumbnail-directory is not writeable, $imagePath and
$thumbnailPath get blank here


>   } else {
>   // the image cannot be uploaded
>   $imagePath = $thumbnailPath = '';

in case $uploadDir is not writeable, imagePath and $thumbnailPath get
blank here.

so your other script fails here, because it gets nothing back:

> if ($images['image'] == '' && $images['thumbnail'] == '') {
>   echo "Error uploading file";
>   exit;
>   }

you can make troubleshooting by first commenting out the check for
uploaded thumbnail and see if the image get uploaded without
"thumbnailing" it.

regards
Mourad

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



[PHP] Re: cURL and sending an POST with an @ as first char.

2006-08-24 Thread Jo�o C�ndido de Souza Neto
I think urlencode can solve this.

"Mathijs" <[EMAIL PROTECTED]> escreveu na mensagem 
news:[EMAIL PROTECTED]
> Hello there,
>
> I Have a question about cURL and sending POST data.
>
> I have an array with values which are needed for an POST.
> There is one value which starts with an @.
> This gives me a error: ErrorNo.: 26, ErrorMsg: 'failed creating formpost 
> data'.
>
> This is becouse an @ at the start of a value is treated as an File upload 
> or something.
>
> I realy need this to be an @ at the start, and i can't add an space 
> infront of it.
>
> How can i fix this.
> Tryed searching cURL's website didn't found anything (yet).
>
> Thx in advance. 

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



Re: [PHP] Re: Why small > big?

2006-08-24 Thread Alex Turner

As I promised, here is the writeup with examples:

http://nerds-central.blogspot.com/2006/08/choosing-file-format-for-small-web.html

Cheers

AJ

tedd wrote:

Alex:

Excuse for top posting:

You said: Clear as mud?

Well actually, it's simperer than I thought. After your reply, I did 
some reading on jpeg and found it's simply a transform, not unlike FFT 
where two-dimensional temporal data is transformed from the time domain 
to the frequency domain -- very interesting reading.


The reverse cosine matrix you mention is probably the discrete cosine 
transform (DCT) matrix where the x, y pixels of an image file have a z 
component representing color. From that you can translate the data into 
the frequency domain, which actually generates more data than the original.


However, the quality setting is where you make it back up in compression 
ratio's by trimming off higher frequencies which don't add much to the 
data. Unlike the FFT, the algorithm does not address phasing, which I 
found interesting.


However, the answer to my question deals with the quality statement. In 
the statement:


imagejpeg($image_p, null, 100);

I should have used something less than 100.

I've change the figure to 25 and don't see any noticeable difference in 
quality of the thumbnail.


It seems to me there should be a table (or algorithm) somewhere that 
would recommend what quality to use when reducing the size of an image 
via this method. In this case, I reduced an image 62 percent (38% of the 
original) with a quality setting of 25 and "see" no difference. I think 
this (the quality factor) is programmable.


As for png images, I would probably agree (if I saw comparisons), but 
not all browsers accept them. I belive that at least one IE has problems 
with png's, right?


tedd

At 4:45 PM +0100 8/23/06, Alex Turner wrote:
M Sokolewice got it nearly correct.  However, the situation is a 
little more complex than he has discussed.


The % compression figure for jpeg is translated into the amount of 
information stored in the reverse cosine matrix.  The size of the 
compressed file is not proportional to the % you set in the 
compressor.  Thus 100% actually means store all the information in the 
reverse cosine matrix.  This is like storing the image in a 24 bit 
png, but with the compressor turned off.  So at 100% jpeg is quite 
inefficient.


The other issue is the amount of high frequency information in your 
images.  If you have a 2000x2000 image with most of the image dynamics 
at a 10 pixel frequency, and you reduce this to 200x200 then the JPEG 
compression algorithm will 'see' approximately the same amount of 
information in the image :-(  The reality is not quite as simple as 
this because of the way JPEG uses blocks etc, but it is an easy way of 
thinking about it.


What all this means is that as you reduce the size of an image, if you 
want it to retain some of the detail of the original but at a smaller 
size, there will be a point at which 8 or 24 bit PNG will become a 
better bet.


Clear as mud?

AJ

M. Sokolewicz wrote:

I'm not quite sure, but consider the following:

Considering the fact that most JPEG images are stored with some form 
of compression usually ~75% that would mean the original image, in 
actual size, is about 1.33x bigger than it appears in filesize. When 
you make a thumbnail, you limit the amount of pixels, but you are 
setting compression to 100% (besides that, you also use a truecolor 
pallete which adds to its size). So, for images which are scaled down 
less than 25% (actually this will prob. be more around 30-ish, due to 
palette differences) you'll actually see the thumbnail being bigger 
in *filesize* than the original (though smaller in memory-size)


- tul

P.S. isn't error_reporting( FATAL | ERROR | WARNING ); supposed to be 
error_reporting( E_FATAL | E_ERROR | E_WARNING ); ??


tedd wrote:

Hi gang:

I have a thumbnail script, which does what it is supposed to do. 
However, the thumbnail image generated is larger than the original 
image, how can that be?


Here's the script working:

http://xn--ovg.com/thickbox

And, here's the script:

imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, 
$width_orig, $height_orig);


//  Output & Content type
header('Content-type: image/jpeg');
imagejpeg($image_p, null, 100);

/* end buffered output */
ob_end_flush();
?>

---

Thanks in advance for any comments, suggestions or answers.

tedd



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






--
www.deployview.com
www.nerds-central.com
www.project-network.com

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



[PHP] Re: cURL and sending an POST with an @ as first char.

2006-08-24 Thread M. Sokolewicz

Mathijs wrote:

Mathijs wrote:


Hello there,

I Have a question about cURL and sending POST data.

I have an array with values which are needed for an POST.
There is one value which starts with an @.
This gives me a error: ErrorNo.: 26, ErrorMsg: 'failed creating 
formpost data'.


This is becouse an @ at the start of a value is treated as an File 
upload or something.


I realy need this to be an @ at the start, and i can't add an space 
infront of it.


How can i fix this.
Tryed searching cURL's website didn't found anything (yet).

Thx in advance.



It seems that i have found a fix.
I Now check if it starts with an "@" and the replaces it with "\@".
Then it will send normaly :).

If anyone has an other sulution, please tell me.


it's called "escaping meta-characters", @ has a special meaning, \@ (the 
escaped version of @) is the literal @ character. the same way as ' in 
many languages is also a special character, \' is its counterpart, the 
literal quote.
So, no, there shouldn't be "another solution" since your solution is the 
correct one.


- tul

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



[PHP] Re: Why small > big?

2006-08-24 Thread tedd

Alex:

Apologies again for top-posting.

No problem with the "sloppy" language, it was more than good enough 
to get your idea across. Besides, I always hate being called for 
using a term incorrectly when I actually knew better.


My claim that the quality-value term can be computed is not as 
involved as you describe. I was simply meaning that IF one used the --


imagejpeg($image_p, null, 100);

-- statement for the sole purpose of making a thumbnail from a larger 
image, then there should be a correlation between size before/after 
and the "quality-term".


For example, if I take an image and simply shrink it to 1/4 it's 
size, then I should be able to show the image using 1/4 as many 
pixels without much loss in quality. Now, how I decide which pixels 
are representative of their local pixel groups in sampling, is 
another thing and I leave that to the JPEG algorithm.


Considering in this thread where I left the quality at 100% and 
reduced the image to less 40 percent of the original, and the end 
result was that I actually made a larger file. So, I belive that at 
least this example shows that 100% is not a good quality value 
setting for reducing images -- thus we know the high end is less than 
100.


Clearly as one reduces images, the quality-value required should also 
reduce. Now, my gut feeling is that this value in reduction is 
predictable, perhaps linear, perhaps polynomial, perhaps something 
that would lend itself well to fuzzy logic -- I don't know 
specifically what that may be, but I believe it can be programmed. 
That's what I was addressing. I have NO data to back-up my gut 
feeling.


As for your other comments regarding blocks and edge effects 
(mosquito  noise) they have direct counterparts in temporal signal 
processing -- trying to truncate any signal is going to introduce 
noise.
That's the reason for so many filter taper solutions, such as cosign, 
hamming, hanning, and more than I wish to remember. I've done a 
considerable amount of that type of programming.


Your comments about the visual aspects of the brain are right-on and 
I find that investigation fascinating. There is so much to learn and 
so much to gain by understanding how we process data (visual and 
otherwise).


Your comments about tonally rich areas of the face being more 
addressed by the brain is true, but the reason for this is two fold: 
one, it is more complicated; but two, it's a face! Our brains process 
images differently for different objects. Turn a picture of someone's 
face upside down and our brains don't process the image the same. 
Interesting, huh?


In any event, (back on topic as you say) our brains process images 
much differently than what a compression algorithm could address. On 
one hand, it has to reduce the image in areas where the brain is not 
interested, and on the other hand, it has to retain those visual 
aspects that the brain is built to recognize. That's not doable 
without error unless the algorithm mimics the brain.


But, in general terms (baring brain specific variations), as an image 
is reduced, one should be able to reduce the value of the quality 
term in some predictable manner depending upon the ratio of change. 
True or not, that's my claim.


Thanks for the exchange -- it was interesting.

tedd

---

At 11:07 PM +0100 8/23/06, Alex Turner wrote:

Tedd,

Sorry for the floppy language.  You are quite correct, the name is 
discrete cosine.  I get too relaxed sometimes.


As to the visual impact of a degree of compression, I don't think 
that you can automate this.  The issue surrounds the way the brain 
processes information.  When you see something, you brain processes 
the visual field and looks for patters that it recognizes and then 
your conscious mind becomes aware of the patterns, not actually the 
thing you are looking at.  Optical illusions can illustrate this 
point. For example where you see a bunch of blobs on a white 
background and then someone tells you it is a dog and you see the 
dog.  Once you see the dog you can no longer 'not see it'.  This is 
because of the way the brain processes patterns.


The trick to DCT is that in most 'organic' images - people, trees 
etc - the patterns for which your brain is looking actually occupy 
low frequencies.  However, the majority of the information which is 
encoded into the image is in high frequencies.  Consequently, by 
selectively removing the high frequencies, the image appears to the 
conscious mind to be the same whilst in reality it is degraded.


The snag come when the pattern your brain is looking to match to 
requires high frequencies.  The classic is a edge.  If one has an 
infinitely large white background with a single infinitely sharp 
line on it, you require infinite frequencies to encode it correctly 
(ten years ago I knew the proof for this, time and good wine has put 
a stop to that).  This is much like the side band problem in radio 
transmission.  If you encode an image in dimensional space

[PHP] [EMAIL PROTECTED]

2006-08-24 Thread Mourad Boulahboub
news.gmane.org

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



[PHP] Re: Downloading of PgSQL data for use local (crappy subject line)

2006-08-24 Thread Michelle Konzack
Hello Richard,

Am 2006-08-18 14:02:51, schrieb Richard Lynch:
> For LARGE datasets, CSV or tab-delimited transfers are probably going
> to be easiest to suck in to the DB.

No, they are only one ore more rows (~1-20) from the
"timeline_table" and the a row from the "projects_table"

> Another option is to just use pg_dump, if you want whole tables.

10 GByte is a little to much for little $USER.  ;-)

> Otherwise, honestly, I'd suggest you just export your data to RSS or
> XML and let the user choose how to open it up.

Hmmm, I have no experience with RSS or XML.  Do you have links?

And the, "let the user choose how to open it up"  -  ROTFL!!!

The $USER is the Typical OFFICE-Guy with ZERO clue about informatic

His/Her workstation has all installed to handel the downloads,
since ist a full Intranet system pased on PHP5.

> Even CSV export is better than PHP arrays, since they can open the
> stuff up in Excel if they want to.

Excel?  --  LOL, ROTFL!!!

Micosuck-Ware was droped for some (3) years!

Since we have encountered the Windows is calling home without the
$USER knowledge and since I am working for the Ministry of Defense...

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)

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



[PHP] creating mailto: URL including 8-bit characters

2006-08-24 Thread Jim McIntyre

Hi,

I'm trying to create a mailto: link in a page that will fill in the 
Subject and Bopy of a new email message with Spanish-language text. 
The text lives in strings in an array of localized text. Accented 
characters in the text are encoded as HTML entities. So, for example, 
the subject and body text might look like this in the raw data:


  $subject = 'Art&iculo acerca de Spyware';
  $body = 'Creo que te será de interés este artíulo...';

I can't figure out how to URL encode the characters so they work 
properly when the email link is created. I tried:


  $encSubject = rawurlencode(html_entity_decode($subject));
  $encBody = rawurlencode(html_entity_decode($body));

  echo 'mailto:?subject=' . $encSubject . "&body=" . $encBody . (etc.)

but that didn't work. The accented characters show up as empty 
squares in the email.


I also tried adding various charset parameters to html_entity_decode, 
but that didn't work either:


  $encSubject = rawurlencode(html_entity_decode($subject), ISO-8859-1);

What does appear to work is simply not encoding the text at all, but 
that leaves a bunch of spaces and ampersand characters in the URL, 
and that's not supposed to be done.


I'd appreciate the list's help figuring out how to do this. Many thanks!

-Jim

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



Re: [PHP] Session / cookie issues

2006-08-24 Thread Andrew Kreps

Could it be a 3rd party cookie problem?  Does IE display the little
eyeball privacy icon on the troubled user's browser status bar?  I
seem to remember having issues when Microsoft started supporting the
cookie privacy stuff.

On 8/23/06, Dave Goodchild <[EMAIL PROTECTED]> wrote:

Hi all. I mailed some time ago regarding a cookie/session issue I am having
and thank you all for your useful and knowledgeable responses. I have now
used 10 separate testers and 9 are able to progress through a 3-stage form
process that validates data as it goes along and enters the data into the
session array - enabling the user to go back and see previous forms
pre-populated with their selected data (cahcing is enforced on these pages).


However, the client still has issues and I have confirmed that their browser
is rejecting cookies. They are using IE on Win XP and have Internet security
set to Medium. I set mine to the same, used IE to go through the process and
had no such issues. Can anyone tell me if I am missing something obvious?

--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk




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



Re: [PHP] Session / cookie issues

2006-08-24 Thread Dave Goodchild

On 24/08/06, Andrew Kreps <[EMAIL PROTECTED]> wrote:


Could it be a 3rd party cookie problem?  Does IE display the little
eyeball privacy icon on the troubled user's browser status bar?  I
seem to remember having issues when Microsoft started supporting the
cookie privacy stuff.



I will check thanks - the user does not seem to have issues using other
cookie-driven sites.




--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk


[PHP] ssl.

2006-08-24 Thread Jo�o C�ndido de Souza Neto
Hy everyone.

Since we change our ssl key from 128kb to a 256kb i notice that something´s 
going wrong.

In my e-commerce, part is secure and part isn´t. when i join into the secure 
part of the site, everithing works fine. But, when the sale is finishes and 
my script run header("Location: http://www.?";) to exit from the secure 
part, the browser gives me a notice that some parts of the page i´ve been 
led to a non-secure region and ask me if i realy want to do that (it never 
had happened before). Thought i confirm by clicking in yes buttom, i doesn´t 
goes away from https.

Now my question:

Has some difference between 128kb e 256kb ssl key?
There´s some way to fix it?

Thanks a lot in advance for any tips...

-- 
João Cândido de Souza Neto
Curitiba Online
[EMAIL PROTECTED]
(41) 3324-2294 (41) 9985-6894
http://www.curitibaonline.com.br 

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



Re: [PHP] ssl.

2006-08-24 Thread Tim Traver


João Cândido de Souza Neto wrote:

Hy everyone.

Since we change our ssl key from 128kb to a 256kb i notice that something´s 
going wrong.


In my e-commerce, part is secure and part isn´t. when i join into the secure 
part of the site, everithing works fine. But, when the sale is finishes and 
my script run header("Location: http://www.?";) to exit from the secure 
part, the browser gives me a notice that some parts of the page i´ve been 
led to a non-secure region and ask me if i realy want to do that (it never 
had happened before). Thought i confirm by clicking in yes buttom, i doesn´t 
goes away from https.


Now my question:

Has some difference between 128kb e 256kb ssl key?
There´s some way to fix it?

Thanks a lot in advance for any tips...

  



João,

This shouldn't have anything to do with the certificate.

It most likely has to do with something being loaded on the exit page 
that is not secure. For example, if there is a hard coded link to an 
image, or an included javascript link to an outside source.


If anything on the page is not secure, then you will get that error.

Tim.

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



Re: [PHP] ssl.

2006-08-24 Thread Jo�o C�ndido de Souza Neto
Nothing was changed at the code, just the ssl key was changed.

Why it was working fine with the old ssl key?

"Tim Traver" <[EMAIL PROTECTED]> escreveu na mensagem 
news:[EMAIL PROTECTED]
>
> João Cândido de Souza Neto wrote:
>> Hy everyone.
>>
>> Since we change our ssl key from 128kb to a 256kb i notice that 
>> something´s going wrong.
>>
>> In my e-commerce, part is secure and part isn´t. when i join into the 
>> secure part of the site, everithing works fine. But, when the sale is 
>> finishes and my script run header("Location: http://www.?";) to exit 
>> from the secure part, the browser gives me a notice that some parts of 
>> the page i´ve been led to a non-secure region and ask me if i realy want 
>> to do that (it never had happened before). Thought i confirm by clicking 
>> in yes buttom, i doesn´t goes away from https.
>>
>> Now my question:
>>
>> Has some difference between 128kb e 256kb ssl key?
>> There´s some way to fix it?
>>
>> Thanks a lot in advance for any tips...
>>
>>
>
>
> João,
>
> This shouldn't have anything to do with the certificate.
>
> It most likely has to do with something being loaded on the exit page that 
> is not secure. For example, if there is a hard coded link to an image, or 
> an included javascript link to an outside source.
>
> If anything on the page is not secure, then you will get that error.
>
> Tim. 

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



[PHP] Re: ssl.

2006-08-24 Thread Alex Turner
It would appear that the root of the page has not gone back to http.  Is 
it possible that this is a one of those cases when two things get 
changed at once by accident?


I would suggest downloading the IE developer's tool bar (or the firefox 
equivalent) and then when you get to the page you think should be http, 
but is sticking on https, view the DOM.  By carefully going through the 
DOM there is a good chance that you will find that, for example, the PHP 
you have redirected to http is indeed running in a frame or some such.


AJ

João Cândido de Souza Neto wrote:

Hy everyone.

Since we change our ssl key from 128kb to a 256kb i notice that something´s 
going wrong.


In my e-commerce, part is secure and part isn´t. when i join into the secure 
part of the site, everithing works fine. But, when the sale is finishes and 
my script run header("Location: http://www.?";) to exit from the secure 
part, the browser gives me a notice that some parts of the page i´ve been 
led to a non-secure region and ask me if i realy want to do that (it never 
had happened before). Thought i confirm by clicking in yes buttom, i doesn´t 
goes away from https.


Now my question:

Has some difference between 128kb e 256kb ssl key?
There´s some way to fix it?

Thanks a lot in advance for any tips...




--
www.deployview.com
www.nerds-central.com
www.project-network.com

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



Re: [PHP] ssl.

2006-08-24 Thread Alex Turner

João,

Surely the issue is to find why it is not working now.  Why it did work 
in the past is only of interest if you want to stop the problem 
re-occurring in the future.  Thus, the correct approach is to find why 
it is not working now, fix it and then see if you can work out what has 
change between the past and now.


It is just possible that changing the key length has resulted in a 
different connection encryption escalation process between the server 
and the client.  I am a little rusty on this :-(  However, if that is 
the case, I would suspect that what you are seeing is a bug that has 
always been there but did not show up before.  This might revolve around 
which port is being used (as you can map both https and http to one port 
if you use escalation - or at least I seem to remember that is possible 
with TLS).


In summary, find out what is broken now and all will be clear.  To find 
out what is wrong now you should find out the exact structure of the 
returned page.


Good luck

AJ

João Cândido de Souza Neto wrote:

Nothing was changed at the code, just the ssl key was changed.

Why it was working fine with the old ssl key?

"Tim Traver" <[EMAIL PROTECTED]> escreveu na mensagem 
news:[EMAIL PROTECTED]

João Cândido de Souza Neto wrote:

Hy everyone.

Since we change our ssl key from 128kb to a 256kb i notice that 
something´s going wrong.


In my e-commerce, part is secure and part isn´t. when i join into the 
secure part of the site, everithing works fine. But, when the sale is 
finishes and my script run header("Location: http://www.?";) to exit 
from the secure part, the browser gives me a notice that some parts of 
the page i´ve been led to a non-secure region and ask me if i realy want 
to do that (it never had happened before). Thought i confirm by clicking 
in yes buttom, i doesn´t goes away from https.


Now my question:

Has some difference between 128kb e 256kb ssl key?
There´s some way to fix it?

Thanks a lot in advance for any tips...




João,

This shouldn't have anything to do with the certificate.

It most likely has to do with something being loaded on the exit page that 
is not secure. For example, if there is a hard coded link to an image, or 
an included javascript link to an outside source.


If anything on the page is not secure, then you will get that error.

Tim. 



--
www.deployview.com
www.nerds-central.com
www.project-network.com

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



Re: [PHP] ssl.

2006-08-24 Thread Alex Turner

João,

Please try and find out why it is not working now.  Once you have that 
worked out, it will be much easier to find out what has changed.


There are a few subtle methods by which changing the key length might 
interact with PHP.  However, in general, PHP is not involved with the 
encryption of the socket.  It will be near impossible to guess what 
might have gone wrong.  It will be much easier to work it out once you 
know the structure of the page that is causing the trouble.


AJ

www.deployview.com

João Cândido de Souza Neto wrote:

Nothing was changed at the code, just the ssl key was changed.

Why it was working fine with the old ssl key?

"Tim Traver" <[EMAIL PROTECTED]> escreveu na mensagem 
news:[EMAIL PROTECTED]

João Cândido de Souza Neto wrote:

Hy everyone.

Since we change our ssl key from 128kb to a 256kb i notice that 
something´s going wrong.


In my e-commerce, part is secure and part isn´t. when i join into the 
secure part of the site, everithing works fine. But, when the sale is 
finishes and my script run header("Location: http://www.?";) to exit 
from the secure part, the browser gives me a notice that some parts of 
the page i´ve been led to a non-secure region and ask me if i realy want 
to do that (it never had happened before). Thought i confirm by clicking 
in yes buttom, i doesn´t goes away from https.


Now my question:

Has some difference between 128kb e 256kb ssl key?
There´s some way to fix it?

Thanks a lot in advance for any tips...




João,

This shouldn't have anything to do with the certificate.

It most likely has to do with something being loaded on the exit page that 
is not secure. For example, if there is a hard coded link to an image, or 
an included javascript link to an outside source.


If anything on the page is not secure, then you will get that error.

Tim. 



--
www.deployview.com
www.nerds-central.com
www.project-network.com

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



Re: [PHP] How to deal with errors in forms

2006-08-24 Thread Chris

Merlin wrote:

Hi there,

I do have a form where there is also a field with max 2000 characters 
the user can put in.


Now before processing the data with php, I do a checkin the script for 
certain criterias if something lookes wrong I do redirect him to the 
original form with inserting the data he has entered. I do this via GET

e.g.: ?title=test&body=blablub

That works fine with one exception. If the user does enter 2000 
characters (or a lot c.) they do get transfered via URL as well and that 
is not possible. Firfox for example then simply displays a blank page!!! 
It would be fine if he would return with just a few less characters, but 
at least display the error message I am providing.


Now, 2 questions:
1) Does anybody know why firefox is shoing a blank page? If the URL does 
contain less characters, lets say 100 everything works fine.
2) How could I possibly save his entry? Maybe with the help of a cookie? 
But then, I do redirect to the page. So I do send a header. As far as I 
know this only once possible?

For example:
setcookie('bla test'); 
HEADER("Location:".$data[rurl]."?error=".$error.$parameter);


Definitely do this with sessions.

All browsers have a limit on the length of the url they can view 
(internet explorer's is less than firefox, not sure where opera or 
safari break but search your preferred search engine and you'll find the 
answer).


--
Postgresql & php tutorials
http://www.designmagick.com/

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