[PHP] Backing up: Database and scripts...

2003-07-22 Thread Michael Smith
Hi,

So I can create the files, move them, etc. to backup my database and a 
couple of directories, but how do I create a gzip file of that and send 
it to the user? I need to basically execute a command to gzip a couple 
of files/directories... I also need to figure out how to un-gzip a gzip 
file... (and extract those files). Please help!

-Michael
--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PEAR::Archive_Tar: File limit???

2003-07-22 Thread Michael Smith
Hi,

I'm using PEAR::Archive_Tar to create a tar backup. I already have all 
my stuff ready in some folders, so this is whats going on:

//we need the files
$files[0] = ../downloads/;
$files[1] = ../images/;
$files[2] = ../pages/;
$files[3] = ../pages_test/;
$files[4] = ../sql/;

//create a new archive
$tar = new Archive_Tar(../backup/backup.tar);
foreach($files as $file) {
$tar-add($file);
}

header(Content-type: application/octet-stream);
header(Content-Disposition: attachment; filename=backup.tar);
header(Content-length:  . filesize(../backup/backup.tar));
header(Pragma: no-cache);
readfile(../backup/backup.tar);
unlink(../backup/backup.tar);
But only the images and pages directory are going into the tar file...

please help!

-Michael
--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Note on SuperGlobals

2003-07-17 Thread Michael Smith
Here's something pretty good I just found:

A few years ago, my wife and I decided to go on a skiing trip up north. 
To reserve skiing equipment, you had to give 24 hours advance notice 
using the ski lodge's on-line website. The catch was that my wife had 
asked me to make the reservations 23 hours before the deadline.

So I got to thinking, and examined the online website, which would not 
let you make any reservations within the 24 hour timeframe. However, 
once you selected an appropriate date, I noticed that the URL was:

https://www.somewhere.com/reservations.php?date=01-23-01

It occurred to me that, while they had locked down security on what 
dates I could choose from, the final value was placed into a GET 
statement at the end of the web address. I modified the web address to 
use date=01-22-01 and indeed, our skies were waiting for us first 
thing the next morning (we paid for them, of course).

This innocent yet practical example is just one of the dangers we have 
to be aware of when using any programming language that can be used in 
ways that we did not intend, which leads us into our discussion on PHP 
Superglobals.

this was found on:
http://hr.uoregon.edu/davidrl/lamp/php.html#PHPSUPERGLOBALS
-Michael
--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] XML Array

2003-07-15 Thread Michael Smith
Hey,

I'm looking for a function to take an XML file and turn it into a PHP 
array with the same structure. So if I have:

template
color#00/color
backgroundimage.jpg/background
/template
It would give me an array:

Array (
[template] = Array (
[color] = #00
[background] = image.jpg
)
)
Anyone know of anything like that?

-Michael
--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: DOMXML...

2003-07-15 Thread Michael Smith
This is not an option for me... I'm writing a CMS and want to be able to 
do things for other users without specific compile options.

-Michael
Russell P Jones wrote:
This may not be what you are looking for, but the DOMXML object since PHP
4.0 works great --- you do have to compile PHP using the --with-dom
For example... If i am dealing with the following structure...

contacts
  contact
  nameRuss/name
  phone919.919.1919/phone
  /contact
  contact
  nameOther/name
  phone912.932.9328/phone
  /contact
/contacts
and the name of this xml file is contacts.xml

I would do the following...

$xmlDoc = domxml_open_file('xml/contacts.xml');
$root   = $xmlDoc-document_element();
$contacts = $root-children();
// this new $contacts file is an array of the xml tree. For example, to
call up the first set of contact info, the info for russ, just use
$contacts[0]
// but there is more. say you want to learn about this contacts[0] node,
such as pull the name russ. First, you have to get all the chirlden of
this node... so you can do...
$node_to_work_with = $contacts[0]-children();

// now this $node_to_work_with is an array with all the children,
including the name, phone, etc. built in + information about these
children. for example...
echo $node_to_work_with[0]-get_content();

// that would print Russ

echo $node_to_work_with[1]-get_content();

// that would print the Phone Number

echo $node_to_work_with[0]-name();

// that would print Name as in the name of the node, which
coincidentally happens to be name...
--Russ



--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Private and protected variables in PHP 5?

2003-07-11 Thread Michael Smith
Hey,

private vars are not accessible that way. This is the way it works...

private $var is only usable by the class. You can't access it through
$object-var.
protected $var is only usable by the class if it was called directly, 
but not by any objects that are classes that are extended from the base. 
Example:

class Parent {
protected $var = test;
function blah($somevar) {
...
}
}
class Child extends Parent {
...
}
$parent = new Parent;
print $parent-var; //ouputs test
$child = new Child;
print $child-var; //outputs nothing
as you can see $var is only accessible by objects that are specifically 
Parents, not Children.

public vars are accessible by the class itself, ($this-var), derived 
classes, and by $class-var.

HTH,
Cheers!
-Michael
Paul Hudson wrote:
All,

I'm toying with the new stuff available in PHP 5 (latest CVS), but I've hit a 
brick wall: both private and protected don't seem to work as I'd expect them 
to.

Here's an example script:

?php
  class dog {
// declare two private variables
private $Name;
private $DogTag;
public function bark() {
  print Woof!\n;
}
  }
  // new class, for testing derived stuff
  class poodle extends dog {
public function bark() {
  print Yip!\n;
}
  }
  // I now create an instance of the
  // derived class
  $poppy = new poodle;
  // and set its private property
  $poppy-Name = Poppy;
  print $poppy-Name;
? 

For some reason, that script works fine - PHP doesn't object to me setting 
private variables in the derived class.  Yet if I use $poppy = new dog, the 
script errors out as expected.  It's almost like PHP inherits the member 
variables, but not the attached access control.

For protected, here's another script:

?php
  class dog {
// this next function is protected
// viz, it should be available to dog
// and its children
protected function bark() {
  print Woof!\n;
}
  }
  class poodle extends dog {
// nothing happening here
  }
  $mydog = new poodle;
  // I now call the protected function
  $mydog-bark();
? 

That script errors out saying that I can't call the protected function bark - 
surely, being protected, it should be available in the poodle class too?

Of course, it might be that these two pieces of functionality are not yet 
implemented in PHP, or, more likely, that I'm just misinterpreting the 
documentation! ;)

If you have any insight, please CC me into your response to the list.

Thanks,

Paul



--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP5 and PHP4 on Same Machine

2003-07-11 Thread Michael Smith
Hi,

Just thought I'd let everyone know: you can run php5 and php4 on the 
same machine (--with-apxs for example) but, I don't know if you can
AddType application/x-httpd-php4 .php4 .php
AddType application/x-httpd-php5 .php5
or not... Is that possible? I know you can load both modules, but 
whichever one I load first isn't usable unless I could make php5 run 
only on .php5 files...

-Michael
--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Variable Functions...

2003-07-10 Thread Michael Smith
Smarty has a class method where it calls:

$this-$some_var(somevalue);

and this throws errors on Windows versions of php that i've tried. why 
is that?

-Michael
--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Windows 2k, Apache, MySQL, PHP 4.3.2, Smarty

2003-07-09 Thread Michael Smith
Problem with Smarty. My application is giving me an error when i try to 
use smarty on a new WAMP install. Smarty is in my include path. Getting 
this error:

*Fatal error*: Call to undefined function: () in 
*c:\htdocs\smarty\Smarty.class.php* on line *1658

*line 1658 is:

$_source_return = $resource_func($resource_name, $template_source, $this);

I think it has something to do with PHP not liking the $resource_fun 
being submitted for the function name. It works fine on my updated LAMP 
environment any help woudl be much appreciated.

-Michael

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


[PHP] Stumper: Get Variable Name

2003-07-08 Thread Michael Smith
Alright, I've got an error reporting class with a report() method.

I want to be able to e-mail myself the name of the variable that bombed 
out and the line that it was on (as well as the filename) if possible. 
Don't really know where to start... looks like this:

function report ($error_var) {

   include (variables/global.var.php);
   require (admin/classes/class.phpmailer.php);
   require (admin/classes/class.smtp.php);
  
   $mail = new PHPMailer();
   //set the variables we need
   $mail-From = $smtp['from'];
   $mail-Subject = Reporting A PrattCMS Error;
   $mail-FromName = $smtp['fromname'];
   $mail-Host = $smtp['host'];
   $mail-Mailer = smtp;
   $mail-SMTPAuth = $smtp['auth'];
   $mail-Username = $smtp['user'];
   $mail-Password = $smtp['pass'];
   $mail-Helo = $smtp['helo'];
   $body = We regret to inform you that ;
}

and I want to be able to tell myself what the variable's name was, the 
line it errored out on, etc.

Thanks!

-Michael

--
Michael Smith
IT Intern
[EMAIL PROTECTED]
If computers get too powerful, we can organize 
them into a committee -- that will do them in. 
  -Bradley's Bromide



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


[PHP] Please Hit these links... (for testing purposes)

2003-07-03 Thread Michael Smith
Hey,

would everyone take a wack at
http://www.prattmuseum.org:8080/prattcms/
http://www.prattmuseum.org:8080/prattcms/?id=49
and click links a couple of times? I'm working on some stats, and I 
especially need some from foreign countries (not US).

Thanks!

-Michael

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


[PHP] Please Hit these links... (for testing purposes)

2003-07-03 Thread Michael Smith
Hey,

would everyone take a wack at
http://www.prattmuseum.org:8080/prattcms/
http://www.prattmuseum.org:8080/prattcms/?id=49
and click links a couple of times? I'm working on some stats, and I
especially need some from foreign countries (not US).
Thanks!

-Michael

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


[PHP] PHP 4.3.1 Compiliation - RHL9

2003-04-03 Thread Michael Smith
Hi,

I'm trying to compile PHP 4.3.1 on a RedHat 9 machine.

I get the following error:

checking return type of qsort... void
configure: error: Cannot find header files under /usr

when using the following configure script:

./configure --program-prefix= --prefix=/usr --exec-prefix=/usr
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib
--libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com
--mandir=/usr/share/man --infodir=/usr/share/info
--cache-file=../config.cache --with-config-file-path=/etc
--with-config-file-scan-dir=/etc/php.d --enable-force-cgi-redirect
--disable-debug --enable-pic --disable-rpath
--enable-inline-optimization --with-db3 --with-curl --with-dom=/usr
--with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr
--with-gd --enable-gd-native-ttf --with-ttf --with-gdbm --with-gettext
--with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-zlib
--with-layout=GNU --enable-bcmath --enable-exif --enable-ftp
--enable-magic-quotes --enable-safe-mode --enable-sockets
--enable-sysvsem --enable-sysvshm --enable-discard-path
--enable-track-vars --enable-trans-sid --with-mysql=shared,/usr
--with-pgsql=shared --with-unixODBC=shared --enable-memory-limit

Any suggestions?

-Michael
-- 
Michael Smith [EMAIL PROTECTED]
Custom87.net


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



[PHP] Finding UserName of HTTP Server

2003-03-20 Thread Michael Smith
Hi,

Is there an environment variable for the user (like apache or nobody)
that is used by the server for http serving?

-Michael
-- 
Michael Smith [EMAIL PROTECTED]
Custom87.net


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



[PHP] $array_nam[$variable][0]

2003-03-19 Thread Michael Smith
Hi,

I'm trying to do a:

$var = $array_name[$var2][0];

where $var2 is an integer. I've got this array from a database and I
want to use a variable in the array... what's the exact syntax of this?

-Michael
-- 
Michael Smith [EMAIL PROTECTED]
Custom87.net


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



[PHP] RE: JOIN for FREE ... Learn and Earn

2003-01-20 Thread Michael Smith
Balogne. Should I say more?

-Michael Smith
---
Today's True Quotes for InDUHviduals:
 
Some people's minds are like cement: all mixed up and permanently set...

 



-Original Message-
From: Charles Cedeno [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, January 19, 2003 9:51 PM
To: [EMAIL PROTECTED]
Subject: JOIN for FREE ... Learn and Earn

Hello:

My name is Charles Cedeno. I am now focusing in one online
opportunity.I have tried several of these opportunities full of hype
promising us thousands of dollars every month. I would get all excited
and
run to my family and friends with another Great Money Maker .  It is a
sad fact that many people who are in need of additional income, are
being
victimized by these fly by night scam artists. 
As a result of trying all these opportunities, I finally found
the
company which is true to their words. Not full of hype, but consistently
send me the monthly check. They have given me the best compensation plan
with their high % commission. I didn't have to perform some juggling act
to maintain some 60 to 40% balance in my legs. It is not a pyramid, so
there are no legs. It is not one of those binary compensation plan
failures either. Everyone earns commissions here. They are providing a
real service not the one that simply transfers wealth from the new
signups
to the people at the top.
When you join, you will have a team of up line sponsors who will
help
you succeed every step of the way. Instead of being left alone, you will
be guided step by step by real people, not those auto responders. Only
you
can make your own success together with the help of your sponsors. If
you
have 2 to 3 hours a day, you will be able to earn a full income in a few
months. And there is absolutely no limit as to how much you can earn. It
is designed to gain momentum after some time. But I prefer to avoid such
statements as You will get rich. I read it everywhere and will not
allow
myself to sound like them. I experienced it personally, you can be
comfortable. 
To get your FREE membership ID, send email to
[EMAIL PROTECTED] and
put REGISTER ME FOR FREE in the subject and your full name in the body
of your email. Also include the statement below in the body of your
email.
By submitting a request for a FREE DHS Club membership I agree to
receive
emails from DHS Club for both their Consumer and Business
Opportunities.
I will then register you into the system. You will receive a
confirmation
email asking you to verify. Open it up and activate your free membership
immediately. Then set back and watch as your new business explodes.


Best regards,


Charles Cedeno


Note: You don't need to request for removal. This is a one-time email.
Your email address will be automatically de-activated in our list if you
don't respond to this mail.



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




[PHP] sending SMS messages via PHP

2001-03-07 Thread Michael Smith

I can easily send standard email messages via PHP. Does anyone know how to
send SMS messages?

--
Michael A. Smith [EMAIL PROTECTED]
Director of Data Systems, wcities.com
ICQ: 35884415
:wq

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