php-windows Digest 13 Jun 2007 15:06:34 -0000 Issue 3256
Topics (messages 28063 through 28077):
Re: Returning variable and array from function
28063 by: Dale Attree
28064 by: Stut
28065 by: Gustav Wiberg
Get referer with PHP
28066 by: Luis Moreira (ESI-GSQP)
28067 by: Bradley Stahl
28068 by: Gustav Wiberg
28069 by: Stut
28071 by: Bradley Stahl
28073 by: Stut
28074 by: Bradley Stahl
28075 by: Luis Moreira (ESI-GSQP)
Dynamic image resizing on upload
28070 by: Mark Abrams
28072 by: Dale Attree
28076 by: Paul Menard
Using COM with PHP - help please!
28077 by: David Felton
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 ---
You would need to return both as elements of an array.
-----Original Message-----
From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
Sent: 12 June 2007 12:08 PM
To: 'php windows' ([EMAIL PROTECTED])
Subject: [PHP-WIN] Returning variable and array from function
Hi there!
I think I have done this before but I can't remember how I did...
I want to return one variable ($htmlReport) and one array from a function
I'd like to like this:
return $htmlReport, $res;
but get the error: Parse error: syntax error, unexpected ',' in
C:\www\test\timeweb\classes\reports.php on line 2745
Best regards
/Gustav Wiberg
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
***********************************************************************************************
The information contained in this e-mail is confidential and may be subject to
legal privilege.
Access to this e-mail by anyone other than the intended recipient is
unauthorised.
If you are not the intended recipient you must not use, copy, distribute or
disclose the e-mail or any part of its contents or take any action in reliance
on it. If you have received this e-mail in error, please notify us immediately
by e-mail ([EMAIL PROTECTED]) or telephone (+27 11 265 4200).
This message is free of all known viruses. It has been screened for viruses by
Blockmail.
***********************************************************************************************
--- End Message ---
--- Begin Message ---
Gustav Wiberg wrote:
I think I have done this before but I can't remember how I did...
I want to return one variable ($htmlReport) and one array from a function
I'd like to like this:
return $htmlReport, $res;
but get the error: Parse error: syntax error, unexpected ',' in
C:\www\test\timeweb\classes\reports.php on line 2745
Yeah, that's not valid PHP. Return it as as array...
return array($htmlReport, $res);
-Stut
--- End Message ---
--- Begin Message ---
Hi there!
Aha, ok thanx! :-)
Best regards
/Gustav Wiberg
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 12, 2007 12:17 PM
To: Gustav Wiberg
Cc: 'php windows' ([EMAIL PROTECTED])
Subject: Re: [PHP-WIN] Returning variable and array from function
Gustav Wiberg wrote:
> I think I have done this before but I can't remember how I did...
>
> I want to return one variable ($htmlReport) and one array from a function
>
> I'd like to like this:
>
> return $htmlReport, $res;
>
> but get the error: Parse error: syntax error, unexpected ',' in
> C:\www\test\timeweb\classes\reports.php on line 2745
Yeah, that's not valid PHP. Return it as as array...
return array($htmlReport, $res);
-Stut
--- End Message ---
--- Begin Message ---
Hi
This is possibly way too simple, but let me ask just the same :
I want to add some code (may be PHP) on an HTML page, to check the
referrer.
It has to be web-server independent.
If the page is invoked by URL X, ok, if not, the page should not be
shown.
Can this be done ?
Thanks
Luis
--- End Message ---
--- Begin Message ---
Luis,
Try using the "$_SERVER['HTTP_REFERER']" server variable to get the URL of
the page that referred the current user to your page. Let me know if this
helps.
--Brad
On 6/12/07, Luis Moreira (ESI-GSQP) <[EMAIL PROTECTED]> wrote:
Hi
This is possibly way too simple, but let me ask just the same :
I want to add some code (may be PHP) on an HTML page, to check the
referrer.
It has to be web-server independent.
If the page is invoked by URL X, ok, if not, the page should not
be
shown.
Can this be done ?
Thanks
Luis
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi there!
If you mean independet of webserver, then try using Javascript. I don't know
the command for retrieving URL in Javascript, but I'm pretty sure there
Is one out there.
Best regards
/Gustav Wiberg
-----Original Message-----
From: Bradley Stahl [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 12, 2007 3:07 PM
To: Luis Moreira (ESI-GSQP)
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Get referer with PHP
Luis,
Try using the "$_SERVER['HTTP_REFERER']" server variable to get the URL of
the page that referred the current user to your page. Let me know if this
helps.
--Brad
On 6/12/07, Luis Moreira (ESI-GSQP) <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> This is possibly way too simple, but let me ask just the same :
>
> I want to add some code (may be PHP) on an HTML page, to check the
> referrer.
> It has to be web-server independent.
> If the page is invoked by URL X, ok, if not, the page should not
> be
> shown.
>
> Can this be done ?
>
> Thanks
> Luis
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Bradley Stahl wrote:
Try using the "$_SERVER['HTTP_REFERER']" server variable to get the URL of
the page that referred the current user to your page. Let me know if this
helps.
Note that this cannot be relied upon. A fair number of proxies and even
some browsers have the option to remove or not supply this header.
-Stut
On 6/12/07, Luis Moreira (ESI-GSQP) <[EMAIL PROTECTED]> wrote:
Hi
This is possibly way too simple, but let me ask just the same :
I want to add some code (may be PHP) on an HTML page, to check
the
referrer.
It has to be web-server independent.
If the page is invoked by URL X, ok, if not, the page should not
be
shown.
Can this be done ?
Thanks
Luis
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Stut,
I did not know that. Do you have any documentation on this? I would really
like to read more about this issue. Thanks for the heads up.
-Brad
On 6/12/07, Stut <[EMAIL PROTECTED]> wrote:
Bradley Stahl wrote:
> Try using the "$_SERVER['HTTP_REFERER']" server variable to get the URL
of
> the page that referred the current user to your page. Let me know if
this
> helps.
Note that this cannot be relied upon. A fair number of proxies and even
some browsers have the option to remove or not supply this header.
-Stut
> On 6/12/07, Luis Moreira (ESI-GSQP) <[EMAIL PROTECTED]> wrote:
>>
>> Hi
>>
>> This is possibly way too simple, but let me ask just the same :
>>
>> I want to add some code (may be PHP) on an HTML page, to check
>> the
>> referrer.
>> It has to be web-server independent.
>> If the page is invoked by URL X, ok, if not, the page should
not
>> be
>> shown.
>>
>> Can this be done ?
>>
>> Thanks
>> Luis
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
--- End Message ---
--- Begin Message ---
Bradley Stahl wrote:
I did not know that. Do you have any documentation on this? I would
really like to read more about this issue. Thanks for the heads up.
There is no documentation on this beyond the HTTP spec not requiring
that this header is set, so I'm not really sure where I can point you.
-Stut
On 6/12/07, * Stut* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
Bradley Stahl wrote:
> Try using the "$_SERVER['HTTP_REFERER']" server variable to get
the URL of
> the page that referred the current user to your page. Let me
know if this
> helps.
Note that this cannot be relied upon. A fair number of proxies and even
some browsers have the option to remove or not supply this header.
-Stut
> On 6/12/07, Luis Moreira (ESI-GSQP) <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
>>
>> Hi
>>
>> This is possibly way too simple, but let me ask just the
same :
>>
>> I want to add some code (may be PHP) on an HTML page, to
check
>> the
>> referrer.
>> It has to be web-server independent.
>> If the page is invoked by URL X, ok, if not, the page
should not
>> be
>> shown.
>>
>> Can this be done ?
>>
>> Thanks
>> Luis
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
--- End Message ---
--- Begin Message ---
No problem. Thanks.
On 6/12/07, Stut <[EMAIL PROTECTED]> wrote:
Bradley Stahl wrote:
> I did not know that. Do you have any documentation on this? I would
> really like to read more about this issue. Thanks for the heads up.
There is no documentation on this beyond the HTTP spec not requiring
that this header is set, so I'm not really sure where I can point you.
-Stut
> On 6/12/07, * Stut* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
wrote:
>
> Bradley Stahl wrote:
> > Try using the "$_SERVER['HTTP_REFERER']" server variable to get
> the URL of
> > the page that referred the current user to your page. Let me
> know if this
> > helps.
>
> Note that this cannot be relied upon. A fair number of proxies and
even
> some browsers have the option to remove or not supply this header.
>
> -Stut
>
> > On 6/12/07, Luis Moreira (ESI-GSQP) <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> >>
> >> Hi
> >>
> >> This is possibly way too simple, but let me ask just the
> same :
> >>
> >> I want to add some code (may be PHP) on an HTML page, to
> check
> >> the
> >> referrer.
> >> It has to be web-server independent.
> >> If the page is invoked by URL X, ok, if not, the page
> should not
> >> be
> >> shown.
> >>
> >> Can this be done ?
> >>
> >> Thanks
> >> Luis
> >>
> >> --
> >> PHP Windows Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
>
>
--- End Message ---
--- Begin Message ---
True
I tested, for now, on my own PC running Apache, and it does work.
I will try to find a javascript option, but for now I already have something
that does the trick, providing the info is there.
Thanks
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED]
Sent: terça-feira, 12 de Junho de 2007 14:26
To: Bradley Stahl
Cc: Luis Moreira (ESI-GSQP); [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Get referer with PHP
Bradley Stahl wrote:
> Try using the "$_SERVER['HTTP_REFERER']" server variable to get the URL of
> the page that referred the current user to your page. Let me know if this
> helps.
Note that this cannot be relied upon. A fair number of proxies and even
some browsers have the option to remove or not supply this header.
-Stut
> On 6/12/07, Luis Moreira (ESI-GSQP) <[EMAIL PROTECTED]> wrote:
>>
>> Hi
>>
>> This is possibly way too simple, but let me ask just the same :
>>
>> I want to add some code (may be PHP) on an HTML page, to check
>> the
>> referrer.
>> It has to be web-server independent.
>> If the page is invoked by URL X, ok, if not, the page should not
>> be
>> shown.
>>
>> Can this be done ?
>>
>> Thanks
>> Luis
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
--- End Message ---
--- Begin Message ---
Is there a PHP function to resize a user's JPG or GIF image during an
upload?
I was advised to use Image Magick http://www.imagemagick.org However, the
Windows install doc has not been written. I have unsuccessfully struggled
with the install for days ...
All I want to do is to resize a large image to a thumbnail of my dimensions
when my end user uploads a an image.
TIA for any help.
--- End Message ---
--- Begin Message ---
$Filename = full path and filename of original file
$Thumbnail = full path and filename of thumbnail
$WIDTH && $HEIGHT = specified for resizing
Gdlib must be installed.
<?php
function Resize($Filename,$Thumbnail,$WIDTH,$HEIGHT){
$image = $Filename;
$thumbnail = $Thumbnail;
$imagesize = getimagesize($image);
$fwidth = $imagesize[0];
$fheight = $imagesize[1];
if($fheight <= $fwidth){
$percentage = round(($WIDTH/$fwidth) * 100);
$newwidth = round(($fwidth * $percentage)/100);
$newheight = round(($fheight * $percentage)/100);
}
elseif($fheight > $fwidth){
$percentage = round(($HEIGHT/$fheight) * 100);
$newwidth = round(($fwidth * $percentage)/100);
$newheight = round(($fheight * $percentage)/100);
}
else{
$percentage = round(($fwidth/$WIDTH) * 100);
$newwidth = round(($fwidth * $percentage)/100);
$newheight = round(($fheight * $percentage)/100);
}
$destImage = imagecreatetruecolor($newwidth,$newheight) or
die($file.' - '.$newwidth.':'.$newheight);
$type = strtolower(substr($Filename,-3));
switch($type){
case 'gif':
$srcImage = ImageCreateFromGif($image);
ImageCopyResized($destImage, $srcImage, 0,
0, 0, 0, $newwidth, $newheight, imagesx($srcImage), imagesy($srcImage));
ImageGif($destImage,$thumbnail);
break;
case 'jpg':
$srcImage = ImageCreateFromJPEG($image);
ImageCopyResized($destImage, $srcImage, 0,
0, 0, 0, $newwidth, $newheight, imagesx($srcImage), imagesy($srcImage));
ImageJPEG($destImage,$thumbnail);
break;
case 'png':
$srcImage = ImageCreateFromPNG($image);
ImageCopyResized($destImage, $srcImage, 0,
0, 0, 0, $newwidth, $newheight, imagesx($srcImage), imagesy($srcImage));
ImagePNG($destImage,$thumbnail);
break;
}
//free the memory used for the images
ImageDestroy($srcImage);
ImageDestroy($destImage);
if(file_exists($thumbnail)){
return true;
}
else{
return false;
}
}?>
-----Original Message-----
From: Mark Abrams [mailto:[EMAIL PROTECTED]
Sent: 12 June 2007 03:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Dynamic image resizing on upload
Is there a PHP function to resize a user's JPG or GIF image during an
upload?
I was advised to use Image Magick http://www.imagemagick.org However, the
Windows install doc has not been written. I have unsuccessfully struggled
with the install for days ...
All I want to do is to resize a large image to a thumbnail of my dimensions
when my end user uploads a an image.
TIA for any help.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
***********************************************************************************************
The information contained in this e-mail is confidential and may be subject to
legal privilege.
Access to this e-mail by anyone other than the intended recipient is
unauthorised.
If you are not the intended recipient you must not use, copy, distribute or
disclose the e-mail or any part of its contents or take any action in reliance
on it. If you have received this e-mail in error, please notify us immediately
by e-mail ([EMAIL PROTECTED]) or telephone (+27 11 265 4200).
This message is free of all known viruses. It has been screened for viruses by
Blockmail.
***********************************************************************************************
--- End Message ---
--- Begin Message ---
Mark,
Not sure about your comment "...the Windows install doc has not been written.".
>From the ImageMagick site I see the pre-compiled Windows downloads
http://www.imagemagick.org/script/binary-releases.php#windows
Just above the list of download links is the paragraph:
"The Windows version of ImageMagick is self-installing. Simply click on
the appropriate version below and it will launch itself and ask you a
few installation questions."
P-
----- Original Message ----
From: Mark Abrams <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Tuesday, June 12, 2007 8:39:04 AM
Subject: [PHP-WIN] Dynamic image resizing on upload
Is there a PHP function to resize a user's JPG or GIF image during an
upload?
I was advised to use Image Magick http://www.imagemagick.org However, the
Windows install doc has not been written. I have unsuccessfully struggled
with the install for days ...
All I want to do is to resize a large image to a thumbnail of my dimensions
when my end user uploads a an image.
TIA for any help.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Does anyone have any experience with this?
I'm using the COM function with PHP4 and have run into problems. I can
instantiate a COM object, and call simple function. Now I have come on
to calling a more complicated function that returns an instance of an
interface. The function is running correctly but I can't figure out how
to access the data in the instance of the interface.
$xfmsObject = new COM("XFMS_COM.XFMSAPIWrapper.1");
$retval =
$xfmsObject->xfortVerifyAndUnpackPAResMsgEx($signedPARes,
$paResPan,
"sdkCheckInstall",
$avresult,
$strErrMsg);
As this is a COM object $avresult and $strErrMsg are manipulated by the
function, $avresult contains the data I am interested in. The interface
is defined as follows:
IxfortAuthValidationResultEx
{
public:
long SignatureCheckResult;
VT_BSTR ECI;
long AuthenticationResult;
VT_BSTR AuthenticationStatusMsg;
VT_BSTR XID;
VT_BSTR HexXID;
VT_BSTR CardholderPAN;
VT_BSTR CardExpiryDate;
VT_BSTR ACSVerificationID;
VT_BSTR HexACSVerificationID;
VT_BSTR ACSVerificationFlavor;
VT_BSTR PurchaseAmount;
VT_BSTR AlphaAuthenticationResult(VARIANT *pVal)
};
I'm using PHP4.
Any information or help much appreciated!
**********************************************************************************
Disclaimer
The information and attached documentation in this e-mail is intended for the
use of the addressee only and is confidential. If you are not the intended
recipient please delete it and notify us immediately by telephoning or
e-mailing the sender. Please note that without Codemasters’ prior written
consent any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.
Attachments to this e-mail may contain software viruses. You are advised to
take all reasonable precautions to minimise this risk and to carry out a virus
check on any documents before they are opened.
Any offer contained in this communication is subject to Codemasters’ standard
terms & conditions and must be signed by both parties. Except as expressly
provided otherwise all information and attached documentation in this e-mail is
subject to contract and Codemasters’ board approval.
Any views or opinions expressed are solely those of the author and do not
necessarily represent those of Codemasters.
This footnote also confirms that this email message has been swept by
SurfControl for the presence of computer viruses.
**********************************************************************************
--- End Message ---