RE: [PHP] send email sample

2005-03-19 Thread david joffrin
Very simple sample:
// Send a mail to [EMAIL PROTECTED]
$headers = From: \Webmaster\[EMAIL PROTECTED];
$mailtext = trim($_POST[email]);
$mailtext .=  is joining the family.\n;
mail('[EMAIL PROTECTED]', 'New Registration', $mailtext, 
$headers);
I am using the fake sendmail windows tool very simple to configure, 
maybe a bit slow though.

David Joffrin
www.bidnplay.com
From: issin [EMAIL PROTECTED]
To: php-general@lists.php.net
Subject: [PHP] send email sample
Date: Sat, 19 Mar 2005 15:25:12 +0800
Dear all,

   Can you give me a send email sample?
   Thanks!

Best Regards,
Issin Yeung

 Information from NOD32 
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] send email sample

2005-03-19 Thread Burhan Khalid
issin wrote:
Dear all,
 

   Can you give me a send email sample?
   Thanks!
RTFM : http://www.php.net/manual/en/function.mail.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] does your mail() base64 encode messages?

2005-03-19 Thread Burhan Khalid
John W. List wrote:
I have an unexpected and perplexing problem.
PHP's mail() function is base64 encoding all message bodies as an
ill-formed MIME attachment resulting in the recipient seeing an
uninteligable base64 encoded string. This only happens to my account
with my host and neither I or the sysadmin can see why as there are no
special configuration settings for me. The host is running PHP4.3.10.
Here's what is happening:
This code
?php
mail ( [EMAIL PROTECTED], test script, Foo!, );
Try mail([EMAIL PROTECTED],test script,Foo!);
Don't send empty headers -- it might be causing the problem. Fwiw, I 
have never encountered this issue.

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


Re: [PHP] does your mail() base64 encode messages?

2005-03-19 Thread John W. List
 Try mail([EMAIL PROTECTED],test script,Foo!);

Thanks very much for your suggestion- It did not fix the problem but
it provided a pointer to a workaround.

It appears that my host base64 encodes message bodies if any sort of
header- even an empty one- is supplied. This is a problem the sysadmin
is looking into but for now I have to live with it.

The empty header caused mail() to put a \n in between the headers and
the MIME headers for the base64 encoded stuff. This in turn caused
mail readers to view the message as a plain text message that happened
to contain a base64 encoded string so the recipient saw gibberish.
Removing the empty header resulted in a plain text message, putting a
valid header in the headers parameter caused the mail to be viewed by
the mail reader as a normal base64 encoded message and thus readable
by the recipient. Unfortunately mail()'s habit of doing this base64
encoding precludes me from doing anything with MIME multipart messages
because all the multipart separators, HTML etc become visible as plain
text, but at least I can send emails containing plain text.

And so to the commercial application which originally showed up this
problem. Its mail code had an extra \n at the end of its headers.
Removing this made it possible for it to send plain text emails,
albeit base64 encoded ones, from this host. I've used this application
from quite a few other customers hosts in the past so this \n is not
normally a problem, but I've never used a host that exhibits this
behaviour. As well as removing this \n I had to comment out the lines
that sent multipart emails but at least now I'm in business.

As to the problem itself, I'm none the wiser. As I see it it can only
be either PHP or Sendmail that is doing this. I've never had this or
any other version of PHP do this to me before but since as I
understand it Sendmail is only being used as a mail relay here I cant
place the blame anywhere else but a possible bug in PHP 4.3.10's
mail() function. It's not a bug, it's a feature!:)

I guess it's all extra experience.
John W. List

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



[PHP] sessioncookies?

2005-03-19 Thread Ken
if you check your cookies (if you are using firefox) you should see
multiple cookies from many sites. It is allowed and I think you can
set as much as possible. However I wouldn't because you'll probably
end up forgetting some of them and it'll become a hassle. Besides,
some browsers might reject cookies, so don't rely too heavily on
cookies. And then there is the security factor to consider... you
don't want to store too many cookies that might give away
passwords/usernames.

That's all the bad reason I can think of.

Good luck :D


On Fri, 18 Mar 2005 18:30:58 +0200, William Stokes [EMAIL PROTECTED] wrote:
 OK. so can I set 2 or more session cookies for the same user? Like this:
 setcookie(sess_id,$sess_id,0,/);
 setcookie(cookie2,$another_variable,0,/);

 If so is there a limit? Or is it a bad idea for some other reason?

 Thanks
 -Will

 Ken [EMAIL PROTECTED] kirjoitti
 viestissä:[EMAIL PROTECTED]
  No, you'll have to use another cookie name.
  Alternatively, you can use arrays
 
  setcookie('cookiename['arrayname']', $value, time());
 
 
  On Fri, 18 Mar 2005 15:07:34 +0200, William Stokes [EMAIL PROTECTED]
  wrote:
  Hello,
 
  I have a following line in my code to set a session cookie when user logs
  in. It works fine.
  setcookie(sess_id,$sess_id,0,/);
 
  Can I store more information to the session cookie? I mean other
  variables.
  Like I tried it like this with no success.
  setcookie(sess_id,$sess_id,$another_variable,0,/);
 
  Thanks
  -Will
 
  --
  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



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



Re: [PHP] send email sample

2005-03-19 Thread John Taylor-Johnston
Burhan Khalid wrote:

 Can you give me a send email sample?
 RTFM : http://www.php.net/manual/en/function.mail.php

Burhan,
That's awfully polite. RTFM. How are people supposed to get started? Take 
that attitude back over to the Perl newsgroup. One of the joys of PHP has been 
a non-techhead, non-stressful, Open Source spirit of teaching and helping 
others, which in turn helps PHP grow and flourish.

Issin,
Go have a look at:
http://compcanlit.usherbrooke.ca/eslcafe/hotpotatoes/hot-potatoes_102.htm
That will get you started. And yes, by all means you should check the manual: 
http://www.php.net/manual/en/ and this article in particular: 
http://www.php.net/manual/en/function.mail.php
HTH :)
John

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



Re: [PHP] Re: fopen

2005-03-19 Thread John Taylor-Johnston
Hi,
W+ does not work either.
I have resorted to adding a blank, 0 byte text file.
But it needs chmod 666.
Interesting, I add this line:

 chmod($defaultfile, 666);

and it send back an illegal error, but it appears to work anyway - the data is 
written!

What does the at_sign mean at the start of this line?

@ $results = fopen($datafilename, w+);


 try $results = fopen($datafilename, w+);

$defaultfile = /home/johj2201/public_html/ffmail.txt; #default file to write 
to
...
chmod($defaultfile, 666);
...
@ $results = fopen($datafilename, w+);
 if (!$results) { die (Our results file could not be opened for writing.  Your 
score was not recorded.  Please contact the person responsible and try again 
later.); }
 flock($results, 2); #lock file for writing
 fwrite($results, $filestr); #write $filestr to $results
 flock($results, 3); #unlock file
 fclose($results); #close file

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



RE: [PHP] How from an html/web form I may go to a php script output(of form values)

2005-03-19 Thread Leonidas Savvides
If is easy please answer and this : when be online AND OPEN A FILE FROM
A WEB LOCATION HOST - MINE WITH NOTEPAD may after I modify it, save it
again to my hosting space WITHOUT save it to my PC first ? Please note
that I mean using NotePad and I mean entering the host usernamepassword
when OPEN / SAVE ...? ATTENTION: I DO NOT MEAN SAVE IT TO MY HDD FIRST
AND AFTER UPLOAD IT !!! Please tell me the same[as for NotePad] but for
Dreamweaver MX ?
[EMAIL PROTECTED] 
-Original Message-
From: Forest Liu [mailto:[EMAIL PROTECTED] 
Sent: 18 March 2005 11:51
To: Leonidas Savvides
Cc: php-general@lists.php.net; [EMAIL PROTECTED]; sony-only;
[EMAIL PROTECTED]
Subject: Re: [PHP] How from an html/web form I may go to a php script
output(of form values)

I donot know what happened in Frontpage. I just use Dreamweaver to
design the page layout, and then UltraEdit to add php code.

I think you are asking about the page submit. You can find the exact
example in the php manual, which can be obtained from php.net

a.php:
form method=post action=b.php
  input name=usrinfo value=Input your info here
  input type=submit
/form

b.php:
echo your input just now is:.$_POST[usrinfo];

it will work.

On Fri, 18 Mar 2005 10:38:45 +0200, Leonidas Savvides
[EMAIL PROTECTED] wrote:
 How from an html/web form I may go to a php script output(of form
 values) ? I mean the programming for the result :
 
 A visitor to webpage-A.php when press submit of a webform go to a
 webpage-B.php where as a php script uses the previous form data , and
 for example there's output of these data the exactly words the visitor
 enters ?
 
 May this done in MS-FrontPage2002 ?
 
 THE SCRIPT IN MS-FrontPage2002 HTML MODE NO EXECUTED BUT IS LIKE NO
 EXIST , UNLIKE THE CODE HAS ALREADY SCRIPT COLOR IN HTML MODE OF
 FRONTPAGE AND ALSO PHP SCRIPT FILE NAME xxx.php IS IN THE WEB FORM
 PROPERTIES ? ... I INSERT PHP SCRIPT IN SCRIPT . /SCRIPT TAGS
?
 AND ALSO I TRY DELETE PHP SCRIPT INSERTING ONLY ONE COMMAND THE:
 Script
 echo this operate till here;
 /Script
 BUT AGAIN THE SAME RESULT  ?
 After press SUBMIT the php script file shows in address bar and all
 viewed area is white (nothing on screen) ?
 
 Leonidas Savvides
 [EMAIL PROTECTED]
 
 


-- 
  Sincerely,
Forest Liu(?)

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



Re: [PHP] How from an html/web form I may go to a php script output(of form values)

2005-03-19 Thread Forest Liu
I am so sorry for my misunderstanding and leading you to anger. But I
am still not so clear yet...about your demand.

I guess you wanna say, a visitor enter his account and password, and
click 'submit', then the browser navigates to b.php to check if all
are correct. Right?

a.php:
form method=post action=b.php
input name=usrinfo value=Input your info here
input type=submit
/form

b.php:
?php
echo your input just now is:.$_POST[usrinfo];
?

it will really work.I promise.

First, make sure your script tag is ?php ... ?, that's the default
tag for interpreter.
Secondly, HTML page is just a plain text file. You can just use
Notepad to edit it. It's not about Frontpage or Deamweaver, It's about
HTML code. Whichever tool you are using, they all generate a plain
text file named *.html on your HDD. Then you should upload them to a
web host space.And , they run on the server side.


On Sat, 19 Mar 2005 17:03:19 +0200, Leonidas Savvides
[EMAIL PROTECTED] wrote:
 If is easy please answer and this : when be online AND OPEN A FILE FROM
 A WEB LOCATION HOST - MINE WITH NOTEPAD may after I modify it, save it
 again to my hosting space WITHOUT save it to my PC first ? Please note
 that I mean using NotePad and I mean entering the host usernamepassword
 when OPEN / SAVE ...? ATTENTION: I DO NOT MEAN SAVE IT TO MY HDD FIRST
 AND AFTER UPLOAD IT !!! Please tell me the same[as for NotePad] but for
 Dreamweaver MX ?
 [EMAIL PROTECTED]
 -Original Message-
 From: Forest Liu [mailto:[EMAIL PROTECTED]
 Sent: 18 March 2005 11:51
 To: Leonidas Savvides
 Cc: php-general@lists.php.net; [EMAIL PROTECTED]; sony-only;
 [EMAIL PROTECTED]
 Subject: Re: [PHP] How from an html/web form I may go to a php script
 output(of form values)
 
 I donot know what happened in Frontpage. I just use Dreamweaver to
 design the page layout, and then UltraEdit to add php code.
 
 I think you are asking about the page submit. You can find the exact
 example in the php manual, which can be obtained from php.net
 
 a.php:
 form method=post action=b.php
  input name=usrinfo value=Input your info here
  input type=submit
 /form
 
 b.php:
 echo your input just now is:.$_POST[usrinfo];
 
 it will work.
 
 On Fri, 18 Mar 2005 10:38:45 +0200, Leonidas Savvides
 [EMAIL PROTECTED] wrote:
  How from an html/web form I may go to a php script output(of form
  values) ? I mean the programming for the result :
 
  A visitor to webpage-A.php when press submit of a webform go to a
  webpage-B.php where as a php script uses the previous form data , and
  for example there's output of these data the exactly words the visitor
  enters ?
 
  May this done in MS-FrontPage2002 ?
 
  THE SCRIPT IN MS-FrontPage2002 HTML MODE NO EXECUTED BUT IS LIKE NO
  EXIST , UNLIKE THE CODE HAS ALREADY SCRIPT COLOR IN HTML MODE OF
  FRONTPAGE AND ALSO PHP SCRIPT FILE NAME xxx.php IS IN THE WEB FORM
  PROPERTIES ? ... I INSERT PHP SCRIPT IN SCRIPT . /SCRIPT TAGS
 ?
  AND ALSO I TRY DELETE PHP SCRIPT INSERTING ONLY ONE COMMAND THE:
  Script
  echo this operate till here;
  /Script
  BUT AGAIN THE SAME RESULT  ?
  After press SUBMIT the php script file shows in address bar and all
  viewed area is white (nothing on screen) ?
 
  Leonidas Savvides
  [EMAIL PROTECTED]
 
 
 
 --
  Sincerely,
Forest Liu()
 
 


-- 
  Sincerely,
Forest Liu()

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



Re: [PHP] Setting cookies for other domains

2005-03-19 Thread Jason Wong
On Friday 18 March 2005 10:32, Brian Dunning wrote:
  I suspect it's
  for sub-domains of sites you administer and not completely different
  domains altogether.

 If this is true, and it's not possible for a site to set a cookie for a
 completely different domain, then why do browsers have security options
 to allow or prevent this specific action?

When you display a webpage it very often pulls in a load of crap from 
other websites (eg banner ads). These other websites are able set their 
own cookies (for their particular domains). The browser prefs are for 
preventing these 3rd party websites from setting these 3rd party cookies.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

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



[PHP] PHP 5 DOM, XPath, UTF-8, and Form Input

2005-03-19 Thread C Drozdowski
I have been doing some testing and need confirmation that the following 
is correct.

You have a DOMDocument that potentially contains UTF-8 encoded data (it 
might not however).

You want to search it via DOMXpath-query() using a value that comes 
from a $_POST value.

If the page that posts the data via a form to the search script  IS NOT 
encoded in UTF-8, then the value must be converted to UTF-8 before it 
is used in the query expression.

Else, if the posting page IS UTF-8 encoded, then the $_POST data does 
not need to be converted before being used in the expression.

Is this correct?
Also, if the $_POST data comes from a UTF-8 encoded page, and it needs 
to be sanitized before use, will the basic PHP string functions work on 
the data (e.g. htmlentities, stripslashes, trim, preg_replace, etc)?

If not what do I have to do?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] How from an html/web form I may go to a php script output(of form values)

2005-03-19 Thread Philip Olson

 If is easy please answer and this : when be online AND OPEN A FILE FROM
 A WEB LOCATION HOST - MINE WITH NOTEPAD may after I modify it, save it
 again to my hosting space WITHOUT save it to my PC first ? Please note
 that I mean using NotePad and I mean entering the host usernamepassword
 when OPEN / SAVE ...? ATTENTION: I DO NOT MEAN SAVE IT TO MY HDD FIRST
 AND AFTER UPLOAD IT !!! Please tell me the same[as for NotePad] but for
 Dreamweaver MX ?

It's difficult to know what you mean exactly but I'll assume
you want to setup FTP access with your text editors as to
edit files remotely. Notepad does not have this option but
dreamweaver does (most text editors do, such as jedit,
ultraedit, editplus, etc.). Here's a tutorial for setting up
FTP with dreamweaver:

 http://macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_14787

Regards,
Philip

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



[PHP] Re: [PHP-WIN] setting php for accepting the urls... phpinfo.php/extra/information/

2005-03-19 Thread Leif Gregory
Hello Rob,

Saturday, March 19, 2005, 2:39:08 AM, you wrote:
R could someone possibly point me in the right direction for allow
R PHP on IIS 6 to accept urls with the query string seperated by
R slashes..

This is called slash arguments and IIS can not natively handle it. I
ran into this issue setting up a Moodle http://www.moodle.org
installation for a client. There is a 3rd party app you can install on
an IIS server which will allow you to do this. It is free for a single
website, but if you are virtual hosting, it costs money.

It's called ISAPI Rewrite http://www.isapirewrite.com/

I finally ended up building them an Win2K, Apache2, MySQL, PHP5 box so
they could use Moodle to the fullest with slash arguments.


Cheers,
Leif Gregory 

-- 
TB Lists Moderator (and fellow registered end-user)
PCWize Editor  /  ICQ 216395  /  PGP Key ID 0x7CD4926F
Web Site http://www.PCWize.com

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



[PHP] looking for address finder..uk

2005-03-19 Thread AndreaD
I'm looking for an address finder where a user types in a postcode and house 
number and then the user is given an option of  to houses to choose from.

Anything like this available for a small charge?


Ross 

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



Re: [PHP] Referer checking is able to be referer spoofed

2005-03-19 Thread Dan Rossi
On 19/03/2005, at 2:36 AM, Marek Kilimajer wrote:
Dan Rossi wrote:
On 19/03/2005, at 2:06 AM, [EMAIL PROTECTED] 
wrote:

I think you misunderstood me or I wasnt clear, the links are coming 
from a syndicate site to the main site, so we check on that domain. I 
am looking at other options, maybe someway of trasparently logging in 
?
You were not clear at all. What are you trying to do?

Hi there Marek, here is how the system currently works. Each feed 
afiliate has a special number, this is used for publishing points on 
the streaming server aswell as loading refering domains from the 
database. A link to the video feed player window will happen from their 
server only, therefore the referer check. What I was trying to say is, 
one of the customers picked up , that it was using referer checks 
aswell as a few other things, and worked out referer spoofing software 
will let you in still. We need to try and avoid this, as each 
customer's authentication is different we cannot have another login as 
its not in sync. So we may have to look at other options, possibly 
someway of transparently logging in I dont know.

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


[PHP] class and global

2005-03-19 Thread pooly
Hi,
I'm trying to use a global object (declared at a upper level), but all I 
got is :
Call to a member function on a non-object in 
/home/pooly/public_html/templeet/modules/freedb.php on line 16

part of the code is :
$freedb = new freedbaxs();
Function return_freedb_search($array)
{
global $freedb;
[snip]
$freedb-freedb_search($txt);
so, can I access an object allocated outside a function ? this 
functionis meant to be a wrapper for that class, because I cannot access 
directly.
thanks for you help,

--
Pooly ;)
http://www.w-fenec.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] global and object

2005-03-19 Thread pooly
Hi,
I'm trying to use a global object (declared at a upper level), but all I 
got is :
Call to a member function on a non-object in 
/home/pooly/public_html/templeet/modules/freedb.php on line 16

part of the code is :
$freedb = new freedbaxs();
Function return_freedb_search($array)
{
global $freedb;
[snip]
$freedb-freedb_search($txt);
so, can I access an object allocated outside a function ? this 
functionis meant to be a wrapper for that class, because I cannot access 
directly.
thanks for you help,

--
Pooly ;)
http://www.w-fenec.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Referer checking is able to be referer spoofed

2005-03-19 Thread Marek Kilimajer
Dan Rossi wrote:
On 19/03/2005, at 2:36 AM, Marek Kilimajer wrote:
Dan Rossi wrote:
On 19/03/2005, at 2:06 AM, [EMAIL PROTECTED] wrote:

I think you misunderstood me or I wasnt clear, the links are coming 
from a syndicate site to the main site, so we check on that domain. I 
am looking at other options, maybe someway of trasparently logging in ?

You were not clear at all. What are you trying to do?

Hi there Marek, here is how the system currently works. Each feed 
afiliate has a special number, this is used for publishing points on the 
streaming server aswell as loading refering domains from the database. A 
link to the video feed player window will happen from their server only, 
therefore the referer check. What I was trying to say is, one of the 
customers picked up , that it was using referer checks aswell as a few 
other things, and worked out referer spoofing software will let you in 
still. We need to try and avoid this, as each customer's authentication 
is different we cannot have another login as its not in sync. So we may 
have to look at other options, possibly someway of transparently logging 
in I dont know.

If you need only hotlink protection then the current referer checking is 
just enough. Most users will not install referer spoofing software.

But if you need to be 100% sure the videos are streamed through 
affiliate server, you can use tokens - a script at the affiliate server 
will request a token from the streaming server (with 
username/password/clip id etc.). This token will be sent with the link 
to the streaming server. Hope this is clear.

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


Re: [PHP] How from an html/web form I may go to a php script output(of form values)

2005-03-19 Thread Rick Robinson
Try this:
Goto 'My Network Places' and set up an ftp connection to whereever you
want to save the file. Then in notepad you can access it just 'like' a
directory on your computer.



On Sat, 19 Mar 2005 16:09:05 + (GMT), Philip Olson
[EMAIL PROTECTED] wrote:
 
  If is easy please answer and this : when be online AND OPEN A FILE FROM
  A WEB LOCATION HOST - MINE WITH NOTEPAD may after I modify it, save it
  again to my hosting space WITHOUT save it to my PC first ? Please note
  that I mean using NotePad and I mean entering the host usernamepassword
  when OPEN / SAVE ...? ATTENTION: I DO NOT MEAN SAVE IT TO MY HDD FIRST
  AND AFTER UPLOAD IT !!! Please tell me the same[as for NotePad] but for
  Dreamweaver MX ?
 
 It's difficult to know what you mean exactly but I'll assume
 you want to setup FTP access with your text editors as to
 edit files remotely. Notepad does not have this option but
 dreamweaver does (most text editors do, such as jedit,
 ultraedit, editplus, etc.). Here's a tutorial for setting up
 FTP with dreamweaver:
 
 http://macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_14787
 
 Regards,
 Philip
 
 --
 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



Re: [PHP] class and global

2005-03-19 Thread Evert - Rooftop Solutions
pooly wrote:
I'm trying to use a global object (declared at a upper level), but all 
I got is :
Call to a member function on a non-object in 
/home/pooly/public_html/templeet/modules/freedb.php on line 16

part of the code is :
$freedb = new freedbaxs();
Function return_freedb_search($array)
{
global $freedb;
[snip]
$freedb-freedb_search($txt);

I don't see an error in this code, perhaps you should give us a bit more 
information.

grt,
Evert
--
Rooftop Solutions - Web Applications on Demand
tel. (+31)628962319 fax. (+31)842242474
[EMAIL PROTECTED]
http://www.rooftopsolutions.nl
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] global and object

2005-03-19 Thread Mister Jack
Oops, sorry for double posting. my mistake. accept my apologies :-p


On Fri, 18 Mar 2005 23:51:15 +, pooly [EMAIL PROTECTED] wrote:
 Hi,
 
 I'm trying to use a global object (declared at a upper level), but all I
 got is :
 Call to a member function on a non-object in
 /home/pooly/public_html/templeet/modules/freedb.php on line 16
 
 part of the code is :
 $freedb = new freedbaxs();
 Function return_freedb_search($array)
 {
 global $freedb;
 [snip]
  $freedb-freedb_search($txt);
 
 so, can I access an object allocated outside a function ? this
 functionis meant to be a wrapper for that class, because I cannot access
 directly.
 thanks for you help,
 
 --
 Pooly ;)
 http://www.w-fenec.org/
 
 --
 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



Re: [PHP] class and global

2005-03-19 Thread Mister Jack
The initialisation seems to be ok, since :

Function return_freedb_search($array)
{
global $freedb;
$freedb = new freedbaxs();
[snip]
$freedb-freedb_search($txt); //line 16...
}

works
and also


$freedb = new freedbaxs();
$freedb-freedb_search(ploplop);
Function return_freedb_search($array)
{
global $freedb;
[snip]
//$freedb-freedb_search($txt); //line 16...

}

those line are all in a PHP file which is include if needed, by
parsing the template file.
So the file is include (then 
$freedb = new freedbaxs();
should be executed)

and return_freedb_search is call a bit later. Everythin has always
worked fine, but this is the first time I tried with an object, and
all i got is this error. that's really strange, and I really don't
have a clue about what is going on. (is the object disapearing ? )


On Sat, 19 Mar 2005 19:59:55 +0100, Evert - Rooftop Solutions
[EMAIL PROTECTED] wrote:
 pooly wrote:
 
  I'm trying to use a global object (declared at a upper level), but all
  I got is :
  Call to a member function on a non-object in
  /home/pooly/public_html/templeet/modules/freedb.php on line 16
 
  part of the code is :
  $freedb = new freedbaxs();
  Function return_freedb_search($array)
  {
  global $freedb;
  [snip]
  $freedb-freedb_search($txt);
 
 
 I don't see an error in this code, perhaps you should give us a bit more
 information.
 
 grt,
 Evert
 
 --
 Rooftop Solutions - Web Applications on Demand
 tel. (+31)628962319 fax. (+31)842242474
 [EMAIL PROTECTED]
 http://www.rooftopsolutions.nl
 
 --
 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



Re: [PHP] class and global

2005-03-19 Thread BAO RuiXian

Evert - Rooftop Solutions wrote:
pooly wrote:
I'm trying to use a global object (declared at a upper level), but 
all I got is :
Call to a member function on a non-object in 
/home/pooly/public_html/templeet/modules/freedb.php on line 16

Hmm, perhaps your problem is the failed connection to your database. Can 
you verify this?

Best
Bao
part of the code is :
$freedb = new freedbaxs();
Function return_freedb_search($array)
{
global $freedb;
[snip]
$freedb-freedb_search($txt);

I don't see an error in this code, perhaps you should give us a bit 
more information.

grt,
Evert

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


Re: [PHP] Referer checking is able to be referer spoofed

2005-03-19 Thread Dan Rossi
On 20/03/2005, at 5:40 AM, Marek Kilimajer wrote:

If you need only hotlink protection then the current referer checking 
is just enough. Most users will not install referer spoofing software.

But if you need to be 100% sure the videos are streamed through 
affiliate server, you can use tokens - a script at the affiliate 
server will request a token from the streaming server (with 
username/password/clip id etc.). This token will be sent with the link 
to the streaming server. Hope this is clear.


Hmm its the exact setup with how the video filenames are generated in 
the player to prevent hotlinking. I guess I am on my own, my client has 
very paranoid customers as they have to pay for the bandwidth. Lets see 
how I go. But theoretically we must assume these people dont have php.

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


[PHP] Re: Setting cookies for other domains

2005-03-19 Thread Raj Shekhar
Scott Haneda [EMAIL PROTECTED] writes:

 Cross domain cookies are indeed possible, look at microsoft.com, msn.com and
 msnbc.com which indeed do share your cookies from one site to the next,
 however, they do it by redirects and get/post methods, which is perfectly
 legit since they control those domains.  No one outside someone with access
 to those servers could implement it.

I might be wrong on this analysis, but here is how I think the MSN
thing works

- When you go to hotmail.com, it redirects you to login.passport.com

- If you do not have your cookie (from the passport.com domain), which
  identifies you as a valid MSN network user, you are asked to sign
  in.  After successful sign on, your browser gets a passport cookie.

- The passport now redirects you to the hotmail.com and it passes your
  user information using the url.  I think it passes some sort of
  session id.  Since in the background, passport and hotmail share the
  same database, hotmail can check on a user's authentication based on
  the session id passed in the URL.  

- The same thing happens when you go to msnbc.com.  You are first
  redirected to passport.com and your passport.com's cookie is
  examined.

Thus, even though you think that msn, hotmail and msnbc are sharing
the same cookie, they are not.  It is the passport.com that is doing
the dirty work of setting and examining the cookie.

-- 
Raj Shekhar  Y!   : Operations Engineer
MySQL DBA, programmer and  slacker   Y!IM : lunatech3007
home : http://rajshekhar.net blog : http://rajshekhar.net/blog/

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



Re: [PHP] class and global

2005-03-19 Thread Mister Jack
there is no database connection involved here. if I displace the
$freedb = new freedbaxs();
inside the function it's works.

I should give a try with a dummy object. (but the constructor, only
initialize empty array)



On Sat, 19 Mar 2005 21:17:02 +0200, BAO RuiXian [EMAIL PROTECTED] wrote:
 
 
 Evert - Rooftop Solutions wrote:
 
  pooly wrote:
 
  I'm trying to use a global object (declared at a upper level), but
  all I got is :
  Call to a member function on a non-object in
  /home/pooly/public_html/templeet/modules/freedb.php on line 16
 
 Hmm, perhaps your problem is the failed connection to your database. Can
 you verify this?
 
 Best
 
 Bao
 
  part of the code is :
  $freedb = new freedbaxs();
  Function return_freedb_search($array)
  {
  global $freedb;
  [snip]
  $freedb-freedb_search($txt);
 
 
  I don't see an error in this code, perhaps you should give us a bit
  more information.
 
  grt,
  Evert
 
 
 
 --
 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



[PHP] Session IDs - How are they generated?

2005-03-19 Thread Yannick Warnier
Hi there,

I'm looking for a good document that describes session ID generation in
PHP 4.3.6. Does somebody have that at hand? 

I couldn't find anything googling it, and nothing in the PHP doc. I
would like to know what kind of parameters it uses during the
generation. And also how it is generated in the case of a script
executed in command line.

Thanks,

Yannick

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



Re: [PHP] Referer checking is able to be referer spoofed

2005-03-19 Thread dan rossi

Hmm its the exact setup with how the video filenames are generated in 
the player to prevent hotlinking. I guess I am on my own, my client 
has very paranoid customers as they have to pay for the bandwidth. 
Lets see how I go. But theoretically we must assume these people dont 
have php.


It looks like we may go with a tokenizer url system, but it means the 
customers will need php oh well.

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


Re: [PHP] Referer checking is able to be referer spoofed

2005-03-19 Thread Dotan Cohen
On Sun, 20 Mar 2005 09:38:29 +1100, dan rossi [EMAIL PROTECTED] wrote:
 
  Hmm its the exact setup with how the video filenames are generated in
  the player to prevent hotlinking. I guess I am on my own, my client
  has very paranoid customers as they have to pay for the bandwidth.
  Lets see how I go. But theoretically we must assume these people dont
  have php.
 
 It looks like we may go with a tokenizer url system, but it means the
 customers will need php oh well.
 

On the referring site have an image that is hosted on YOUR domain. Set
a cookie when the user's browser requests the image. Even a 1x1 gif in the
corner will do: you just need it to come from your domain. Then
validate against that cookie.

Dotan Cohen

http://Liriks-Song.com/
http://Song-Lirics.com/

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



Re: [PHP] Referer checking is able to be referer spoofed

2005-03-19 Thread Marek Kilimajer
Dotan Cohen wrote:
On Sun, 20 Mar 2005 09:38:29 +1100, dan rossi [EMAIL PROTECTED] wrote:
Hmm its the exact setup with how the video filenames are generated in
the player to prevent hotlinking. I guess I am on my own, my client
has very paranoid customers as they have to pay for the bandwidth.
Lets see how I go. But theoretically we must assume these people dont
have php.
It looks like we may go with a tokenizer url system, but it means the
customers will need php oh well.

On the referring site have an image that is hosted on YOUR domain. Set
a cookie when the user's browser requests the image. Even a 1x1 gif in the
corner will do: you just need it to come from your domain. Then
validate against that cookie.
The image can be hotlinked too ;)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] WORK WITH PHP FILES REMOTELY WITH NotePad ? YES/NO ?

2005-03-19 Thread Leonidas Savvides
WORK WITH PHP FILES REMOTELY WITH NotePad ? YES/NO ?
I want to know if when be online I CAN OPEN A FILE FROM A WEB LOCATION
HOST - MINE and after I modify it save it again to my hosting space
WITHOUT save it to my PC first using NotePad and I mean entering the
host usernamepassword when OPEN / SAVE ...? ATTENTION: I DO NOT MEAN
SAVE IT TO MY HDD FIRST AND AFTER UPLOAD IT !!! TELL ME THIS SAMELY FOR
Dreamweaver MX ?
[EMAIL PROTECTED]



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



Re: [PHP] Referer checking is able to be referer spoofed

2005-03-19 Thread Marek Kilimajer
dan rossi wrote:

Hmm its the exact setup with how the video filenames are generated in 
the player to prevent hotlinking. I guess I am on my own, my client 
has very paranoid customers as they have to pay for the bandwidth. 
Lets see how I go. But theoretically we must assume these people dont 
have php.


It looks like we may go with a tokenizer url system, but it means the 
customers will need php oh well.

Any server side language will do.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] WORK WITH PHP FILES REMOTELY WITH NotePad ? YES/NO ?

2005-03-19 Thread Mark Charette
Leonidas Savvides wrote:
 ATTENTION: I DO NOT MEAN
SAVE IT TO MY HDD FIRST AND AFTER UPLOAD IT !!! TELL ME THIS SAMELY FOR
Dreamweaver MX ?
Not in PHP. It's a client side trick (done with machine and/or OS 
specific code). Even Web-based Documentum (eRooms) uses a staging 
directory on the users HDD before invoking the correct program. Works 
well with custom COM objects on the PC side integrated with MSIE, barely 
and very error-prone with any other browser.

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


[suspicious - maybe spam] RE: [PHP] WORK WITH PHP FILES REMOTELY WITH NotePad / Dreamweaver MX ? YES/NO ?

2005-03-19 Thread Leonidas Savvides
WORK WITH PHP FILES REMOTELY WITH NotePad / Dreamweaver MX ? YES/NO ?
I want to know if when be online I CAN OPEN A PHP FILE FROM A WEB
LOCATION HOST - MINE and after I modify it save it again to my hosting
space WITHOUT save it to my PC first, using NotePad and I mean entering
the host usernamepassword when OPEN or SAVE ...? ATTENTION: I DO NOT
MEAN SAVE IT TO MY HDD FIRST AND AFTER UPLOAD IT !!! TELL ME THIS SAMELY
FOR Dreamweaver MX ?
[EMAIL PROTECTED] 

-Original Message-
From: Mark Charette [mailto:[EMAIL PROTECTED] 
Sent: 20 March 2005 01:29
To: Leonidas Savvides
Cc: php-general@lists.php.net
Subject: Re: [PHP] WORK WITH PHP FILES REMOTELY WITH NotePad ? YES/NO ?

Leonidas Savvides wrote:
  ATTENTION: I DO NOT MEAN
 SAVE IT TO MY HDD FIRST AND AFTER UPLOAD IT !!! TELL ME THIS SAMELY
FOR
 Dreamweaver MX ?

Not in PHP. It's a client side trick (done with machine and/or OS 
specific code). Even Web-based Documentum (eRooms) uses a staging 
directory on the users HDD before invoking the correct program. Works 
well with custom COM objects on the PC side integrated with MSIE, barely

and very error-prone with any other browser.

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



[PHP] Private Cache Headers in IE and Mozilla

2005-03-19 Thread Eli
Hi,
I want to cache a PHP page privately for a week.
What headers should I send to make it work both in Mozilla and IE?
I have set these headers, but those work only for IE:
?php
$max_age=604800;
header(Date: .gmdate(D, d M Y H:i:s,time()));
header(Cache-Control: private);
header(Cache-Control: max-age=$max_age,false);
header(Expires: .gmdate(D, d M Y H:i:s,time()+$max_age). GMT);
?
What are the correct headers?
-thanks, Eli
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] WORK WITH PHP FILES REMOTELY WITH NotePad ? YES/NO ?

2005-03-19 Thread Larry E . Ullman
WORK WITH PHP FILES REMOTELY WITH NotePad ? YES/NO ?
I want to know if when be online I CAN OPEN A FILE FROM A WEB LOCATION
HOST - MINE and after I modify it save it again to my hosting space
WITHOUT save it to my PC first using NotePad and I mean entering the
host usernamepassword when OPEN / SAVE ...? ATTENTION: I DO NOT MEAN
SAVE IT TO MY HDD FIRST AND AFTER UPLOAD IT !!! TELL ME THIS SAMELY FOR
Dreamweaver MX ?
First of all, you need to calm down, STOP YELLING, and be less 
aggressive in your emails. Remember that you're asking for free help 
from strangers here.

Second, what you are asking is a Notepad question, it actually has 
__nothing__ to do with PHP.

Third, Notepad is a very bare bones text editor and does not have 
features like the one you're looking for.

Fourth, a great way to see what an application can do is open it and 
look at the menus. Like File. Like FileOpen.

Fifth, yes, Notepad can open remote files if you can connect to the 
remote server from your computer. This is true of any application.

Sixth, can __you__ actually connect to your remote server from Windows 
so that you can open a networked file? Um, I'm guessing not.

Seventh, many FTP applications let you set an external text editor. 
This would let you connect to the server, edit a file in Notepad, and 
save it, without saving it to your hard drive first.

Eighth, many of these answers will be the same for Dreamweaver, 
although that's a much more sophisticated application. That being said, 
DW probably has the ability to open and edit remote files. You know 
what would be a good way to find out for certain? Check out a DW 
reference or open the application.

Ninth, there's is no number nine.
Tenth, again, this isn't really a PHP question.
Larry
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] WORK WITH PHP FILES REMOTELY WITH NotePad ? YES/NO ?

2005-03-19 Thread Rick Robinson
you can setup an ftp in my network places and use it just like a
folder on your computer from notepad


On Sat, 19 Mar 2005 20:55:49 -0500, Larry E. Ullman
[EMAIL PROTECTED] wrote:
  WORK WITH PHP FILES REMOTELY WITH NotePad ? YES/NO ?
  I want to know if when be online I CAN OPEN A FILE FROM A WEB LOCATION
  HOST - MINE and after I modify it save it again to my hosting space
  WITHOUT save it to my PC first using NotePad and I mean entering the
  host usernamepassword when OPEN / SAVE ...? ATTENTION: I DO NOT MEAN
  SAVE IT TO MY HDD FIRST AND AFTER UPLOAD IT !!! TELL ME THIS SAMELY FOR
  Dreamweaver MX ?
 
 First of all, you need to calm down, STOP YELLING, and be less
 aggressive in your emails. Remember that you're asking for free help
 from strangers here.
 
 Second, what you are asking is a Notepad question, it actually has
 __nothing__ to do with PHP.
 
 Third, Notepad is a very bare bones text editor and does not have
 features like the one you're looking for.
 
 Fourth, a great way to see what an application can do is open it and
 look at the menus. Like File. Like FileOpen.
 
 Fifth, yes, Notepad can open remote files if you can connect to the
 remote server from your computer. This is true of any application.
 
 Sixth, can __you__ actually connect to your remote server from Windows
 so that you can open a networked file? Um, I'm guessing not.
 
 Seventh, many FTP applications let you set an external text editor.
 This would let you connect to the server, edit a file in Notepad, and
 save it, without saving it to your hard drive first.
 
 Eighth, many of these answers will be the same for Dreamweaver,
 although that's a much more sophisticated application. That being said,
 DW probably has the ability to open and edit remote files. You know
 what would be a good way to find out for certain? Check out a DW
 reference or open the application.
 
 Ninth, there's is no number nine.
 
 Tenth, again, this isn't really a PHP question.
 
 Larry
 
 --
 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



Re: [PHP] Referer checking is able to be referer spoofed

2005-03-19 Thread dan rossi
On 20/03/2005, at 10:14 AM, Marek Kilimajer wrote:

The image can be hotlinked too ;)


Bit of a headfuck ey ? Hmm I think we are gonna go with a mixture of 
that and a token url.

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