php-general Digest 15 Mar 2004 08:48:16 -0000 Issue 2647

Topics (messages 180396 through 180415):

Re: Mail
        180396 by: Jason Davidson
        180397 by: Will

User denided function
        180398 by: nblanco

XML architecture question
        180399 by: Jabro
        180402 by: Ray Hunter

Re: Classes & Objects.
        180400 by: Marco Schuler

Re: Web based php  development tool
        180401 by: Marco Schuler

[Q] PHP code embedded in html files - What happens?
        180403 by: Michael T. Peterson
        180405 by: Jeffrey Lee
        180407 by: EastLothianDirectory
        180408 by: EastLothianDirectory
        180409 by: Steve Edberg

Re: Scripts creating files and folders into un/grp "Nobody" on Apache
        180404 by: Jay

Anyway to access a class variable without using a return function?
        180406 by: Terence
        180410 by: Tom Rogers

Behind the scenes coding?
        180411 by: Dustin Wish with INDCO Networks
        180412 by: Jason Wong
        180413 by: Ryan A
        180414 by: Dustin Wish with INDCO Networks

Re: servers in php
        180415 by: DvDmanDT

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 ---
Check the manual to be sure, but it appears that you have the arguments
for the mail function in the wrong order .

mail(to, subject, msg, headers) ... i beleive is the correct order.

Jason

"Will" <[EMAIL PROTECTED]> wrote:
> 
> Hello All,
> I am having a problem with sending a reply from a form.  It is giving me a
> 550 error: There is no valid sender in any header line.
> 
> My form is:
> <?
> include ("inc/setup.php");
> 
> // Mail reply to Orginial poster
> $recipient .= "[EMAIL PROTECTED], $_POST[email]\n";
> $mailheaders .= "To: $_POST[email]\n";
> $mailheaders .= "From: $_POST[email]\n";
> 
> $subject .= "$_POST[subject]";
> 
> $msg .= "Please do not reply to this email!!!\n\n";
> 
> $msg .= "Here is our answer:               \r$_POST[message]\n\n";
> 
> $msg .= "Please use your username/password that was assigned to you.\n\n";
> 
> mail($recipient, $mailheaders, $subject, $msg);
> 
> $add_reply = "INSERT into $table_name25 values ('', now(),
> '$_POST[subject]', '$_POST[name]',
> '$_POST[email]', '$_POST[message]')";
> mysql_query($add_reply,$conn) or die(mysql_error());
> 
> header("Location: support_archive.php");
> exit;
> ?>
> 
> And when I recieive the one email there are no from and reply to in the
> email client.  Plus it is in the subject line!!!  What the heck am I doing
> wrong???
> 
> Thanks in advance,
> ~WILL~
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
Thank you very much!!! That was it!!!!

~WILL~


-----Original Message-----
From: Jason Davidson [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 2:40 PM
To: Will
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Mail

Check the manual to be sure, but it appears that you have the arguments
for the mail function in the wrong order .

mail(to, subject, msg, headers) ... i beleive is the correct order.

Jason

"Will" <[EMAIL PROTECTED]> wrote:
> 
> Hello All,
> I am having a problem with sending a reply from a form.  It is giving
me a
> 550 error: There is no valid sender in any header line.
> 
> My form is:
> <?
> include ("inc/setup.php");
> 
> // Mail reply to Orginial poster
> $recipient .= "[EMAIL PROTECTED], $_POST[email]\n";
> $mailheaders .= "To: $_POST[email]\n";
> $mailheaders .= "From: $_POST[email]\n";
> 
> $subject .= "$_POST[subject]";
> 
> $msg .= "Please do not reply to this email!!!\n\n";
> 
> $msg .= "Here is our answer:               \r$_POST[message]\n\n";
> 
> $msg .= "Please use your username/password that was assigned to
you.\n\n";
> 
> mail($recipient, $mailheaders, $subject, $msg);
> 
> $add_reply = "INSERT into $table_name25 values ('', now(),
> '$_POST[subject]', '$_POST[name]',
> '$_POST[email]', '$_POST[message]')";
> mysql_query($add_reply,$conn) or die(mysql_error());
> 
> header("Location: support_archive.php");
> exit;
> ?>
> 
> And when I recieive the one email there are no from and reply to in
the
> email client.  Plus it is in the subject line!!!  What the heck am I
doing
> wrong???
> 
> Thanks in advance,
> ~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

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

Is it posible to use a user funcion in a Select statement? I need to return from a 
Database the sum of the less two of three columns. For example, if the data were 67, 
86,53 I must return, in a single field, the sum of 53+67. I'm using OBDC over a MS 
Access Database in PHP.

Thanks in advance,
Nacor

--- End Message ---
--- Begin Message ---
Hi List,
hope somebody here can help me out here. For a new page I'm designing I see
one problem coming up.
As I need to generate varius outputs such as HTML or PDF I think going over
XML isn't a bad idea.
I create one XSL for my output and change the XML for Customer A or B behind
it.
Now how do I make sure customer A doesn't see customer B's XML file? I could
generate the XML for
every time I need it or store it as a blob are some of the ideass that came
in my mind.
Has anybody an idea on how to solve this? Are solutions for this available?
Customer A + B have to identify thru an authentication mechanism with PHP of
course.

thx
Jabro

--- End Message ---
--- Begin Message ---
On Sun, 2004-03-14 at 13:17, Jabro wrote:
> Hi List,
> hope somebody here can help me out here. For a new page I'm designing I see
> one problem coming up.
> As I need to generate varius outputs such as HTML or PDF I think going over
> XML isn't a bad idea.
> I create one XSL for my output and change the XML for Customer A or B behind
> it.
> Now how do I make sure customer A doesn't see customer B's XML file? I could
> generate the XML for
> every time I need it or store it as a blob are some of the ideass that came
> in my mind.
> Has anybody an idea on how to solve this? Are solutions for this available?
> Customer A + B have to identify thru an authentication mechanism with PHP of
> course.

if your authentication is designed correctly you should not have an
issues with cust. a seeing cust. b xml files. That is really irrelavent
as an xml architecture. 

What i would do is have separate xml and xsl(t) files for each customer
that would be used to create the desired output....now the beauty with
xml and xsl(t) is that you can use inheritance as well. I would have a
global xml and/or xsl(t) files that contains generic or global
requirments. Then the customer xml files can inherite from the global
ones. This has helped me with major xml projects. Use schema to do the
validation since that support inheritance as well. You can create the
xml files on the fly or store them in a database or filesystem. I have
used oracle xml datatypes with great success.  Oracle has many great
built-in features for xml that are fantastic.

There are some php classes that probably have been created for dealing
with xml to get you started.

--
Ray

--- End Message ---
--- Begin Message ---
Hi

Am So, 2004-03-14 um 03.55 schrieb Elliot J. Balanza:
> Anybody knows a good on line tutorial for objects & classes on PHP.

Sure! Google is your friend or
http://www.phppatterns.com/index.php/link/category/1/ for example.

-- 
Regards
 Marco

--- End Message ---
--- Begin Message ---
Hi

Am So, 2004-03-14 um 00.34 schrieb Joseph Ross Lee:
> Anybody here who could recommend a web based php dev tool for editing php
> sources online? Thanks! I'm having a hard time finding a nice one. Thanks in
> advance guys!

I have seen such a tool some time ago. Just don't remember its name.
Maybe http://www.php-editors.com/ can offer some help.

-- 
Regards
 Marco

--- End Message ---
--- Begin Message ---
When the following file, tmp.htm, is executed no output is produced.

<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
 echo '<p>hello world</p>';
?>
</body>
</html>

However, when the name of the file is changed to tmp.php the expected
output, 'hello world', is obtained.  Is this the correct behavior?  More
specifically, is the php script not executed?

Cheers,

Michael

--- End Message ---
--- Begin Message ---
Hi Michael,

In my understanding, web server will involve php interpreter when the file
extension is specify.  Say, if a web server is configured to involve php
interpreter when the extension is php, then when the request file is php,
the php file's content will be interpreted.  So, I think your web server is
configured like this.  I believe it's normal behaviour in your case.
Please correct me if I've made anything wrong, thanks.

Cheers,
Jeffrey

"Michael T. Peterson" <[EMAIL PROTECTED]> ¦b¶l¥ó
news:[EMAIL PROTECTED] ¤¤¼¶¼g...
> When the following file, tmp.htm, is executed no output is produced.
>
> <html>
> <head>
> <title>Test</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
> <body>
> <?php
>  echo '<p>hello world</p>';
> ?>
> </body>
> </html>
>
> However, when the name of the file is changed to tmp.php the expected
> output, 'hello world', is obtained.  Is this the correct behavior?  More
> specifically, is the php script not executed?
>
> Cheers,
>
> Michael

--- End Message ---
--- Begin Message ---
Try naming your file temp.php instead of temp.html
----------
START CODE
----------

<?
$message = "Hello World";
?>
<html>
<body>
<? echo "$message"; ?>
</body>
<html>

--------
END CODE
---------

Regards,
Chris
---------------

 

--- End Message ---
--- Begin Message ---
I missed out the 'slash' at the </html>



---- Original Message ----
From:           EastLothianDirectory
Date:           Mon 3/15/04 2:35
To:             [EMAIL PROTECTED]
Subject:        Re: [PHP] Re: [Q] PHP code embedded in html files - What happens?

Try naming your file temp.php instead of temp.html
----------
START CODE
----------

<?
$message = "Hello World";
?>
<html>
<body>
<? echo "$message"; ?>
</body>
<html>

--------
END CODE
---------

Regards,
Chris
---------------

 

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

--- End Message ---
--- Begin Message --- At 6:01 PM -0800 3/14/04, Michael T. Peterson wrote:
When the following file, tmp.htm, is executed no output is produced.

<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
 echo '<p>hello world</p>';
?>
</body>
</html>

However, when the name of the file is changed to tmp.php the expected
output, 'hello world', is obtained.  Is this the correct behavior?  More
specifically, is the php script not executed?

Cheers,


That is the conventional behavior, yes. If you want PHP to be invoked on files with an .html extension, you can (assuming you use Apache) change the line in httpd.conf that looks like this

AddType application/x-httpd-php3 .php

to this

AddType application/x-httpd-php3 .php .html


See


http://www.php.net/manual/en/install.apache.php

for more info.

steve

--
+--------------- my people are the people of the dessert, ---------------+
| Steve Edberg                                      [EMAIL PROTECTED] |
| University of California, Davis                          (530)754-9127 |
| Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
+---------------- said t e lawrence, picking up his fork ----------------+

--- End Message ---
--- Begin Message ---
thanks... i've passed these suggestions on to my host... it seems to have
partially convinced them that the problem is not my scripts but possibly
instead the installation's fault / cPanel's fault.

well it's progress at least :P

"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello Jay,
>
> Thursday, March 11, 2004, 8:04:36 AM, you wrote:
>
> J> sorry but i'm trying to avoid putting my ftp login in password directly
into
> J> my script. i should have mentioned that earlier.
>
> Unless you have the ability on the server to change the usergroup
> Apache runs under, the only way I've found around this is to use a CGI
> compiled version of PHP (instead of an Apache Module) specifically for
> when uploading and run the CGI version as my user:group. Also if you
> host with Pair Networks they offer a PHPWRAP function which,
> effectively, does this for you.
>
> -- 
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html

--- End Message ---
--- Begin Message ---
Hi List,

I have a class with a constructor that sets the variables and I currently
use functions to return each one. When using alot of variables in the
constructor i tend to have many return functions. Is there a way to access
the constructor variables without using a return function?

This is how I do it:

class MyClass {
    function MyClass {
        $this->var1="1";
        $this->var2="2";
    }
    function GetVar1() {
        return $this->var1;
    }
    function GetVar2() {
        return $this->var2;
    }
}

Thanks

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

Monday, March 8, 2004, 3:42:30 PM, you wrote:
T> Hi List,

T> I have a class with a constructor that sets the variables and I currently
T> use functions to return each one. When using alot of variables in the
T> constructor i tend to have many return functions. Is there a way to access
T> the constructor variables without using a return function?

T> This is how I do it:

T> class MyClass {
T>     function MyClass {
T>         $this->var1="1";
T>         $this->var2="2";
T>     }
T>     function GetVar1() {
T>         return $this->var1;
T>     }
T>     function GetVar2() {
T>         return $this->var2;
T>     }
T> }

T> Thanks


Should be something like this:

class MyClass {
    var $var1;
    vat $var2;
    function MyClass {
        $this->var1="1";
        $this->var2="2";
    }
    function GetVar1() {
        return $this->var1;
    }
    function GetVar2() {
        return $this->var2;
    }
}
$test = new MyClass();

echo $test->var1.'<br>';
echo $test->var2.'<br>';

This is not recommended by OOP buffs but it is perfectly legal.
-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
I have been looking everywhere for any tips or tutorials on posting to
separate websites and parsing the return values for input into a mysql db.
I understand parsing html pages, but not how to post to a form on a
different site and once the values are returned parse and redirect. I have
read alittle about using CURL to perform some of this, but no real help
there. 

I need to post to a login script, then once the page is processed, I will
parsed the returned page for the data. any help please?

--- End Message ---
--- Begin Message ---
You have started a new thread by taking an existing posting and replying to
it while you changed the subject.

That is bad, because it breaks threading. Whenever you reply to a message,
your mail client generates a "References:" header that tells all recipients
which posting(s) your posting refers to. A mail client uses this information
to build a threaded view ("tree view") of the postings.

With your posting style you successfully torpedoed this useful feature; your
posting shows up within an existing thread it has nothing to do with.

Always do a fresh post when you want to start a new thread. To achieve this,
click on "New message" instead of "Reply" within your mail client, and enter
the list address as the recipient. You can save the list address in your
address book for convenience.

On Monday 15 March 2004 11:23, Dustin Wish with INDCO Networks wrote:
> I have been looking everywhere for any tips or tutorials on posting to
> separate websites and parsing the return values for input into a mysql db.

[snip]

--- End Message ---
--- Begin Message ---
Hehehe, this is pretty good, 3rd or 4th time I have read this exact email.
I'm guessing Jason has this saved and waits for someone to do this then
copies and pastes!
Cheers,
-Ryan

> You have started a new thread by taking an existing posting and replying
> to
> it while you changed the subject.
>
> That is bad, because it breaks threading. Whenever you reply to a message,
>
> your mail client generates a "References:" header that tells all
> recipients
> which posting(s) your posting refers to. A mail client uses this
> information
> to build a threaded view ("tree view") of the postings.
>
> With your posting style you successfully torpedoed this useful feature;
> your
> posting shows up within an existing thread it has nothing to do with.
>
> Always do a fresh post when you want to start a new thread. To achieve
> this,
> click on "New message" instead of "Reply" within your mail client, and
> enter
> the list address as the recipient. You can save the list address in your
> address book for convenience.
>
> On Monday 15 March 2004 11:23, Dustin Wish with INDCO Networks wrote:
> > I have been looking everywhere for any tips or tutorials on posting to
> > separate websites and parsing the return values for input into a mysql
> db.
>
> [snip]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
 

I have been looking everywhere for any tips or tutorials on posting to
separate websites and parsing the return values for input into a mysql db.

I understand parsing html pages, but not how to post to a form on a
different site and once the values are returned parse and redirect. I have
read alittle about using CURL to perform some of this, but no real help
there. 

 

I need to post to a login script, then once the page is processed, I will
parsed the returned page for the data. any help please?

 

 


--- End Message ---
--- Begin Message ---
.. You have never used PHP on win32, have you?

-- 
// DvDmanDT
MSN: dvdmandt?hotmail.com
Mail: dvdmandt?telia.com
"Norbert Pfeiffer" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Hi Comex,
>
> forget Win-PHP, it only scarcely to 60% of the
> functions are supported. Everything which with
> Sockets, Pipes or the like to do has, became
> omitted.
>
>
> m. b. G. Norbert
> _____________________
> normal:  02686-987103
> Notruf:  0177-2363368
> ---------------------
> e.o.m.

--- End Message ---

Reply via email to