php-general Digest 29 Oct 2001 12:06:36 -0000 Issue 963

Topics (messages 72659 through 72706):

SSI
        72659 by: Gary
        72665 by: Christian Dechery
        72666 by: Gary

Re: Breaking a string
        72660 by: speedboy

Re: php-mysql question
        72661 by: David Robley

Re: sending email to php script
        72662 by: David Robley

Re: SMTP
        72663 by: David Robley
        72664 by: Lucas Chan

How to determine a valid Date
        72667 by: Carlos Fernando Scheidecker Antunes
        72676 by: Julio Nobrega
        72677 by: David Robley

feature sugestion
        72668 by: Ray Todd Stevens
        72673 by: Kurt Lieber

Problem appending data in a file with fopen("ftp://...","a";)
        72669 by: Dave Létourneau
        72671 by: Kurt Lieber
        72674 by: Dave Létourneau
        72678 by: David Robley
        72679 by: Kurt Lieber

now I can compile
        72670 by: Ray Todd Stevens

Attention Die-Hard SEC Fans!
        72672 by: cdubbayou.hotmail.com

Re: phpmyadmin is installed, now how to access it?
        72675 by: Chip

MySQL command log
        72680 by: Richard Baskett
        72681 by: David Robley

Array's
        72682 by: De Necker Henri
        72683 by: _lallous

Re: php.ini executable
        72684 by: _lallous
        72705 by: Phil Driscoll

Re: Random
        72685 by: _lallous

mySQL table update
        72686 by: Niklas Lampén

Re: Array
        72687 by: De Necker Henri
        72688 by: _lallous

POSTing values to file
        72689 by: Michiel van Heusden
        72690 by: _lallous

Problems sending mails with PHP
        72691 by: Bruno
        72693 by: CC Zona

Problem with From: and Reply to:
        72692 by: Per Hugosson
        72694 by: CC Zona
        72703 by: Richard Heyes

Parse Error
        72695 by: Alberto
        72696 by: Alexander Weber
        72697 by: james.fairbairn.bt.com
        72698 by: james.fairbairn.bt.com
        72699 by: Valentin V. Petruchek

Re: [PHP-DB] mySQL table update
        72700 by: DL Neil

PHP changing my JavaScript??
        72701 by: Moloko
        72704 by: _lallous

Function not found
        72702 by: De Necker Henri

Re: Delivering NAMED pdf files
        72706 by: George Pitcher

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]


----------------------------------------------------------------------


How do you get a SSI to work on a php page?

TIA
Gary





At 19:04 28/10/01 -0500, Gary wrote:
>How do you get a SSI to work on a php page?

you don't need SSI if you're running PHP... just use include()...

_____________________________
. Christian Dechery
. . Gaita-L Owner / Web Developer
. . http://www.webstyle.com.br
. . http://www.tanamesa.com.br





Yes I do, it is to run a pre-exiting program. I figured it out. I was 
uing double quotes in the ssi and excaping them when echoing. I should 
of been using single quotes.

Thanks
Gary

Christian Dechery wrote:

> At 19:04 28/10/01 -0500, Gary wrote:
> 
>> How do you get a SSI to work on a php page?
> 
> 
> you don't need SSI if you're running PHP... just use include()...
> 
> _____________________________
> . Christian Dechery
> . . Gaita-L Owner / Web Developer
> . . http://www.webstyle.com.br
> . . http://www.tanamesa.com.br
> 





> I was looking to take a string like Dan or Dan is great and return it
> like
>
> D
> a
> n...

http://www.php.net/manual/en/function.wordwrap.php





On Fri, 26 Oct 2001 23:27, Gerard Onorato wrote:
> Hello,
>
> I am a recent return to the list. Wow has the traffic grown! This is
> awesome.
>
> I have a couple of questions and one may be a RTFM but I can't find the
> answer.
>
> #1) While I thought I was extremely familiar with the MYSQL functions
> available in PHP I found on e in a code snippet that I have not used
> before and can't find. It is simply MYSQL(dbname, querystring). On a
> *nix box with Apache it is returning a resource ID but on a w2k box
> with apache (or iss) it is returning nothing at all. It does execute
> the query however. Any ideas or any pointer as to where I can actually
> find this function would be appreciated! Thanks.

An older version of the docs here shows that mysql is available for 
downwards compatibility, from mysql_db_query, which is deprecated since 
4.06. Changing to mysql_query is recommended.

> #2) Does anyone know of a convention / conference which will have any
> PHP coverage in the North East?

Northeast of where :-)

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   "I tripped over the lamp plug," Tom said cordially.




On Sat, 27 Oct 2001 03:23, JSheble wrote:
> A while ago an email came through here about how to parse out email
> message from a php script.  The thing that was mostly of interest to me
> is the ability to send an email to a php script, I guess through a
> sendmail alias?  I asked how to accomplish this, and never saw an
> answer come through.  So I'd like to ask again :o)
>
> Does anybody know what would be required or necessary to send an email
> to an address that would run a php script?

You say sendmail, so do it thusly:

Edit /etc/aliases and add a line like

phpmail: "| /pathto/your/php/script"

and run newaliases to update your alias database.

You'll also need to compile php as a standalone, and put as the first 
line of your php script

#!/path/to/php -q

Cheers
-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   He's dead, Jim. Get his ears! - Spock




On Sat, 27 Oct 2001 18:51, Lucas Chan wrote:
> Hi,
>
> I have PHP running on my Debian (unstable distribution) box.  I'm
> trying to generate an email via the mail() function.
>
> It keeps failing because I do not have a properly installed/configured
> SMTP daemon on my machine.  This is despite the fact that I have
> modified the SMTP variable in the php.ini file to point to my ISP's
> SMTP server.
>
> Has anyone else experienced this problem before?
>
> Regards,
>
> [ lucas ]

The *nix version of php expects to find a functional mail transport agent 
on the local host; the SMTP setting in the ini file is (or should be) 
clearly marked as Windows only.

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   "I don't know any shanties," said Tom unceasingly.




> The *nix version of php expects to find a functional mail transport agent
> on the local host

Hrm.

Yeah.  I think that's kind've umm, I dunno.... silly.

Regards,

[ lucas ]






Hello all,

Is there any built-in function to determine a valid date?

If there's not I will have to translate one that I've wrote with DrScheme to PHP.

I just want to save time :)

thanks again,

Carlos Fernando.


Linux User #207984





checkdate();

http://www.php.net/manual/en/function.checkdate.php

--


  Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

"Carlos Fernando Scheidecker Antunes" <[EMAIL PROTECTED]> wrote in
message 009e01c16013$d2627ec0$0a505ad1@Nando4">news:009e01c16013$d2627ec0$0a505ad1@Nando4...
Hello all,

Is there any built-in function to determine a valid date?

If there's not I will have to translate one that I've wrote with DrScheme to
PHP.

I just want to save time :)

thanks again,

Carlos Fernando.


Linux User #207984








On Mon, 29 Oct 2001 11:21, Carlos Fernando Scheidecker Antunes wrote:
> Hello all,
>
> Is there any built-in function to determine a valid date?
>
> If there's not I will have to translate one that I've wrote with
> DrScheme to PHP.
>
> I just want to save time :)

Quicker to ask online than look in the manual, is it?

http://www.php.net/manual/en/function.checkdate.php



-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   Oxymoron: Unusual Routine.




A lot of visually based editors support embeded java scripts.  This 
can easily be used to make the system support php with one 
problem.  Most of these system use the concept that these scripts 
ignore html comments to help them ignore the code.  How about 
making the php engine ignore these to.  That is any string like <!-- 
or //--> is treated as white space.
--------------------------------------------------------------------
Ray Todd Stevens     Specialists in Network and Security 
Consulting
Senior Consultant    Software audit service available
Stevens Services
Suite 21
3754 Old State Rd 37 N
Bedford, IN 47421
(812) 279-9394
[EMAIL PROTECTED]

Thought for the day:
    Communist (n): one who has given up all hope
    of becoming a Capitalist.


For PGP public key send message with subject 
please send PGP key

If this message refers to an attachment the attachment
may arrive as a seperate mail message depending on the
type of mail client and gateway software you are using.





On Sunday 28 October 2001 06:10 pm, Ray Todd Stevens wrote:
> How about
> making the php engine ignore these to.  That is any string like <!--
> or //--> is treated as white space.

Um...maybe I don't understand your statement but php already has commenting 
built in.  Anything between /* and */ is ignored by the scripting engine.  
(just like <!-- and --> in HTML)

--kurt




I am able to create the file when it is not already there but I got a "file
exists" error when I try to fopen it in append mode the second time.  I
wrote this to store a log of the traffic on my site (userid in a
cookie+timestamp) in a file.  Don't know if i'm using the good technique but
it's very frustrating.  I tried with 2 different FTP servers where I have
all the necessary rights.

Is it possible to solve this problem or it's a feature in PHP?

Dave Létourneau
[EMAIL PROTECTED]






On Sunday 28 October 2001 06:41 pm, you wrote:
> Is it possible to solve this problem or it's a feature in PHP?

If I understand your problem, you are trying to open the same file twice.  
I'm not sure why you would want to do that, but assuming you have a good 
reason, you need to make sure you fclose($filename) before you try to 
fopen($filename) again.  Otherwise, PHP maintains the file open for reading 
(and writing, if that's how you opened it.)

hth

--kurt 




I only fopen my file once...

My program checks if there is a specific session cookie.  If not (it's a new
user that browse the site) I set a cookie and try to store the unique ID of
this user (other cookie) in a file with a timestamp to track which user came
and when (+ nb of times...).  That's where I use my fopen() then I fclose
the file.  The fopen("...", "a") creates the file if it's not already there
but once it's created, it cannot append a new line (User;timestamp) to this
file : "Error : File exists".

:((


"Kurt Lieber" <[EMAIL PROTECTED]> a écrit dans le message news:
[EMAIL PROTECTED]
> On Sunday 28 October 2001 06:41 pm, you wrote:
> > Is it possible to solve this problem or it's a feature in PHP?
>
> If I understand your problem, you are trying to open the same file twice.
> I'm not sure why you would want to do that, but assuming you have a good
> reason, you need to make sure you fclose($filename) before you try to
> fopen($filename) again.  Otherwise, PHP maintains the file open for
reading
> (and writing, if that's how you opened it.)
>
> hth
>
> --kurt






On Mon, 29 Oct 2001 13:59, Dave Létourneau wrote:
> I only fopen my file once...
>
> My program checks if there is a specific session cookie.  If not (it's
> a new user that browse the site) I set a cookie and try to store the
> unique ID of this user (other cookie) in a file with a timestamp to
> track which user came and when (+ nb of times...).  That's where I use
> my fopen() then I fclose the file.  The fopen("...", "a") creates the
> file if it's not already there but once it's created, it cannot append
> a new line (User;timestamp) to this file : "Error : File exists".
>
> :((
>
> "Kurt Lieber" <[EMAIL PROTECTED]> a écrit dans le message news:
> [EMAIL PROTECTED]
>
> > On Sunday 28 October 2001 06:41 pm, you wrote:
> > > Is it possible to solve this problem or it's a feature in PHP?
> >
> > If I understand your problem, you are trying to open the same file
> > twice. I'm not sure why you would want to do that, but assuming you
> > have a good reason, you need to make sure you fclose($filename)
> > before you try to fopen($filename) again.  Otherwise, PHP maintains
> > the file open for
>
> reading
>
> > (and writing, if that's how you opened it.)
> >
> > hth
> >
> > --kurt

This may be a 'feature' of your ftp target. There may be limitations on 
what you can do via ftp including overwrite existing files. If you have 
control of the box, or admin access, check /etc/ftpaccess if it is a *nix 
OS. About BillOS, I have no idea.

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   Life is Roff when yer Stewpid




On Sunday 28 October 2001 07:29 pm, you wrote:
> I only fopen my file once...
>
> My program checks if there is a specific session cookie.  If not (it's a
> new user that browse the site) I set a cookie and try to store the unique
> ID of this user (other cookie) in a file with a timestamp to track which
> user came and when (+ nb of times...).  That's where I use my fopen() then
> I fclose the file.  The fopen("...", "a") creates the file if it's not
> already there but once it's created, it cannot append a new line
> (User;timestamp) to this file : "Error : File exists".

Aha -- I understand.  I also didn't see the first time that you're using FTP. 
 You can't fopen() a file for read/write through FTP.  You can do one, or the 
other, but not both.  

http://www.php.net/manual/en/function.fopen.php




I asked for help because I could not compile php 4.  I now have this 
working thanks to several nifty helpers.  Thr problem was that in the 
src directory there is a directory for each version of linux, and then 
a symlink called linux to the version that is currently running.  This 
symlink had not been added some how or rather.  Got the proper 
link and everything is going great guns.

Thanks to all.
--------------------------------------------------------------------
Ray Todd Stevens     Specialists in Network and Security 
Consulting
Senior Consultant    Software audit service available
Stevens Services
Suite 21
3754 Old State Rd 37 N
Bedford, IN 47421
(812) 279-9394
[EMAIL PROTECTED]

Thought for the day:
    Advertising (n): the science of arresting the human
    intelligence for long enough to get money from it.
           -- Stephen Leacock.


For PGP public key send message with subject 
please send PGP key

If this message refers to an attachment the attachment
may arrive as a seperate mail message depending on the
type of mail client and gateway software you are using.





Dear [EMAIL PROTECTED],

Are You A Crazed SEC Football or Sports Fan?

If you are, then go to: http://www.sectraditions.com to find out 
about the most comprehensive books on SEC sports ever written.

"A Tailgater's Guide To SEC Football"
and "SEC Baseball History & Tradition"

by sports writer Chris Warner

Forthcoming by November, 2001, "SEC Basketball History & Tradition,"
that has an afterword with Dale Brown

Visit http://www.sectraditions.com for more info.

THESE BOOKS MAKE GREAT GIFTS FOR ANY OCCASION!

Books can also be found in Barnes & Nobles, Books-A-Million & Amazon.com.




On Sunday 28 October 2001 15:52, Moody wrote:
> > I see all the files are name php3 rather than php. When I access the
> > index.php3 of course it my browser doesn't know what to do so it asks if
> > I want to download it.
>
> Sounds like you need to add ".php3" to your AddType directive in the
> httpd.conf file
> i.e.the line in httpd.conf that says:
>
> AddType application/x-httpd-php .php
>
> Should be changed to:
>
> AddType application/x-httpd-php .php .php3
>
> This should solve the problem with .php3 scripts not executing on your
> server :-)
>  Otherwise, if you want/have to change all the extensions to .php, you'll
> have to change all the requires and includes in the phpMyAdmin scripts to
> reflect these changes.

Interesting that it only worked after adding .php3 to the existing .php line. 
Earlier I had uncommented the lines just above that one which is almost 
identical except it is for .php3, but that didn't do the trick.

Thanks for the help,
--
Chip W.




I've done it before, but I cant remember how to view the commands that have
been sent to MySQL.  I normally try not to ask MySQL questions here even
though it's pretty much a standard with PHP :)  But I have exhausted myself
in researching the problem and I hope one of you might have the answer.  A
friend had his server hacked and they thought it would be funny to change
the username and password to the mysql table in mysql plus a couple other
tables....  We're hunting now ;)

Thanks ahead of time!

Rick





On Mon, 29 Oct 2001 14:59, Richard Baskett wrote:
> I've done it before, but I cant remember how to view the commands that
> have been sent to MySQL.  I normally try not to ask MySQL questions
> here even though it's pretty much a standard with PHP :)  But I have
> exhausted myself in researching the problem and I hope one of you might
> have the answer.  A friend had his server hacked and they thought it
> would be funny to change the username and password to the mysql table
> in mysql plus a couple other tables....  We're hunting now ;)
>
> Thanks ahead of time!
>
> Rick

If you have logging enabled for mysql, check that log. It might be in 
your mysql/data directory. Also check ~/.mysql_history for caommands ent 
via the mysql command line monitor.

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   "Now I can chop down that tree," said Tom with a heavy accent.




Please help!

Im have been trying to get a multi-dimentional array for so time now and
dont seems to get a right!

I have the following :

while($row=db_range()){
      list($co_id,$surname,$init,$ba) = $row;

      $acid[$i] = array("$a"=>array("$co_id"),
                        "$b"=>array("$surname,$init"),  // does it work like
this ???
                        "$c"=>array("$ba")) ;

      $i++;
    }//end while 1

I have 4 fields that i want to to put in an array and about 3000 records.
How can i list the fields in an array and retrive the values out of the
array

PLS help!






>                         "$b"=>array("$surname,$init"),  // does it work
like
it does work like that, but you're creating an array of one item which is a
string holding to values comma seperated.
you can do this too:
>                         "$b"=>array($surname,$init),  // does it work like
w/o the quotes.
and also no need to put quotes around the $b or $a.
and when you're storing one element no need to put it in an array like you
did for this:
> = array("$a"=>array("$co_id"),
do directly:
array($a => $co_id, ...

> I have 4 fields that i want to to put in an array and about 3000 records.
> How can i list the fields in an array and retrive the values out of the
> array

$values = array();
$i =0;
while (getting the rows)
{
  list($id, $surname, $ba) = $row;
  $values[$i]['surname'] = $surname;
  $values[$i]['id'] = $id;
  $values[$i]['ba'] = $ba;
  $i++;
}

retrieve any element as:
$values[INDEX HERE]['surname'] for example.


"De Necker Henri" <[EMAIL PROTECTED]> wrote in message
3A8ED7A62794D311AA7700508B6164EC08DCA35E@SCPTS01">news:3A8ED7A62794D311AA7700508B6164EC08DCA35E@SCPTS01...
> Please help!
>
> Im have been trying to get a multi-dimentional array for so time now and
> dont seems to get a right!
>
> I have the following :
>
> while($row=db_range()){
>       list($co_id,$surname,$init,$ba) = $row;
>
>       $acid[$i] = array("$a"=>array("$co_id"),
>                         "$b"=>array("$surname,$init"),  // does it work
like
> this ???
>                         "$c"=>array("$ba")) ;
>
>       $i++;
>     }//end while 1
>
> I have 4 fields that i want to to put in an array and about 3000 records.
> How can i list the fields in an array and retrive the values out of the
> array
>
> PLS help!
>
>






go for it...even if someone did a visual tool for that.

my question goes, has anyone made a *nix program to configure php.ini ? ;)
before i ....

"Jtjohnston" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Has anyone made a Windows executable to configure the php.ini? ... just
> asking, before I find myself doing it myself.
>
>






On Sunday 28 October 2001 11:05 pm, jtjohnston wrote:
> Has anyone made a Windows executable to configure the php.ini? ... just
> asking, before I find myself doing it myself.

The windows installer version of the php distribution configures php.ini, but 
only deals with the bare minimum settings to get the software working.
-- 
Phil Driscoll




$ceiling is too big.

try to do this and see:
echo getrandmax();
you might get 32767 as an output!

therefore, $ceiling must be <= getrandmax();

try to scale down your floor and ceiling,
ie:
$max = $ceiling - $floor;
$random = rand(0, $max) + $floor;

"Andrew Duck" <[EMAIL PROTECTED]> wrote in message
005f01c15ea6$30375800$0100007f@localhost">news:005f01c15ea6$30375800$0100007f@localhost...
#Create Random number
  $floor = 100000;
  $ceiling = 999999;
  srand((double)microtime()*1000000);
  $random = rand($floor, $ceiling);

Warning: rand(): Invalid range: 100000..999999 in c:\my
documents\ezone\testing\signup2.php on line 49

Can someone please tell me where i went wonr gin this coding.

Thanks







I have a large table with quite many dates in format dd.mm.yyyy (don't
ask why :) and I want to convert them into yyyy-mm-dd for obvious
reasons. How can I do this the smartest way? I know I could do it with
php and update it row by row but that doesn't seem too smart. Can I
somehow do a copy from table to table at the same time?
 
Like:
 
Table 1:
Name = John Doe
Date1 = 01.01.2001
Date2 = 02.02.2001
 
Table 2:
Name = NULL
Date1 = 0000-00-00
Date2 = 0000-00-00
 
And now I want to set Table 2 to this:
 
Name = John Doe
Date1 = 2001-01-01 // Value from Table 1
Date2 = 2001-02-02 // Value from Table 1
 
 
At least tell me what to look for in the manual. :)
 
Niklas




Now i did the following :
My output is only null or blank values!,but my data is there!

 while($row=db_range()){
      list($co_id,$surname,$init,$ba) = $row;
      echo "$co_id $surname<br>";  # This works perfect!
      $values[$i]['id'] = $co_id;
      $values[$i]['surname'] = $surname;
      $values[$i]['init'] = $init;
      $values[$i]['ba'] = $ba;
      $cid = $values[$i]['id'];
      echo "$id<br>"  ;           # Doesnt wanna work
      list($a,$b,$c,$d) = $values[$i];
      echo "$a" ;                 # Doesnt wanna work
      $i++;     
    }//end while 1




>       $values[$i]['id'] = $co_id;
you didn't initialize the $i did you?
should put $i =0; before the while loop.

>       echo "$id<br>"  ;           # Doesnt wanna work
what is $id ? i don't see it defined in your code, i see $cid instead.

>       list($a,$b,$c,$d) = $values[$i];
sure won't work, try:
       list($a,$b,$c,$d) = each($values[$i]);


"De Necker Henri" <[EMAIL PROTECTED]> wrote in message
3A8ED7A62794D311AA7700508B6164EC08DCA35F@SCPTS01">news:3A8ED7A62794D311AA7700508B6164EC08DCA35F@SCPTS01...
> Now i did the following :
> My output is only null or blank values!,but my data is there!
>
>  while($row=db_range()){
>       list($co_id,$surname,$init,$ba) = $row;
>       echo "$co_id $surname<br>";  # This works perfect!
>       $values[$i]['id'] = $co_id;
>       $values[$i]['surname'] = $surname;
>       $values[$i]['init'] = $init;
>       $values[$i]['ba'] = $ba;
>       $cid = $values[$i]['id'];
>       echo "$id<br>"  ;           # Doesnt wanna work
>       list($a,$b,$c,$d) = $values[$i];
>       echo "$a" ;                 # Doesnt wanna work
>       $i++;
>     }//end while 1






anybody help me please...

how can I open a file from php (something like require, but without closing
the php-file)
and then send some string to that file with POST
is thispossible?/?






see http://www.php.net/fopen

"Michiel Van Heusden" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> anybody help me please...
>
> how can I open a file from php (something like require, but without
closing
> the php-file)
> and then send some string to that file with POST
> is thispossible?/?
>
>






Yesterday everything was working fine, but today I got to my office and my
PHP couldn't send mails anymore. I get the next message in the apache log :

sh: sendmail -t -i: command not found

I've tried to change the php.ini mail section to point to the exact sendmail
path, but I get the same message.

Does anyone know what this problem is about?

Thank you!

Bruno






In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Bruno) wrote:

> Yesterday everything was working fine, but today I got to my office and my
> PHP couldn't send mails anymore. I get the next message in the apache log :
> 
> sh: sendmail -t -i: command not found
> 
> I've tried to change the php.ini mail section to point to the exact sendmail
> path, but I get the same message.

You did restart the server after making the changes to php.ini, right? 

>From <http://php.net/configuration>: "The configuration file (called 
php3.ini in PHP 3.0, and simply php.ini as of PHP 4.0) is read when PHP 
starts up. For the server module versions of PHP, this happens only once 
when the web server is started."

-- 
CC




Hi,

I´m using php to send form data from our web page. When a visitor
fills in the form he adds his email address, but I cant get it to
show up in the "From:"-line. Instead I get "From: Apache..." which is
totally wrong of course. Our auto-reply goes to
[EMAIL PROTECTED] instead of to the senders adress. What do I
do wrong?

This is my script:

><?php
>mail("[EMAIL PROTECTED]", "Press Picture Download",
>"From: $emailadress\n
>X-Originating-IP: [$REMOTE_ADDR]\n
>Content-Type: text/plain; charset=iso-8859-1\n
>Reply-To: $emailadress\n\n Name: $name\n Company: $company\n Adress:
>$adress\n Email: $emailadress\n Business: $business\n Send info:
>$noinfo\n Comments: $comments");
>?>

and this is what I get:

>Date: Wed, 24 Oct 2001 14:14:57 +0200
>From: Apache <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Press Picture Download
>
>  Name: Bla bla bla
>  Company: Bla bla bla
>  Adress:  Bla bla bla
>  Email: [EMAIL PROTECTED]
>  Business: Bla bla bla
>  Send Snowcrash info:
>  Comments: Bla bla bla
>
>From: [EMAIL PROTECTED]
>X-Originating-IP: [111.111.111.111]
>Content-Type: text/plain; charset=iso-8859-1
Reply-To: [EMAIL PROTECTED]
--
______________________
Snowcrash - Per Hugosson
Phone +46 (0)8 442 98 30
Fax +46 (0)8 442 98 11
Cell +46 (0)70 318 49 93




In article <p05100304b802cdc3b801@[212.247.198.195]>,
 [EMAIL PROTECTED] (Per Hugosson) wrote:

>  I cant get it to 
> show up in the "From:"-line. Instead I get "From: Apache..." which is 
> totally wrong of course. Our auto-reply goes to 
> [EMAIL PROTECTED] instead of to the senders adress. What do I 
> do wrong?
> 
> This is my script:
> 
> ><?php
> >mail("[EMAIL PROTECTED]", "Press Picture Download",
> >"From: $emailadress\n
> >X-Originating-IP: [$REMOTE ADDR]\n
> >Content-Type: text/plain; charset=iso-8859-1\n
> >Reply-To: $emailadress\n\n Name: $name\n Company: $company\n Adress: 
> >$adress\n Email: $emailadress\n Business: $business\n Send info: 
> >$noinfo\n Comments: $comments");
> >?>

Try changing the line terminators from "\n" to (RFC-compliant) "\r\n".

-- 
CC




> ><?php
> >mail("[EMAIL PROTECTED]", "Press Picture Download",
> >"From: $emailadress\n
> >X-Originating-IP: [$REMOTE_ADDR]\n
> >Content-Type: text/plain; charset=iso-8859-1\n
> >Reply-To: $emailadress\n\n Name: $name\n Company: $company\n Adress:
> >$adress\n Email: $emailadress\n Business: $business\n Send info:
> >$noinfo\n Comments: $comments");
> >?>

You appear to be missing the body argument, which goes between the subject
and header arguments.

--
Richard Heyes
http://www.phpguru.org/frederick/
"The good thing about American-English is that you can arbitrarily make up
words if you're stuck in the middle of a sentence with no way out"





Parse error: parse error, expecting `T_VARIABLE' in
/sdr/httpd/Prisa/DATA/private/libs/captura/valores.php on line 18


<?
/////////
//
// Trabaja con valores/indices
//
/////////

include("/sdr/httpd/Prisa/DATA/private/libs/db/db_sql.lib");

class val_valores
{
        /////////
        //
        // Todos los campos de la tabla
        //
        /////////

        var VAL_ID;                 <-- Line 18
        var VAL_TICKER;
        var VAL_ID_FEED;


Where is the problem? Can't figure it :(






Just use 

var $VAL_ID;

Names of variables always start with a "$" sign.


Alberto wrote:
> 
> Parse error: parse error, expecting `T_VARIABLE' in
> /sdr/httpd/Prisa/DATA/private/libs/captura/valores.php on line 18




might be a syntax error in the .lib file you are including (missing ";",
possibly)... let me know.

-----Original Message-----
From: Alberto [mailto:alberto arround [EMAIL PROTECTED]]
Sent: 29 October 2001 10:14
To: [EMAIL PROTECTED]
Subject: [PHP] Parse Error


Parse error: parse error, expecting `T_VARIABLE' in
/sdr/httpd/Prisa/DATA/private/libs/captura/valores.php on line 18


<?
/////////
//
// Trabaja con valores/indices
//
/////////

include("/sdr/httpd/Prisa/DATA/private/libs/db/db_sql.lib");

class val_valores
{
        /////////
        //
        // Todos los campos de la tabla
        //
        /////////

        var VAL_ID;                 <-- Line 18
        var VAL_TICKER;
        var VAL_ID_FEED;


Where is the problem? Can't figure it :(



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




oops, missed that one!

-----Original Message-----
From: Alexander Weber [mailto:[EMAIL PROTECTED]]
Sent: 29 October 2001 10:08
To: Alberto
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Parse Error


Just use 

var $VAL_ID;

Names of variables always start with a "$" sign.


Alberto wrote:
> 
> Parse error: parse error, expecting `T_VARIABLE' in
> /sdr/httpd/Prisa/DATA/private/libs/captura/valores.php on line 18

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Try this:

        var $VAL_ID;
        var $VAL_TICKER;
        var $VAL_ID_FEED;








> I have a large table with quite many dates in format dd.mm.yyyy (don't
> ask why :) and I want to convert them into yyyy-mm-dd for obvious
> reasons. How can I do this the smartest way? I know I could do it with
> php and update it row by row but that doesn't seem too smart. Can I
> somehow do a copy from table to table at the same time?
> Table 1:
> Name = John Doe
> Date1 = 01.01.2001
> Date2 = 02.02.2001
> Table 2:
> Name = NULL
> Date1 = 0000-00-00
> Date2 = 0000-00-00
> And now I want to set Table 2 to this:
> Name = John Doe
> Date1 = 2001-01-01 // Value from Table 1
> Date2 = 2001-02-02 // Value from Table 1


Niklas,

> At least tell me what to look for in the manual. :)
7 MySQL Language Reference
SELECT
SUBSTRING()
INSERT INTO
CONCAT_WS()

Used MySQL-Front as a convenient prototyping tool. Created the two tables and slotted 
in sample data - would be
big mistake/more time-consuming trying to work with full-sized files (and if you do, 
hint: use LIMIT).

Decided to approach the problem as a 'game of two halves'. First worked on the SELECT 
statement to pull rows off
the table and format the date components using substring(). Then tried to figure out 
how to get the results into
Table 2 - first of all as separate fields, then using concat_ws() to combine them into 
one. Only worked on one
date column - figured the other was simply a replication task...

Thus a part-solution:

insert into TBL_NIKLAS2 (NAME, DATE1)
  select
    NAME,
    concat_ws("/", substring(DATE1, 7, 4), substring(DATE1, 4, 2), substring(DATE1, 1, 
2))
  from TBL_NIKLAS1

(NB solution fails if existing dates are not strings and/or dates do not conform to 
dd.mm.yyyy format).

I was a little surprised that I couldn't structure the commands:
...
  select...
    substring(DATE1, 7, 4) as DATEYYYY...
    concat_ws("/", DATEYYYY, ...

which seemed a logical/self-documenting way to go about it, but someone more familiar 
with SQL than I will have
to explain why...?

Regards,
=dn






Hi All,
got a strange problem with a PHP include file that contains all my
JavaScript functions. This file is included on every page in my site and
contains some image swap behavious amongst other things. The first time I go
into the site, however, I get all sorts of JavaScript errors which I have
traced to the fact that lots of quotes are being dumped into the JavaScript
for some reason, screwing up the syntax. As soon as I hit refresh, the
quotes disappear and the page loads fine.... anyone got any ideas as to why
this is happening??

example of screwed up script:
var d="document;" if(d.images){ if(!d.MM_p) d.MM_p="new" Array();
    var i,j="d.MM_p.length,a=MM_preloadImages.arguments;" for(i="0;"
i<a.length; i++)

this is how it should look:
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
i++)


any ideas at all much appreciated!


--
Moloko
'When the going gets weird, the weird turn pro' - Dr Gonzo
GCM/CS/IT/MC d-- S++:- a-- C++ U--- P+ L !E W+++$ N+ K+ w+++$ M+ PS+++ PE-
PGP- t+ 5- X-- R* tv++ b+++ DI++++ D G e h-- r++ y++






it happened to me when i enter the page for the very first time and I use
session_start()

I suggest to make the page reload itself w/ a parameter so that the first
pass to the site will screw the javascript and then automatically 2nd pass
(which is self called) is okay.


"Moloko" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi All,
> got a strange problem with a PHP include file that contains all my
> JavaScript functions. This file is included on every page in my site and
> contains some image swap behavious amongst other things. The first time I
go
> into the site, however, I get all sorts of JavaScript errors which I have
> traced to the fact that lots of quotes are being dumped into the
JavaScript
> for some reason, screwing up the syntax. As soon as I hit refresh, the
> quotes disappear and the page loads fine.... anyone got any ideas as to
why
> this is happening??
>
> example of screwed up script:
> var d="document;" if(d.images){ if(!d.MM_p) d.MM_p="new" Array();
>     var i,j="d.MM_p.length,a=MM_preloadImages.arguments;" for(i="0;"
> i<a.length; i++)
>
> this is how it should look:
> var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
>     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length;
> i++)
>
>
> any ideas at all much appreciated!
>
>
> --
> Moloko
> 'When the going gets weird, the weird turn pro' - Dr Gonzo
> GCM/CS/IT/MC d-- S++:- a-- C++ U--- P+ L !E W+++$ N+ K+ w+++$ M+ PS+++ PE-
> PGP- t+ 5- X-- R* tv++ b+++ DI++++ D G e h-- r++ y++
>
>






Where can i find the code for the "array_search()" function in php4.I do
have php4 but the function isnt found.The "in_array()" function is found. 




Thanks to all who offered suggestions.

I have now solved the problem.

Realising that what was actually happening was the offered filename being
the same as the php script name, I built a routine which checks to see if a
script with the desired <filename>.php exists and if not it copies my script
to  a file with that name. This takes place when the page is first loaded,
redirecting to the next page in the web-process (remember that I'm doing all
this with Lasso/Filemaker). The button on that page then calls for the
<filename> script which pushes out the correctly named pdf document to the
user. I have another button which asks for confirmation that the download
was completed satisfactorily and that is used to delete the temporary
<filename>.php script.

This methgod may be of use to someone else. If so, please email me and I'll
share my code.

Regards

George P in Edinburgh and looking forward to Frankfurt next week


----- Original Message -----
From: "Bill Rausch" <[EMAIL PROTECTED]>
To: "George Pitcher" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, October 19, 2001 8:22 PM
Subject: RE: [PHP] Delivering NAMED pdf files


> George,
>
> Rasmus' suggestion is correct, but he was terse as usual :) and you
> might not have understood what he was saying.
>
> My solution is to present a list of the filenames available as LINKS
> (to non-existent files). Then the script does what you've already
> got.  The problem is that some browsers "cheat" and ignore the
> filename that you send in the headers "because they think they know
> better" because of the URL that is currently active. So you fool them
> by making a fake URL.
>
> In my case I have links that look like:
> <a href="/dl.php/file.pdf">file.pdf</a>
>
> and my dl.php script looks something like:
>
> ...
> $uri = urldecode(substr($REQUEST_URI,8));       # skip over the /dl.php/
> $x = strpos( $uri, "?" ); # get rid of trailing SID, etc.
> if( $x > 0 )
>      $uri = substr($uri,0,$x);
>
> header( ...
> header( ...
>
> readfile( "$realfileloc/$uri" );
> ...
>
> Bill
> --
>   Bill Rausch, Software Development, Unix, Mac, Windows
>   Numerical Applications, Inc.  509-943-0861   [EMAIL PROTECTED]


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



Reply via email to