Re: [PHP] Compiling PHP Source guides

2004-12-23 Thread Donald Tyler

Greg Donald wrote:
On Wed, 22 Dec 2004 13:56:39 -0800, Donald Tyler [EMAIL PROTECTED] wrote:
 

I do have a rudimentary knowledge of *nix stuff
   

I don't mean to offend, but it doesn't really seem so.  Basic *nix
skills usually include knowing how to configure, compile, and install
software from source.  The PHP docs explain in very explicit detail
how to do it, and I have to say you won't find any more hand holding
than you get with PHP documentation.  The 'F' in RTFM really means
'Fine' when used in a PHP context.
 

and am very computer
literate, but most of the programming I have done is with scripting
languages such as Actionscript, Javascript, PHP etc. I realy have no
idea about compiling source code.
   

If your download is still compressed you need to uncompress it. 
Depending on the download's file extension you will need to use one of
these commands:

tar zxvf php-4.3.10.tar.gz
tar jxvf php-4.3.10.tar.bz2 

Then you change to the source directory:
cd php-4.3.10/
Then you configure the source:
./configure
You will need to add your desired compile options in the ./configure
command.  I have no idea what support you want to build into your PHP.
If you don't either you might look at:
./configure --help
Then after you're done with the configure, you compile the software:
make
Then you probably want to install the software permanently to a
system-wide location (or you might not, I don't know).  On *nix the
usual install locations are somewhere like /usr or /usr/local, which
can be defined in the configure with --prefix if you don't want the
default location.  So then to do the actual install you would do:
make install
Then your php binary will be /usr/bin/php or /usr/local/bin/php.
There's also the configure option to build your PHP as a module for
use with a web server such as Apache.  For that you might use a
configure command something like:
./configure --enable-module=so --with-apxs=/usr/sbin/apxs
 

I was just hoping for something in laymans terms I guess...
   

I would guess it's hard to talk about heart surgery without talking
about heart surgery.  Same goes for compiling software.  The commands
are pretty explicit and you have to know what your doing to get the
desired results.  It's no disgrace to not know, once upon a time I
didn't know..  but I read lots of docs, and I asked many questions and
I learned.  I got a few flames along the way but that's part of
knowing *nix I guess.  :)
Several companies I've worked for in the past have brought in outside
consultants when something would come up that we didn't have skills
for in-house.  On that note, you might consider talking with a
consultant or even getting them to do your PHP install for you if in
the end you give up and cannot figure it out.  Make them document the
process as part of the deal.
 

Thanks for your responses.
Wish me luck.
   

Good luck.
 

Thanks for the info.
I do understand that *nix usage generaly relies on a lot of compiling 
software, but I have been relying on pre-compiled RPMs so far. I am by 
no means an expert, or even intermediate *nix user, which is why I used 
the term rudimentary.

I have been running 6 Linux servers for a small company for about a year 
now learning as I go. I knew nothing about *nix when I started and 
considering most of my other responsibilities leave very little time to 
learn and experiment on the Linux systems I dont think I've done too badly.

P.S. You didnt offend me, I just wanted to explain my situation.
Thanks again for the help.
Donald Tyler
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Compiling PHP Source guides

2004-12-22 Thread Donald Tyler
I did RTFM. The exact page you linked to in fact:
QUOTE:
 Requirements
In order to have these functions available, you must compile PHP with 
support for the mysqli extension.

END QUOTE
That is the whole point of my request. I need a guide explaining *how* 
to compile the PHP Source.


John Nichel wrote:
Donald Tyler wrote:
Hi,
I am looking for a guide on compiling PHP 4. I am a complete newbie 
to compiling and have no idea where to start, so any links to guides 
and/or other useful info would be much appreciated.

My reason is that I need MySQL 4 support, but I would like to get a 
general overview of compiling a program source in general.

Thanks in advance.
Donald Tyler

I'd say RTFM, but I don't want to offend anyone's sensibilities, so...
http://us4.php.net/manual/en/install.unix.php
MySQL up too 4.0...
http://us4.php.net/manual/en/ref.mysql.php
MySQL = 4.1
http://us4.php.net/manual/en/ref.mysqli.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Compiling PHP Source guides

2004-12-22 Thread Donald Tyler
[EMAIL PROTECTED] wrote:
Quoting Donald Tyler [EMAIL PROTECTED]:
 

I did RTFM. The exact page you linked to in fact:
QUOTE:
 Requirements
In order to have these functions available, you must compile PHP with
support for the mysqli extension.
END QUOTE
That is the whole point of my request. I need a guide explaining *how*
to compile the PHP Source.
   

The directions to compile the PHP source *are* on the page at
http://us4.php.net/manual/en/install.unix.php -- you compile it using the
make steps in the directions there.
(But it seems the problem is that you don't recognize those as compilation
instructions, which is understandable if you're a newbie.  The page also says
that
Basic Unix skills (being able to operate make and a C compiler)
are a prerequisite, so you probably should find a person you can rely on to
deliver those skills repeatably or teach them to you, which is not something
you really get from a mailing list.  Get a good intor Unix book.  After all,
you wouldn't expect that if you subscribed to a heart surgery mailing list and
said I'm a complete newbie -- can you tell me how to do a quadruple bypass?
someone would step you through it?  Yes, there are differences in degree,
but...!  :)
 

OK, I guess I'll try to read the instructions again. I *have* tried 
reading them on multiple occasions but its just greek to me.

I do have a rudimentary knowledge of *nix stuff and am very computer 
literate, but most of the programming I have done is with scripting 
languages such as Actionscript, Javascript, PHP etc. I realy have no 
idea about compiling source code.

I was just hoping for something in laymans terms I guess...
Thanks for your responses.
Wish me luck.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Compiling PHP Source guides

2004-12-21 Thread Donald Tyler
Hi,
I am looking for a guide on compiling PHP 4. I am a complete newbie to 
compiling and have no idea where to start, so any links to guides and/or 
other useful info would be much appreciated.

My reason is that I need MySQL 4 support, but I would like to get a 
general overview of compiling a program source in general.

Thanks in advance.
Donald Tyler
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] 2 x DB connections at once

2004-01-23 Thread Donald Tyler
Yes thanks, that will do it. I wasn't aware you had to pass an extra param
to get it to create a new connection.

Both the connections were in separate objects and they were being specified
every time I did a query or select db, but since I didn't add that extra
param you mentioned I guess they were really the same connection even though
they were two separate private variables in different objects.

Thanks for your help

-Original Message-
From: Luke [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 22, 2004 4:22 PM
To: Donald Tyler
Subject: Re: [PHP] 2 x DB connections at once

It depends, how are you creating the connections, and where are you keeping
the connection ID
and when you query, or select database, or anything to do with the
databases, do you make sure you specify that connection id?

//Notice the TRUE, that creates a new conenction, and doesnt use the
existing connection (hence returning a different id)

$sqlconnection1 = mysql_connect('test.com', 'username', 'password');
$sqlconnection2 = mysql_connect('test.com', 'username', 'password', TRUE);

then when you select databases and query youll have to specify that
connection!

//choose DB 1 on connection 1
mysql_select_db('mydata1', $sqlconnection1);
//choose db2 on connetion 2
mysql_select_db('mydata1', $sqlconnection2);

//and querying
//this will select the table named table from the mydata1 database
mysql_query(SELECT * FROM table WHERE name='me', $sqlconnection1);
//this will select the table named table from the mydata2 database
mysql_query(SELECT * FROM table WHERE name='me', $sqlconnection2);


hope thats what you were after
-- 
Luke

_
Donald Tyler [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
OK, now I have done some work and it gets even stranger.

Two Objects

Validator
Importer

Both objects have private variables called $this-Connection

However, when I change the DB for one objects connection pointer, the other
objects connection pointer ALSO changes DB.

Is it not possible to have two completely separate DB connections active at
the same time?


-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 3:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] 2 x DB connections at once

I thought this was possible, but it doesn't seem to be working:

I have a class, that has a private variable called $this-Connection, which
is a Database Connection pointer to a MySQL database. During the lifetime of

the Class, it uses the connection multiple times without a problem.

The class also uses a function from an include file that has its OWN
Database Connection pointer. And it seems that for some reason, as soon as
that external function is called, the Private Database Pointer within my
Class suddenly points to the Database name that the external functions
Database Pointer was using.

I ALWAYS specify which connection pointer I want to use when selecting the
DB and doing a mysql_query, so I have no earthly idea how the external
Connection pointer is affecting my Private Connection Pointer.

I hope I explained that well enough; it's real difficult to put into words.

Does anyone have any idea what might be happening?

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

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



[PHP] 2 x DB connections at once

2004-01-22 Thread Donald Tyler
I thought this was possible, but it doesn't seem to be working:

I have a class, that has a private variable called $this-Connection, which
is a Database Connection pointer to a MySQL database. During the lifetime of
the Class, it uses the connection multiple times without a problem.

The class also uses a function from an include file that has its OWN
Database Connection pointer. And it seems that for some reason, as soon as
that external function is called, the Private Database Pointer within my
Class suddenly points to the Database name that the external functions
Database Pointer was using.

I ALWAYS specify which connection pointer I want to use when selecting the
DB and doing a mysql_query, so I have no earthly idea how the external
Connection pointer is affecting my Private Connection Pointer.

I hope I explained that well enough; it's real difficult to put into words.

Does anyone have any idea what might be happening?

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



RE: [PHP] 2 x DB connections at once

2004-01-22 Thread Donald Tyler
OK, now I have done some work and it gets even stranger.

Two Objects

Validator
Importer

Both objects have private variables called $this-Connection

However, when I change the DB for one objects connection pointer, the other
objects connection pointer ALSO changes DB.

Is it not possible to have two completely separate DB connections active at
the same time?


-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 22, 2004 3:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] 2 x DB connections at once

I thought this was possible, but it doesn't seem to be working:

I have a class, that has a private variable called $this-Connection, which
is a Database Connection pointer to a MySQL database. During the lifetime of
the Class, it uses the connection multiple times without a problem.

The class also uses a function from an include file that has its OWN
Database Connection pointer. And it seems that for some reason, as soon as
that external function is called, the Private Database Pointer within my
Class suddenly points to the Database name that the external functions
Database Pointer was using.

I ALWAYS specify which connection pointer I want to use when selecting the
DB and doing a mysql_query, so I have no earthly idea how the external
Connection pointer is affecting my Private Connection Pointer.

I hope I explained that well enough; it's real difficult to put into words.

Does anyone have any idea what might be happening?

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

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



RE: [PHP] Re: Flash-PHP Socket Connection

2004-01-21 Thread Donald Tyler
We are just about to try and get this working with sockets ourselves. Our
intranet currently does exactly what you are trying to do, but without using
sockets.

In reply to your question, there is no one site for XMLRPC really. I suggest
you read up on the following subjects:

XMLRPC document specification:
http://www.xmlrpc.com/spec

Flash XML object:
http://www.macromedia.com/devnet/mx/flash/articles/tools_xmlobject.html

PHP XMLRPC implementation:
http://us3.php.net/manual/en/ref.xmlrpc.php

Using XMLRPC instead of the previously mentioned methods of loading the PHP
output as a text file has the following benefits:

1. Complete freedom to communicate a complex data structure, including
multidimensional arrays. This is difficult if not impossible to do with
simple PHP text output.
2. Data types are kept intact when being transferred. E.g. there is no
confusion as to whether:

1 = integer: 1
1 = string: 1
1 = Boolean: true

3. XMLRPC is an industry standard. Using it will allow other developers to
easily build clients for your server side script should you wish.
4. PHP has full XMLRPC functionality built in; Flash has XML functionality
built in. There is a little extra work involved in extending the Flash XML
object to an XMLRPC parser (or you could try one of the OpenSource
alternatives), but I recommend building one yourself if you have the time,
it really helps you understand XML.

-Original Message-
From: Eric Bolikowski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 20, 2004 4:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Flash-PHP Socket Connection

Hey Ben

I know it may sound nuts, but I really want to make a socket connection
between a Flash and a PHP file.

Normally I would simply read in a text file/read XML/send data with GET or
POST, but I'm looking for a socket connections of following reasons:

1) I want a fast connection
2) I'm looking at this as a challenge, because it doesn't seem like anyone
else has done this before

Eric

Ben Ramsey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 What I mean is: you shouldn't need to use sockets to read in a file from
 Flash unless you're trying to do something more complicated, but from
 the way it sounds, you just want to pull data from MySQL with a PHP
 script and output it to Flash.  The PHP script could just echo plain
 text and Flash can read that in just fine without needing to connect via
 a socket.
 -Ben

 Ben Ramsey wrote:

  Flash has the ability to read in text files, so you could use PHP to
  output data in the correct format and use Flash to read the PHP script
  like it reads a text file.  We did this in ASP once upon a time.
 
  Here's a tutorial about reading text files into Flash:
  http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
 
  Also, from what I understand, Flash now has a great XML parser, so you
  could use PHP to generate XML and Flash could read in the XML as
  variables.  You might want to look into that, but I think it's only
  available in the newest version.
 
  -Ben
 
 
  Eric Bolikowski wrote:
 
  Hi everybody
 
  I'm working on a site that will be based on Flash, PHP and MySQL. PHP
  will
  work as a middleware for Flash and MySQL.
 
  My problem is communication between Flash and PHP.
  I'm really out looking for using the socket functions in PHP and Flash
to
  make fast connection.
 
  I have googled for almost an hour now, and I can't seem to find any
  interesting. The only info I find, is about sending data between Flash
  and
  PHP with HTTP GET or HTTP POST.
 
  So if anybody has some general information on this or a link to a
  tutorial
  on the subject, I would like to get those resources.
 
  Thanks a lot
 
  Eric

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



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



RE: [PHP] thumbnail???

2004-01-21 Thread Donald Tyler
Try this:

function Resize_Image($FilePath, $new_w){
$File = fopen($FilePath, r);
$FileContents = fread($File, filesize($FilePath));

$src= imagecreatefromstring($FileContents);
$width  = imagesx($src);

// Shrink the image to the maximum width
// Maintaining aspect ratio
if($width  $new_w){
$height = imagesy($src);
$aspect_ratio = $height/$width;
$new_h = abs($new_w * $aspect_ratio);
$img = imagecreatetruecolor($new_w,$new_h); 

imagecopyresized($img,$src,0,0,0,0,$new_w,$new_h,$width,$height);

ob_start();
imagejpeg($img);
$FileContents = ob_get_contents();
ob_end_clean();
imagedestroy($img);
}

return $FileContents;
}

you can then either save the filecontents as an image, or place it in a
database.

-Original Message-
From: Rafael Alex Cremer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 20, 2004 5:29 PM
To: [EMAIL PROTECTED]
Subject: [PHP] thumbnail??? 

OK, but how? I already use GD, I need to now how to create a thumbnail, 
somebody now how to use the GD functions to create a thumbnail???

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

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

RE: [PHP] Re: Flash-PHP Socket Connection

2004-01-21 Thread Donald Tyler
You would use sockets if you were developing a client/server application
that was making a LOT of requests very quickly.

Opening and closing connections using normal HTTP methods gets slow when
carrying out such intense data communication.

A good example would be an online game where you need to constantly know the
location of all players all the time.

-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 20, 2004 7:55 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Flash-PHP Socket Connection

Use xmlReceiver to trigger the back end PHP script. Have that script 
generate XML which you parse in Flash. Plain text will work, but a single 
quotation mark in the text sends you off to never never land. Here's an 
example:

xmlReceiver.load( http://; + host + feed_xml_article.php);

I know it's not a socket, but it's plenty fast.

Regards - Miles Thompson

PS What good would a socket to PHP do, anyway? (I probably just revealed my 
ignorance!) /mt

At 11:03 PM 1/20/2004 +0100, Eric Bolikowski wrote:
Hey Ben

I know it may sound nuts, but I really want to make a socket connection
between a Flash and a PHP file.

Normally I would simply read in a text file/read XML/send data with GET or
POST, but I'm looking for a socket connections of following reasons:

1) I want a fast connection
2) I'm looking at this as a challenge, because it doesn't seem like anyone
else has done this before

Eric

Ben Ramsey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  What I mean is: you shouldn't need to use sockets to read in a file from
  Flash unless you're trying to do something more complicated, but from
  the way it sounds, you just want to pull data from MySQL with a PHP
  script and output it to Flash.  The PHP script could just echo plain
  text and Flash can read that in just fine without needing to connect via
  a socket.
  -Ben
 
  Ben Ramsey wrote:
 
   Flash has the ability to read in text files, so you could use PHP to
   output data in the correct format and use Flash to read the PHP script
   like it reads a text file.  We did this in ASP once upon a time.
  
   Here's a tutorial about reading text files into Flash:
   http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
  
   Also, from what I understand, Flash now has a great XML parser, so you
   could use PHP to generate XML and Flash could read in the XML as
   variables.  You might want to look into that, but I think it's only
   available in the newest version.
  
   -Ben
  
  
   Eric Bolikowski wrote:
  
   Hi everybody
  
   I'm working on a site that will be based on Flash, PHP and MySQL. PHP
   will
   work as a middleware for Flash and MySQL.
  
   My problem is communication between Flash and PHP.
   I'm really out looking for using the socket functions in PHP and
Flash
to
   make fast connection.
  
   I have googled for almost an hour now, and I can't seem to find any
   interesting. The only info I find, is about sending data between
Flash
   and
   PHP with HTTP GET or HTTP POST.
  
   So if anybody has some general information on this or a link to a
   tutorial
   on the subject, I would like to get those resources.
  
   Thanks a lot
  
   Eric

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

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

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



RE: [PHP] Problems with $_POST

2004-01-21 Thread Donald Tyler
This is the method I recommend also.

The token method works fine, but is slightly harder to implement.

Basically you would keep the function that creates the record separate from
the page that shows confirmation of the record being created.

e.g.

1. User visits:
www.mysite.com/accounts/pages/NewInvoice.php

2. User fills out form and clicks submit, forms Action is:
www.mysite.com/accounts/Functions/CreateInvoice.php

3. After CreateInvoice.php has successfully made the invoice, WITHOUT
printing any other output, you use the header() command to send them to:
www.mysite.com/accounts/pages/InvoiceSuccess.php



-Original Message-
From: Aidan Lister [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 21, 2004 4:01 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Problems with $_POST

Or,

After you've dumped the data into the DB, issue a header('location:
/path/to/script');

This will also solve the problem of IE saying are you sure you want to
resend the form data.


Toby Irmer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 You can use a token to check if a form has been sent before...

 ?
 class formReload {

  var $tokenarray = '__token';
  var $tokenname = '__token';

  function createToken()
  {
   $tok = md5(uniqid(mytoken));
   return sprintf(input type='hidden' name='%s'
 value='%s',$this-tokenname,htmlspecialchars($tok));
  }

  function easyCheck()
  {
   $tok = $_REQUEST[$this-tokenname];
   if (isset($_SESSION[$this-tokenarray][$tok]))
   {
return false;
   }
   else
   {
$_SESSION[$this-tokenarray][$tok] = true;
return true;
   }
  }
 }
 ?

 hth

 toby


 - Original Message -
 From: Binay [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; Reidar Solberg [EMAIL PROTECTED]
 Sent: Wednesday, January 21, 2004 9:23 AM
 Subject: Re: [PHP] Problems with $_POST


 Hi

 What is the primary key in your tble? Using tht primary key check for
 duplicate entry... Theres no way u can change the posted data ... so even
if
 u reset $_POST['submit']  after the insert operation is done, next time u
 refresh it will be set and hence will duplicate...so check for duplicate
 entries urself only based on primary key or unique values in ur table.

 Hope this helps

 Cheers
 Binay

 U wrote..
 
 I have a FORM for entering data into a DB.

 I use:
 ...
 ...
 if ($_POST['submit'] == 'Register') {
 ...
 code for INSERT into DB.

 This works OK, but if I REFRESH the page, it  duplicates the dataset in
 the table.

 How can I reset  $_POST['submit']  so it don't make this happen?

 Rgds
 Reidar Solberg
 

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

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

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



RE: [PHP] textfields showing php tags code

2004-01-21 Thread Donald Tyler
Is it just showing that one or in all three text fields?

-Original Message-
From: craig [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 21, 2004 11:24 AM
To: Php
Subject: [PHP] textfields showing php tags  code

Hi All,
This one has me stumped, it worked yesterday, but not today,
and I didn't change anything (as far as I know).

This is some of the code from a function which is now showing the
?php echo $quantity; ? code inside the textareas, rather than
the passed value from the function call.

any ideas are greatly appreciated.

Craig

function showForm($quantity='', $fname='', $lname='') {
 ?
   form action='orderX.php' method='post' name='orderForm'
 table border='0'
  tr
   td align='right'Quantity:/td
   tdinput name='quantity' type='text' size='3'  value='?php
echo $quantity; ?'*/td
/tr
  tr
   td align='right'First Name:/td
   tdinput name='fname'type='text' size='25' value='?php
echo $fname; ?'*/td
/tr
  tr
   td align='right'Last Name:/td
   tdinput name='lname'type='text' size='25' value='?php
echo $lname; ?'*/td
/tr
  /table
   /form
 ?php
}

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

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



[PHP] PHP 5 Book

2004-01-21 Thread Donald Tyler
Hi

 

Anyone know if Rasmus (or anyone for that matter) is writing a book on PHP
5? And when it might be available?

 

Thanks

 

Donald Tyler



RE: [PHP] textfields showing php tags code

2004-01-21 Thread Donald Tyler
There is nothing wrong with your code, I just tried it on my site and it
works fine.

Try and run the function you posted on its own, without adding back anything
that you removed, just to make sure you didn't inadvertently remove the
problem.

If it works, then you know where to look, if it doesn't work, I would check
your webserver and see if anyone has messed around with the PHP
configuration.

Someone must have changed something if it was working before.h

-Original Message-
From: craig [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 21, 2004 12:21 PM
To: Donald Tyler
Subject: RE: [PHP] textfields showing php tags  code

all of them, there are actually 11 fields, but I shorted
the code up.

Craig

 -Original Message-
 From: Donald Tyler [mailto:[EMAIL PROTECTED]
 Sent: January 21, 2004 11:12 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] textfields showing php tags  code
 
 
 Is it just showing that one or in all three text fields?
 
 -Original Message-
 From: craig [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, January 21, 2004 11:24 AM
 To: Php
 Subject: [PHP] textfields showing php tags  code
 
 Hi All,
 This one has me stumped, it worked yesterday, but not today,
 and I didn't change anything (as far as I know).
 
 This is some of the code from a function which is now showing the
 ?php echo $quantity; ? code inside the textareas, rather than
 the passed value from the function call.
 
 any ideas are greatly appreciated.
 
 Craig
 
 function showForm($quantity='', $fname='', $lname='') {
  ?
form action='orderX.php' method='post' name='orderForm'
  table border='0'
 tr
td align='right'Quantity:/td
tdinput name='quantity' type='text' size='3'  
 value='?php
 echo $quantity; ?'*/td
 /tr
 tr
td align='right'First Name:/td
tdinput name='fname'type='text' size='25' 
 value='?php
 echo $fname; ?'*/td
 /tr
 tr
td align='right'Last Name:/td
tdinput name='lname'type='text' size='25' 
 value='?php
 echo $lname; ?'*/td
 /tr
   /table
/form
  ?php
 }
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



FW: [PHP] Flash-PHP Socket Connection

2004-01-20 Thread Donald Tyler
We use XMLRPC to communicate between flash  PHP. I presume it can be
coupled with sockets if you should need a permanent connection as well.

It has worked perfectly for pretty much anything we throw at it (It allows
you to send any PHP or Action script native data type, e.g. arrays,
Booleans, integers etc. back and forth across the web)

Obvious security implications about, so be very very careful with what you
do with the data received. Trust no one! Not even your own Flash Client.

-Original Message-
From: Eric Bolikowski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 20, 2004 3:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Flash-PHP Socket Connection

Hi everybody

I'm working on a site that will be based on Flash, PHP and MySQL. PHP will
work as a middleware for Flash and MySQL.

My problem is communication between Flash and PHP.
I'm really out looking for using the socket functions in PHP and Flash to
make fast connection.

I have googled for almost an hour now, and I can't seem to find any
interesting. The only info I find, is about sending data between Flash and
PHP with HTTP GET or HTTP POST.

So if anybody has some general information on this or a link to a tutorial
on the subject, I would like to get those resources.

Thanks a lot

Eric

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

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



[PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Donald Tyler
There could be something you're not seeing and assuming it's correct. But
typing your code into the email we aren't getting the full story.

Can you actually attach your scripts to an email and send that? Copying and
pasting then into the email won't necessarily provide all the info needed to
solve your problem.

For example: I once uploaded a PHP script to the server and for some reason
on the way up extra character were placed in the document that did not show
up in most text editors. I had to use a very basic terminal text editor to
see the added characters.

-Original Message-
From: Nick Wilson [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 16, 2004 8:17 AM
To: php-general
Subject: [PHP] Syntax Error - This is WEIRD!

if a script calls antohter like 'include('http://site.com/index.php');

Why would I get a syntax error on line 1 of index.php when it looks like
this:

?php
// line one above this one


What's the deal there?

Many thanks for any insight ;-)
-- 
Nick W

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

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



RE: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Donald Tyler
Yes your right, that’s exactly the problem. I didn’t even realize he was
doing that.

By including the PHP file via HTTP, you are including the OUTPUT of the PHP
file, not the actual PHP file itself.

e.g.

by including a file with the following code:

?PHP

print 'Hello';

?

you would be including the word Hello as PHP code, which is obviously
going to cause a syntax error.

-Original Message-
From: Dagfinn Reiersøl [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 16, 2004 10:18 AM
To: PHP General
Subject: Re: [PHP] Syntax Error - This is WEIRD!

Nick Wilson wrote:

if a script calls antohter like 'include('http://site.com/index.php');

Why would I get a syntax error on line 1 of index.php when it looks like
this:

?php
// line one above this one


What's the deal there?

Many thanks for any insight ;-)
  

I've never tried to do an include via HTTP, so maybe I'm clueless, but
it occurs to me that it might be a good idea to try doing a plain old
file include, using exactly the same file. I have the feeling it would
be interesting to know whether that would work or not.

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

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



RE: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Donald Tyler
Yes that is true. But I would strongly recommend against doing that.

You should never include anything over HTTP. Its extremely messy, 100%
insecure and just a very very bad idea.

You should have all the files you need to include located on your web
server.

-Original Message-
From: Dagfinn Reiersøl [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 16, 2004 11:50 AM
To: PHP General
Subject: Re: [PHP] Syntax Error - This is WEIRD!

Donald Tyler wrote:

Yes your right, that’s exactly the problem. I didn’t even realize he was
doing that.

By including the PHP file via HTTP, you are including the OUTPUT of the PHP
file, not the actual PHP file itself.

e.g.

by including a file with the following code:

?PHP

   print 'Hello';

?

you would be including the word Hello as PHP code, which is obviously
going to cause a syntax error.
  

Yes. I read the manual which provides no clear explanation (I suspect 
that whoever wrote it didn't actually know how it works). So I decided 
to test it. It does exactly what you say it does. I made an include file 
like this:

?php
echo '?php echo Hello World!; ?';
?

If you inlude that using HTTP, it outputs Hello world!

Seems like a strange thing to do, outputting PHP code on a Web page, but 
it's not without conceivable usefulness.

-Original Message-
From: Dagfinn Reiersøl [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 16, 2004 10:18 AM
To: PHP General
Subject: Re: [PHP] Syntax Error - This is WEIRD!

Nick Wilson wrote:

  

if a script calls antohter like 'include('http://site.com/index.php');

Why would I get a syntax error on line 1 of index.php when it looks like
this:

?php
// line one above this one


What's the deal there?

Many thanks for any insight ;-)
 



I've never tried to do an include via HTTP, so maybe I'm clueless, but
it occurs to me that it might be a good idea to try doing a plain old
file include, using exactly the same file. I have the feeling it would
be interesting to know whether that would work or not.

  


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

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



[PHP] Intermitent problems retreiving PDF's from a MySQL database.

2004-01-09 Thread Donald Tyler
Hi,

I have a website where the admin can create entries in a news list and
upload an associated PDF document.

I am storing the document in a MySQL database on another machine on the same
network.

For some reason, occasionaly when loading a PDF document, internet explorer
will lock up, the Windows flag will continue to wave as if it is loading
the document, but it will never load. Once this happens, all of the other
PDF documents wont load until you restart internet explorer. Then it all
works fine until you click that one PDF again.

I thought that maybe the PDF had been corrupted somehow, but the problem
miraculously fixed itself so I didnt have a change to check that out.

Now I got a call from one of my users complaining of the exact same problem,
which once again miraculously fixed itself after reloading internet
explorer.

There are no error messages in the apache log or the mysql log.

Does anyone have any idea what is going on?!?

Thanks

Donald Tyler

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



[PHP] Fw: Intermitent problems retreiving PDF's from a MySQL database.

2004-01-09 Thread Donald Tyler
Hi,

I have a website where the admin can create entries in a news list and
upload an associated PDF document.

I am storing the document in a MySQL database on another machine on the same
network.

For some reason, occasionaly when loading a PDF document, internet explorer
will lock up, the Windows flag will continue to wave as if it is loading
the document, but it will never load. Once this happens, all of the other
PDF documents wont load until you restart internet explorer. Then it all
works fine until you click that one PDF again.

I thought that maybe the PDF had been corrupted somehow, but the problem
miraculously fixed itself so I didnt have a change to check that out.

Now I got a call from one of my users complaining of the exact same problem,
which once again miraculously fixed itself after reloading internet
explorer.

There are no error messages in the apache log or the mysql log.

Does anyone have any idea what is going on?!?

Thanks

Donald Tyler

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



RE: [PHP] Sessions within new windows

2003-11-06 Thread Donald Tyler
Windows update doesn't fix the problem. I keep my system updated 100% of
the time.

I no one has mentioned getting it to work on Windows XP. That is what I
am using, Windows XP Professional. Maybe the problem is confined to XP.

Here is the EXACT IE version that I am using:

6.0.2800.1106.xpsp2.030422-1633

I have a few other machine in the building that have other Versions of
M$ Windows on them, I will give those a try and let you know how it
goes.

-Original Message-
From: olinux [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 06, 2003 12:48 AM
To: Pablo Gosse; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows


 If, as Chris wrote, this is indeed a feature/bug of
 IE, then it must be
 configurable somewhere, though I'm lost as to where
 that might be.
  
 Does anyone have any ideas how this could be
 controlled via IE's
 settings?

I've experienced a similar problem on a php based
system I use. I don't know what their code looks like.
I think its an IE issue though - windows update always
fixes the problem for me. 
http://windowsupdate.microsoft.com 


olinux

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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

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



RE: [PHP] Sessions within new windows

2003-11-06 Thread Donald Tyler
I am downloading ethereal and I will post my findings.

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 06, 2003 2:31 PM
To: Pablo Gosse; Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows

--- Pablo Gosse [EMAIL PROTECTED] wrote:
 Hi Donald.  I just tried this in XP Professional on IE 6.0 and it
worked
 fine, both via a javascript function and a standard link with the
target
 set to _blank.
 
 Anyone else have any idea why this would be happening?

No, but it would really be nice if anyone that experiences this could
capture the HTTP transaction(s) that illustrate the behavior more
definitively.

Ethereal (http://www.ethereal.com/) can help with this.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



RE: [PHP] Sessions within new windows

2003-11-06 Thread Donald Tyler
Well that's bizarre. I change it back to opening the new windows so that
I can go test it on some other machines, and now it works on this
machine!?

Makes no sense...

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 06, 2003 2:31 PM
To: Pablo Gosse; Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows

--- Pablo Gosse [EMAIL PROTECTED] wrote:
 Hi Donald.  I just tried this in XP Professional on IE 6.0 and it
worked
 fine, both via a javascript function and a standard link with the
target
 set to _blank.
 
 Anyone else have any idea why this would be happening?

No, but it would really be nice if anyone that experiences this could
capture the HTTP transaction(s) that illustrate the behavior more
definitively.

Ethereal (http://www.ethereal.com/) can help with this.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] Sessions within new windows

2003-11-05 Thread Donald Tyler
Hi,

 

Not sure if this is a PHP or Browser issue but here is my problem:

 

I have a site that has a members section. In the news area, when a user
clicks the link for an article, it pops open a new window a requests the
article via a PHP script.

 

What's happening is that when the new window pops up, the script isn't
getting the session info properly. I changed it so that the page opens
up in the main window instead of a new one and it works fine.

 

I presume this is because the browser is not sending the session ID to
the script when opening the new window. Does anyone know of a way for me
to fix this without embedding the session ID in the URL?

 

I thought the only criteria that the browser used when deciding if to
send a Session ID or not was if the page is located at the same domain
name.

 

P.S. Its Internet Explorer 6 I am using.

 

Thanks.



RE: [PHP] Sessions within new windows

2003-11-05 Thread Donald Tyler
Just a quick update:

It seems to only be a problem with Internet Explorer on the PC. Both IE
 Safari on MacOSX work as expected.

-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Sessions within new windows

Hi,

 

Not sure if this is a PHP or Browser issue but here is my problem:

 

I have a site that has a members section. In the news area, when a user
clicks the link for an article, it pops open a new window a requests the
article via a PHP script.

 

What's happening is that when the new window pops up, the script isn't
getting the session info properly. I changed it so that the page opens
up in the main window instead of a new one and it works fine.

 

I presume this is because the browser is not sending the session ID to
the script when opening the new window. Does anyone know of a way for me
to fix this without embedding the session ID in the URL?

 

I thought the only criteria that the browser used when deciding if to
send a Session ID or not was if the page is located at the same domain
name.

 

P.S. Its Internet Explorer 6 I am using.

 

Thanks.

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



RE: [PHP] Sessions within new windows

2003-11-05 Thread Donald Tyler
Yeah I was. I did try that though and it made no difference =0(

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:40 AM
To: Donald Tyler
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions within new windows

Are you using _blank as target. Then try a named window. But this is 
just a wild guess.

Donald Tyler wrote:

 Just a quick update:
 
 It seems to only be a problem with Internet Explorer on the PC. Both
IE
  Safari on MacOSX work as expected.
 
 -Original Message-
 From: Donald Tyler [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, November 05, 2003 8:17 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Sessions within new windows
 
 Hi,
 
  
 
 Not sure if this is a PHP or Browser issue but here is my problem:
 
  
 
 I have a site that has a members section. In the news area, when a
user
 clicks the link for an article, it pops open a new window a requests
the
 article via a PHP script.
 
  
 
 What's happening is that when the new window pops up, the script isn't
 getting the session info properly. I changed it so that the page opens
 up in the main window instead of a new one and it works fine.
 
  
 
 I presume this is because the browser is not sending the session ID to
 the script when opening the new window. Does anyone know of a way for
me
 to fix this without embedding the session ID in the URL?
 
  
 
 I thought the only criteria that the browser used when deciding if to
 send a Session ID or not was if the page is located at the same domain
 name.
 
  
 
 P.S. Its Internet Explorer 6 I am using.
 
  
 
 Thanks.
 

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

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



RE: [PHP] Sessions within new windows

2003-11-05 Thread Donald Tyler
I am using a normal link. Here is the exact html code:

a href=View_Article.php?ID={ID} target=_blankimg
src=../Images/view.gif width=22 height=22 border=0/a

-Original Message-
From: Pablo Gosse [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 11:17 AM
To: [EMAIL PROTECTED]; Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows

That's strange, as I've been writing a CMS over the past year which
requires the user to have IE 5.5 or newer, and I have no problems with
pop-ups accessing session values under IE 6.0.

Perhaps it's an issue of how you're invoking the new windows?

Are you using a normal link with target=_blank or are you using
Javascript to launch the new window?

Cheers,
Pablo

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:42 AM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions within new windows

--- Donald Tyler [EMAIL PROTECTED] wrote:
 I have a site that has a members section. In the news area, when a
user
 clicks the link for an article, it pops open a new window a requests
the
 article via a PHP script.
 
 What's happening is that when the new window pops up, the script isn't
 getting the session info properly.

[snip]

 P.S. Its Internet Explorer 6 I am using.

This is a feature/bug of IE 6. It might be something you can configure
somewhere, but I avoid IE like the plague, so I'm not sure about that.

Every other browser, to my knowledge, will work properly.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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

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



FW: [PHP] Sessions within new windows

2003-11-05 Thread Donald Tyler


-Original Message-
From: Pablo Gosse [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 2:11 PM
To: Donald Tyler
Subject: RE: [PHP] Sessions within new windows

Hmm, that's strange.

I use Javascript functions to control the few pop-up windows in the CMS,
but I just went in and changed some to standard href tags with the
_blank for the target attribute, as you have, and it still works with no
problem.

If, as Chris wrote, this is indeed a feature/bug of IE, then it must be
configurable somewhere, though I'm lost as to where that might be.

I just tested it out on a number of systems around here, both on a
Windoze 2000 box and on a RedHat box using a Terminal Services
connection, and it worked fine for me.

Does anyone have any ideas how this could be controlled via IE's
settings?

Cheers,
Pablo

-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 11:48 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows

I am using a normal link. Here is the exact html code:

a href=View_Article.php?ID={ID} target=_blankimg
src=../Images/view.gif width=22 height=22 border=0/a

-Original Message-
From: Pablo Gosse [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 11:17 AM
To: [EMAIL PROTECTED]; Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows

That's strange, as I've been writing a CMS over the past year which
requires the user to have IE 5.5 or newer, and I have no problems with
pop-ups accessing session values under IE 6.0.

Perhaps it's an issue of how you're invoking the new windows?

Are you using a normal link with target=_blank or are you using
Javascript to launch the new window?

Cheers,
Pablo

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:42 AM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions within new windows

--- Donald Tyler [EMAIL PROTECTED] wrote:
 I have a site that has a members section. In the news area, when a
user
 clicks the link for an article, it pops open a new window a requests
the
 article via a PHP script.
 
 What's happening is that when the new window pops up, the script isn't
 getting the session info properly.

[snip]

 P.S. Its Internet Explorer 6 I am using.

This is a feature/bug of IE 6. It might be something you can configure
somewhere, but I avoid IE like the plague, so I'm not sure about that.

Every other browser, to my knowledge, will work properly.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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

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

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



[PHP] Problem connecting to remote MySQL Server

2003-11-03 Thread Donald Tyler
Hi,

I am publishing a site I have developed and I am having problems with
the scripts being able to access the remote MySQL server. When I try to
connect using the PHP scripts I just get an error saying that access is
denied.

I can access it fine from my machine using PHPMyAdmin so I know that
remote access is being allowed.
I have also connected to the web hosting server via SSH and have
connected successfully to the MySQL server via the MySQL client at the
terminal from that machine. So I know the server that the scripts are
running on also has access to the MySQL server.

Here is my script. Please let me know if you have any ideas why this
would be happening:

-

?PHP

/***
**
*   Connects to a MySQL database using the Belvedere
account  *

*/
function DBMS_CONNECT()
{
global $Site_Settings;

// Connect To DBMS
$Connection = mysql_connect($Site_Settings['DB_Host'],
$Site_Settings['DB_UserName'], $Site_Settings['DB_Password'])
or SQL_KillScript(Connecting to DBMS,$Connection);

// Select DB
if (!mysql_select_db($Site_Settings['DB_Name'],$Connection))
SQL_KillScript(Selecting Database,$Connection);

// Return the connection variable
return $Connection;
}

?

---

Here is the error message:

MySQL Error 1044 : Access denied for user: '[EMAIL PROTECTED]' to database
'Belvedere'

---

My DB_Host is specified as a domain name. e.g. db1.myhost.com

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



[PHP] Restarting Apache without screwing up running scripts?

2003-10-13 Thread Donald Tyler
Hi,

 

 

We are building an Intranet for our company and I was wondering how
people deal with having to restart the server when its running an
intranet. Obviously if there is a complex process running and the server
restarts in the middle of it then its going to screw a lot of stuff up.

 

The only thing I could think of was to script the Intranet in such a way
as I could go into the admin section and simply disable it, then all the
currently running processes would finish, but the system would refuse to
start any new ones until I re-enabled it again.

 

Just want some advice, thanks.

 

 

Donald



RE: [PHP] Resource Limits

2003-09-29 Thread Donald Tyler
Just incase you weren't aware. You can change the Max execution time
during the script with:

set_time_limit(Milliseconds);

-Original Message-
From: Decapode Azur [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 27, 2003 5:51 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Resource Limits

hi the list,

How can I get the values of 'max_execution_time', 'max_input_time' and 
'memory_limit' from my php script ?


thanks

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

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



RE: [PHP] How to smart refresh php section using iframe?

2003-09-29 Thread Donald Tyler
This is not possible with PHP alone. You need to use some client side
code such as JavaScript or Flash.

I would recommend JavaScript. It would be pretty easy to accomplish what
you are talking about with that.

Grab yourself a copy of JavaScript the Definitive Guide by Orielly.
It's pretty comprehensive.

-Original Message-
From: ascll [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 27, 2003 1:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to smart refresh php section using iframe?

Greetings,

I'm newbie in php and I would like to develop a .php page that
constantly
retrieves data from MySQL database, but I having difficulties to doing
so.
Please show me the complete code, if possible.


Thanks in advance.

= index.php =
html
body
table

!-- 
// SECTION A
// =
// Load one only, no need to refresh
--
tr
  tdColumn1/td
  tdColumn2/td
  tdColumn3/td
  tdColumn4/td
  tdColumn5/td
/tr


!-- 
// SECTION B
// =
// Using .php to retrieve data from MySQL database (no problem)
// together with iframe (I don't know how to configure iframe)
// and also use javascript to auto refresh this section every 1-second
(SECTION B ONLY)
// since the data show on section B would keep on changing (I don't know
the
codes)
--
tr
  td . $Column1 . /td
  td . $Column2 . /td
  td . $Column3 . /td
  td . $Column4 . /td
  td . $Column5 . /td
/tr


!-- 
// SECTION C
// =
// Auto refresh this section every 30-second (SECTION C ONLY and I don't
know the codes)
--
tr
  td . $Column1 . /td
  td . $Column2 . /td
  td . $Column3 . /td
  td . $Column4 . /td
  td . $Column5 . /td
/tr


!-- 
// SECTION D
// =
// Load one only, no need to refresh
--
tr
  tdEnd of Record/td
/tr


/table
/body
/html
= index.php =

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

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



RE: [PHP] Re: $_SESSION stuffs that come with php.ini

2003-09-26 Thread Donald Tyler
Session auto start is not enabled as default because it is a performance
drain. It is much more efficient to use session_start() only when you
need it.

The easiest way to do things is usual the worst. (Most inefficient)

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 26, 2003 2:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: $_SESSION stuffs that come with php.ini

Alright that work now  Don't know why does the php.ini default is
not
what it should be...  I found a few that aren't on the list in php.ini,
but
hte most important thing right now is that it is fixed...

Scott Fletcher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Is this the one???

 http://us3.php.net/session

 Thanks...

 Scott Fletcher [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  I have been building the website for 6 months with everything and I
didn't
  have hte php.ini on it.  Just didn't realize it, so I create the
php.ini
  that come from php.ini_dist that came with php source code.  Now the
  $_SESSION doesn't work.  I'm not able to make the php.ini to be like
the
 one
  that php work without it.  So, anyone know what is the default
session
  configuration?
 
  Thanks...

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

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



[PHP] mysql.lock file location

2003-09-25 Thread Donald Tyler
Hi,

 

Does anyone know how to tell PHP to look in a different location for the
mysql.lock file? It's currently looking in /tmp/ and that's wrong.

 

 

Thanks

 

 

Donald



FW: [PHP] mysql.sock file location

2003-09-25 Thread Donald Tyler
I meant mysql.sock, sorry.

-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 8:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] mysql.lock file location

Hi,

 

Does anyone know how to tell PHP to look in a different location for the
mysql.lock file? It's currently looking in /tmp/ and that's wrong.

 

 

Thanks

 

 

Donald

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



RE: [PHP] mysql.lock file location

2003-09-25 Thread Donald Tyler
The MySQL functions only allow me to change the location per function
call.

I want to change the default mysql.sock file location for PHP, it would
seem silly to change every script to do that, especially since this is
only a test server and the main server will most likely have the
mysql.sock file in another location.

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 8:26 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mysql.lock file location

On Thursday 25 September 2003 21:17, Donald Tyler wrote:

 Does anyone know how to tell PHP to look in a different location for
the
 mysql.lock file? It's currently looking in /tmp/ and that's wrong.

manual  MySQL Functions

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Oh, give me a home,
Where the buffalo roam,
And I'll show you a house with a really messy kitchen.
*/

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

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



RE: [PHP] mysql.sock file location

2003-09-25 Thread Donald Tyler
Thanks for the reply. I forgot about the php.ini file. That seemed to
point me in the right direction.

However, although PHP is now looking at the correct file. I still get
the error message:

Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/var/lib/mysql/mysql.sock' (13) in
/usr/local/apache2/htdocs/dbtest.php on line 3


Do you have any idea why it would not connect even though its looking at
the correct file?

Here is the line from the PHP.ini file after I edited it (incase I did
something retarded)

mysql.default.socket = /var/lib/mysql/mysql.sock

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 9:06 AM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] mysql.sock file location

[snip]
I meant mysql.sock, sorry.

Does anyone know how to tell PHP to look in a different location for the
mysql.lock file? It's currently looking in /tmp/ and that's wrong.
[/snip]

But MySQL is running? PHP AFAIK doesn't care where mysql.sock is, unless
it is not the default.

locate mysql.sock
look in my.conf to see if the paths match
if not, change the path in my.conf and restart mysql

There is a PHP directive in the php.ini

; Default socket name for local MySQL connects.  If empty, uses the
built-in
; MySQL defaults.
mysql.default_socket =

where you can specify the location of the sock if need be.

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



RE: [PHP] mysql.sock file location

2003-09-25 Thread Donald Tyler
Yeah I thought so to. But I did a chmod 755 on the sock file and it
didn't help.

Here's the test script I am using: (Presume that's what you meant by
connection string?

?PHP

if($Connection = mysql_connect('localhost', '**', '**'))
print 'Success!';
else
print 'Failure';

?

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 9:44 AM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] mysql.sock file location

[snip]
Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/var/lib/mysql/mysql.sock' (13) in
/usr/local/apache2/htdocs/dbtest.php on line 3
[/snip]

Can we see your connection string? My bet would be permissions...

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



RE: [PHP] mysql.sock file location

2003-09-25 Thread Donald Tyler
Yes, I ping it and it says its alive.

-Original Message-
From: Brad Pauly [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:07 AM
To: Donald Tyler
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] mysql.sock file location

Donald Tyler wrote:
 Yeah I thought so to. But I did a chmod 755 on the sock file and it
 didn't help.
 
 Here's the test script I am using: (Presume that's what you meant by
 connection string?
 
 ?PHP
 
   if($Connection = mysql_connect('localhost', '**', '**'))
   print 'Success!';
   else
   print 'Failure';
 
 ?

Are you sure the MySQL server is running? Can you connect from the 
command line using the same credentials as above?

- Brad

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



RE: [PHP] mysql.sock file location

2003-09-25 Thread Donald Tyler
I wasn't worried about short code =0P

I would have done this if I was:

$Connection = mysql_connect('localhost','**','**')
or die(mysql_error());

=0P

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:13 AM
To: Brad Pauly; Donald Tyler
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] mysql.sock file location

[snip]
 Here's the test script I am using: (Presume that's what you meant by
 connection string?
 
 ?PHP
 
   if($Connection = mysql_connect('localhost', '**', '**'))
   print 'Success!';
   else
   print 'Failure';
 
 ?
[/snip]

Let's get a hair more info, try

if(!($Connection = mysql_connect('localhost', '**',
'**'))){
print(mysql_error() . \n);
exit();
}

It also has the added benefit of shortening the code

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



RE: [PHP] mysql.lock file location

2003-09-25 Thread Donald Tyler
Yeah I do that too. But I was reluctant to do that with something that
just seemed like a fix for a problem that shouldn’t even exist.

If the server with my scripts is configured correctly, then I should
never have to specify a .sock file. I hope...

-Original Message-
From: Jackson Miller [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:15 AM
To: Donald Tyler
Subject: Re: [PHP] mysql.lock file location

On Thursday 25 September 2003 8:55, you wrote:
 Is there no way for me to change the default location for PHP? I have
 quite a few scripts that I really don’t want to have to do that to. I
 would rather reconfigure PHP.
You can set default mysql settings in php.ini which allows you to set a
socket 
file.  Then you leave the default settings out of mysql_connect all
together.  
I _think_ that you can then connect with 
mysql_connect(localhost,username,password) and it will use the
socket 
file set in php.ini.

If that doesn't work you can try editing the client section of
/etc/my.cnf

Also, I always set up my apps in a way that the db connection is only in
one 
place and just called from all the scripts that need it.  You can do
this 
with an include or using object oriented coding.  This way if you ever
have 
to make a system wide change you don't have to go to all the scripts and

change it.

Hope that helps.

-Jackson

 -Original Message-
 From: Jackson Miller [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 25, 2003 8:24 AM
 To: Donald Tyler
 Subject: Re: [PHP] mysql.lock file location

 On Thursday 25 September 2003 8:17, Donald Tyler wrote:
  Hi,
 
  Does anyone know how to tell PHP to look in a different location for

 the

  mysql.lock file? It's currently looking in /tmp/ and that's wrong.

 mysql_connect(:/path/to/mysql.lock,username,password);

 -Jackson

  Thanks
 
 
 
 
 
  Donald

-- 
jackson miller
 
cold feet creative
615.321.3300 / 800.595.4401
[EMAIL PROTECTED]
 
 
cold feet presents Emma
the world's easiest email marketing
Learn more @  http://www.myemma.com

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



RE: [PHP] mysql.sock file location

2003-09-25 Thread Donald Tyler
Argh! Wonderful. Now I have broken something else.

I just restarted the machine and now MySQL won't start. I keep getting
the error:

030925 10:30:10 mysqld started
030925 10:30:10 InnoDB: Operating system error number 13 in a file
operation.
InnoDB: See http://www.innodb.com/ibman.html for installation help.
InnoDB: The error means mysqld does not have access right to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: Fire operation call: 'open'.
InnoDB: Cannot continue operation
030925 10:30:10 mysqld ended

I went and checked the entire /var/lib/mysql directory structure and
everything (including ibdata1) is set to root:mysql 755

I am going to headbut the screen in a minute!

-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:32 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] mysql.sock file location

Yes, I ping it and it says its alive.

-Original Message-
From: Brad Pauly [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:07 AM
To: Donald Tyler
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] mysql.sock file location

Donald Tyler wrote:
 Yeah I thought so to. But I did a chmod 755 on the sock file and it
 didn't help.
 
 Here's the test script I am using: (Presume that's what you meant by
 connection string?
 
 ?PHP
 
   if($Connection = mysql_connect('localhost', '**', '**'))
   print 'Success!';
   else
   print 'Failure';
 
 ?

Are you sure the MySQL server is running? Can you connect from the 
command line using the same credentials as above?

- Brad

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

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



RE: [PHP] mysql.sock file location

2003-09-25 Thread Donald Tyler
No not a network IP ping. A mysqladmin ping:

Mysqladmin --user=root ping

-Original Message-
From: Brad Pauly [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:53 AM
To: Donald Tyler
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] mysql.sock file location

Donald Tyler wrote:
 Yes, I ping it and it says its alive.

I don't understand. What did you ping? How does that mean it is running?

Getting a response from a ping does not mean MySQL is running. Did you 
try connecting with a MySQL client from the command line? Have you 
looked at the running processes to see if it exists there?

- Brad

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

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



RE: [PHP] mysql.sock file location

2003-09-25 Thread Donald Tyler
Don't know yet, I've managed to stop mysql from loading now! (See my
previous mail)

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:40 AM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] mysql.sock file location

[snip]
I wasn't worried about short code =0P

I would have done this if I was:

$Connection = mysql_connect('localhost','**','**')
or die(mysql_error());

=0P
[/snip]

Cool, but do you get errors?

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



RE: [PHP] mysql.sock file location

2003-09-25 Thread Donald Tyler
Well after getting MySQL back up and running (After restarting the
machine) the script worked fine. So it looks like editing the PHP.ini
file worked.

Thanks to everyone who helped. Don't know where I would be without you
guys ( gals?).

Donald.

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:40 AM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] mysql.sock file location

[snip]
I wasn't worried about short code =0P

I would have done this if I was:

$Connection = mysql_connect('localhost','**','**')
or die(mysql_error());

=0P
[/snip]

Cool, but do you get errors?

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



RE: [PHP] PHP vs CGI ???

2003-09-19 Thread Donald Tyler
PHP can be installed as either a CGI or an Apache module. There is
documentation on this in the PHP readme files.

Pretty much everything I read said that its always better to use the
Apache Module version. (apparently its much more stable and secure)

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 19, 2003 8:38 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP vs CGI ???

Hi!

I have a question.  Someone said that PHP is CGI, that kind of
turned my
head because PHP is not like that.  But I can see one thing, PHP can be
compiled as either a 'Shell-Scripting-Language', 'Webserver Component'
or
'Both'...   PHP would be a form of CGI if it is used as Shell Scripting
Language but if I compile Apache and have it create a PHP module then it
is
not a form of CGI.

Can anyone point this out or clarify this?  It would be very much be
appreciated.

Thanks,
 Scott F.

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




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



[PHP] Resizing a jpeg stored in a database

2003-09-18 Thread Donald Tyler
Hi,

 

I have a question that I hope you can answer. So far I have accomplished
the following:

 

Storing a jpeg in a MySQL database

Retrieving the jpeg from the database

Sending the jpeg to a browser and displaying it correctly

 

Creating dynamic PNG images in PHP

Resizing the dynamic PNG image in PHP

 

 

 

Now I need to combine the two processes. I am storing jpegs in a
database, and I want to write a script that can serve the image as
either a thumbnail view or a full view. How exactly would I go about
this? I was hoping I could just load the image from the database and
then insert it into an object I created with imagecreate(). However I
don't seem to be able to find any functions that will allow me to do
that.

 

I noticed there were functions to import images from files or URL's.
Does this mean that I will first have to save the image as a file on the
hard drive and THEN import it into the image object?

 

Thanks in advance for your help.

 

 

 

Donald Tyler



[PHP] Lost Connection to MySQL server during query

2003-09-09 Thread Donald Tyler
I have a script that is processing data from a single table and splitting it
into smaller normalized tables.

 

The script takes anywhere between 5-10 minutes to complete, and as it runs
it constantly outputs a report on its progress.

 

The script seems to run fine the first time I run it, but with subsequent
runs (To see if it incorrectly creates duplicates of records etc), after a
couple of minutes the script ends with an error message saying Lost
connection to MySQL server during query.

 

During the first run, the script is mostly just chopping up the data and
placing it in the new tables, and doing a little comparing. But during
subsequent runs, all of the records in the new tables should already exist,
so the script see's this, and instead of creating new records, it compares
them to see if its correct.

 

Does anyone have any idea why it would be losing connection all the time?

 

This is just being run on a test server at the moment. Being used as the
server and also the client, configured as follows:

 

Windows XP Tablet Edition

PHP 4.3.3

PHP Extensions:   XmlRPC

MySQL 4.0.14

Apache 2.0.47

 

Please help, this has been making my life hell for a week now!

 

Thanks

 

 

Donald



[PHP] XmlRPC - Server did not understand request

2003-08-26 Thread Donald Tyler
Thanks to the excellent help from someone at Full Data Systems (Thank you!),
I finally managed to get the XmlRPC extension working on my windows PHP
installation.

I am not trying to send any params at the moment, all I want to do is get a
valid response.

However, now when I try and run the script in debug mode, I get an error
message (Details below).

The same script works fine on a Mac OSX Server machine that we have. Anyone
have any idea's?

opening socket to host: localhost, port: 80, uri:
Test_Server/XML/PHP_Servers/XMLTEST.php

sending http request:

POST Test_Server/XML/PHP_Servers/XMLTEST.php HTTP/1.0
User-Agent: xmlrpc-epi-php/0.2 (PHP)
Host: localhost:80
Content-Type: text/xml
Content-Length: 111

?xml version=1.0 encoding=iso-8859-1?
methodCall
methodNametest/methodName
params/
/methodCall

receiving response...

got response:

. 

!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
htmlhead
title400 Bad Request/title
/headbody
h1Bad Request/h1
pYour browser sent a request that this server could not understand.br /
/p
hr /
addressApache/2.0.47 (Win32) PHP/4.3.2 Server at localhost Port
80/address
/body/html





//---[ Here is the client code: ---\\

?PHP

require_once('XMLRPC_Utils.php');

$XMLRequest = array();

$options = array('output type' = 'xml', 'version' = 'xmlrpc');
$result = xu_rpc_http_concise(
array(method= 'test',
  args  = $XMLRequest,
  host  = 'localhost',
  uri   =
'Test_Server/XML/PHP_Servers/XMLTEST.php',
  port  = 80,
  options   = $options,
  debug = 1));

?

//---[ Here is the server code: ---\\

?php

include(xmlrpc_utils.php);

// ensure extension is loaded.
xu_load_extension();

function test($method_name, $params, $app_data)
{
return 'Hello Scott';
}

/* create a new server object */
$server = xmlrpc_server_create();

xmlrpc_server_register_method($server, test, test);

/* Now, let's get the client's request from the post data */
$request_xml = $HTTP_RAW_POST_DATA;
if(!$request_xml) {
  $request_xml = $HTTP_GET_VARS[xml];
}
if(!$request_xml) {
  echo h1No XML input found!/h1;
}
else {
  /* setup some (optional) output options */
  $display = array();
  if($HTTP_POST_VARS[verbosity]) {
 $display[verbosity] = $HTTP_POST_VARS[verbosity];
  }
  if($HTTP_POST_VARS[escaping]) {
 $display[escaping] = $HTTP_POST_VARS[escaping];
  }
  else {
 $display[escaping] = array(non-ascii, markup);
  }
  if($HTTP_POST_VARS[version]) {
 $display[version] = $HTTP_POST_VARS[version];
  }
  if($HTTP_POST_VARS[encoding]) {
 $display[encoding] = $HTTP_POST_VARS[encoding];
  }
  if($HTTP_POST_VARS[output_type]) {
 $display[output_type] = $HTTP_POST_VARS[output_type];
  }

  /* handle the request */
  $response = xmlrpc_server_call_method($server, $request_xml,
$response, $display);

  if($HTTP_POST_VARS[disp] === html) {
 if($HTTP_POST_VARS[output_type] === php) {
echo xmp\n;
var_dump($response);
echo \n/xmp\n;
 }
 else {
echo xmp\n$response\n/xmp\n;
 }
  }
  else {
 echo $response;
  }
}

?

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



FW: [PHP] XmlRPC - Server did not understand request

2003-08-26 Thread Donald Tyler


-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 26, 2003 9:29 AM
To: 'Marek Kilimajer'
Subject: RE: [PHP] XmlRPC - Server did not understand request

Well that fixed it.

*Slaps head*. I guess I should have noticed that. Sorry for such a retarded
question.

Thanks for the help. =0)

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 26, 2003 9:18 AM
To: Donald Tyler
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] XmlRPC - Server did not understand request

Donald Tyler wrote:

 sending http request:
 
 POST Test_Server/XML/PHP_Servers/XMLTEST.php HTTP/1.0
should be
POST /Test_Server/...
(asuming Test_Server is a directory)

 User-Agent: xmlrpc-epi-php/0.2 (PHP)
 Host: localhost:80
should be
Host: localhost

 Content-Type: text/xml
 Content-Length: 111
 
 ?xml version=1.0 encoding=iso-8859-1?
 methodCall
 methodNametest/methodName
 params/
 /methodCall
 
 receiving response...
 
 got response:
 
 . 
 
 !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
 htmlhead
 title400 Bad Request/title
 /headbody
 h1Bad Request/h1
 pYour browser sent a request that this server could not understand.br
/
 /p
 hr /
 addressApache/2.0.47 (Win32) PHP/4.3.2 Server at localhost Port
 80/address
 /body/html
 
 
 
 
 
 //---[ Here is the client code: ---\\
 
 ?PHP
 
 require_once('XMLRPC_Utils.php');
 
 $XMLRequest = array();
 
 $options = array('output type' = 'xml', 'version' = 'xmlrpc');
 $result = xu_rpc_http_concise(
   array(method= 'test',
 args  = $XMLRequest,
 host  = 'localhost',
 uri   =
 'Test_Server/XML/PHP_Servers/XMLTEST.php',
 port  = 80,
 options   = $options,
 debug = 1));
 
 ?
 
 //---[ Here is the server code: ---\\
 
 ?php
 
 include(xmlrpc_utils.php);
 
 // ensure extension is loaded.
 xu_load_extension();
 
 function test($method_name, $params, $app_data)
   {
   return 'Hello Scott';
   }
 
   /* create a new server object */
   $server = xmlrpc_server_create();
   
   xmlrpc_server_register_method($server, test, test);
   
   /* Now, let's get the client's request from the post data */
   $request_xml = $HTTP_RAW_POST_DATA;
   if(!$request_xml) {
 $request_xml = $HTTP_GET_VARS[xml];
   }
   if(!$request_xml) {
 echo h1No XML input found!/h1;
   }
   else {
 /* setup some (optional) output options */
 $display = array();
 if($HTTP_POST_VARS[verbosity]) {
$display[verbosity] = $HTTP_POST_VARS[verbosity];
 }
 if($HTTP_POST_VARS[escaping]) {
$display[escaping] = $HTTP_POST_VARS[escaping];
 }
 else {
$display[escaping] = array(non-ascii, markup);
 }
 if($HTTP_POST_VARS[version]) {
$display[version] = $HTTP_POST_VARS[version];
 }
 if($HTTP_POST_VARS[encoding]) {
$display[encoding] = $HTTP_POST_VARS[encoding];
 }
 if($HTTP_POST_VARS[output_type]) {
$display[output_type] = $HTTP_POST_VARS[output_type];
 }
   
 /* handle the request */
 $response = xmlrpc_server_call_method($server, $request_xml,
 $response, $display);
   
 if($HTTP_POST_VARS[disp] === html) {
if($HTTP_POST_VARS[output_type] === php) {
   echo xmp\n;
   var_dump($response);
   echo \n/xmp\n;
}
else {
   echo xmp\n$response\n/xmp\n;
}
 }
 else {
echo $response;
 }
   }
   
 ?
 

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



[PHP] XMl Parsing within PHP

2003-08-14 Thread Donald Tyler
Hi,

 

I am trying to create a Class that will parse an XML document. It all works
fine as individual functions but I cant get it to work as a class.

 

For example, when I do the following in my class:

 

xml_set_element_handler($this-xml_parser,
'$this-startElement', $this-endElement);

xml_set_character_data_handler($this-xml_parser,
$this-valueHandler);

 

I get an error message:

 

Warning: xml_parse(): Unable to call handler $thiss-startElement() in
c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on
line 90

 

Now I presume this is because I am trying to call methods of my class.

 

Does anyone know a good way around this?

 

Thanks.



RE: [PHP] Building an XML Parser Class

2003-08-14 Thread Donald Tyler
I did read the other thread, and I tried that.

It didn't work...

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 2:46 PM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] Building an XML Parser Class

[snip]
xml_set_element_handler($this-xml_parser, '$this-startElement',
$this-endElement);
xml_set_character_data_handler($this-xml_parser,
$this-valueHandler);

I get an error message:

Warning: xml_parse(): Unable to call handler $this-startElement() in
c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on
line 90

Now I presume this is because I am trying to call methods of my class.
[/snip]

Hmmm... I thought you might have read the other class thread. Since the
method is not public you could call it with the :: syntax.

http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php

HTH

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


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



RE: [PHP] Building an XML Parser Class

2003-08-14 Thread Donald Tyler
Three ways I tried using the :: syntax:

1. With either double OR single and with OR without () (Tried all 4
combinations) quotes:

xml_set_element_handler($this-xml_parser, xmlTranslator::startElement,
xmlTranslator::endElement);

Gives me the following error message:

Warning: xml_parse(): Unable to call handler xmlTranslator::startElement()
in c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on
line 90

2. With no quotes:
 
xml_set_element_handler($this-xml_parser, xmlTranslator::startElement(),
xmlTranslator::endElement());

This runs the functions, but doesn't pass any parameters to it. All I get
are missing parameter error messages.





-Original Message-
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 08, 2003 9:11 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Building an XML Parser Class

I did read the other thread, and I tried that.

It didn't work...

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 2:46 PM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] Building an XML Parser Class

[snip]
xml_set_element_handler($this-xml_parser, '$this-startElement',
$this-endElement);
xml_set_character_data_handler($this-xml_parser,
$this-valueHandler);

I get an error message:

Warning: xml_parse(): Unable to call handler $this-startElement() in
c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on
line 90

Now I presume this is because I am trying to call methods of my class.
[/snip]

Hmmm... I thought you might have read the other class thread. Since the
method is not public you could call it with the :: syntax.

http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php

HTH

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


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



FW: [PHP] Re: Building an XML Parser Class

2003-08-14 Thread Donald Tyler

Thanks for the link.

Sadly it doesn't really apply to what I am trying to do. My class literally
translates the Xml Document into an associative array.

PHP's functionality for working with XML documents is way too limited for me
to do what I need to while still keeping my code legible. That's why I am
changing it into an array first.

As I said, the code works perfect. All I need to do is to be able to call a
method of the parent of the Xml Parser.

I presume the Xml Parser is an object even though it is created with 

$MyXmlParser = xml_parser_create();

Instead of say: 

$MyXmlParser = new XmlParser;

-Original Message-
From: Greg Beaver [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 5:01 PM
To: Donald Tyler
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: Building an XML Parser Class

http://pear.php.net/XML_Parser

:)
Greg
--
phpDocumentor
http://www.phpdoc.org

Donald Tyler wrote:
 Hi,
 
 I am trying to create a Class that will parse an XML document. It all
works
 fine as individual functions but I cant get it to work as a class.
 
 For example, when I do the following in my class:
 
 xml_set_element_handler($this-xml_parser, '$this-startElement',
 $this-endElement);
 xml_set_character_data_handler($this-xml_parser, $this-valueHandler);
 
 I get an error message:
 
 Warning: xml_parse(): Unable to call handler $this-startElement() in
 c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on
 line 90
 
 Now I presume this is because I am trying to call methods of my class.
 
 Does anyone know a good way around this?
 
 
 Thanks.
 
 


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


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



RE: [PHP] Building an XML Parser Class

2003-08-14 Thread Donald Tyler
Tried that already, all it does it change the error message to:

Warning: xml_parse(): Unable to call handler () in c:\program files\apache
group\php\My_includes\Class.xmlTranslator.php on line 90

I guess this is because its looking within the xml parser object for a
function called $this-startElement. Which it obviously doesn't exist
because its in the xml parsers parent object.

-Original Message-
From: Evan Nemerson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 4:36 PM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: Re: [PHP] Building an XML Parser Class

Try getting rid of the quotes around $this-startElement, or changing them
to 
double quotes.

If you don't understand why, php.net/language.types.string should make for
an 
exhilarating read :)



On Thursday 07 August 2003 12:40 pm, Donald Tyler wrote:
 Hi,

 I am trying to create a Class that will parse an XML document. It all
works
 fine as individual functions but I cant get it to work as a class.

 For example, when I do the following in my class:

 xml_set_element_handler($this-xml_parser, '$this-startElement',
 $this-endElement);
 xml_set_character_data_handler($this-xml_parser, $this-valueHandler);

 I get an error message:

 Warning: xml_parse(): Unable to call handler $this-startElement() in
 c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on
 line 90

 Now I presume this is because I am trying to call methods of my class.

 Does anyone know a good way around this?


 Thanks.

-- 
Why be born again, when you can just grow up?

-Unknown



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



RE: [PHP] XMl Parsing within PHP

2003-08-14 Thread Donald Tyler
Its $this-startElement().

That was a typo. I typed the error message instead of copying and pasting
it. Sorry.

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 1:26 PM
To: Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] XMl Parsing within PHP

[snip]
xml_set_element_handler($this-xml_parser, '$this-startElement',
$this-endElement);
xml_set_character_data_handler($this-xml_parser,
$this-valueHandler);

I get an error message:

Warning: xml_parse(): Unable to call handler $thiss-startElement() in
c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on
line 90
[snip]

Is the handler called $thiss-startElement() or $this-startElement?

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


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



[PHP] Building an XML Parser Class

2003-08-14 Thread Donald Tyler
Hi,

I am trying to create a Class that will parse an XML document. It all works
fine as individual functions but I cant get it to work as a class.

For example, when I do the following in my class:

xml_set_element_handler($this-xml_parser, '$this-startElement',
$this-endElement);
xml_set_character_data_handler($this-xml_parser, $this-valueHandler);

I get an error message:

Warning: xml_parse(): Unable to call handler $this-startElement() in
c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on
line 90

Now I presume this is because I am trying to call methods of my class.

Does anyone know a good way around this?


Thanks.



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



RE: [PHP] Trouble getting $HTTP_RAW_POST_DATA

2003-08-01 Thread Donald Tyler
You should encase the $HTTP_RAW_POST_DATA in print_r() or you will just get
the word Array printed. But I doubt that will solver your problem because
it seems that $HTTP_RAW_POST_DATA is empty.

Also, print_r() does not include any HTML formatting, so you will need to
look at the source for the page in the browser to make it readable.

-Original Message-
From: Balazs Halasy [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 01, 2003 7:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Trouble getting $HTTP_RAW_POST_DATA

I need to have the contents of $HTTP_RAW_POST_DATA because of
non-regular uploads (from browser to my home-made WevDAV server
implementation 
(done in PHP)). However, no matter what I
do, it is always NULL. I guess the following script should return
SOMETHING in $HTTP_RAW_POST DATA if always_populate_raw_post_data = On is
added to the php.ini file (and yes, I've restarted apache :-)... so, why
is it empty and how can I get the RAW post data? My PHP version is 4.3.2.

test.php: 

form action=?echo($PHP_SELF)? method=post 
input type=text value=you-suck 
input type=submit 
/form 
?php 
echo(Raw post data: .$HTTP_RAW_POST_DATA.br\n); 
echo(Raw post data decoded:
.base64_decode($HTTP_RAW_POST_DATA).br\n); 
echo(hr); 
phpinfo(); 
? 



Allman


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


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



[PHP] XmlRPC Extension in Apache 4.2.3

2003-08-01 Thread Donald Tyler
Hi Everyone,

I posted this on the PHP install list but didn't get a reply. I hope you
guys/gals can be more helpful.

I am having trouble getting the XmlRpc extension working with PnP 4.2.3.

SYSTEM:
Windows XP Pro
PHP 4.2.3 (Running as Apache module)
Apache 2.0.44

When Apache starts I get the following error:

Unknown(): Unable to load dynamic link library 'c:\program files\apache
group\php\extensions\php_xmlrpc.dll' - The specified module could not be
found.

The error.log after a clean start:

[Fri Jul 18 17:08:29 2003] [notice] Parent: Created child process 3420 PHP
Warning:  Unknown(): Unable to load dynamic library 'c:\program files\apache
group\php\extensions\php_xmlrpc.dll' - The specified module could not be
found.  in Unknown on line 0 [Fri Jul 18 17:08:32 2003] [notice] Child 3420:
Child process is running [Fri Jul 18 17:08:32 2003] [notice] Child 3420:
Acquired the start mutex. [Fri Jul 18 17:08:32 2003] [notice] Child 3420:
Starting 250 worker threads.

I know the dll exists in the correct location and the extension path is
specified correctly in the php.ini file because other extensions load fine.

Anyone have any suggestions?

Thanks.


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



RE: [PHP] Google APIs with PHP

2003-07-31 Thread Donald Tyler
You probably shouldn't have posted your Google key here...

-Original Message-
From: Daniel Ke [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 30, 2003 11:45 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Google APIs with PHP

Sorry about it. I should include the code as attachment.

Daniel

_
Get 10Mb extra storage for MSN Hotmail. Subscribe Now! 
http://join.msn.com/?pgmarket=en-hk



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



RE: [PHP] capturing reloads

2003-07-30 Thread Donald Tyler
The only way I know is to use sessions.

Each time they load the page, you would check a session variable that you
use store the status of a specific page. E.g.

if($_SESSION['ReloadStatus']['ContactUs'] == true)
{
//Page has already been loaded once. This is a reload.
//[ Your code here ] --\\
}
else
{
//Page hasn't already been loaded. This is the first visit.
//[ Your code here ] --\\

//Register this page as loaded:
$_SESSION['ReloadStatus']['ContactUs'] == true
}

-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 30, 2003 8:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] capturing reloads

anyone know how to catch if someone has reloaded a page?



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


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



RE: [PHP] Re: Email forwarding from SendMail to PHP

2003-07-29 Thread Donald Tyler
I don't suppose you could copy and paste the site into an email and send it
to me could you? I can't seem to access the site.

Thanks..

-Original Message-
From: Joseph Szobody [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 28, 2003 3:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Email forwarding from SendMail to PHP

See if this helps:

http://www.evolt.org/article/Incoming_Mail_and_PHP/18/27914/

Joseph

Donald Tyler [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Anyone know of a place to get some good tutorials on how to forward email
 from SendMail to PHP for processing?
 
 


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


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



[PHP] Email forwarding from SendMail to PHP

2003-07-28 Thread Donald Tyler
Anyone know of a place to get some good tutorials on how to forward email
from SendMail to PHP for processing?