php-general Digest 13 Oct 2002 11:51:45 -0000 Issue 1641

Topics (messages 119752 through 119782):

php 4.3.0pre and openssl 0.96g compile error
        119752 by: Jochen Kächelin

Re: POST and GET variables don't work
        119753 by: Jennifer Swofford
        119754 by: Oscar F
        119755 by: Andres Olarte
        119756 by: John W. Holmes
        119757 by: Jennifer Swofford
        119758 by: Sascha Cunz

Re: getimagesize() with ftp-url?
        119759 by: Stefan Wessman

Multiple Return Values from function
        119760 by: Paul Maine
        119763 by: .: B i g D o g :.
        119764 by: Marco Tabini

html form array
        119761 by: tim tom
        119765 by: John W. Holmes
        119766 by: Roger Thomas

Re: what does _\\_ mean?
        119762 by: Ns_Andy

syntax error on mysql select statement
        119767 by: Pablo Oliva
        119768 by: John W. Holmes
        119769 by: Marco Tabini
        119771 by: Coskun SUNALI

php cgi question
        119770 by: David Cook

Predefined variables not set?
        119772 by: Miles
        119773 by: Chris Hewitt

Re: $html_code .= include ("filetoinclude.txt");
        119774 by: Shawn McKenzie
        119780 by: . Edwin

newline in string
        119775 by: Shawn McKenzie
        119776 by: Jason Wong

A little help needed, I cant figure!
        119777 by: Randum Ian

Upload Problem
        119778 by: tony.tabzilla.com
        119781 by: Chris Hewitt

Re: PHP in crontab job
        119779 by: Juhan Kundla

PHP/mySQL help or advice
        119782 by: Ray Healy \(Data Net Services\)

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 ---
I tried to compile PHP with OpenSSL (0.96g) support with

--with-openssl=/usr/src/web/openssl/current

the way I did it since 4.1.0.

I  always  get  the  message,  that  php  can't  find  the  openssl
include-files.

Any suggestions?

-- 
Jochen Kaechelin

--- End Message ---
--- Begin Message ---
Try:

$_Post[name];

or $HTTP_POST_VARS[name];

In new PHP version, register_globals is set to "off" by default, which is
why $name isn't working for you.  Although, I'm surprised GET isn't
working....

Jen


> I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with
>
> configure --with-java --with-apxs=/usr/local/apache/bin/apx
>
> It's running with Apache 1.3.26
>
> PHP work ok, even Java works, but if I try to pass variables from a form
> with either POST or GET, the variables don't get through.  This is the
code
> I'm using:
>
> index.html:
> ...
> <form action="php.php" method="post">
>      Name: <input type="text" name="name"><br>
>       <input type="submit">
>   </form>
> ...
>
> php.php:
>
> <?php
> echo "*";
> echo $name;
> echo "*";
> ?>
>
> The variable $name is always empty.  I tried this same scripts on the RPM
> version installed with Mandrake 7.2 and it worked fine, so it shouldn't be
> the scripts.  What could be wrong? Maybe I missed a ./configure option?
>
> Thanks in advance,
>
>
> Andres



--- End Message ---
--- Begin Message ---
Most likely you have register_globals set to "off" on your php.ini. 
Change this to register_globals = on (or "true", or "yes", either one 
should).

If you dont want to do that, Try with $_GET['name'] or $_POST['name'].

HTH.

   Oscar F.-

Andres Olarte wrote:

> 
> 
> 
> I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with
> 
> configure --with-java --with-apxs=/usr/local/apache/bin/apx
> 
> It's running with Apache 1.3.26
> 
> PHP work ok, even Java works, but if I try to pass variables from a form 
> with either POST or GET, the variables don't get through.  This is the 
> code I'm using:
> 
> index.html:
> ...
> <form action="php.php" method="post">
>     Name: <input type="text" name="name"><br>
>      <input type="submit">
>  </form>
> ...
> 
> php.php:
> 
> <?php
> echo "*";
> echo $name;
> echo "*";
> ?>
> 
> The variable $name is always empty.  I tried this same scripts on the 
> RPM version installed with Mandrake 7.2 and it worked fine, so it 
> shouldn't be the scripts.  What could be wrong? Maybe I missed a 
> ./configure option?
> 
> Thanks in advance,
> 
> 
> Andres
> 
> 
> 
> _________________________________________________________________
> Únase al mayor servicio mundial de correo electrónico: 
> http://www.hotmail.com/es
> 
> 


--- End Message ---
--- Begin Message ---
Thanks to Oscar and Jennifer, it's working now.  I did a bit of reading, and 
it seems it's not recommend to enable "register_globlas", why is that?

Is there an array that contains both POST and GET variables or am I stuck to 
using two different ones?




>From: Oscar F <[EMAIL PROTECTED]>
>To: Andres Olarte <[EMAIL PROTECTED]>,php-general 
><[EMAIL PROTECTED]>
>Subject: Re: [PHP] POST and GET variables don't work
>Date: Sat, 12 Oct 2002 19:58:04 -0400
>
>Most likely you have register_globals set to "off" on your php.ini. Change 
>this to register_globals = on (or "true", or "yes", either one should).
>
>If you dont want to do that, Try with $_GET['name'] or $_POST['name'].
>
>HTH.
>
>   Oscar F.-
>
>Andres Olarte wrote:
>
>>
>>
>>
>>I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with
>>
>>configure --with-java --with-apxs=/usr/local/apache/bin/apx
>>
>>It's running with Apache 1.3.26
>>
>>PHP work ok, even Java works, but if I try to pass variables from a form 
>>with either POST or GET, the variables don't get through.  This is the 
>>code I'm using:
>>
>>index.html:
>>...
>><form action="php.php" method="post">
>>     Name: <input type="text" name="name"><br>
>>      <input type="submit">
>>  </form>
>>...
>>
>>php.php:
>>
>><?php
>>echo "*";
>>echo $name;
>>echo "*";
>>?>
>>
>>The variable $name is always empty.  I tried this same scripts on the RPM 
>>version installed with Mandrake 7.2 and it worked fine, so it shouldn't be 
>>the scripts.  What could be wrong? Maybe I missed a ./configure option?
>>
>>Thanks in advance,
>>
>>
>>Andres
>>
>>
>>
>>_________________________________________________________________
>>Únase al mayor servicio mundial de correo electrónico: 
>>http://www.hotmail.com/es
>>
>>




_________________________________________________________________
MSN Fotos: la forma más fácil de compartir e imprimir fotos. 
http://photos.msn.es/support/worldwide.aspx

--- End Message ---
--- Begin Message ---
$_REQUEST[] (also contains cookies)

---John Holmes...

> -----Original Message-----
> From: Andres Olarte [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, October 12, 2002 8:11 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] POST and GET variables don't work
> 
> Thanks to Oscar and Jennifer, it's working now.  I did a bit of
reading,
> and
> it seems it's not recommend to enable "register_globlas", why is that?
> 
> Is there an array that contains both POST and GET variables or am I
stuck
> to
> using two different ones?
> 
> 
> 
> 
> >From: Oscar F <[EMAIL PROTECTED]>
> >To: Andres Olarte <[EMAIL PROTECTED]>,php-general
> ><[EMAIL PROTECTED]>
> >Subject: Re: [PHP] POST and GET variables don't work
> >Date: Sat, 12 Oct 2002 19:58:04 -0400
> >
> >Most likely you have register_globals set to "off" on your php.ini.
> Change
> >this to register_globals = on (or "true", or "yes", either one
should).
> >
> >If you dont want to do that, Try with $_GET['name'] or
$_POST['name'].
> >
> >HTH.
> >
> >   Oscar F.-
> >
> >Andres Olarte wrote:
> >
> >>
> >>
> >>
> >>I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with
> >>
> >>configure --with-java --with-apxs=/usr/local/apache/bin/apx
> >>
> >>It's running with Apache 1.3.26
> >>
> >>PHP work ok, even Java works, but if I try to pass variables from a
form
> >>with either POST or GET, the variables don't get through.  This is
the
> >>code I'm using:
> >>
> >>index.html:
> >>...
> >><form action="php.php" method="post">
> >>     Name: <input type="text" name="name"><br>
> >>      <input type="submit">
> >>  </form>
> >>...
> >>
> >>php.php:
> >>
> >><?php
> >>echo "*";
> >>echo $name;
> >>echo "*";
> >>?>
> >>
> >>The variable $name is always empty.  I tried this same scripts on
the
> RPM
> >>version installed with Mandrake 7.2 and it worked fine, so it
shouldn't
> be
> >>the scripts.  What could be wrong? Maybe I missed a ./configure
option?
> >>
> >>Thanks in advance,
> >>
> >>
> >>Andres
> >>
> >>
> >>
> >>_________________________________________________________________
> >>Únase al mayor servicio mundial de correo electrónico:
> >>http://www.hotmail.com/es
> >>
> >>
> 
> 
> 
> 
> _________________________________________________________________
> MSN Fotos: la forma más fácil de compartir e imprimir fotos.
> http://photos.msn.es/support/worldwide.aspx
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
BTW, disregard my comment about GET... I confused myself.  Zzz.

Jen


> Try:
>
> $_Post[name];
>
> or $HTTP_POST_VARS[name];
>
> In new PHP version, register_globals is set to "off" by default, which is
> why $name isn't working for you.  Although, I'm surprised GET isn't
> working....
>
> Jen
>
>
> > I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with
> >
> > configure --with-java --with-apxs=/usr/local/apache/bin/apx
> >
> > It's running with Apache 1.3.26
> >
> > PHP work ok, even Java works, but if I try to pass variables from a form
> > with either POST or GET, the variables don't get through.  This is the
> code
> > I'm using:
> >
> > index.html:
> > ...
> > <form action="php.php" method="post">
> >      Name: <input type="text" name="name"><br>
> >       <input type="submit">
> >   </form>
> > ...
> >
> > php.php:
> >
> > <?php
> > echo "*";
> > echo $name;
> > echo "*";
> > ?>
> >
> > The variable $name is always empty.  I tried this same scripts on the
RPM
> > version installed with Mandrake 7.2 and it worked fine, so it shouldn't
be
> > the scripts.  What could be wrong? Maybe I missed a ./configure option?
> >
> > Thanks in advance,
> >
> >
> > Andres



--- End Message ---
--- Begin Message ---
Am Sonntag, 13. Oktober 2002 02:11 schrieb Andres Olarte:
> Thanks to Oscar and Jennifer, it's working now.  I did a bit of reading,
> and it seems it's not recommend to enable "register_globlas", why is that?

For security...

Imagine, you register a session variable to contain the user's ID. Anyone 
could login using that ID in a GET or POST variable with register_globals to 
on.

-Sascha
--- End Message ---
--- Begin Message ---
Well, it is remote in the case of http-url's.

Try this code:

<?php
 $size = getimagesize("http://www.php.net/gifs/php_logo.gif";);

 echo '<pre>';
 print_r($size);
 echo '</pre>';
?>

And you will see this result:

Array
(
    [0] => 120
    [1] => 64
    [2] => 1
    [3] => width="120" height="64"
    [bits] => 8
    [channels] => 3
    [mime] => image/gif
)

My point is that it would be nice if the same could be done with an ftp-url.
I don't know if there are any issues that would make this hard to implement,
but if it is possible i think this should be added to complement the
http-url support.

/OnionMan
<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> getimagesize isn't remote.
>
> --
>
> Nicos - CHAILLAN Nicolas
> [EMAIL PROTECTED]
> www.WorldAKT.com - Hébergement de sites Internet
>
> "Stefan Wessman" <[EMAIL PROTECTED]> a écrit dans le message de news:
> [EMAIL PROTECTED]
> > Hi!
> >
> > Can anyone tell me if the getimagesize() function is supposed to work
with
> > ftp-url's?
> > The PHP Manual states "URL support was added in PHP 4.0.5", but maby
that
> is
> > supposed to mean http-url's only?
> >
> > The following is an expample of how i would like to be able to use
> > getimagesize():
> >
> > <?php
> >     $size =
> > getimagesize("ftp://user:[EMAIL PROTECTED]/pictures/image.jpg";);
> >
> >     echo '<pre>';
> >     print_r($size);
> >     echo '</pre>';
> > ?>
> >
> > This code yields the following errors in my log:
> >
> > [12-Oct-2002 23:32:14] PHP Warning:  getimagesize(): php_hostconnect:
> > connect failed in getimagesize.php on line 2
> > [12-Oct-2002 23:32:14] PHP Warning:  getimagesize(...): failed to create
> > stream: FTP server reports 227 Entering Passive Mode (194.236.xxx.xxx in
> > getimagesize.php on line 2
> >
> > Is this a bug, or is it a missing feature, or maby a documentation
issue?
> > I've tried it on a few different ftp-servers, so i don't think that is t
he
> > problem.. but who knows?
> >
> > Any thoghts would be appreciated.
> >
> > /OnionMan
> >
> >
>
>


--- End Message ---
--- Begin Message ---
Can I return more than one value from a function?

php

Thank You
Paul
--- End Message ---
--- Begin Message ---
I would probably return an array with the multiple values in the
array...easier to work with.


On Sat, 2002-10-12 at 20:49, Paul Maine wrote:
> Can I return more than one value from a function?
> 
> php
> 
> Thank You
> Paul
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.: B i g D o g :.


--- End Message ---
--- Begin Message ---
Well, you could return an array that contains more than one value, or
you could pass some parameters by reference rather than by value
(although that's not always a good idea).

On Sat, 2002-10-12 at 22:49, Paul Maine wrote:
> Can I return more than one value from a function?
> 
> php
> 
> Thank You
> Paul
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
dear all,
i ran my code below on ie and it works. but when i use netscape 4.76 under linux, i 
only get the
message "submitted" even though i've checked some fields.

what do i need to add to make it work with netscape under linux?
code follows:

<?
if ($_POST["submit"]) {
    print "submitted<BR>";
    for($i=0;$i<sizeof($foo);$i++) {
        print "$foo[$i]<BR>";
    }
}
else {
?>
<form action=<? echo $_SERVER["PHP_SELF"] ?> method=post>
  <input type=checkbox name=foo[] value=one>One
  <input type=checkbox name=foo[] value=two>Two
  <input type=checkbox name=foo[] value=three>Three
  <input type=submit value=submit name=submit>
</form>
<?
}
?>

--
best regards
tim

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
--- End Message ---
--- Begin Message ---
> dear all,
> i ran my code below on ie and it works. but when i use netscape 4.76
under
> linux, i only get the
> message "submitted" even though i've checked some fields.

The code is running on the same box, right? Just accessing it with
different browsers?
 
> what do i need to add to make it work with netscape under linux?
> code follows:
> 
> <?
> if ($_POST["submit"]) {
>     print "submitted<BR>";
>     for($i=0;$i<sizeof($foo);$i++) {
>         print "$foo[$i]<BR>";
>     }
> }
> else {
> ?>
> <form action=<? echo $_SERVER["PHP_SELF"] ?> method=post>
>   <input type=checkbox name=foo[] value=one>One
>   <input type=checkbox name=foo[] value=two>Two
>   <input type=checkbox name=foo[] value=three>Three
>   <input type=submit value=submit name=submit>
> </form>

Try putting quotes (") around your types, names, and values in your
input elements. Netscape may not recognize foo[] as a proper name
without the quotes and send the data incorrectly.

---John Holmes...


--- End Message ---
--- Begin Message ---
try this (noticed that I've changed $foo to $_POST["foo"]. after all we're
livin in globals off rite? )

<?
if ($_POST["submit"]) {
    print "submitted<BR>";
    for($i=0;$i<sizeof($_POST["foo"]);$i++) {
        print $_POST["foo"][$i]."<BR>";
    }
}
else {
?>
<form action="<? echo $_SERVER["PHP_SELF"] ?>" method="post">
  <input type="checkbox" name="foo[]" value="one">One
  <input type="checkbox" name="foo[]" value="two">Two
  <input type="checkbox" name="foo[]" value="three">Three
  <input type="submit" value="submit" name="submit">
</form>
<?
}
?>

--
roger


--- "John W. Holmes" <[EMAIL PROTECTED]> wrote:
> > dear all,
> > i ran my code below on ie and it works. but when i use netscape 4.76
> under
> > linux, i only get the
> > message "submitted" even though i've checked some fields.
> 
> The code is running on the same box, right? Just accessing it with
> different browsers?
>  
> > what do i need to add to make it work with netscape under linux?
> > code follows:
> > 
> > <?
> > if ($_POST["submit"]) {
> >     print "submitted<BR>";
> >     for($i=0;$i<sizeof($foo);$i++) {
> >         print "$foo[$i]<BR>";
> >     }
> > }
> > else {
> > ?>
> > <form action=<? echo $_SERVER["PHP_SELF"] ?> method=post>
> >   <input type=checkbox name=foo[] value=one>One
> >   <input type=checkbox name=foo[] value=two>Two
> >   <input type=checkbox name=foo[] value=three>Three
> >   <input type=submit value=submit name=submit>
> > </form>
> 
> Try putting quotes (") around your types, names, and values in your
> input elements. Netscape may not recognize foo[] as a proper name
> without the quotes and send the data incorrectly.
> 
> ---John Holmes...
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
--- End Message ---
--- Begin Message ---
> Here's the code:
> $fp = @fopen ("a.txt")
> while ($buf = @fgets($fp,1024) {
> trim($buf)
> if (substr($buf,-1 == _\\_) {

i missed a )
if (substr($buf,-1) == _\\_) {


--- End Message ---
--- Begin Message ---
Can anyone see any problems with the following:
SELECT * FROM ad AS t1, ad_location AS t2 ORDER BY t1.ad_ts_update LIMIT
0,40 WHERE t1.ad_location = t2.ad_loc_id AND ( (t1.ad_cdl_a = on OR
t1.ad_cdl_b = on) AND t1.ad_longhaul = on AND t1.ad_fulltime = on ) AND
( t2.ca_losangeles = 1 OR t2.ca_santaana = 1 ) AND t1.ad_display = 1

The error I get is:
You have an error in your SQL syntax near 'WHERE t1.ad_location =
t2.ad_loc_id AND ( t1.ad_cdl_a = on AND t1.ad_longhaul = ' at line 1 

--- End Message ---
--- Begin Message ---
ORDER BY and LIMIT go at the end...after WHERE.

---John Holmes...

> -----Original Message-----
> From: Pablo Oliva [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 13, 2002 12:13 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] syntax error on mysql select statement
> 
> Can anyone see any problems with the following:
> SELECT * FROM ad AS t1, ad_location AS t2 ORDER BY t1.ad_ts_update
LIMIT
> 0,40 WHERE t1.ad_location = t2.ad_loc_id AND ( (t1.ad_cdl_a = on OR
> t1.ad_cdl_b = on) AND t1.ad_longhaul = on AND t1.ad_fulltime = on )
AND
> ( t2.ca_losangeles = 1 OR t2.ca_santaana = 1 ) AND t1.ad_display = 1
> 
> The error I get is:
> You have an error in your SQL syntax near 'WHERE t1.ad_location =
> t2.ad_loc_id AND ( t1.ad_cdl_a = on AND t1.ad_longhaul = ' at line 1
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
Yes, the LIMIT clause must be at the end of the line. Take a look at the
documentation:

http://www.mysql.com/doc/en/SELECT.html


On Sun, 2002-10-13 at 00:12, Pablo Oliva wrote:
> Can anyone see any problems with the following:
> SELECT * FROM ad AS t1, ad_location AS t2 ORDER BY t1.ad_ts_update LIMIT
> 0,40 WHERE t1.ad_location = t2.ad_loc_id AND ( (t1.ad_cdl_a = on OR
> t1.ad_cdl_b = on) AND t1.ad_longhaul = on AND t1.ad_fulltime = on ) AND
> ( t2.ca_losangeles = 1 OR t2.ca_santaana = 1 ) AND t1.ad_display = 1
> 
> The error I get is:
> You have an error in your SQL syntax near 'WHERE t1.ad_location =
> t2.ad_loc_id AND ( t1.ad_cdl_a = on AND t1.ad_longhaul = ' at line 1 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
"SELECT * FROM ad AS t1"


Where is the table?
Should be like:

SELECT ad AS t1 FROM table_name Where ...... Limit 0,n

Coskun SUNALI / Turkey

"Pablo Oliva" <[EMAIL PROTECTED]> wrote in message
000101c2726e$c506ee50$6a6c0444@cr8tivewerk">news:000101c2726e$c506ee50$6a6c0444@cr8tivewerk...
> Can anyone see any problems with the following:
> SELECT * FROM ad AS t1, ad_location AS t2 ORDER BY t1.ad_ts_update LIMIT
> 0,40 WHERE t1.ad_location = t2.ad_loc_id AND ( (t1.ad_cdl_a = on OR
> t1.ad_cdl_b = on) AND t1.ad_longhaul = on AND t1.ad_fulltime = on ) AND
> ( t2.ca_losangeles = 1 OR t2.ca_santaana = 1 ) AND t1.ad_display = 1
>
> The error I get is:
> You have an error in your SQL syntax near 'WHERE t1.ad_location =
> t2.ad_loc_id AND ( t1.ad_cdl_a = on AND t1.ad_longhaul = ' at line 1
>


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

Got a question regarding using php scripts as cgi's.

What I am trying to do is this. (ya may need a bit of background, it gets a
little complicated... well for me its complicated)

Im building a web based email system using php (duh) as the front end and
glue for everything, part of it is using a program called getmail to
retreive remote pop accounts to the virtual accounts on the server (its all
virtual using qmail/vpopmail and courier-imap). The various setttings for
this are in a file called getmailrc, in the virtual users home dir, (this
will also be theoretically relevant when I try and do the same thing with a
server side filtering program called maildrop.. but one at a time I reckon
:))

ie. /home/vpopmail/domains/some.email.domain/someuser/.getmail/getmailrc

This file is owned specifically by a user/group otherwise getmail wont work

ie: -rw-r--r--    1 vpopmail vchkpw        585 Sep 29 07:16 getmailrc

any permissions other than this will tweak getmails internal security and
stop it.

I decided to minimise security problems and use mysql as an intermidiary
storage for any rules created for getmail, which works fine. :) (yay me..
lol)

NOW comes the problem, I need to write (overwrite) that getmailrc file after
the user has finished messing with their settings, to do this I decided that
since the file can only be read/written to by the vpopmail/vchkpw
user/group, that I would knock up a php script to run as a cgi, that would
do only one thing: Upon a button being pressed to 'finish edit' the new
rules would be written to the mysql table, then the cgi would be invoked
with a particular identifier so that it could then look up the mysql table
(using that identifier so it gets the right rows), and following some rules
inbuilt, write out the getmailrc file with that restrictive permissions set.

I wrote up a script that was just for POC, that would get the data for where
that file was supposed to be (the /home/vpopmail/etc...etc) and read it,
then break out the various details and display it, basically just showing me
what was already in the file. (using the shebang method, as my php cgi
interpreter is OUTSIDE the web tree, but thats another story of getting the
damn thing to work at all... damn RPM'S sometimes...
that --enable-force-redirect had me stuck for a few days)

When I tested it out from the shell, using ./getmailtest.cgi as root, it
worked, in that it did what it was sposed to.. display the contents of the
getmailrc file. This cgi php script is owned by vpopmail/vchkpw which should
allow reading the file as said above

Great, thought I, and proceeded to attempt linking to it from within the
editing script, using both an attempt with a 'submit' button and a click
through link.

Now comes the prob, it fails, with an error of being unable to either open
the file, or that the file doesnt exist (depending on what I fiddle with in
the script).

Would anyone have any ideas as to what may be going wrong here? I havent
tried doing this before, using php as a cgi to do stuff to files on the
system, so I am at quite a loss, and any help would be appreciated.

Regards

David Cook







--- End Message ---
--- Begin Message ---
When trying to get $_SERVER["QUERY_STRING"] I am getting 'Undefined index 
QUERY_STRING' error

If there is a query string, e.g.  www.site.com/index.php?hello_world then it IS 
defined.  So it seems that PHP is complaining about undefined variables, rather than 
just outputting nothing.

How can I fix this?  I've had no problems until i reinstalled php today...

Cheers,

Miles
--- End Message ---
--- Begin Message ---
Miles wrote:

>than just outputting nothing.
>
>How can I fix this?  I've had no problems until i reinstalled php today...
>
register_globals?

HTH
Chris


--- End Message ---
--- Begin Message ---
function file_get_contents($filename) {
    $fp = @fopen($filename, "r");
     if (!($fp)) {
         return 0;
     }
     while (!feof($fp))  {
        $temp .= fread($fp, 4096);
     }
     return $temp;
}

and then:  $html_code = file_get_contents(filetoinclude.txt);

HTH
-Shawn

"Research And Development" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Should this work?
>
> $html_code .= include ("filetoinclude.txt");
>
> I am populating a variable with html to be printred later as usual:
> $html_code .= "html....".
>
> But I have some static html files that I want included in the html that
> I am storing in the variable. The HTML is in text files. The above code
> obviously does not work. I want to know if there is another way.
>
> Thanks.
>


--- End Message ---
--- Begin Message ---
Hello,

The function might be available in the next release so you don't have to
define your own.

  http://www.php.net/manual/en/function.file-get-contents.php

But until then...

- E

"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> function file_get_contents($filename) {
>     $fp = @fopen($filename, "r");
>      if (!($fp)) {
>          return 0;
>      }
>      while (!feof($fp))  {
>         $temp .= fread($fp, 4096);
>      }
>      return $temp;
> }
>
> and then:  $html_code = file_get_contents(filetoinclude.txt);
>
> HTH
> -Shawn
>
> "Research And Development" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Should this work?
> >
> > $html_code .= include ("filetoinclude.txt");
> >
> > I am populating a variable with html to be printred later as usual:
> > $html_code .= "html....".
> >
> > But I have some static html files that I want included in the html that
> > I am storing in the variable. The HTML is in text files. The above code
> > obviously does not work. I want to know if there is another way.
> >
> > Thanks.
> >
>
>
--- End Message ---
--- Begin Message ---
I have loaded an html file into a string.  How can I search the string for
newlines/linefeeds? I know they are there, because if I echo the string and
view source in the browser, some tags are on new lines.

Example:
<html>

<head>
</head>

TIA
-Shawn


--- End Message ---
--- Begin Message ---
On Sunday 13 October 2002 17:24, Shawn McKenzie wrote:
> I have loaded an html file into a string.  How can I search the string for
> newlines/linefeeds? I know they are there, because if I echo the string and
> view source in the browser, some tags are on new lines.
>
> Example:
> <html>
>
> <head>
> </head>

Search for "\r" and "\n" for linefeeds and newlines respectively. Note you 
must use double-quotes.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
>From the cradle to the coffin underwear comes first.
                -- Bertolt Brecht
*/

--- End Message ---
--- Begin Message ---
Morning all,

I am currently working on a project for my client that involves an
archive of Artist Singles and Album charts dating from the 1960's to the
current day. I would like to be able to put them into a database but I
am unsure of which database to use (I don't mind learning one if it
proves to be better) or how to layout the tables within the database.

For example I intend to have over 4,000 different charts covering well
over 6,000 artists and over 26,000 singles and album titles. Could mySQL
and PHP cope with this demand?

I thought about having a table for Artists, one for Singles and then one
for Albums and a junction table coupling all of them together but I
can't figure out how to do it.

Has anybody got any thoughts that could help me along the way?

Kind regards,
Randum Ian
[EMAIL PROTECTED]
DJ / Reviewer / Webmaster, DancePortal (UK) Limited 
DancePortal.co.uk - Global dance music media


--- End Message ---
--- Begin Message ---
I posted "User Upload" and with no advice I attempted to use the sources i
could find and came up with the following:

while (file_exists("$i.tab")) {
$i ++;
}
$destfile = $i;
$destfile .= "tab";
stripslashes($userfile);
copy($userfile, "/uploads/" . $destfile);
chdir("/uploads");
$lines = file($destfile);
$content = implode("<br>", $lines);
unlink($destfile);
echo("$userfile_name");

It doesnt work (surprise, surprise), what im trying to do is upload the file
to my /uploads/ directory then read it and store it on the $content
variable, then the content variable inserts a row into db (allready done),
then I delete the file the while loop is to make sure I dont overwrite the
file and make an error in my database.

The errors PHP returns are:

Warning: Unable to open 'C:\\My Documents\\lyrics\\C_DTBS\\SLIME.TXT' for
reading: No such file or directory in /home/tabzilla/public_html/doadd.php
on line 89

Warning: ChDir: No such file or directory (errno 2) in
/home/tabzilla/public_html/doadd.php on line 90

Warning: file("tab") - No such file or directory in
/home/tabzilla/public_html/doadd.php on line 91

Warning: Bad arguments to implode() in /home/tabzilla/public_html/doadd.php
on line 92

Warning: unlink() failed (No such file or directory) in
/home/tabzilla/public_html/doadd.php on line 93


ANY HELP? ANYONE???

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:

>
>Warning: Unable to open 'C:\\My Documents\\lyrics\\C_DTBS\\SLIME.TXT' for
>reading: 
>
Has the webserver got permission to read this file? It does not seem to 
be under the document root.

>No such file or directory in /home/tabzilla/public_html/doadd.php
>on line 89
>
Is line 89 in the code you posted, if so please mark it. I suggest 
echoing the value of any variables so that you can check that they 
contain exactly what you think they do.

>Warning: Bad arguments to implode() in /home/tabzilla/public_html/doadd.php
>on line 92
>
Possibly because the file was not opened/found.

HTH
Chris

--- End Message ---
--- Begin Message ---
Ühel ilusal päeval [11-10-2002 20:48] kirjutas Sharat Hegde:
> Hello John,
> 
> Thanks for the help. I was able to solve this. Thanks Marek for your help 
> too in giving the same solution.
> 
> The problem was with the crontab command not having the full path to php. 
> Silly that a command line on the shell script should work but crontab is 
> unable to find the same path.

This is not silly, the cron simply does not have the environment
variables set. If you are using vixie cron, you can set the environment
within the crontab ie:

PATH=/bin:/usr/bin
[EMAIL PROTECTED]

* * * * * man cron

Cheers,
Juhan
--- End Message ---
--- Begin Message ---
Hi All

I have been trying to write a database and scripts for a calendar that shows which 
days are booked and have failed at each point.

What i would like it to do is to show a calendar which have the dates that are booked 
in a cell which are colour coded (say red) when it is unavailable and say white when 
available.

The admiministartor should be able to enter multiple dates at a time (say a holiday is 
booked for 5 days). perhaps a section for nortes that is only available for admin use 
only would be handy.

An option to view 2 months at a time or perhaps the whole year would also be nice.

I have downloaded various scripts and tried to write my own but I cannot seem to be 
able to enter multiple dates or colour code the output.

Can anyone help me or perhaps someone already has a script & database that does this 
and would be willing to share.

Otherwise it there a script already out there that will do this - all the one that I 
can find seem to do too much by allowing multiple users and storing a lot more data 
which is something I do nort need.

Any help would be appreciated as I am tearing my hair out at the moment.

Thanks for your time

Ray Healy
--- End Message ---

Reply via email to