php-general Digest 8 Oct 2006 23:54:13 -0000 Issue 4390

Topics (messages 242818 through 242830):

Re: ECHO $variable
        242818 by: benifactor
        242820 by: Chris Shiflett
        242821 by: John Wells

Uploading files / processing with a PHP script
        242819 by: Ron Piggott (PHP)
        242825 by: Stut
        242828 by: Larry Garfield
        242829 by: John Wells

Unsealing openssl_seal's data without PHP
        242822 by: William Triplett

$_SERVER['HTTP_REFERER']
        242823 by: Peter Lauri
        242826 by: Dave Goodchild
        242827 by: Stut

Re: FTP
        242824 by: Stut

Apply the hyper link ( javascript functon ) with php
        242830 by: edwardspl.ita.org.mo

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 ---
the way i posted worked fine with out either... he doesn't need to use these
to format the way his output is displayed, he only needs to use the proper
php syntax if i am correct.
----- Original Message ----- 
From: "Penthexquadium" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, October 08, 2006 1:41 AM
Subject: Re: [PHP] ECHO $variable


> On Mon, 9 Oct 2006 00:23:00 -0700, "benifactor" <[EMAIL PROTECTED]> wrote:
> > you should try this...
> >
> > $saved_message_title = '1 Peter 5:7 "Cast all your cares on Him for He
> > cares about you"';
> > ----- Original Message ----- 
> > From: "Ron Piggott (PHP)" <[EMAIL PROTECTED]>
> > To: "PHP General" <[email protected]>
> > Sent: Saturday, October 07, 2006 11:39 PM
> > Subject: [PHP] ECHO $variable
> >
> >
> > > In one of my scripts I have
> > >
> > > <input type=text name="message_title" size=40 maxlength=80
value="<?echo
> > > $saved_message_title;?>">
> > >
> > > where
> > >
> > > $saved_message_title is 1 Peter 5:7 "Cast all your cares on Him for He
> > > cares about you"
> > > --- note the "
> > >
> > > When this is displayed on the screen $saved_message_title reads
> > >
> > > 1 Peter 5:7
> > >
> > > I am assuming the " closes the value=
> > >
> > > How may I echo this to the screen and have the full text be displayed,
> > > not just 1 Peter 5:7 ?
> > >
> > > Ron
> > >
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> His problem is in HTML, not PHP.
>
> Uses htmlspecialchars() or htmlentities() to convert special characters
> to HTML entities. The double quote will becomes "&quot;" so that it can
> be display correctly.
>
> --
> Sorry for my poor English.
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Ron Piggott wrote:
> When this is displayed on the screen $saved_message_title reads
> 
> 1 Peter 5:7 
> 
> I am assuming the " closes the value=
> 
> How may I echo this to the screen and have the full text be
> displayed, not just 1 Peter 5:7 ?

http://php.net/htmlentities

You should really be using this for all output.

Hope that helps.

Chris

-- 
Chris Shiflett
http://shiflett.org/

--- End Message ---
--- Begin Message ---
On 10/9/06, benifactor <[EMAIL PROTECTED]> wrote:
the way i posted worked fine with out either... he doesn't need to use these
to format the way his output is displayed, he only needs to use the proper
php syntax if i am correct.

But what if the string is edited to contain single quotes as well?
Then your solution breaks anyway...

Like Chris said, you should be  using htmlentities for output...

John W

----- Original Message -----
From: "Penthexquadium" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, October 08, 2006 1:41 AM
Subject: Re: [PHP] ECHO $variable


> On Mon, 9 Oct 2006 00:23:00 -0700, "benifactor" <[EMAIL PROTECTED]> wrote:
> > you should try this...
> >
> > $saved_message_title = '1 Peter 5:7 "Cast all your cares on Him for He
> > cares about you"';
> > ----- Original Message -----
> > From: "Ron Piggott (PHP)" <[EMAIL PROTECTED]>
> > To: "PHP General" <[email protected]>
> > Sent: Saturday, October 07, 2006 11:39 PM
> > Subject: [PHP] ECHO $variable
> >
> >
> > > In one of my scripts I have
> > >
> > > <input type=text name="message_title" size=40 maxlength=80
value="<?echo
> > > $saved_message_title;?>">
> > >
> > > where
> > >
> > > $saved_message_title is 1 Peter 5:7 "Cast all your cares on Him for He
> > > cares about you"
> > > --- note the "
> > >
> > > When this is displayed on the screen $saved_message_title reads
> > >
> > > 1 Peter 5:7
> > >
> > > I am assuming the " closes the value=
> > >
> > > How may I echo this to the screen and have the full text be displayed,
> > > not just 1 Peter 5:7 ?
> > >
> > > Ron
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> His problem is in HTML, not PHP.
>
> Uses htmlspecialchars() or htmlentities() to convert special characters
> to HTML entities. The double quote will becomes "&quot;" so that it can
> be display correctly.
>
> --
> Sorry for my poor English.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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



--- End Message ---
--- Begin Message ---
When I upload a file into an application I am writing with the HTML form
command

<INPUT NAME="userfile" TYPE="file">

and then give the PHP command

move_uploaded_file( $userfile , $destination_file_name);

the owner of the file is 'www'.  Is there any way I am able to
automatically change the owner of the file to my FTP login identity (for
example 'rpiggott')

Ron




--- End Message ---
--- Begin Message ---
Ron Piggott (PHP) wrote:
When I upload a file into an application I am writing with the HTML form
command

<INPUT NAME="userfile" TYPE="file">

and then give the PHP command

move_uploaded_file( $userfile , $destination_file_name);

the owner of the file is 'www'.  Is there any way I am able to
automatically change the owner of the file to my FTP login identity (for
example 'rpiggott')

As far as I am aware only the root user can change the owner of files. You could set up a very specific sudo command to allow the www user to chown files to rpiggott but that's beyond the scope of this mailing list (plus I'd have to look it up and you can do that just as well as I can). Of course that would need you to have root on the server in the first place.

-Stut

--- End Message ---
--- Begin Message ---
On Sunday 08 October 2006 13:25, Stut wrote:

> > the owner of the file is 'www'.  Is there any way I am able to
> > automatically change the owner of the file to my FTP login identity (for
> > example 'rpiggott')
>
> As far as I am aware only the root user can change the owner of files.
> You could set up a very specific sudo command to allow the www user to
> chown files to rpiggott but that's beyond the scope of this mailing list
> (plus I'd have to look it up and you can do that just as well as I can).
> Of course that would need you to have root on the server in the first
> place.
>
> -Stut

The owner of a file can change ownership of the file, too, I believe, 
essentially "willing" it to someone else.  Of course, that means your web 
scripts can't access the file, either.  

A better solution is to set the file's group permissions to 7, then chown the 
file to apache:mygroup, then put both apache and your ftp user into the 
mygroup group.  

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

--- End Message ---
--- Begin Message ---
On 10/8/06, Ron Piggott (PHP) <[EMAIL PROTECTED]> wrote:
the owner of the file is 'www'.  Is there any way I am able to
automatically change the owner of the file to my FTP login identity (for
example 'rpiggott')

Just curious, why do you want to do this?  What are you *really*
hoping to accomplish?

John W




Ron






--- End Message ---
--- Begin Message ---
Dear php users,

Is there any way to decrypt data encrypted using openssl_seal _without_ using openssl_open, and instead using the openssl command- line tools?

Here's how the data is encrypted (using openssl_seal). The function 'store_for_later()' just base64_encodes the data and writes to an archive location. $keycert contains the x509 certificate.

###
$key = openssl_pkey_get_public($keycert);
openssl_seal($plaintext,
             $sealed,
             $envelope,
             array($key));

store_for_later($sealed, $envelope[0]);
###

Retrieving the stored data using php, by base64_decoding it and openssl_open'ing it works fine. However, this sequence of commands fails using the OpenSSL command-line tools:

###
bt$ openssl base64 -A -d -in envelope | \
    openssl rsautl -inkey key.pem -decrypt > data_key
bt$ openssl rc4 -A -d -in sealed -kfile data_key
bad magic number
bt$
###

What's 'bad magic number' mean? I tried using the -nosalt option to openssl, and get garbage from openssl, but no 'bad magic number' error message. I suspect it has something to do with the way php creates the initial rc4 key, as I get the same plaintext key if I decrypt the "envelope" from within php or from openssl command-line.

Regards,
William

--- End Message ---
--- Begin Message ---
Hi guys,

 

I am trying to track where the people entered a unique page from (developing
an affiliate system).

 

I have been using the $_SERVER['HTTP_REFERER'] to track this and record it
on a affiliate entrance of the web site. However, that is not tracking all
clicks. Only some of them have. I assume some of the links are not from a
traditional <a></a> link.

 

Is there any other way to do this?

 

Best regards,

Peter Lauri

 

www.lauri.se <http://www.lauri.se/>  - personal web site

www.dwsasia.com <http://www.dwsasia.com/>  - company web site

 

 


--- End Message ---
--- Begin Message ---
HTTP_REFERER is not a reliable way of capturing a remote address. Sometimes
the client does not set it at all.

On 08/10/06, Peter Lauri <[EMAIL PROTECTED]> wrote:

Hi guys,



I am trying to track where the people entered a unique page from
(developing
an affiliate system).



I have been using the $_SERVER['HTTP_REFERER'] to track this and record it
on a affiliate entrance of the web site. However, that is not tracking all
clicks. Only some of them have. I assume some of the links are not from a
traditional <a></a> link.



Is there any other way to do this?



Best regards,

Peter Lauri



www.lauri.se <http://www.lauri.se/>  - personal web site

www.dwsasia.com <http://www.dwsasia.com/>  - company web site









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

--- End Message ---
--- Begin Message ---
Peter Lauri wrote:
I am trying to track where the people entered a unique page from (developing
an affiliate system).

I have been using the $_SERVER['HTTP_REFERER'] to track this and record it
on a affiliate entrance of the web site. However, that is not tracking all
clicks. Only some of them have. I assume some of the links are not from a
traditional <a></a> link.

Is there any other way to do this?

Check the archives - this has come up a couple of times just recently. The usual way is to create URLs for referers in the following style...

http://domain.com/r/joesblog

Then you get /r/ requests routed to a referral tracker (several options for that), map "joesblog" to a referrer, log the hit and redirect.

-Stut

--- End Message ---
--- Begin Message ---
Raphael Martins wrote:
I will be sending files over my php script... One client asked me for a
project where he allow clients to send some large files (like 50mb)...I
thought that FTP (via PHP)  will allow that.

Today he just give the FTP server user and password to his clients, but he
is worried about the security (of course!). Is there a better way? I was
thinking in split the files in several .RAR volumes... (actually, the client
will send his .RAR files instead of a 50mb file), and use remote scripting
to upload each file separatly.

Eww, nasty.

Any Ideas?

Set the upload_max_filesize value for the directory where the upload script lives. That would be the cleanest way to allow this to happen.

However, HTTP was not designed for uploading files of that size so you are better off using an FTP server - this would almost certainly not involve PHP at all. If security is a concern you could generate a temporary FTP user from a PHP script that will get removed after, say, 24 hours. How you would do this will vary depending on the FTP server you are using.

-Stut

--- End Message ---
--- Begin Message ---
Dear All,

How to apply the following function with php ?
<a href=javascript:popup('index.htm')> Test </a>

Edward.

--- End Message ---

Reply via email to