Re: [PHP] Date (Year) .. adding..

2001-05-23 Thread mheumann

Hi Jason,

You might want to put the '+$x' outside the date().
$year = date("Y") + $x;

Greetings,
Michael.

> I'm trying to figure out how to add to the year:
>
> for($x=0; $x<20; $x++)
> {
> $year = date("Y" + $x);
> print($year . "\n");
> }
>
> I've tried several variations on the above and cannot get the year to come
> out.
>
> Any suggestions?
>
> Thanks
> Jason


#
# Michael Heumann
# S&I Chile - Software e Informatica Limitada
# Arlegui 440, Of. 403, Viña del Mar, Chile
# Fonofax: (56)(32) 710833
# Email: [EMAIL PROTECTED]
# Web: http://www.softwareinformatica.cl
#

--
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]




Re: [PHP] include!!!!!

2001-05-23 Thread mheumann

Hi,
that sounds like your Web server doesn't interpret PHP at all.  Are you sure you 
enabled it correctly?
What platform are you working on?
Greetings,
Michael.

> I'm new to php (having converted from the evil ASP) and i'm having some
> trouble with includes
>
> this is what i'm doing...
>
>  include("inc/db.inc.php")
>
> database stuff
>
> ?>
>
> db.inc.php is as follows:
> $linkID = mysql_connect('localhost', 'root', 'not-telling-you');
> mysql_select_db('foobar');
>
>
> All i get is the above outputted to the screen as html!
>
>
> --
> 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]


#
# Michael Heumann
# S&I Chile - Software e Informatica Limitada
# Arlegui 440, Of. 403, Viña del Mar, Chile
# Fonofax: (56)(32) 710833
# Email: [EMAIL PROTECTED]
# Web: http://www.softwareinformatica.cl
#

--
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]




[PHP] Again: PHP4 and IMAP: Bug?

2001-05-23 Thread mheumann

Hi,
I'm growing rather desperate about this issue that's been causing me several sleepless 
nights already.
All I want is to be able to use IMAP to access POP3 mailboxes with PHP4 (4.0.5). I had 
no trouble
compiling both  imap and PHP4, and actually I also compiled PHP3 with the same IMAP 
library.  My little
test script (see below)  works fine on PHP3, but on PHP4 I get the following 
message(s), being the first
the most relevant one:

Warning: Couldn't open stream {mail.host.tld/pop3:110}INBOX in 
/usr/data/htdocs/intranet/mail.php on line
6
 Warning: Unable to find stream pointer in /usr/data/htdocs/intranet/mail.php on line 
7
 Warning: Variable passed to each() is not an array or object in 
/usr/data/htdocs/intranet/mail.php on line 8
 Warning: Unable to find stream pointer in /usr/data/htdocs/intranet/mail.php on line 
10


The code is ok, as far as I can tell (and I'm not a newbie anymore):


Mail Test

";
 imap_close( $mbox );
?>



The $host in the imap_open line has already been replaced by the literal string, I 
have left out the \ before
the {,  everything in vain.

I use apache 1.3.20, PHP 4.0.5, the IMAP snapshot from a couple of days ago and I 
configured PHP like
this:

'./configure' '--with-apxs=/usr/sbin/apxs' '--with-gd=yes' '--with-xpm-dir' 
'--with-jpeg-dir=/usr/local' '--with-
ttf=/usr/src/freetype-1.3.1' '--with-zlib' '--with-xml' '--with-ftp' 
'--with-mcal=../libmcal' '--with-imap' '--with-
sybase=/opt/sybase-11.9.2' '--with-mysql=/usr' '--with-mcrypt=/usr/local' 
'--with-mhash' '--with-config-file-
path=/etc/httpd/conf' '--enable-versioning' '--enable-track-vars'

according to phpinfo().

I tried to track down the problem by inserting messages in various PHP and IMAP source 
code places. I
couldn't get  beyond the call to tcp_open in IMAP's mail_open function.  It seems that 
this tcp_open is not
being called by PHP4,  while PHP3 calls it perfectly.  I think maybe the tcp driver is 
not loaded, or so.
The pop3 driver seems to be ok.

I really don't know, I'm just speculating here.  But what could be the problem?  Is 
there anything I may
have missed  during configure and compile of PHP4 that differs from the PHP3 procedure?

Please, you PHP makers out there, try to help me. I would really appreciate this.  If 
I can't solve this
problem, I can't  port my project to PHP4.

Thanks in advance,
Greetings,
Michael Heumann.

#
# Michael Heumann
# S&I Chile - Software e Informatica Limitada
# Arlegui 440, Of. 403, Viña del Mar, Chile
# Fonofax: (56)(32) 710833
# Email: [EMAIL PROTECTED]
# Web: http://www.softwareinformatica.cl
#

--
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]




Re: [PHP] Inserting the date into MySQL via PHP

2001-05-23 Thread mheumann

Hi,

please forgive me if your typo concerns only your posting, but you didn't close your 
VALUES parenthesis.
Then, the order of the data in the second parenthesis doesn't match that in the first 
one (which it has to).
So the correct way to do it would be:

$insert = mysql_query("insert into dbrss (Feed, Title, URL, Abstract, Old) VALUES
('$Feed','$Title','$URL','$Abstract',NOW())",$db);

Hope this helps.
Greetings,
Michael.

> Hello,
>
> This is a really simple (looking) problem, but I can't seem to find the solution
> in the documentation.  I want to insert today's date into a MySQL Date field.
>
> My first attempt was to use the following:
>
> $insert = mysql_query("insert into dbrss (Feed, Title, URL, Abstract, Old)
> VALUES ('$Feed','$Title','$URL',NOW(),'",$db);
>
> The relevant table was created with the following:
>
> CREATE TABLE dbrss (
> ID int(7) NOT NULL auto_increment,
> Feed varchar(50) NOT NULL,
> Title varchar(255) NOT NULL,
> URL varchar(255) NOT NULL,
> Abstract varchar(255),
> superRSS varchar(50),
> Type varchar(50),
> Old date,
> Source varchar(100),
> SourceURL varchar(100),
> PRIMARY KEY (ID)
> );
>
> I also tried to insert a date generated by:
> $Date = date(Y-m-d);
>
> using the following variation:
>
> $insert = mysql_query("insert into dbrss (Feed, Title, URL, Abstract, Old)
> VALUES ('$Feed','$Title','$URL','$Date','",$db);
>
> Any help would be appreciated.
>
> Mike
> --
> Mike Gifford, OpenConcept Consulting, http://openconcept.ca
> Offering everything your organization needs for an effective web site.
> Featured Client: http://halifaxinitiative.org
> A good life is one inspired by love and guided by knowledge - B. Russell
>
>
> --
> 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]


#
# Michael Heumann
# S&I Chile - Software e Informatica Limitada
# Arlegui 440, Of. 403, Viña del Mar, Chile
# Fonofax: (56)(32) 710833
# Email: [EMAIL PROTECTED]
# Web: http://www.softwareinformatica.cl
#

--
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]




Re: [PHP] printing a php/html page to the browser

2001-05-23 Thread mheumann

Usually, it should be enough to rename the file extension to .phps and the browser 
should handle it
correctly, if the web server (i.e. apache) is properly configured.

Michael.

> If I had a mixed html/php page, i.e. where some of the strings had html
> in them, other than setting the header to be of mime type 'text', how
> could I process this page to display it exactly like it was seen in a
> text editor, in html to the browser?

#
# Michael Heumann
# S&I Chile - Software e Informatica Limitada
# Arlegui 440, Of. 403, Viña del Mar, Chile
# Fonofax: (56)(32) 710833
# Email: [EMAIL PROTECTED]
# Web: http://www.softwareinformatica.cl
#

--
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]




[PHP] PHP-Developers: imap_open fails on PHP4, ok on PHP3

2001-05-24 Thread mheumann

Hi,

I'm afraid this is a rather tough one, as nobody has answered so far.

I'm growing rather desperate about this issue that's been causing me
several sleepless nights already. All I want is to be able to use IMAP to
access POP3 mailboxes with PHP4 (4.0.5). I had no trouble compiling both 
imap and PHP4 on Linux, and actually I also compiled PHP3 with the same IMAP
library.  My Apache uses both modules simultaneously. My little test script (see 
below)  works fine on 
PHP3, but on PHP4 I get the following message(s), being the first the most relevant 
one: 

Warning: Couldn't open stream {mail.host.tld/pop3:110}INBOX in 
/usr/data/htdocs/intranet/mail.php on line 
6
 Warning: Unable to find stream pointer in /usr/data/htdocs/intranet/mail.php on line 
7
 Warning: Variable passed to each() is not an array or object in 
/usr/data/htdocs/intranet/mail.php on
 line 8
 Warning: Unable to find stream pointer in /usr/data/htdocs/intranet/mail.php on line 
10

The code is ok, as far as I can tell (correct me if I'm wrong): 

 
Mail Test 
 
"; 
 imap_close( $mbox ); 
?> 
 
 

The $host in the imap_open line has already been replaced by the literal
string, I have left out the \ before the {,  everything in vain. 

I use apache 1.3.20, PHP 4.0.5, the IMAP snapshot from a couple of days
ago and I configured PHP like this: 

'./configure' '--with-apxs=/usr/sbin/apxs' '--with-gd=yes'
'--with-xpm-dir' '--with-jpeg-dir=/usr/local' '--with-
ttf=/usr/src/freetype-1.3.1' '--with-zlib' '--with-xml' '--with-ftp'
'--with-mcal=../libmcal' '--with-imap' '--with- sybase=/opt/sybase-11.9.2'
'--with-mysql=/usr' '--with-mcrypt=/usr/local' '--with-mhash'
'--with-config-file- path=/etc/httpd/conf' '--enable-versioning'
'--enable-track-vars'   

according to phpinfo(). 

I tried to track down the problem by inserting messages in various PHP and
IMAP source code places. I couldn't get  beyond the call to tcp_open in
IMAP's mail_open function.  It seems that this tcp_open is not being
called by PHP4,  while PHP3 calls it perfectly.  I think maybe the tcp
driver is not loaded, or so.  The pop3 driver seems to be ok. 

I really don't know, I'm just speculating here.  But what could be the
problem?  Is there anything I may have missed  during configure and
compile of PHP4 that differs from the PHP3 procedure? 

Please, you PHP makers out there, try to help me. I would really
appreciate this.  If I can't solve this problem, I can't  port my project
to PHP4. 

Thanks in advance, 
Greetings, 
Michael Heumann.


-- 
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]




Re: [PHP] fdf and pfd functions in PHP

2001-05-24 Thread mheumann

Hi,
I think this is more complicated. You'll need to create the FDF file manually 
pertaining to the format 
specifications. You will have to use the data posted from the HTML form, but just 
writing them out to the 
file won't do the trick.  I haven't done this with PHP yet, maybe the fdf functions 
provided can help you 
somewhat with the format.
Greetings,
Michael.

> Okay, I'm trying to teach myself how to utilize fdf and insert into pdf and
> I have a question for y'all. When using pfd forms to submit to an fdf file,
> the php script uses the variable $HTTP_RAW_POST_DATA as the source to write
> to the fdf file. If I use an HTML form to do the same thing, what variable
> would I use? I tried $HTTP_POST_DATA and it returned an empty variable set
> resulting in an empty fdf file. The code I'm using is as follows:
> 
>  $fdffp = fopen("test.fdf","w");
> fwrite($fdffp, $HTTP_POST_DATA, strlen($HTTP_POST_DATA));
> fclose($fdffp);
> ?>
> 
> Sorry for the basic question but I guess we all have to start somewhere!
> 
> Cheers,
> 
> Dave
> 
> -- 
> 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]



-- 
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]




Re: [PHP] Form security

2001-05-24 Thread mheumann

Hi,
you could use an additional parameter containing a checksum of the entire URL, that 
you check at the 
beginning.  Of course, somebody with the right motivation could find out your checksum 
scheme (I would 
use a subset of the md5 function), but at least it won't be simple anymore.
You could also use a Session ID that you generate somewhere on your site (usually the 
start page). You 
pass that along to the form and check it for validity. PHP 4 supports sessions.
Hope this helps.
Greetings,
Michael.


> Since nobody answered my last question (or any of them for that matter). Let
> me rephrase it a little
> different.
> 
> Other then checking the referer (to make sure the posted data came from the
> right page)
>  and user agent (to see if it exists), is there any other way to secure a
> form from having other
> forms submitting to it?
> 
> -dave


-- 
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]