Re: [PHP] Redirect Function?!!

2001-12-06 Thread Jason Brooke

?php header(Location: http://your.domain/path/to/file.html;); ?


- Original Message -
From: Martin Towell [EMAIL PROTECTED]
To: 'Cam' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, December 07, 2001 3:23 PM
Subject: RE: [PHP] Redirect Function?!!


 how about include'ing the target page then exit'ing straight after?

 include $page;
 exit;

 -Original Message-
 From: Cam [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 07, 2001 4:23 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Redirect Function?!!


 Anyone know of a way to redirect to another page with PHP?  I'm aware of
the
 META tag redirection via the HTTP header, but I really need a more elegant
 solution that redirects immediately without relying on any HTML tags.
 Appreciate the help,
 -C




 --
 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] Passing many valaues to function

2001-11-03 Thread Jason Brooke

maybe in an associative array 

jason 


- Original Message - 
From: Daniel Harik [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, November 04, 2001 4:53 AM
Subject: [PHP] Passing many valaues to function


 Hello
 
 I need to pass about 15 values to function, what would be best way of
 doing it?
 
 
 Thank you very much




-- 
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] defending PHP mail function

2001-10-31 Thread Jason Brooke

Which addresses won't work? 


- Original Message - 
From: Matthew Luchak [EMAIL PROTECTED]
To: Php-General (E-mail) [EMAIL PROTECTED]
Sent: Thursday, November 01, 2001 2:04 AM
Subject: [PHP] defending PHP mail function


Recently I have had to defend the use of PHP in light of a number of
screw-ups with the mail function in 4.0+.  It seems that some email
addresses will simply not work with mail.  I have been shopping around
for a smtp direct class ( http://www.zend.com/codex.php?id=347
http://www.zend.com/codex.php?id=347single=1 single=1 ) looks pretty
good to me and was wondering if anyone has any experiences, shortcuts
etc. to this kind of problem with mail.

 
Matthew Luchak 
Webmaster 
Kaydara Inc. 
[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] defending PHP mail function

2001-10-31 Thread Jason Brooke

 Really?  No good at all, huh?  I would think that would answer the
question
 right there if it was an SMTP problem or a problem that lies elsewhere.
If
 you take SMTP out of the equation, and the problem still occurs, then you
 know that's not the issue.  If the problem does go away, then you've
isolated
 it to either PHP SMTP code (probably) or your SMTP server (not as likely,
but
 still a possibilty)

He already stated that the same code worked with a previous version. He also
made it clear that he was using Win32/SMTP. We all know it will probably
work on a Unix box with sendmail or similar because so many of us use it on
a daily basis with no such problem - that won't help his situation.

I think probing the guy a bit on the premise that he might be mistakenly
loking at Php as the problem is fair enough, but beginning an inquisition
certainly isn't warranted   ;)

jason




-- 
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] php mysql prob...

2001-10-30 Thread Jason Brooke

Or the single quotes around the table name in the sql string 


 Your query is probably broken - do some error checking after your 
 database call with mysql_error() and see what the problem is.
 
 Guess; the table name.




-- 
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] Re: I rest my case

2001-10-30 Thread Jason Brooke

John, Jason didn't literally mean for you to search for the exact string
'Block' - he was telling you to look through the various types of
ThisIsAnApacheDirective tags found in your httpd.conf file, such as
Directory, File etc etc


 There is no BLOCK element in the httpd.conf. Is that where I should be
 looking?
 Warwick


 Jason Murray wrote:

  Hey thanks guys for the help, but it's still not happening.
  Apache had already the AddType lines mentioned by y'all.
 
  It's possible the AddType lines are inside a container that
  will ensure they're not executed. Backtrack to the Block
  element that the AddType lines are in, and see what it does.
 
  Jason




-- 
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] phpmyadmin is installed, now how to access it?

2001-10-28 Thread Jason Brooke

In your web browser like you would any other web interface on your machine

jason

- Original Message -
From: Chip [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, October 28, 2001 4:39 PM
Subject: [PHP] phpmyadmin is installed, now how to access it?


 I just installed the FreeBSD port for PHPMyAdmin and was reading the docs
on
 the php wizard site but cannot figure out how to actually access the
 interface. Is it through a particular port like webmin? Can some clue me
in
 please?
 --
 Chip W.

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

2001-09-13 Thread Jason Brooke

 hi,
 how can i change variables that has two or more words to variables that 
   has + instead of blanks in that variables.
 Like this: word1 word2 word3  = word1+word2+word3
 
 thanks

http://www.php.net/manual/en/ref.url.php 

jason 




-- 
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] Changing perl to PHP

2001-09-12 Thread Jason Brooke

 # read the post from PayPal system and add 'cmd'
 read (STDIN, $query, $ENV{'CONTENT_LENGTH'});
 $query .= 'cmd=_notify-validate';

 # post back to PayPal system to validate
 use LWP::UserAgent;
 $ua = new LWP::UserAgent;
 $req = new HTTP::Request 'POST','https://www.paypal.com/cgi-bin/webscr';
 $req-content_type('application/x-www-form-urlencoded');
 $req-content($query);
 $res = $ua-request($req);


Untested, using the curl part of the online manual (
http://www.php.net/manual/en/ref.curl.php ) as a reference:


foreach ($HTTP_POST_VARS as $key=$value) $query .= $key=$value;
$query .= cmd=_notify-validate;

if ($ch = curl_init(https://www.paypal.com/cgi-bin/webscr;)) {

  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
  curl_exec($ch);
  curl_close($ch);

}

jason




-- 
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] Changing perl to PHP

2001-09-12 Thread Jason Brooke

 ?php
 $fp = fsockopen(www.paypal.com, 443, $errono, $errstr, 30);
 if (!$fp) {
 echo $errstr ($errno)br\n;
 } else {
 fputs ($fp, GET https://www.paypal.com/cgi-bin/webscr
 HTTP/1.1\015\012);
 fputs ($fp, HOST www.paypal.com\015\012);
 fputs ($fp, Content-type:
application/x-www-form-urlencoded\015\012);
 fputs ($fp, Content-Length: . strlen($query).\015\012);
 fputs ($fp, Connection: Close\015\012);
 fputs ($fp, $query); // you might want to do some urlencoding here, if
 it hasn't been done already..
 fputs ($fp, \015\012\015\012);
 while (!feof($fp)) {
 $return .= fgets ($fp,128);
 }
 fclose ($fp);
 }
 ?

I think this may fail for two reasons - it doesn't look much like valid
'SSL-speak' and, the paypal server possibly requires method 'POST'

jason




-- 
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] Verify email client can read html email?

2001-09-12 Thread Jason Brooke

 When sending out email is it possible to know if their email client
 program will be able to read a html email?  If it can't read a html
 email then it would show a text email.  I know it's conventional wisdom
 that this isn't possible but has anyone even heard of someone figuring
 this out?

If you have a look at some of the email rfc's, you'll find a format for
sending both so that most clients will be able to show one or the other

jason




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

2001-09-12 Thread Jason Brooke

 Hell0,

 I have a MySql database with 3 columns.  The first column is id second
 is name and third is value, I have two drop-down lists, with the
 first filled with an array from the column name.  I would like for the
 second drop-down list be changed according to the value of what has
 been selected in the first drop-down list.
 I have fill that I'm going in the right direction, but have run into a
 wall. Can anyone give me some advice in doing this miraculous feat?

 Thanks,

 Jared

Javascript, basically.
Lookup the javascript event handlers, properties, and methods - 'onchange'
and 'select' would possibly be the key ones in this situation.

jason




-- 
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] PHP 4.0.6 bug

2001-09-10 Thread Jason Brooke

 I upgraded from PHP 4.0.5  4.0.6 and since i get openbasedir errors all
 over the place when i try to upload a file through a php script

 is this a bug?

 Stefan de Wal
 dewal.nl

Stefan, did you check your open_basedir and/or error_reporting settings in
php.ini and apache config? What are the errors?

Just because something worked before but doesn't now, doesn't mean it's a
bug in php. It's often because of default settings being different from the
settings you had before upgrade. That's not to say there can't be a bug in
php of course, but just jumping to that conclusion (apparently right away)
is silly.

You can probably help everyone by checking your side of things thouroughly
first, and then when you do report problems, provide more info.

jason




-- 
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] mail() ERROR - WHY, WHY, WHY

2001-09-10 Thread Jason Brooke

 I drowing here and need a life-ring!  I have a site relying heavily on
 e-mail registration, forums, etc. and mail() is broken in my php
 install.  I've been using an smtp server other than sendmail, but
 based on recommendations I have removed that smtp server, removed php,
 installed sendmail, reinstalled php, and php still complains that
 Warning: mail() is not supported in this PHP build and sendmail is
 clearly in my /var/lib/php.ini sendmail_path and the location is
 correct.  I can send mail from the command line, but not via php's
 mail()

 Need Heelp! real bad.

Hi

Can you please provide more info about your php version, operating system,
installation method, configure line (if compiled from source) etc?




-- 
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] PHP 4.0.6 bug

2001-09-10 Thread Jason Brooke

  Stefan, did you check your open_basedir and/or error_reporting settings
in
  php.ini and apache config? What are the errors?
 
 I did. No difference between the old php.ini and the new...the apache
config
 is also unchanged.

And the mentioned open basedir errors? What did they say?


 I think the problem lies in the person who made the rpm package which I
run.
 So i take back the possible bug report. I solved it by running an older
php
 package (4.0.5)

I'm glad you've got a workaround, but it'd be nice to get to the bottom of
the problem and fix it so you can run the latest version which is what you
probably wanted when you upgraded to it. What made you reach the new
conclusion that it's a problem with the rpm, and can we work out what's
wrong with it?

jason




-- 
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] PHP Redirect in the middle of code?

2001-09-10 Thread Jason Brooke

 Right off the top of my head, you have three options that I can see:
 
 (1) Rewrite the code to avoid any output before the redirect.

I'd recommend this one myself 

jason 




-- 
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] Assigning output of include() to a variable

2001-09-09 Thread Jason Brooke

 Hi,

 I've been trying to figure this thing out for 3 hours now. Lets say we
have
 a variable $x. Now I need to assign $x with similar output that comes from
 an include function.

 For anyone who did not understand me -- Instead of the stupid include()
 function outputing the file contents to the browser I need it to assign it
 to variable x.

 I am pretty sure inlude() cannot do it but is there any other function
 similar to include() that will process the file and then assign the output
 to a variable.

 Thanks in advance

 SID

there's a stupid function called file() that does that
it's in the stupid manual - which also explains the behaviour of include for
you as well

jason




-- 
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] Question about running php as root

2001-09-05 Thread Jason Brooke

 But is there a way to make one of my root scripts run by sending it a
 command to do so from the DSO version of PHP like with system command
 or something like that. Or some roundabout way to make it think root is
 asking the script run.

 I hope you understand what I am asking.

There possibly is, depending on your operating system (which you didn't
mention) but you should probably consider doing it a different way - create
a database table which contains jobs to do and have the apache side of php
insert entries into that table, then have your root php script (running at
intervals determined by you), check that table and perform the tasks set in
the database table.

If any of the commands you execute from the root php script take
user-submitted data from the database and pass it to the command line, be
sure to check it for naughty stuff - there's sections in the online php
manual about security, and passing data to the command line

jason






-- 
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] Determining IP address

2001-09-05 Thread Jason Brooke

 I was wondering if there is a way in PHP that you can determine the IP
 address?  I am wondering because I am developing a simple web based
 program (in php) for use in a hospital setting and I want to do some
 checks to make sure that the program is not being run from a computer
 outside of the hospital.  Instead of having user names and passwords, I
 thought it would be eaiser if I just checked the IP address, especially
 since this is not a program that really has to be secure, but I would
 like to prevent just anyone from using it. Is this possible with php?
 Thanks,
 Andrew V. Romero

Yes, you can get it from the webserver environment - there's a section in
the Php manual about this here:
http://www.php.net/manual/en/language.variables.external.php

'Environment variables' is the section you want

jason




-- 
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] PHP and SOCKETS

2001-08-30 Thread Jason Brooke

 Hi there,
 
 I need use sockets in my code, but PHP doesn't see function named
 'socket'. Does any one have any expirience with PHP sockets ?
 Maybe name has changed ?

Did you --enable-sockets in your ./configure line ? 

jason 




-- 
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] Delete Files on Server with PHP

2001-08-30 Thread Jason Brooke

 How can I send a command to remove it from the server within PHP?

 Thanks,

 Paul

You go to the online manual, browse to the Filesystem Functions section and
look up a function that removes files
http://www.php.net/manual/en/ref.filesystem.php

jason




-- 
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] POST to port 443 (SSL)

2001-08-28 Thread Jason Brooke

 Hello,
 I am trying to use the UPS Online Tools, the XML version. This requires
you
 POSTing an XML document to their Tools server, which is SSL enabled. I am
 having a problem getting this to connect in PHP (4.0.6) on my server
(Apache
 1.3.20). In my scripts, I use
 $Socket = fsockopen (www.ups.com, 443, $errno, $errstr);

 if (!$Socket)
 die (Error bla bla bla);

 fputs ($Socket, GET /ups.app/xml/Rate HTTP/1.0\r\n\r\n);
 ...
 ...
 If you point your browser to https://www.ups.com/ups.app/xml/Rate you will
 see a response. But this code seems to just time-out. If I change the port
 443 to port 80, I will get a response. What am I missing for it to talk to
 an SSL port??

The ability to 'speak ssl' instead of plain text

You should probably use the curl functions to do your post via SSL, or some
other tools if using the curl funcs isn't suitable for you. Incidentally,
you're doing a GET anyway when you say that the server requires a post.

jason


-- 
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] virtual() call to CGI script

2001-08-28 Thread Jason Brooke

if you're using apache, something along the lines of the following untested
directives should prevent anyone but the localhost (which is where your
virtual() calls should be coming from) from accessing the cgi's via http

Directory /path/to/usr/cgi
order deny, allow
deny from all
allow from localhost
/Directory

 Thanks for the idea, but ...

 That would cause the script to be executed with permissions of the web
 server, and for security, that is generally prohibited by the ISP (we
 are the ISP).  The only exception to that rule is public scripts which
 reside in:

   safe_mode_exec_dir = /host/runphp

 and are thus allowed to execute with permissions of the web server.

 To provide for the execution of private user CGIs, each user has their
 own /cgi directory.  Apache is configured to recognize /cgi in any URL
 as an executable CGI, and wraps all user CGIs with SuEXEC, to run them
 with permissions of the user, not the web server.

 But of course that means user scripts are accessible via URL.  So the
 question remains, how to limit their access.

 As the ISP, we could use any feature of the web server for our own
 CGIs, but we intentionally avoid that.  We have a hosting environment
 with a rich set of customer accessible tools, and we demonstrate that
 fact by using only those tools ourselves.  IOW, we use what we sell.

 I have some techniques for limiting access to user CGIs, but I still
 wonder how others have approached this problem ...


 Egan




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

2001-08-28 Thread Jason Brooke

 I use mcrypt to encrypt passwords,  I saw somewhere international users
had
 trouble with the high ascii.  is the any functions that can convert the
high
 ascii to hex or something ?

 Thanks

 Randy

Have a squiz here:

http://www.php.net/manual/en/ref.strings.php




-- 
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] virtual() call to CGI script

2001-08-28 Thread Jason Brooke

 We don't define any virtual hosts in httpd.conf; instead, we use a
 custom handler hooked into post-read-request.  So I won't be able to
 define /path/to/usr/cgi in httpd.conf.

 But if that concept will work in user .htaccess files, it would be an
 improvement over my current techniques.  I'll give it a try ...

 Thanks for the idea!


 Egan

Ah ok

It will work in .htaccess if you enable it, or you might even be able to use
something like:
DirectoryMatch ^/path/to/.*/cgi

(untested again)




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

2001-08-28 Thread Jason Brooke

 Hi,

I would like to know how to use the mailto function calling the
mail
 client and at the same time having the subject filled with something.

This is not a php question, it's html and easily answered by looking at a
html reference, but the answer is:
a href=mailto:user@host?subject=The Subjectclick here to email/a

jason


-- 
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] virtual() call to CGI script

2001-08-28 Thread Jason Brooke

 After testing this I see that:

 Apache uses the IP address of the remote host to determine whether to
 allow or deny access.

 Even though PHP is running on localhost, and making a request via the
 virtual() function, Apache still knows the IP address of the remote
 host, and uses that.

I didn't think of that

I just did a test on my own server and used
readfile(http:///cgi-bin/test;) where test just prints
getenv(REMOTE_ADDR) and it prints the ip address of eth0, so you'd be able
to do it this way - but I don't think using readfile() is as nice as
virtual() in this case because readfile() performs another literal http
request back to the server causing the use of another httpd process I think,
whereas virtual() probably doesn't

Another way you might be able to do it is find an environment variable that
is only present when the cgi's are executed by the virtual() call, then use
the apache SetEnvIf directive combined with DirectoryMatch

jason




-- 
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] HEAD instead of GET??

2001-08-28 Thread Jason Brooke

 For example:
 
 HEAD /contact.php4 HTTP/1.0
 
 instead of
 
 GET /contact.php4 HTTP/1.0
 
 
 
 
 What does it mean?
 
 cheers,
 
 - seb

From the http1.1 rfc (because it's a http-related thing, not php) 
ftp://ftp.isi.edu/in-notes/rfc2616.txt 



9.4 HEAD

   The HEAD method is identical to GET except that the server MUST NOT
   return a message-body in the response. The metainformation contained
   in the HTTP headers in response to a HEAD request SHOULD be identical
   to the information sent in response to a GET request. This method can
   be used for obtaining metainformation about the entity implied by the
   request without transferring the entity-body itself. This method is
   often used for testing hypertext links for validity, accessibility,
   and recent modification.

   The response to a HEAD request MAY be cacheable in the sense that the
   information contained in the response MAY be used to update a
   previously cached entity from that resource. If the new field values
   indicate that the cached entity differs from the current entity (as
   would be indicated by a change in Content-Length, Content-MD5, ETag
   or Last-Modified), then the cache MUST treat the cache entry as
   stale.




-- 
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] PHP mysql admin?

2001-08-27 Thread Jason Brooke

Just gave it a go, it hangs for ages connecting to my servers with many
databases, and takes ages to retrieve record sets that load much much faster
via the phpmyadmin html interface

phpmyadmin, although plenty buggy on certain actions, is far better to use
for me so far


- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: Joseph Bannon [EMAIL PROTECTED]; PHP (E-mail)
[EMAIL PROTECTED]
Sent: Tuesday, August 28, 2001 11:57 AM
Subject: RE: [PHP] PHP mysql admin?


 phpMyAdmin is very nice...
 but not even close to Mysqlfront... try it out...

 http://www.mysqlfront.de/




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

2001-08-20 Thread Jason Brooke

php -q

try php -h for other options - if that fails, there's always the manual -
http://www.php.net/manual


- Original Message -
From: Nick Davies [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 20, 2001 8:06 PM
Subject: [PHP] php executable



 Is it possible to surpress the

 X-Powered-By: PHP/4.0.6
 Content-type: text/html

 text when running php from the commandline?

 Thanks.
 Nick.




-- 
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] Using mcrypt in PHP

2001-08-19 Thread Jason Brooke

hopefully someone who knows what they're doing can reply to you, but in the
meantime this should get you going - it works for me:

$td = mcrypt_module_open(MCRYPT_TripleDES, , MCRYPT_MODE_ECB,
/usr/lib/mcrypt-modes);
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, your key string here, $iv);

then just use mdecrypt_generic($td, $data) and mcrypt_generic($td, $data)
where $data is your string to encrypt


- Original Message -
From: Dr. Evil [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 20, 2001 11:03 AM
Subject: [PHP] Using mcrypt in PHP



 There seems to be no reliable information in the manual about how to
 do this.  I'm trying to use mcrypt 2.4 with php4.06, which should be a
 compatible combination.

 So far, I have gotten it to work like this:

 $cypher = MCRYPT_RIJNDAEL_128;
 $encrypted = mcrypt_encrypt($cypher, $key, $plaintext, MCRYPT_MODE_ECB);
 $decrypted = mcrypt_decrypt($cypher, $key, $encrypted, MCRYPT_MODE_ECB);

 However, when I do this, I get an error saying:

 Warning: attempt to use an empty IV, which is NOT recommend in

 So I tried to do the same thing with an IV:

 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cypher, MCRYPT_MODE_ECB),
 MCRYPT_RANDOM);

 and then added this $iv as an argument to encrypt and decrypt.  At
 this point, it doesn't work, because the iv is different in the
 encrypt and decrypt functions, because it is randonly generated.  Is
 it true that I need the same iv to encrypt as to decrypt?  I'm just
 not understanding how to use this.  All I want to do is to encrypt
 stuff and then decrypt it, using a key, right?  It used to work.

 Thanks.

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

2001-08-12 Thread Jason Brooke

  I am logging server activity to a MySQL database.  Unfortunately, I
  have yet found a way to log the number of bytes being transferred to a
  visitor.  The closest I've come to anything like that is
  apache_lookup_uri() but I'm not sure it's meant to handle such a
  thing.  Does anyone know a solution to this?

 I wouldn't use PHP for this at all.  Look at Apache's Piped Logs feature
 that sends log entries to an external process for logging.  Should be
 relatively simple to pipe it to something that enters the information into
 a MySQL DB.  I bet something exists that does just that somewhere.

 -Rasmus

I made a little C program to do this a couple of years ago. I'm not very
good at C but if you want the source anyway, just email me.

Incidentally, the number of bytes transferred to the client is available in
the Apache logging - check the Apache manual for the format specifier under
the LogFormat directive.

jason




-- 
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] IE - View Source

2001-07-26 Thread Jason Brooke

I was under the impression it couldn't be done because it would require your
code control the end-user's web browser, no matter what the brand.

Can you please show us these sites?


- Original Message -
From: Steve Haemelinck [EMAIL PROTECTED]
To: Brad S. Jackson (E-mail) [EMAIL PROTECTED]; PHP Mailing Listl
(E-mail) [EMAIL PROTECTED]
Sent: Thursday, July 26, 2001 4:32 PM
Subject: [PHP] IE - View Source


 Some sites are able to disable the source view in ie. How do you do that?

 Haemelinck Steve

 Personal:
 Haemelinck.be - Developers Unite :)
 Junior WebDeveloper
 http://www.haemelinck.com/
 [EMAIL PROTECTED]

 Work:
 MCT IT Consulting - Take consulting 2 the next level
 Junior IT Consultant
 http://www.mct.be/
 [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] .htaccess and determining if a user is logged in

2001-07-24 Thread Jason Brooke

 I've done further investigation and it seems that if I go with the
approach
 of looking for a REMOTE_USER value, I'll have to do the following:

 Since Apache only fills out the REMOTE_USER if the file is in a protected
 directory, I have to make a symbolic link within a protected directory to
 the non-protected script. Then Apache will require authentication for the
 file. Thus, both non-authenticated and authenticated users are running the
 same script.

 Any problems with this approach? My worry is that if the user passes
 $REMOTE_USER=FooledYou in the url, it'll fool my script into thinking
 Apache sent it. I'll have to check into that one.

 Any better ideas?

Yep - have a look at the manual here:
http://www.php.net/manual/en/language.variables.external.php

and here:
http://www.php.net/manual/en/configuration.php  (search for 'gpc_order')

jason





-- 
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] Stopping stolen / spoofed / linked sessions

2001-06-30 Thread Jason Brooke

  I want to use PHP4 sessions for authentication,

 Ok, stop right there.  Sessions and authentication have nothing to do with
 each other.  To create a secure authenticated site you should be using
 HTTP-based authentication over SSL.  Sessions are simply for maintaining
 state across http requests and have nothing to do with authentication.

 -Rasmus

So setting a 'loggedin' session variable once a person has authenticated, and
checking for that session variable each request before proceeding is not ok?

jason




-- 
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] Capturing the url in the location bar

2001-05-15 Thread Jason Brooke

$variable = http://;. $HTTP_HOST. $REQUEST_URI; 



 Is there a way of capturing the entire url contianed in the location bar
 within a variable?




-- 
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] need better solution...

2001-05-14 Thread Jason Brooke

 but sometimes I want something like this:
 ?php
  session_start(); // for instance
  code code code
  if(something)
  print error message and terminate script;
 ?
 html
 sadasdsa
 /html

 what do I do in this case??? I've tried all kinds of programing
 techniques... but none of them seems to fit here.

I don't understand why you're asking what to do in that case - what exactly is
the problem there?

jason





-- 
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] need better solution...

2001-05-14 Thread Jason Brooke

 the problem is, if I terminate the script on that condition the footer
 won't be displayed...

Instant fix - include footer.inc; exit;

Better fix: decide your logical layout before you proceed and arrange if/else
blocks accordingly so you don't need to terminate the script to avoid showing a
page's contents.

ie: have your single template shell which includes a particular content
container if your code allows. here's one way

?
/*
protect yourself from people doing things like
http://your.domain/your/script?include=../../../../../../../../some/secret/file
*/
unset($include); // will do for the purpose of this example

if ($something)
$include = this_particular_content.inc;
else if ($something_else)
$include = this_other_content.inc;

include your_header.inc;

include $include;

include footer.inc;
?




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

2001-05-14 Thread Jason Brooke

 $SERVER_NAME only gives me foober.com (since that is the servername), but not
 the alias someone typed in to get there ...

 --Joe

Give HTTP_HOST a go
Check here for more
http://www.php.net/manual/en/language.variables.predefined.php or use phpinfo()
to see exactly what you have available

jason




-- 
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] finding a variables name

2001-05-14 Thread Jason Brooke

foreach($GLOBALS as $key=$val) 
 echo $key=$valbr\n; 

see the list() and each() functions in the manual for php3 


- Original Message - 
From: Joseph Blythe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 15, 2001 1:48 PM
Subject: [PHP] finding a variables name


 Hey ppl,
 
 How does one find the name of a variable, not what the variable contains?
 
 This is not the same as variable variables.
 
 I know this seems a bit pointless but I have come across a situation 
 where I really need to be able to do this.
 
 Hope someone can help,
 
 Thanks,
 
 Joseph




-- 
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] Simulate the Enter key in Unix with PHP

2001-05-11 Thread Jason Brooke

Why don't you just use the -b switch and do it in one hit? 


- Original Message - 
From: YoBro [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 12, 2001 3:32 PM
Subject: [PHP] Simulate the Enter key in Unix with PHP


 Hello,
 
 I have been trying to get PHP to execute some code to add users to the
 htpasswd file.
 So far I have this
 
 system (htpasswd /users/website/.htpasswd jim);
 
 My browser receives the unix data that reads : Adding user jim printed to
 the browser.
 Then you are usually prompted for a password in Unix, so the following is
 the password I want to submit, but how do I tell it to simulate an ENTER key
 press after each submission of the password.
 
 system (password);  // usually press enter after this
 system (password); // and enter again.
 
 I am hoping this will fix the problem. If it is beginning to add the user,
 then it should work if I can execute the passwords with an ENTER after it as
 well.
 
 
 YoBro
 
 
 
 -- 
 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] Passing variables to another page - newbie

2001-05-06 Thread Jason Brooke

 Thanks to everyone for the help - unfortunately my problem seems to be the
 function I'm using to do the redirecting.  header() is supposed to be the
 first item passed.  What I'm trying to do is use a line of code well down
 into the logic of my script to redirect the user to another page along with
 the necessary variables.
 
 I may need to validate input on one page, have another form inside my code
 that is executed after the first form posts, then when they choose payment
 type that form can post to the appropriate payment site  Seems like an
 extra step.
 
 Dean

Why would you need to print anything out before redirecting them? 

jason 




-- 
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] appended with \

2001-05-04 Thread Jason Brooke

 I am using a form to test posting a variable. If my variable looks like this
 in script post_var.php3 :
 
 stringinaaform
 
 then  it comes out like this in recieve.php3 :
 
 \stringinaaform\
 
 why? thanks in advance.

Did you check the manual? http://www.php.net/manual/en/configuration.php 

jason 




-- 
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] sprintf()'s in if()'s

2001-05-04 Thread Jason Brooke

 I suppose when you have so few problems you get to nitpick..

 Guess my question is; why doesn't this work?

 if(sprintf(%01.2f,$Result[CurrentPrice]+$Result[Increment]) =
sprintf(%01.2f,$BidAmt)) {

 when this works;
 if(0.30 = 1.00) {

 I'll just settle with a workaround for now.

 Thanks,
 Chris

The former is being treated as a string, the latter is a double/float
You probably don't need to format them when making the comparison. Just try:

if ( ($Result[CurrentPrice]+$Result[Increment]) = $BidAmt) {

jason




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

2001-04-27 Thread Jason Brooke

 Hello everyone!

 I am trying to pass a variable in a url and can't seem to do it.  The
problem is, the url is already being determined by a php if statement.
So, when I get to the part where I try to append the url I get parse errors.
What I would ideally like to do is generate the url using php and append the
url with a variable, also using php.  The variable is a username, therefore
i need to use (urlencode()).  Any ideas.

 Thanks,

 Brendan

The short answer is 'yes, just do it'
Paste the code that's giving you errors and someone will help you

jason




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

2001-04-21 Thread Jason Brooke
header("Location: http://your.dom/file"); 


- Original Message - 
From: "Kishore" [EMAIL PROTECTED]
To: "phpgeneral" [EMAIL PROTECTED]
Sent: Saturday, April 21, 2001 11:28 PM
Subject: [PHP] redirection


 How to redirect to another page in php. Is there any inbuilt function
 available for redirection.
 If possible send with example.
 
 
 Thanks
 
 kishor




-- 
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] IP address enconding

2001-04-19 Thread Jason Brooke


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



 No! I can encode IP address to an Integer:
 192.168.0.1 consider as: a.b.c.d
 and now the formula goes:
 a shl 24 + b shl 16 + c shl 8 + d
 
 but i was looking for something ready made
 
 -elias
 http://www.kameelah.org/eassoft




-- 
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] php equivalent for `command`

2001-04-18 Thread Jason Brooke

echo ++$x;

http://www.php.net/manual/en/language.operators.increment.php



  Is there a php equivalent for the use of ` (I think) in Unix/Perl? So
for example echo "`$x++`" would first evaluate $x++ and then print the
resulting value.
 
  Euan Greig
  Technical Consultant
  BRANN DATA
  [EMAIL PROTECTED]
  01285 645997




-- 
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] Asking for input from shell?

2001-04-08 Thread Jason Brooke

$fp = fopen("php://stdin", "r");
echo fgets($fp, 64); 
fclose($fp);

- Original Message - 
From: "enthalpy" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 09, 2001 1:10 PM
Subject: [PHP] Asking for input from shell?


 
 anyone have sample code of how you can have a php script (cgi)
 ask for input from the shell?
 
 -CoreComm-Internet-Services---http://core.com-
 (Jon Marshall CoreComm Services Chicago)
 ([EMAIL PROTECTED] Systems Engineer II)
 ([EMAIL PROTECTED]   Network Operations)
 -Enthalpy.org-http://enthalpy.org-
 ([EMAIL PROTECTED] The World of Nothing)
 --
 
 
 -- 
 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] PHP + IRC

2001-04-04 Thread Jason Brooke

Yes - see the network and/or socket functions sections in the manual at
http://www.php.net
You might want to use the IRC RFC as a reference on the protocol

jason



 Hello PHP,

   Is there any ways to use php with irc?

 --
 Best regards,




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

2001-04-03 Thread Jason Brooke

Yes 



 Hi all,
 
 Has anyone had any experience in using the QSI payments software with
 PHP4?
 
  Mark




-- 
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] Post but not Post

2001-03-28 Thread Jason Brooke

Use fsockopen to send the data:

$host = "your.host";
$port = 80;
$postdata = "field1=value1field2=value2field3=value3";

if ($sp = fsockopen($host, $port)) {
  fputs($sp,"POST /path/to/script.php HTTP/1.0\n");
  fputs($sp,"Host: $host\n");
  fputs($sp,"Content-type: application/x-www-form-urlencoded\n");
  fputs($sp,"Content-length: ".strlen($postdata)."\n");
  fputs($sp,"Connection: close\n\n");
  fputs($sp,$postdata);
  fclose($sp);
}

jason


 Hello.

 we all know that we can send variables to another PHP file via form tag
 and with post method.
 now i wonder if i can send variables from a script to another like POST
 method but not using form tags.
 like my question is how can i transfer data from form to form like the
POST
 of the form tag, but w/o session variables or cookies, or url parameters
 (like the GET method), and w/o forms ofcourse?

 Currently, i'm doing this via hidden forms and automatic posting via
 JavaScript, but is there is any clean and better way?

 Thanks.




-- 
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] Post but not Post

2001-03-28 Thread Jason Brooke

 I was just doing this a while back and ran into problems when going to
443.
 Any ideas on that?  A regular fsockopen failed because of the security
 needed.

 -Bob

Probably because you weren't following the SSL protocol
You'll find the curl functions useful for SSL posting - or even non SSL

jason




-- 
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] Fetching mails from a mailbox in PHP

2001-03-11 Thread Jason Brooke

Yes - see the network functions in the Php manual.
If you don't already know the protocol commands for the mail retrieval
protocol you want to use, see the relevant rfc.

jason

- Original Message -
From: "Filip Olsson" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 12, 2001 10:12 AM
Subject: [PHP] Fetching mails from a mailbox in PHP


Question:

Can you by any other means except the IMAP functions get the mails from an
mailbox?
Appreciate an answer.


--
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] exec as another user

2001-03-07 Thread Jason Brooke

Or install the cgi version and use it in conjunction with suExec alongside
the module version.

jason


- Original Message -
From: "Jon Snell" [EMAIL PROTECTED]
To: "php general" [EMAIL PROTECTED]
Sent: Thursday, March 08, 2001 9:44 AM
Subject: RE: [PHP] exec as another user


 It would be a much better idea to set the +s flag on the executable you
are
 trying to run, and make sure it's owned by the other user.

 -Original Message-
 From: Henrik Hansen [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 07, 2001 1:10 PM
 To: php general
 Subject: Re: [PHP] exec as another user


  Hi,
 
  This may be a stupid question but how can I execute programs as another
  user under php?
  I'm using Linux with Apache 1.3.12 and PHP 4.

 The only way i can figure out would be by using the sudo command without a
 password
 (don't do that with root), do a 'man sudo' on your linux box

 --
 Henrik Hansen


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




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

2001-03-06 Thread Jason Brooke

Hi Tyler - did you check the date functions in the manual?

date() with the 'n' format let's you grab the month's ordinal from a unix
timestamp, and mktime() let's you easily create unix timestamps

$next_mon = date("n", mktime(0,0,0,date("m")+1));

jason



 Hello,

 How do I get the number of the next month (Ex: 4).  And when the current
 month reaches 12, the next month would be 1 and the next year would be
2002.
 Anybody know how I can accomplish this?

 Thanks,
 Tyler Longren




-- 
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] checking for a defined function

2001-03-01 Thread Jason Brooke

http://www.php.net/manual/en/function.extension-loaded.php

jason

- Original Message -
From: "Eric Peters" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 01, 2001 10:29 AM
Subject: [PHP] checking for a defined function


 how can I do something like

 if(!defined(cybercash_encr())) dl("cybercash.so");

 anyone know of a good way to see if a function/module has been included in
 php?

 I need a run time solution for a script to be encoder()ed and distributed,

 Thanks

 Eric




-- 
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] php4 as a module AND a cgi

2001-02-26 Thread Jason Brooke

 I have to ask, though, why would you want to run it as a cgi?

 Its slower as cgi and runs more security risks.
 I'd only run it as a cgi if that was my only choice.

It's probably less of a security risk when utilised via the cgi actually, at
least when using Apache as the webserver because you can use suExec to cause
it to run under the script owner's uid instead of Apache's. I've often
considered switching vhosts over to the cgi version instead of module for this
very reason.

jason




-- 
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] php vs perl

2001-02-15 Thread Jason Brooke

 When Jason says 'especially when your note using the cgi' he means the
 cgi version of PHP (I think) in preference to installing PHP as an
 apache module.


Almost, yes - I literally meant the 'common gateway interface', due to the
fact that the webserver spawns the requested script/program outside of it's
own process. I don't know the technical detals involved in doing this, but I'm
guessing that in general, it'd incur more overhead on the system than the same
code would if it was parsed by the already-running httpd process.

jason




-- 
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] deleting cart items on session expire

2001-02-15 Thread Jason Brooke

 However, there's no necessity to have the cgi version if you already have
 the modular version.  All that is needed is to call the appropriate script
 using a tool such as 'wget'.  This can be done manually or from cron as
 appropriate.

 Billy

No there's not - I think that goes without saying though.

But while you're compiling Php anyway, why not re-run ./configure without the
'--with-apache' and add an '--enable-discard-path' and type 'make; make
install' - then you can use this awesome tool from the command line without
having to invoke a http request to your webserver usng a third-party tool.

jason




-- 
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] php vs perl

2001-02-14 Thread Jason Brooke

 Is there any reason why php is better than perl for shopping carts
 and/or product catalogs?

 Thanks,
 Jeff


It's hard to just come out and say that php is better than perl for shopping
carts because there's too many factors to take into consideration.

If you were a person who'd never used either, I'd guess that php might be
better to use because the essential ingredients are pretty much already
included with php, such as session handling, form and url data processing,
and a wide variety of database functions.

That's not to say the same things aren't fairly easy to plug right into perl
by way of readily-available modules, but it's probably a bit of extra work,
especially for the beginner. Someone who already uses perl would likely have
libraries for these things already installed/handled anyway though.

I think the syntax might be a little easier to understand in php too,
although it's sure to be a personal preference thing to a large extent.

To me, the bottom line is go with the one you feel most
productive/comfortable with. They're both about as cross-platform portable
as each other (I think?) and both are pretty robust under heavy load,
especially when you're not using the cgi.

jason




-- 
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] deleting cart items on session expire

2001-02-14 Thread Jason Brooke

You'll probably need to trigger the deletion of all expired carts with
something other than trying to guess when the user closes their browser.

Maybe a regular cronjob, or just do it inside your globally-included
function definition script so that any hit to the website can trigger it for
you, or perhaps just put it in the script that's used when creating a new
cart for someone.

jason

- Original Message -
From: "Joseph H Blythe" [EMAIL PROTECTED]
To: "php-general" [EMAIL PROTECTED]
Sent: Friday, February 16, 2001 3:29 PM
Subject: [PHP] deleting cart items on session expire


 hey all,

 I was wondering how one would suggest removing items from a cart system
once the session lifetime has expired. I have it set to the default 0, which
expires the session on browser close, what I want to be able to do is
"delete * from Cart where session='$PHPSESSID'" when the user closes thier
browser window is this even possible? maybe using register_shutdown_function
or something?

 Any ideas would be great!

 Thanks

 Joseph




-- 
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] deleting cart items on session expire

2001-02-14 Thread Jason Brooke

 If you're already using the CGI version of PHP, there isn't any
 disadvantage to using either it or perl scripts to do this clean-up.  If
 you're running the Apache module version of PHP, you'll need to find a
 tool that can be invoked from the command prompt (such as perl) to do
 this for you.

Just as an aside, there's no reason I can think of that you can't run both
the Apache module and standalone binary on the same system side by side -
I've been doing this for about 2 years without trouble.

jason




-- 
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] Using php as a shell scripting language

2001-02-12 Thread Jason Brooke

Hi Tony
Did you happen to check the manual? :)

This will get you started:
./configure --with-your-required-options --enable-discard-path



- Original Message -
From: "Tony Bibbs" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 1:18 PM
Subject: [PHP] Using php as a shell scripting language


 I have a need to use php similar to how I would bash when creating shell
 scripts.  I have two RH6.2 machines that have the same version of php
 (slightly different compile-options).  One machine in particular lacks the
php
 binary in /usr/local/bin and that's what I need to use php in a shell
script.

 I did ./configure --help to see if there was an option that I was missing
and
 nothing jumped out at me as being the obvious fix.  How do I compile PHP
to
 get this binary?

 TIA,

 -TB

 ***
 Tony Bibbs
 Iowa Outdoors - Hunting and Fishing
 http://www.iowaoutdoors.org
 [EMAIL PROTECTED]
 515.554.8046
 ***




 --
 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] Files only available via HTTPS

2001-02-08 Thread Jason Brooke

http://www.modssl.org/docs/2.6/ssl_reference.html#ToC22

jason


- Original Message -
From: "Daniel Tryba" [EMAIL PROTECTED]
To: "Michael Conley" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, February 09, 2001 12:24 PM
Subject: Re: [PHP] Files only available via HTTPS


 On Thu, Feb 01, 2001 at 04:29:09PM -0800, Michael Conley wrote:
  I have several PHP files that I only want users to be able to access via
  HTTPS.  How can I control that on an Apache 1.3.14 server running on
RedHat
  7?  I have openssl and mod_ssl working fine.  Currently, I can access
all of
  the files on my site via either http or https.  I want to keep certain
files
  (with interesting information) from being accessed via http.  I realize
this
  isn't really a PHP question, but I have no idea how to do this.

 You could check on which port the request was made for the php file.
 https is usually port 443

 if ($SERVER_PORT!=443)
 header("Location: https://server/$PHP_SELF");

 --

 Daniel Tryba

 --
 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] SQL Statments?

2001-02-05 Thread Jason Brooke

 If I have a text file with all my sql statements (from like say mysqldump)
 what's the easiest way of passing them to mysql? I'm on RedHat6.2 with
mysql
 3.22.32

 Thanks,
 -Jonathan

I'm not sure about the easiest way, but definitely an easy way would be to
simply do:

cat filename | mysql your_database -u user -p


jason




-- 
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] Apache and PHP

2001-02-04 Thread Jason Brooke

I'm not even sure that the shell escape is even used in win32 perl - I think
it's done via a regular file association. I clearly remember setting it to
#!/some/fake/rubbish one time as a test and it still worked fine

I imagine the same would go for php.exe

jason



 Do you normally have #!perl.exe as your shebang?

 Normally I'd see something like #!/usr/local/bin/perl or
 #!/usr/local/bin/php

 not sure of pathing issues on Windows for that.

 #!c:\program files\php4\php.exe
 ?


 "Patrick L. Olson" wrote:

  I must be missing something while I had no problem getting
  perl and SSI working getting PHP to work is eluding me
  for some reason. I have added this to httpd.conf
  can someone enlighten me on what may be missing
 
  # And for PHP 4.x, use:
  #
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps
 
  if I call it like http://127.0.0.1/cgi-bin/one.php
  with the shebang line #!php.exe
  I get the following error
  No input file specified
  if I call it without the shebang I get
  the Internal Server Error
  Error logs indicate the the #! is needed
  if I call it in the web root as
  http://127.0.0.1/one.php4
  it prints the code to the screen
  any insight welcome
 
  Thanks
  going to RRTFM :)




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

2001-01-24 Thread Jason Brooke

The online manual has some working examples

Also, using the socket funcs in Php isn't very different from using them in
C - try searching www.google.com if the examples in the manual aren't enough

jason


- Original Message -
From: "Boget, Chris" [EMAIL PROTECTED]
To: "Php (E-mail)" [EMAIL PROTECTED]
Sent: Wednesday, January 24, 2001 8:00 AM
Subject: [PHP] Sockets


 Are there any tutorials on how to use Sockets in PHP?
 If so, where can I find them?  I've looked on several of
 the sites that are linked from the main php.net site but
 found nothing... :/

 Thanks.

 Chris




-- 
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] FW: Cookies, Dammit!

2001-01-16 Thread Jason Brooke

I hope you don't mind me nagging on this ;) but what do you mean by having
to echo changes into the /minisite directories?

What I meant was, from minisite45/index.htm, include() the same content
include file you use in /index.htm. I'm not seeing why the
/minisitex/index.htm pages need to change at all? The only thing that
would change is the content of the include()'d file that /index.htm, and the
minisite/indexx.htm include.


/index.htm

html
etc etc
body...

? include "main_include.inc"; ?

/body
/html

main_include.inc:

some possible html tags
? echo "Welcome". ($minisite ? " from $minisite" : "."); ?
some possible html tags


/minisite45/index.htm

html stuff
?
$minisite = 45; /* or even a snip that dynamically gets it from the
script_name */
include "main_include.inc";
?



- Original Message -
From: "Richard S. Crawford" [EMAIL PROTECTED]
To: "Jason Brooke" [EMAIL PROTECTED]; "Richard S. Crawford"
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, January 17, 2001 9:19 AM
Subject: RE: [PHP] FW: Cookies, Dammit!


 The first approach is actually what we do now.  However, since /index.htm
is
 a dynamic page which changes frequently, we don't want to have to try to
 echo all of those changes into all of the /minisite directories (of which
 there are well over 100) every single time a change occurs.  We're going
to
 try the second approach now, but we still are going to try to build the
 query string of the Location: header based on values retrieved from a
MySQL
 database.

 --
 Richard S. Crawford
 Senior Web Developer
 NeuroHub, Inc.
 (916)789-4167 / (530)307-0069(cell)
 AIM Handle: Buffalo2K
 http://www.neurohub.net





-- 
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] MySQL Newbie ? -Help!

2001-01-09 Thread Jason Brooke

one simple way would be to make a duplicate, empty table and then do:

insert into newtable select distinct * from oldtable


then try adding a uniqueness constraint if you don't want duplicates in the
future

jason



 Hi,
 Is there a way to go through a table and remove all duplicate entries so
 that there is only one? The way I am doing it now is taking FOREVER.
Thanks,

 Matt Stone





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