[PHP] RE: creating thumbnails from .BMP files

2003-05-29 Thread Robert
John W. Holmes wrote:

>> How do you create thumbnails from .BMP files?  Is there a function
> like
>> there is for JPG (ImageJPEG)?
> 
> Probably need to use an external program that understands that format
> and an exec() call.
> 
> ---John W. Holmes...
> 
> Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
> 
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
> 
> 
> 

I use convert - its part of the ImageMagick package.  You use exec to run it
and it will convert a lot of different file formats.  Incidentally, you can
use MPlayer to do thumbnails from movies as well!
-- 



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



[PHP] very simple eregi / loop question

2002-06-07 Thread Robert

How would you loop though a file ( or web page) and get all of a certain
thing. I'm trying to strip stuff out of tables, but I have only managed to
get the first of what I'm searching for. My expression is
eregi("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}", $search, $content);
which does the job, but how do I apply that to get all of that from the
page?

thanks

--




--------


Robert Packer
Programming and Design Associate
814-944-1108
[EMAIL PROTECTED]
-- NRC Online --





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




AW: [PHP] PHP vs. Java

2002-07-10 Thread robert

> I agree with the other reply to your question.

> (Keep in mind that it will be easier to sell Java to
> the corporate guys. Some executives shy away from open
> source.)

Php vs. Java?
Why not work together.

copy from manual:
"
There are two possible ways to bridge PHP and Java: you can either
integrate PHP into a Java Servlet environment, which is the more stable
and efficient solution, or integrate Java support into PHP. The former
is provided by a SAPI module that interfaces with the Servlet server,
the latter by the Java extension. 

PHP 4 ext/java provides a simple and effective means for creating and
invoking methods on Java objects from PHP. The JVM is created using JNI,
and everything runs in-process. Build instructions for ext/java can be
found in php4/ext/java/README. 
"

> Good luck!!!




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




[PHP] gd ->1:image resolution 2:font quality

2002-07-12 Thread robert

hi

Couldn't find a way for changing resolution,
for png-image create with gd.

Default resolution of gd is 72dpi.

Created picture is a barcode.
>From TTF - Font.

thanks for help and hints.
robert


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




Re: [PHP] PHP and geographic maps

2002-07-12 Thread robert

Found by the way.

"MapServer is an OpenSource development environment for 
building spatially enabled Internet applications."

http://mapserver.gis.umn.edu/doc/phpmapscript-class-guide.html

hope it does help

robert


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




[PHP] Re: gd ->1:image resolution 2:font quality

2002-07-12 Thread robert

> Couldn't find a way for changing resolution,
> for png-image create with gd.

My idea to solve the problem:
1:Picture to create with gd, scale up by factor 69.4[?] (for 600dpi )
  Result is an huge 72 dpi picture.
2:Resize and convert result picture to 600dpi by an external program.

Next question: 
Which external program I can use?
Have to work on windows 2.
This is not the reason for my lack of english skills ;)

> Default resolution of gd is 72dpi.
> 
> Created picture is a barcode.
> From TTF - Font.
> 
> thanks for help and hints.
> robert
> 


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




Re: [PHP] What a difference a / makes!

2004-01-20 Thread robert
Look at the one for yt and one for Alaska.  If there is a difference in 
the code in 1 place that is probably why it IS working on the yt page.  
That's where I would start.  Then I would put in an alias in my web 
configuration to point css /home/web/css or whatever so that you can go :

echo '';

The thing you do need to check is your $continentcode especially, as 
that is the one that links between pages and the style sheet (unless I 
missed where it was assigned based on something else).  Also check to 
make sure you have ' appropriately.  I find an odd number of ' in your 
example and if you are not careful then you have cut off a piece of the 
echoed code.

That will cut down some on code as well as help with the figuring out of 
where the issue is.  I personally use print  " " for things like that, no having to join the 
information together, the server does the work for me.

Robert

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


[PHP] php 4.0.5.dev will not read php.ini on NT

2001-01-17 Thread Robert

PHP 4.0.5.dev 
I installed it on my Windows 2000 Pro machine with IIS and MySQL and it works like a 
champ
I installed it on my Windows NT Server with IIS and MSSQL and it will not read the 
php.ini file
I put it in the following folders to try to get it to work

C:\winnt
C:\
C:\winnt\system32
C:\windows  <---created just to see if it would work

I used the same archive for both and even copied the php.ini from the 2000 machine to 
the NT machine.
I have tried editing it and then restarting IIS ( net stop iisadmin ... net start 
w3svc ) and no changes show up.

GRRR!!!
What's up here?
Thanks



Re: [PHP] php 4.0.5.dev will not read php.ini on NT

2001-01-18 Thread Robert


  Configuration File (php.ini) Path php.ini

is what it said before.
It still says that, I switched back to 4.04pl1 and now it works fine
I wrote an IC parts search engine that will search our MSSQL database for
partial part numbers and
part numbers with the dash in the wrong place. It's working now!!!  YAY!

Now I need to parse the output and send a message with only the requested
parts.

- Original Message -
From: "Brian Clark" <[EMAIL PROTECTED]>
To: "PHP is not a drug ." <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 10:57 PM
Subject: Re: [PHP] php 4.0.5.dev will not read php.ini on NT


>
> Hello Robert,
>
> (R == "Robert") [EMAIL PROTECTED] writes:
>
> R> PHP 4.0.5.dev I installed it on my Windows 2000 Pro machine with
> R> IIS and MySQL and it works like a champ I installed it on my
> R> Windows NT Server with IIS and MSSQL and it will not read the
> R> php.ini file I put it in the following folders to try to get it to
> R> work
>
> R> C:\winnt
> R> C:\
> R> C:\winnt\system32
> R> C:\windows  <---created just to see if it would work
>
> Stick  into a file and load it in a browser. Look
> for the line that says something along the lines of:
>
> php.ini file path is set to: X
>
> Where X is the base directory. I'm not sure about 4.x's phpfino()
> saying those exact words, but where ever it says it should be,
> put it in that directory and try it.
>
> R> GRRR!!!
> R> What's up here?
> R> Thanks
>
> -Brian
> --
> If a listener nods his head when you're
> explaining your program, wake him up.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Convert DBF tu MySQL

2001-01-22 Thread Robert

I used DBF2MySQL from http://www.nica.ru/~ae/software/
It works, but truncated the field names to 10 characters (
Specific_Part_Number became Specific_P )

- Original Message -
From: "Roman" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 1:43 AM
Subject: [PHP] Convert DBF tu MySQL


> Hello !!
>
>
> Please, help me someone. How to convert dbf file from FOXPRO(for DOS) to
> MySQL database if it's posible, or if not how to connect this dbf file
form
> php script and apply sql command for
> used data from this file...
>
> Thanx
>
> Roman
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php in a layer trouble

2002-04-24 Thread Robert

Has anyone ever had trouble with Netscape not displaying a layer with you
put any php code in it? Anyone know a source for reading more about it?



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




[PHP] script to test proxies?

2002-05-10 Thread Robert

Anyone know of a script that I could use to check through a database or
flatfile for valid proxies?

Thanks



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




[PHP] Replacing Sablotron backend with libxslt (gnome) backend for XSLT extension

2002-03-08 Thread Robert

After reading /ext/xslt/README.XSLT-BACKENDS in the source, specifically



 Config.m4
 ---

The XSLT extension's "magic" really occurs in the config.m4 file.  Here you
 must add a couple of things in order for your backend to be enabled.  Its a
bit
 too complex to describe (but easy to implement and understand).  Take a
look at
 config.m4 (which is well commented) to see what is necessary.

 Makefile.in
 ---

Simply add the source files for your backend to the LTLIBRARY_SOURCES
variable
 and you're all set with this file.



...and having various compilation/linking/performance problems with the
default Sablotron backend, I am seriously interested in replacing it with
the libxslt (gnome) libraries.  I hacked around with the Config.m4 and
Makefile.in files as noted in Sterling's comments to see if I could get PHP
configure/make to accept libxslt sources/libraries (after successfully
compiling/installing them) in place of Sablotronbut no success.

Before spending hours/days trying to do this methodically and painfully
(since I have always just configured/made PHP "by the book" and am a recent
ASP/IIS convert), I was hoping that somebody, somewhere has already done
this and just not posted or documented it (or at least thought about it).

Regards,
Robert Tuttle
United Devices, Inc.
[EMAIL PROTECTED]




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




[PHP] Defining constants with a value of 0?

2001-07-12 Thread Robert

I'm running into some unexpected behavior that I can't figure out.  This is
with PHP version 3, where, to my knowledge, boolean is not built in.



The type of true is returned as an integer, while the type of false is
returned as a string.  Even if I say (int) 0, it still returns its type as a
string.  Can anyone explain to me why it behaves this way?  Thank you.

-Rob


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Updating PHP checkout page

2007-02-09 Thread Robert
Hopefully I will manage to explain my problem and you will have a solution 
for it :).
I have a checkout page, coded in PHP (by some other coder, not available 
anymore). On the page I have one table containing shopping cart items and 
one submission form, to collect all information from the customer. When the 
page is loaded, the table is filled with data from the temporary data table 
through SQL query (collected on the previous page, shopping cart page), 
except for the field about the amount of the sales tax, which is not yet 
known because I don't know anything about the customer. So I have a shopping 
cart table and a blank form below that, ready to be filled with customer's 
information.

Now, my question is: How can I calculate and fill the sales tax field in the 
shopping cart table, if the customer chooses his state from the drop down 
list in the form? I must say here that the sales tax is only applicable for 
residents of just one state, Vermont, because the company is based in 
Vermont. For instance, if the customer chooses Vermont as his state, how 
this can be translated into sales tax amount, added into the field in the 
shopping cart table and recalculated the total amount? Should the page be 
reloaded, with changed value of some variable for the sales tax? Should the 
JavaScript be used?
All information entered in the form should be kept after the selection of 
the state and calculation is made (I assume that the page should be 
reloaded/refreshed), so the user shouldn't have to re-enter them again.
After this recalculation, the customer hits the "Make Purchase" button and 
the form is submitted and the receipt for the purchase is sent.



I'm not very familiar with PHP or JavaScript, so any help is greatly 
appreciated.




Thanks,
Robert

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



[PHP] Delayed page display

2010-03-04 Thread robert
I have a script that retrieves several queued email messages from a MySQL
database and sends them out, printing out progress as it goes along; for
example:

ema...@example.com ... sent
ema...@example.com ... sent
ema...@example.com ... sent

Either "sent" or "failed" is displayed based on the result of the mail() call.

When accessing the script however, the browser(?) waits until the script has
completely processed prior to displaying the page (instead of displaying it in
progress).  Other scripts on the same system display in progress, and it's
unclear what's different/special about this one.

The page header contains several hundred characters, and line breaks are
included after each "sent", so I don't think it's a browser buffering issue.
The behavior is the same in both Firefox & IE.

The engine is PHP 5.2 under Apache.  And none of the ob_ functions are being
used.  I did try adding a flush(), but the behavior is still the same.

So what else could cause the page to buffer completely prior to being
displayed?

Any insights appreciated,
  Robert


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



[PHP] RE: Delayed page display

2010-03-04 Thread robert
Additional info:

php.ini has output_buffering=4096.  Calling flush() or ob_implicit_flush()
within the script doesn't seem to help.  However setting
php_value output_buffering off
in .htaccess does the trick.

Any ideas what else to try?  Would like a script-only solution that is not
php.ini/htaccess dependent.

Thanks,
  Robert



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



[PHP] Issue with Quick Email validation

2011-03-10 Thread robert
Hi,
I'm newbie to PHP and this list, possible not a new question so forgive me if 
it's a repeat 
I have a form where I want the submitter Email ID to only be from one domain

Here's the part I'm having issues with 

$domain = explode( "@", $who);
if ( $domain[1] == "company.com") {
echo $domain[1];
echo("Email invalid.");
exit;
}

First Echo is just for me to check 
I type in a correct Email ID, say m...@company.com 

The return of this is:

company.com
Email invalid.


As far as I can see this if statement should not fall in, what am I missing?




Re: [PHP] Issue with Quick Email validation

2011-03-10 Thread robert
Thank you, that did get me past that part!

Had also to put in else statement to call Email function, without doing so the 
mail was sent even though giving error 

Robert



 

 

-Original Message-
From: Louis Huppenbauer 
To: rob...@myself.com
Cc: php-general@lists.php.net
Sent: Thu, Mar 10, 2011 11:38 am
Subject: Re: [PHP] Issue with Quick Email validation


try != instead of ==, that should do the trick.



2011/3/10  :

> Hi,

> I'm newbie to PHP and this list, possible not a new question so forgive me if 

it's a repeat

> I have a form where I want the submitter Email ID to only be from one domain

>

> Here's the part I'm having issues with

>

>$domain = explode( "@", $who);

>if ( $domain[1] == "company.com") {

>echo $domain[1];

>echo("Email invalid.");

>exit;

>}

>

> First Echo is just for me to check

> I type in a correct Email ID, say m...@company.com

>

> The return of this is:

>

> company.com

> Email invalid.

>

>

> As far as I can see this if statement should not fall in, what am I missing?

>

>

>


 


[PHP] scroll down list -visible, but not possible to choose

2011-08-31 Thread robert
Hi,
 Got so excellent and fast help last time so trying again here

 I have the below function with array for satus of issues where I need to have 
'Resolved/Closed' visible but not available for choice
 This as closing is a separate function to ensure correct resolution code is 
selected 

Already tried removing 'Resolved', and got everything working only to notice 
when testing that when viewing issues the Resolved
 ones showed up as 'Support Working' even though closed in the system


 function print_statuses($selected) {
 $statuses = array('Resolved','Support Working','Waiting on 
Customer','New','Read Update');
 foreach($statuses as $status) {
 echo "$status";
 }
 }


[PHP] Can't figure mail & post out

2005-03-06 Thread Robert
Hi -

I am very new to php and can't get this to work right.  It keeps telling me 
there is no send header.  I have tried multiple variations?  Any ideas?  I 
am simply trying to query the database and send out an email to each person 
in my database.

Thanks,
Robert


$query = "SELECT first_name, email FROM offer";
$result = @mysql_query ($query);

if ($result) {
  echo 'Mailing List...';
  while ($row = mysql_fetch_array ($result, MYSQL_NUM)) {
  $fname = "$row[0]";
  $body = "Hi {$_POST['fname']},";
 $headers = "MIME-Version: 1.0\r\n";
 $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
 $headers .= "From: ";
 $sendto = "$row[1]";
  echo "Row one output = $sendto";
  mail ($_POST['sendto'],'Testing', $body, $headers);
  echo "Sent to $row[1]";}
  mysql_free_result ($result); 

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



Re: [PHP] Can't figure mail & post out

2005-03-06 Thread Robert
Thanks, I fixed the problem and it's working great.  Didn't need the $_POST 
in the email and needed double quotes around the sender header variable.


"Zareef Ahmed" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi Robert,
>
> Please take a look at php manual and try to know something about
> $_POST, $_GET etc.
> Your code is full of errors.
>
>
> On Sun, 6 Mar 2005 15:33:30 -0500, Robert <[EMAIL PROTECTED]> wrote:
>> Hi -
>>
>> I am very new to php and can't get this to work right.  It keeps telling 
>> me
>> there is no send header.  I have tried multiple variations?  Any ideas? 
>> I
>> am simply trying to query the database and send out an email to each 
>> person
>> in my database.
>>
>> Thanks,
>> Robert
>>
>> $query = "SELECT first_name, email FROM offer";
>> $result = @mysql_query ($query);
>>
>> if ($result) {
>>   echo 'Mailing List...';
>>   while ($row = mysql_fetch_array ($result, MYSQL_NUM)) {
> mysql_fetch_row can be an alternative.
>>   $fname = "$row[0]";
>>   $body = "Hi {$_POST['fname']},";
> You are sendting the email to users who are in the database, but
> greeting them with $_POST['fname']
>>  $headers = "MIME-Version: 1.0\r\n";
>>  $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
>>  $headers .= "From: ";
> From is not set, value is not here.
>
>>  $sendto = "$row[1]";
>>   echo "Row one output = $sendto";
>>   mail ($_POST['sendto'],'Testing', $body, $headers);
> Again you are sending the mail to same person very time.
>
>>   echo "Sent to $row[1]";}
> Again problem.
>>   mysql_free_result ($result);
>>
>> --
>
> PHP manual is good thing to start .
> http://www.php.net
>
>
> zareef ahmed
>
> -- 
> Zareef Ahmed :: A PHP Developer in India ( Delhi )
> Homepage :: http://www.zareef.net 

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



[PHP] Requiring stuff question

2005-05-23 Thread Robert
I have the following in a config file:

// Define and require the Smarty library
define('SMARTY_DIR', 'Smarty/');
require(SMARTY_DIR . 'Smarty.class.php');

// Define the pager stuff
define('PAGER_DIR', 'Pager/');
require(PAGER_DIR . 'Pager.php');
require(PAGER_DIR . 'Pager_Wrapper.php');

// Define the DB package
define('PEAR_DB', 'DB/');
require(PEAR_DB . 'DB.php');

The Smarty stuff works no problem. The DB and Pager stuff do not. Since I am 
new to PHP I may be just misunderstanding how to do it.

I am using Apache/PHP on Windows.

Robert

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



[PHP] Re: adding items to a list or menu

2004-04-11 Thread Robert
"R.G. Vervoort" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> Not sure if it is a php question but since i am working in php here it is.
> 
> Ho can i add items to (the item label=visual text and the value=index
> number) a list object on a website.
> 
> I am having a list with 4 items and i would like to add the text from a
> textfield (textfield1.value) to the list object so it will hold 5 items.
> 
> thanks for any suggestions
> 
> Roy
> The Netherlands

PHP is server side, it looks like you want to send items to a client
side app (javascript?) you could do something like this:

--->Snip!

\n"; //Not a javascript guy,
but you get the point

foreach($array as $key=>$item) {
   echo "\n textdata.item$key=$item";
}

?>
 etc.

<---

Not sure how javascript looks (started working with it in last 2 days)
but you can change that echo statement to what it should be in
javascript

Cheers!

Robert

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



Re: [PHP] munge / obfuscate ?

2008-03-27 Thread robert

I like this and never would have thought to do this.

What kind performance hit does this have, if there were 100 images,  
for example?





On Mar 27, 2008, at 7:02 PM, Robert Cummings wrote:

Hi Joey,

Please keep responses on the list so others can also benefit from the
learning process.

Comments below...

On Thu, 2008-03-27 at 21:46 -0400, Joey wrote:

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2008 9:28 PM
To: Joey
Cc: PHP
Subject: Re: [PHP] munge / obfuscate ?


On Thu, 2008-03-27 at 21:10 -0400, Joey wrote:

Hi All,



I have written an app to allow a person to go online and see a  
picture

we
take of them.  When we link to the picture I don't want it to be  
obvious

that the URL is

Domain.Com/Pix/123.jpg because the next person we take a picture  
of may

be

123.jpg, so I am trying to munge/obfuscate the URL to make it less

obvious.





That should have been:

   if( $key == sha1( $id.':'.$sekret ) )


   {
   header( 'Content-Type: image/jpg' );
   readfile( "/images/not/in/web/path/$id.jpg" )
   exit();
   }

   //
   // Failure... tell them to bugger off :)
   //
   header( 'Content-Type: image/jpg' );
   readfile( '/images/wherever/you/please/buggerOff.jpg' );
   exit();

?>


Sorry to be such a newbie...

I basically would call this function lets say like:
munge( $url );

end in the end be returned the munged url, however, I don't  
understand the

values you have like the readfile with that url -vs- failure?


I didn't munge... I provided code for a script that sends the  
requested

image if it was requested with the appropriate key (presumably set
wherever the image was linked). If the key doesn't validate then  
another
image is presented. It can say "bugger off", it can say "not found",  
it
can say whatever you please. By placing the images outside the web  
root

and using a script like this you are virtually guaranteed the visitor
can't just request images by making a lucky guess.

Let's say the above script was called: getUserImage.php

Then you might have the following in your HTML:

src="getUserImage.php? 
id=123&key=4fad1fea72565105d84cb187d1a3ed3bfb9aba3b" />


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for 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] everything as classes

2008-04-03 Thread robert
Along the lines of a previous post "How to get a code review", I am  
curious if it is overkill to create everything in classes. For  
example, a movie website where there is a class for the movie  
datatype, class for getting/adding/deleting/updating movie's data to  
the database, and class for displaying the data. (Of course there are  
classes for  general functionality like sql database connection etc.)  
For listing movies alone there are at least 4 different inheritance  
classes for chronological, alphabetic, category and keyword. Anyway  
this is how I coded something similar but for Flash/Actionscript site  
but I'm not sure about a PHP site. I appreciate your comments.

- robert

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



Re: [PHP] everything as classes

2008-04-04 Thread robert

Hi
After spending yesterday afternoon I cleaned up my code and simplified  
in many places. I really like the idea to use Static class for "single  
use" database operations. Thank you very much to you that responded  
with comments.


-robert


On Apr 3, 2008, at 11:23 AM, Richard Heyes wrote:
Along the lines of a previous post "How to get a code review", I am  
curious if it is overkill to create everything in classes.


Everything, yes. Sometimes all you need is a quick and not so dirty  
function. Though saying that, OO is generally thought of as the way  
to go.


> For example,
a movie website where there is a class for the movie datatype,  
class for getting/adding/deleting/updating movie's data to the  
database, and class for displaying the data. (Of course there are  
classes for  general functionality like sql database connection  
etc.) For listing movies alone there are at least 4 different  
inheritance classes for chronological, alphabetic, category and  
keyword. Anyway this is how I coded something similar but for Flash/ 
Actionscript site but I'm not sure about a PHP site. I appreciate  
your comments.


Based on what you've described I would go with the following classes:

Movie

This class would handle fetching the movies data, updating it and/or  
deleting it. Or you could have a static Movie method for deleting  
one, eg Movie::Delete($id). Could also have a static Add() method  
which creates a movie and returns a movie object.


DB Connection

There are plenty of database classes around (not least my own PEAR  
replica - http://www.phpguru.org/article.php/121). Others include  
MDB2, PDO, ADODB etc.


Movie Listing(s) (abstract?)
|
+- By name (alphabetical
+- By category
+- By keyword
+- By date (chronological)

Here you'd have the code to show listings. With common code on the  
parent movie listings class and with specific code on the  
appropriate child class.


--
Richard Heyes
Employ me:
http://www.phpguru.org/cv



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



Re: [PHP] changing order of items

2008-05-15 Thread robert


On May 15, 2008, at 11:58 AM, afan pasalic wrote:


Eric Butera wrote:


I use this:

http://developer.yahoo.com/yui/examples/dragdrop/dd-reorder.html


This one is good too.
But, actually, I need something more simple. Nothing "fancy" :D.




for something very simple how about add a drop down list for each item:

[chooose position..]
{ - before task 1 }
{ - before task 2 }
{ - before task 3 }
{ - before task 4 }
{ - at the end}

and when user clicks save, the php side will do it's magic and update.  
i think there is a limitation especially if the user decides to  
reorder many items. but then if you are handy with the javascript/ajax  
then just do a visual update which can make it easier for the user.


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



Re: [PHP] Semi-OT: PHP Login with client security

2008-05-19 Thread robert


On May 18, 2008, at 10:14 PM, Tim Thorburn wrote:


Hi all,

Having a slight problem with a demo I gave at a clients last week -  
looking for a little advise.  Part of my demo involved a password  
protected area - the simplified process is: client enters password  
on login page > if login/password match encrypted database, PHP  
session is created, form forwards to a secured area > secured area  
checks to make sure PHP session is valid > if valid display content,  
if not, return to login screen.


This procedure is what I've used for many years, tested on a variety  
of servers and connections.  It works.  During the demo with my  
client, I was able to enter login/password info, the PHP session was  
created - however the screen would not forward to the secured area.   
Instead I was pretended with a blank screen (client only has an  
outdated/non-updated version of IE6).  If I were to type in the URL  
to the secured area, it would display content properly.  As a test,  
I logged out, closed my browser and started again, this time  
entering an incorrect login/password - again it would not forward to  
the next screen properly, however this time when I typed in the full  
URL, it would not display as the session hadn't been created.


I've spoken briefly with my clients IT person, however he's  
unwilling to share any firewall information or really anything  
regarding their security setup - which I understand as I'm not an  
employee and just a contractor.


So, after long winded description - does anyone with network  
security experience have any idea either a) what I would need to ask  
the IT person to allow for their site only, or b) have any  
suggestions for alternate password authentication that may work  
given the above conditions?


TIA
-Tim




try to use a full url instead of relative. e.g.

header('location: thankyou.php');

vs.

header('location: http://www.mysite.com/thankyou.php');

or use $_SERVER['DOCUMENT_ROOT'] for portability.

i think this is some weirdness on IE6. this worked for me.

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



Re: [PHP] Still not getting Includes right.

2008-05-19 Thread robert
i just saw this last message and forgive me if I'm missing something  
but why not use $_SERVER['DOCUMENT_ROOT'] as a prefix to any of the  
paths?





On May 19, 2008, at 10:49 AM, Tyson Vanover wrote:

So have developed some nice tools for generating forms, connecting  
to databases, things that I do repeatedly. When I run test pages  
that include these utility files in the same directory as the  
utility files it works fine.  The are included no problem.  As soon  
as I have scripts in other directories include these utility tools  
it breaks.


Here is my path structure
Page that uses the tools:
/srv/www/html/lib/index.html

Tools:
/srv/www/html/Tools/formtool/formtool.php
/srv/www/html/Tools/dbtool/dbtool.php
/srv/www/html/secdepot/libquery.inc

phpinfo() returns:
doc_root/srv/www/html   /srv/www/html
include_path.:/srv/www/html .:/srv/www/html

in the index.html I have tried:
ini_set( 'include_path', '/srv/www/html/Tools:/srv/www/html/ 
secdepot:.');

require 'dbtools/dbtool.php';
require 'libquery.inc';
require 'formtool/formclasses.php';
errors:
require(dbtools/dbtool.php) [function.require]: failed to open  
stream: No such file or directory /srv/www/html/lib/index.php, line 12
require() [function.require]: Failed opening required 'dbtools/ 
dbtool.php' (include_path='/srv/www/html/Tools:/srv/www/html/ 
secdepot:.') /srv/www/html/lib/index.php, line 12


as well as:
require '/srv/www/html/Tools/dbtools/dbtool.php';
require '/srv/www/html/secdepot/libquery.inc';
require '/srv/www/html/Tools/formtool/formclasses.php';
error:
require(/srv/www/html/Tools/dbtools/dbtool.php) [function.require]:  
failed to open stream: No such file or directory  /srv/www/html/lib/ 
index.php, line 11
require() [function.require]: Failed opening required '/srv/www/html/ 
Tools/dbtools/dbtool.php' (include_path='.:/srv/www/html') /srv/www/ 
html/lib/index.php, line 11


as well as:
require 'dbtools/dbtool.php';
require 'libquery.inc';
require 'formtool/formclasses.php';
error:
require(Tools/dbtools/dbtool.php) [function.require]: failed to open  
stream: No such file or directory /srv/www/html/lib/index.php, line 11
require() [function.require]: Failed opening required 'Tools/dbtools/ 
dbtool.php' (include_path='.:/srv/www/html') /srv/www/html/lib/ 
index.php, line 11


as far as I can tell I am not chrooted:
?>ps aux | grep httpd
outputs:
root  1937  0.0  5.2  25600 13456 ?Ss 19:50   0:00 /usr/ 
sbin/httpd
raa-web   1956  0.3  0.8   4636  2084 ?S 19:50   0:14 /usr/ 
sbin/lighttpd -f /etc/raa/lighttpd.conf
apache1987  0.0  4.2  25736 10920 ?S 19:50   0:00 /usr/ 
sbin/httpd
apache1990  0.0  4.2  25736 10892 ?S 19:50   0:00 /usr/ 
sbin/httpd
apache1993  0.0  4.3  25736 11048 ?S 19:50   0:00 /usr/ 
sbin/httpd
apache1995  0.0  4.2  25736 10908 ?S 19:50   0:00 /usr/ 
sbin/httpd
apache2003  0.0  4.2  25736 10912 ?S 19:50   0:00 /usr/ 
sbin/httpd
apache2008  0.0  4.2  25736 10908 ?S 19:50   0:00 /usr/ 
sbin/httpd
apache2011  0.0  4.2  25736 10864 ?S 19:50   0:00 /usr/ 
sbin/httpd
apache2014  0.0  4.2  25736 10900 ?S 19:50   0:00 /usr/ 
sbin/httpd
root  2644  0.0  0.3   2908   788 tty1 R+ 20:57   0:00 grep  
httpd


Am I missing something blatently obvious?

--
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] Semi-OT: PHP Login with client security

2008-05-19 Thread robert


On May 19, 2008, at 12:20 PM, Tim Thorburn wrote:


robert wrote:


On May 18, 2008, at 10:14 PM, Tim Thorburn wrote:


Hi all,

Having a slight problem with a demo I gave at a clients last week  
- looking for a little advise.  Part of my demo involved a  
password protected area - the simplified process is: client enters  
password on login page > if login/password match encrypted  
database, PHP session is created, form forwards to a secured area  
> secured area checks to make sure PHP session is valid > if valid  
display content, if not, return to login screen.


This procedure is what I've used for many years, tested on a  
variety of servers and connections.  It works.  During the demo  
with my client, I was able to enter login/password info, the PHP  
session was created - however the screen would not forward to the  
secured area.  Instead I was pretended with a blank screen (client  
only has an outdated/non-updated version of IE6).  If I were to  
type in the URL to the secured area, it would display content  
properly.  As a test, I logged out, closed my browser and started  
again, this time entering an incorrect login/password - again it  
would not forward to the next screen properly, however this time  
when I typed in the full URL, it would not display as the session  
hadn't been created.


I've spoken briefly with my clients IT person, however he's  
unwilling to share any firewall information or really anything  
regarding their security setup - which I understand as I'm not an  
employee and just a contractor.


So, after long winded description - does anyone with network  
security experience have any idea either a) what I would need to  
ask the IT person to allow for their site only, or b) have any  
suggestions for alternate password authentication that may work  
given the above conditions?


TIA
-Tim




try to use a full url instead of relative. e.g.

header('location: thankyou.php');

vs.

header('location: http://www.mysite.com/thankyou.php');

or use $_SERVER['DOCUMENT_ROOT'] for portability.

i think this is some weirdness on IE6. this worked for me.

I'll try $_SERVER['DOCUMENT_ROOT'] during my next demonstration  
which should be sometime next week.  Odd that this issue has never  
come up before O.o




Actually i think you might be experiencing the P3P privacy policy  
thing. I tried it myself but couldn't get the headers to cooperate;  
only worked when i appended the session id to the url. I hope someone  
here can chime in on it.


Google keywords "php session ie6" or "ie6 cookies". i'd also recommend  
a helmet, facemask and bullwhip.








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



[PHP] page suck attack

2008-05-21 Thread robert

Hi
Every so often my site is "attacked" in which all URLS on my site are  
retrieved in the span of minutes. What is this called?? I mean what do  
I google for? I don't know where to begin.


I'm not sure if I am going to implement such at thing but I would like  
to be able to research it to know my options.


thank you
robert

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



Re: [PHP] page suck attack

2008-05-21 Thread robert
Not that i can tell. Yahoo and google have a signature: googlebot and  
slurp. both of them also check my site over a span of days. that's all  
good. The others come from regular isps as far as their IP tells me  
and the hits are within milliseconds.



On May 21, 2008, at 8:57 AM, Gavin M. Roy wrote:


Search engines indexing your site?
On Wed, May 21, 2008 at 11:54 AM, robert <[EMAIL PROTECTED]> wrote:


Hi
Every so often my site is "attacked" in which all URLS on my site are
retrieved in the span of minutes. What is this called?? I mean what  
do I

google for? I don't know where to begin.

I'm not sure if I am going to implement such at thing but I would  
like to

be able to research it to know my options.

thank you
robert

--
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: RES: [PHP] page suck attack

2008-05-21 Thread robert
Cool! yes Fasterfox could be it. If anyone cares, it also gave me some  
clues to what I was looking for: "offline browsing". Certainly better  
keywords than "page suck" :)


thank you everyone!





On May 21, 2008, at 10:02 AM, Thiago Pojda wrote:


Perhaps someone is accessing your website with some prefetching tool?


I'm not sure, but I think Fasterfox does that.


Atenciosamente,
www.softpartech.com.br
Thiago Henrique Pojda
Desenvolvimento Web
+55 41 3033-7676
[EMAIL PROTECTED]
ExcelĂȘncia em Softwares Financeiros
-Mensagem original-
De: robert [mailto:[EMAIL PROTECTED]
Enviada em: quarta-feira, 21 de maio de 2008 13:05
Para: PHP
Assunto: Re: [PHP] page suck attack

Not that i can tell. Yahoo and google have a signature: googlebot and
slurp. both of them also check my site over a span of days. that's all
good. The others come from regular isps as far as their IP tells me
and the hits are within milliseconds.


On May 21, 2008, at 8:57 AM, Gavin M. Roy wrote:


Search engines indexing your site?
On Wed, May 21, 2008 at 11:54 AM, robert <[EMAIL PROTECTED]>  
wrote:



Hi
Every so often my site is "attacked" in which all URLS on my site  
are

retrieved in the span of minutes. What is this called?? I mean what
do I
google for? I don't know where to begin.

I'm not sure if I am going to implement such at thing but I would
like to
be able to research it to know my options.

thank you
robert

--
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] Re: Requiring stuff question

2005-05-23 Thread Robert
"John Nichel" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Robert wrote:
>> I have the following in a config file:
>>
>> // Define and require the Smarty library
>> define('SMARTY_DIR', 'Smarty/');
>> require(SMARTY_DIR . 'Smarty.class.php');
>>
>> // Define the pager stuff
>> define('PAGER_DIR', 'Pager/');
>> require(PAGER_DIR . 'Pager.php');
>> require(PAGER_DIR . 'Pager_Wrapper.php');
>>
>> // Define the DB package
>> define('PEAR_DB', 'DB/');
>> require(PEAR_DB . 'DB.php');
>>
>> The Smarty stuff works no problem. The DB and Pager stuff do not. Since I 
>> am new to PHP I may be just misunderstanding how to do it.
>
> What's the error you're getting?
>
There is no error in the Apache2 log file...

Robert 

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



[PHP] Re: Requiring stuff question

2005-05-23 Thread Robert
>"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message 
> >news:[EMAIL PROTECTED]
>[snip]
>// Define and require the Smarty library
>define('SMARTY_DIR', 'Smarty/');
>require(SMARTY_DIR . 'Smarty.class.php');
>
>// Define the pager stuff
>define('PAGER_DIR', 'Pager/');
>require(PAGER_DIR . 'Pager.php');
>require(PAGER_DIR . 'Pager_Wrapper.php');
>
>// Define the DB package
>define('PEAR_DB', 'DB/');
>require(PEAR_DB . 'DB.php');
>
>The Smarty stuff works no problem. The DB and Pager stuff do not. Since
>I am
>new to PHP I may be just misunderstanding how to do it.
>[/snip]
>
>What is the whole exact path to the DB and Pager stuff?

[root] C:\Documents and Settings\me\My Documents\websites\DEV\smarty   # 
this is where my config.inc.php file is
[DB] C:\Documents and Settings\me\My Documents\websites\DEV\smarty\DB
[Pager] C:\Documents and Settings\me\My Documents\websites\DEV\smarty\Pager

Is that what you wanted?

Robert 

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



Re: [PHP] Requiring stuff question

2005-05-23 Thread Robert
On 5/23/05, Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> Robert wrote:
> > I have the following in a config file:
> >
> > // Define and require the Smarty library
> > define('SMARTY_DIR', 'Smarty/');
> > require(SMARTY_DIR . 'Smarty.class.php');
> >
> > // Define the pager stuff
> > define('PAGER_DIR', 'Pager/');
> > require(PAGER_DIR . 'Pager.php');
> > require(PAGER_DIR . 'Pager_Wrapper.php');
> >
> > // Define the DB package
> > define('PEAR_DB', 'DB/');
> > require(PEAR_DB . 'DB.php');
> >
> > The Smarty stuff works no problem. The DB and Pager stuff do not. Since I am
> > new to PHP I may be just misunderstanding how to do it.
> 
> PEAR requires that its path is in include_path. Use:
> 
> ini_set('include_path', '/where/is/your/PEAR/:' . ini_get('include_path'));
> 
Ah! Thanks!

Robert

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



[PHP] PHP mysql Apache install on FC3

2005-08-04 Thread robert
Hello,

I am not quite sure if this is the correct mailing list to post this
question, but here I go anyway.  I have a vanilla Fedora Core 3
installation, and I am trying to run a php script through a local
website that has calls into a MySQL database.  I can run this script
at the command line using the php PHPScript.php command, and it runs
perfectly.  When I run it through the firefox web browser, I get an
error that says:

[client 127.0.0.1] PHP Warning:  mysql_pconnect(): Can't connect to local
MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in
/var/www/html/index.php on line 4

I have checked the socket, it exists.  Again, if I run this script just
using php, it works just fine.  However, when running it through Apache or
httpd it does not.  What am I doing incorrectly?

Thank you for your time,
Robert

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



[PHP] Newline character problem...

2005-12-02 Thread Robert
I'm new to PHP but not programming in general. I have used C++ for a while
and I'm familiar with the newline character as it's basically the same in
PHP. Whenever I print something with a newline character in it all it
produces is a space between whatever two things I'm printing. I'm running
php 5.1.1 running on FreeBSD 6 with apache 2.2.0. All the latest versions
installed today.

This is the most basic of examples:

print 'one' ;
print "\n" ;
print 'two' ;

The output of this when accessed on my server is: one two
It should be: one
   two

I've tried using printf as well but to no avail. It just adds a space
between the outputs. I've also tried using different browsers but still get
the same result. What am I doing wrong? Could this a php configuration
issue? Apache maybe?

Thanks,

Rob


[PHP] php classes and data retrieval

2006-01-27 Thread robert

Hello!
I have a database and php classes and I'm not sure the best way I  
should be retrieving the data.


as below, if 'other' (line 9) is stored in the database as an id of a  
record in another table,

should my getData() method:

a. return the id as part of the MyObj object and whatever function
that called it is responsible for matching the id to the name?
or
b. should it look up the value from within the class?

(I read something about JOIN or stuff beyond SELECT --sorry i'm kinda  
just getting into this-- could bring a database to it's knees)


Also I thought that with OOP you are supposed to keep the classes  
independent of each other, but I was thinking if I need a MyObj I  
would want all the data in a ready usable form and not a mix of data  
and database ids.


I'm not sure what is the best practice or even if there is a correct  
one, but suggestions would be appreciated!


-robert


here is my set up:

DATABASE:
myobj_table with id, name, other as columns
other_table with id, name as columns

PHP CLASSES:
   1: id = $id;
   8: $this->name = $name;
   9: $this->other = $other; // ?? ID OR VALUE ??
  10:   }
  11:
  12:   // getters/setters
  13:
  14: }
  15:
  16:
  17: /* create/update/delete database methods */
  18: class MyObjData {
  19:
  20:   var $_id;
  21:   var $_items;
  22:
  23:   function MyObjData($id) {
  24: $this->_id = $id;
  25:   }
  26:
  27:   function getData() {
  28: $query = "select * from myobject_table where id='" . $this- 
>_id . "'";
  29: $records = getDatabaseRecords($query); // some db action:  
returns an array of records

  30: foreach ($records as $record) {
  31:   $data = new MyObj(
  32:   $record['id']
  33: , $record['name']
  34: , $record['other']
  35: );
  36:   $this->_items[] = $data;
  37:   unset($data);
  38: }
  39: return $this->_items;
  40:   }
  41:
  42:   // other methods
  43:
  44: }
  45:
  46:
  47:
  48: ?>

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



[PHP] parse form input

2001-01-30 Thread Robert

variables passed from form = 
part=68030&quan=500&I=x&part=68040&quan=350&I=x&sid=6754g543a76
I am sending several part numbers from the form, but when parsed it only gives me the 
last one
How do I get it to return all of the parts? I'm a PHP newbie, only been programming 
for 2 weeks...


[PHP] rad tools, form paser/validator

2002-11-24 Thread Robert Mena
Hi all,

I've been working with php for a while and whenever I
have the chance I give some tutorials/speeches about
it to other developers, specially those with no
experience with web development.

They all find easy but in one point or another start
asking about an IDE with a debugger, variable watch
etc or RAD tools (they come from Visual Basic/Delphi
enviroments).

In the IDE part I know we have some paid tools (such
as Zend) but can't tell anything that could count as
RAD tool.

So, I'd like to know if there are any RAD tools ,
either free or paid that you know.

One thing that I am planing to develop, or enhance if
I found something similar already, is a form
"parser/validator".

Suppose your design department comes with a real nice
html-css-form and you need to validate it, send the
content as email or add in a database.

This tool would read the HTML and prompt you for the
optional/required fields, validation options
(minimum/max length) etc, send via email or add in a
database..

Then would generate the php code to validate and
perform the required actions.

I think there is a classe (from manuel lemos) that
does soemthing similar but also generate the form
itself based on a definition.

What do you thing about it ?

The ideia is to speed up the repetitive/boring stuff
leting the developer focus on special logic - usually
restricted to fewer options.

__
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] Re: php and caching

2002-11-24 Thread Robert Cummings
Ernest E Vogelsinger wrote:
> 
> At 22:38 24.11.2002, Alex said:
> [snip]
> >But my  main page, for instance mail.php, includes top.php and bottom.php.
> >But top.php must be processed each time because it prints on every page on
> >my site if the user has new messages. But if all pages are cached, then it's
> >always the cached version that's printed to the user, so even if he has new
> >mail, it doesn't show (because the page is directly taken from the cache
> >instead of being re-requested).
> >So I don't want this situation to happen, but i'd want users to be able to
> >make use of their back button without clearing the forms. Is there a
> >solution around this problem?
> [snip]
> 
> You can't have all of both worlds - either allow the browser to cache, then
> the form content will be still available from the  button. Or you
> disallow caching, then it won't.

Actually you can. Try using session variables.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - telnet wocmud.org 4000  |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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




Re: [PHP] Re: php and caching

2002-11-24 Thread Robert Cummings
Ernest E Vogelsinger wrote:
> 
> If you read my complete post you'll notice that I suggested using session
> variables. The issue why I first answered the question _without_ talking
> about session variables is the fact that Alex was talking about a search
> form. Search forms are often used on "normal" static web pages _without_
> the help of sessions... that's the reason.
> 
> Rest assured I know about sessions in PHP :)

That'll teach me to form an opinion and skim :) My apologies.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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




[PHP] spawing new PHP process

2002-11-26 Thread ROBERT MCPEAK
I'm interested in spawing a new PHP process -- if that's the correct terminology.

The situation is that I've got a very slow loading page, where, for example, I'm using 
PHP to send, say, 1000 emails.  The user clicks submit, and, although PHP is firing 
out the emails, it appears to the user that page is hanging.  I'd like to somehow send 
that process to the background and let the page load straight-away.

In another scripting language I've used, this function was called "spawn."

Do we have something like this in PHP (I know we do!! Just can't find it.) I've looked 
through the docs but don't see what I'm looking for.

Thanks in advance.

-Bob


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




Re: [PHP] spawing new PHP process

2002-11-26 Thread ROBERT MCPEAK
Rasmus,

Thanks for you reply.  I agree that what you suggest is the correct solution for the 
mail delivery scenario I used as an example.

My example was poor in that in limited the scope of what I was asking.

I have other situations where I would like to somehow "spawn" a new php process so 
that the page loads quickly and my user doesn't get frustrated or confused.

Another such situation would be when I do time consuming operations on a MySql table, 
such as building an index or loading data.  These operations may take several minutes 
and I'd like to avoid having to make my user wait for the page to load.

What is the correct solution for this problem?

I'm a newcomer to PHP, am quite excited by it, and really appreciate your insight.

Thanks,

Bob

>>> Rasmus Lerdorf <[EMAIL PROTECTED]> 11/26/02 11:46AM >>>
The correct solution for this particular problem is to just queue the
outbound mail and have your MTA deliver them out of band.  "man sendmail"

-Rasmus

On Tue, 26 Nov 2002, ROBERT MCPEAK wrote:

> I'm interested in spawing a new PHP process -- if that's the correct terminology.
>
> The situation is that I've got a very slow loading page, where, for example, I'm 
>using PHP to send, say, 1000 emails.  The user clicks submit, and, although PHP is 
>firing out the emails, it appears to the user that page is hanging.  I'd like to 
>somehow send that process to the background and let the page load straight-away.
>
> In another scripting language I've used, this function was called "spawn."
>
> Do we have something like this in PHP (I know we do!! Just can't find it.) I've 
>looked through the docs but don't see what I'm looking for.
>
> Thanks in advance.
>
> -Bob
>
>
> --
> 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] Is it possible to do this in PHP ? If it is then, how ?

2002-11-27 Thread Robert Cummings
Axis Computers wrote:
> 
> Hi,
> 
> I was wondering if this is possible to in PHP ... I am developing an
> application for a pizza place, where touch typing interface is much faster
> than using the mouse, so I was wondering if I can develop an interface with
> a calculator style keypad, and the codes entered (using something like STDIN
> in Perl), are automatically compared to the MySQL database to provide
> realtime feedback to the user, such as code 32 is hawaian pizza, and after
> the user enters code 32 Hawaian pizza get's displayed as feedback ... and
> then awaits for some other input such as size, etc...

I can't think of any reason why not. Obviously this won't be a web
application :) Though a good design could be re-used to form an online
ordering application also.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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




[PHP] Advice with encrypting+storing sensitive data

2002-12-04 Thread Robert Mena
Hi,

I need to develop an application where the protection
of the data (to be stored on a database) should be
very important (perhaps the principal requirement).

THe goal is to have the data stored in a way that even
the admin or anyone that hacks the web and/or database
server could not (or easily) recover the original
data.

First of all I am not a security expert and the
protection need not to be military-grade, just strong
enough to make things harder.

I would like to share a couple of ideias but mostly
interestered in phpers experiences and opinions.

1) Use mcrypt

The user should have to create a phrase and all
sensitive data will be stored using this phrase. 
Since the phrase will not be hardcoded in the php
scripts, even if the web is hacked it will not be
recovered.

For each row I would store the encrypted value and the
initialization vector.

In order to recover the value at the beginning of the
session (when the user logs in) I could store the
phrase as session variable (encrypted with mcrypt and
a system phrase?)

If the user decides to change the phrase a big update
in all encrypted rows/fields would be necessary.

2) Use PGP

Basically the same ideia but differnt encryption
tool/scheme.
Not sure how to implement or if there is any gain.

Well any tips/sugestions/opinions are welcome.


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] Advice with encrypting+storing sensitive data

2002-12-05 Thread Robert Mena
Thanks Bahwi, 

I agree with you regarding the client-side aspect.
But since we are talking about a regular web-based
application in php I think I will have to deal with
that.

The other security concerns are already addressed,
such as the use of SLL to encrypt the traffic and
possibly the use of an encoder do hide the source
code.

I do not think I understood your ideia : 
>The next best thing is to store it in session
> variables, but build your own system perhaps, and
yes, encrypt it lightly with some system and a 
> system passphrase




__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] Dumb session cookie question?

2002-12-08 Thread Robert Pruitt
IE traditionally puts cookies in a folder named Cookies.

Do a search for 'cookies' -- see what you come up with.


on 08/12/02 10:17 PM, Douglas Douglas ([EMAIL PROTECTED]) wrote:

 

Hi all.
I'm sorry about the dumb question, but I've just
expend two hours trying to find the damn cookie and I
couldn't :(
I've read that when you use sessions and configure the
php.ini with session.use_cookies = 1, your sessions
will always send cookies to the client (if the client
accept the cookies)...
Is that right?
I ask because I'm reading my first tutorial about
sessions and it worked fine... but I can't find where
IE6 (Windows XP, Apache 1.3.27) stores those cookies I
used... I want to see the cookie's contents...
So I was wondering if PHP really sends the cookies,
but I also printed the $_SESSION and $_COOKIE arrays
and it displayed the correct information... in
$_COOKIE displayed PHPSESSID == , so I
think there is some cookie somewhere, my question is
where is it?
I'm so confused right now...
Thanks for any help. Sorry again.
   



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




[PHP] $_SERVER["PATH_TRANSLATED"] returns empty string

2002-12-18 Thread Robert Nedbal
Hi,
I'm having problems with my PHP installation. When I try to get real path
to my script by using $_SERVER["PATH_TRANSLATED"], I receive empty string.

$_SERVER["PATH_TRANSLATED"]  empty string (why?)
$_SERVER["PHP_SELF"] works as expected (ok)
$_SERVER["DOCUMENT_ROOT"]works as expected (ok)

OS: RedHat Linux 8.0
Apache: httpd-2.0.40-11
PHP: php-4.2.2-8.0.5 (recompiled from source)

Any ideas how to fix this?

Best regards,
Robert

PS: When replaying please CC me as I'm not subscribed to this list,
thanks.

--
--------
Robert Nedbal - Czech Technical University in Prague, Czech Republic
email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/
  /* Debuggers are evil. Never ever trust them. */



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




Re: [PHP] $_SERVER["PATH_TRANSLATED"] returns empty string

2002-12-18 Thread Robert Nedbal
Hi,
thanks for your reply. But changing source code in my setup is not a long
term option. My problem is that $_SERVER["PATH_TRANSLATED"] gives me
empty string.

Does anybody know how to fix my PHP installation, so
$_SERVER["PATH_TRANSLATED"] will give me correct file path?

Best regards,
Robert

On Wed, 18 Dec 2002, Wico de Leeuw wrote:
> Maybe basename($_SERVER['SCRIPT_NAME']);
>
> At 14:10 18-12-02 +0100, Robert Nedbal wrote:
> >Hi,
> >I'm having problems with my PHP installation. When I try to get real path
> >to my script by using $_SERVER["PATH_TRANSLATED"], I receive empty string.
> >
> >$_SERVER["PATH_TRANSLATED"]  empty string (why?)
> >$_SERVER["PHP_SELF"] works as expected (ok)
> >$_SERVER["DOCUMENT_ROOT"]works as expected (ok)
> >
> >OS: RedHat Linux 8.0
> >Apache: httpd-2.0.40-11
> >PHP: php-4.2.2-8.0.5 (recompiled from source)
> >
> >Any ideas how to fix this?
> >
> >Best regards,
> >Robert
> >
> >PS: When replaying please CC me as I'm not subscribed to this list,
> >thanks.
> >
> >--
> >
> >Robert Nedbal - Czech Technical University in Prague, Czech Republic
> >email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/
> >   /* Debuggers are evil. Never ever trust them. */
> >----
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--

Robert Nedbal - Czech Technical University in Prague, Czech Republic
email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/
  /* Debuggers are evil. Never ever trust them. */



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




Re: [PHP] $_SERVER["PATH_TRANSLATED"] returns empty string

2002-12-18 Thread Robert Nedbal
On Wed, 18 Dec 2002, Chris Hewitt wrote:
> Robert Nedbal wrote:
>
> >Hi,
> >thanks for your reply. But changing source code in my setup is not a long
> >term option. My problem is that $_SERVER["PATH_TRANSLATED"] gives me
> >empty string.
> >
> >Does anybody know how to fix my PHP installation, so
> >$_SERVER["PATH_TRANSLATED"] will give me correct file path?
> >
> >Best regards,
> >Robert
> >
> Are you implying that it used to work on another computer, or before an
> upgrade? If so, can you compare the php.ini files? Otherwise maybe its a
> bug (php with Apache2 I don't think is stable yet).
>
> HTH
> Chris

Yes exactly, it's working on our production server (apache 1.x, php-4.0.6).
On our test server it's _not_ working (apache 2.0.40, php-4.2.2).

/etc/php.ini file is identical on both systems.

So should I try to use apache 1.x instead of apache2?

Best regards,
Robert

--

Robert Nedbal - Czech Technical University in Prague, Czech Republic
email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/
  /* Debuggers are evil. Never ever trust them. */



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




[PHP] Win32 php : MS Access support (odbc support)

2002-12-19 Thread Robert Mena
Hi, 

I will have to retrieve data stored in a MDB (MS
Access) "database".

Since this MDB file be hosted in a Windows machine I'd
like to have a CGI version of PHP with ODBC support so
I can retrieve the data locally and send to a remote
mysql database automatically.

Since I've never used the CGI version to MDB any
tips/caveats will be appreciated.

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] $_SERVER["PATH_TRANSLATED"] returns empty string

2002-12-20 Thread Robert Nedbal
On Wed, 18 Dec 2002, Chris Hewitt wrote:
> Robert Nedbal wrote:
> >So should I try to use apache 1.x instead of apache2?
> >
> Pass on that, I have no experience of Apache 2, but I do not think it is
> intended for production yet. Looking at phpinfo() on my computer here
> (GNU/Linux RedHat 7.3 PHP 4.1.2 and Apache 1.3.23) in the "PHP
> Variables" at the bottom shows "_SERVER["PATH_TRANSLATED"} as having the
> value "/var/www/html/phpinfo.php", which is correct. If you do not get a
> value by looking at phpinfo() then I suggest there must be some sort of
> bug. You could try searching the bug list, otherwise maybe going back to
> Apache 1.3.x is a good idea.
>

I tried Apache 1.3.x and it works. I tested phpinfo() on both systems and
there are results:
 _SERVER["PATH_TRANSLATED"]
Apache 1.3.27 + php-4.2.3:  correct value
Apache 2.0.40 + php-4.2.2:   empty string (not even shown by phpinfo())

I think that there is not big difference between php-4.2.2 and php-4.2.3,
at least in release notes for php-4.2.3 was nothing about _SERVER
variables.

Should I add record about this to http://bugs.php.net/ ?

> Hope this helps.

Yes, thank you very much.

Best regards,
Robert

>
> Chris
>
>

--

Robert Nedbal - Czech Technical University in Prague, Czech Republic
email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/
  /* Debuggers are evil. Never ever trust them. */



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




RE: [PHP] mail() not working on Win2k

2003-01-06 Thread Collins, Robert
Do you have this line in your php.ini file?

SMTP=;for
win32 only

-Original Message-
From: Rad Craig [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 06, 2003 9:22 AM
To: PHP Mailing List
Subject: [PHP] mail() not working on Win2k


I'm running under Win2k, new install of PHP(last week), I have been trying
to test the mail() function, but it doesn't seem to work.  I host my own
mail server on the same machine and I know it works, has been for months,
all other mail come/goes just fine.  I don't have the default SMTP server
for IIS installed since I have my own SMTP/POP3 mail server on this same
server.

I have tried it with the following:
mail("[EMAIL PROTECTED]", "test message", "this is a test");

I have SMTP authentication turned off on my mail server for this testing.

It never arrives, I never get an error.

I can telnet to port 25, all works fine.

phpinfo.php reports that everything looks good, only thing i saw was that
the extension directory shows c:\php4 instead of c:\php.

I don't have any extra .dll's or anything turned on since it has built-in
support for MySQL.

Can someone PLEASE help.


Rad Craig



-- 
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] Re: Img src

2003-01-08 Thread Robert Fisher
Try using single quotes inside your double quotes,
just like you did with the width and haight values. he
following line:

print "";


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Re: Img src

2003-01-08 Thread Robert Fisher
Try using single quotes inside your double quotes,
just like you did with the width and haight values. 

The following line should work:

print "";

Robert Fisher
Axis Solutions, Inc.

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] How to detect a PHP script time-out?

2003-01-08 Thread Robert Fisher
If you are willing to do a rewrite, then have your
main script start a fork, or child process.  The child
process would run your script while the parent would
do nothing else but wait for the child.  if the child
times out the parent will know and you can then print
out a error message.

See the following on how to implement forks (process
controls).  It is kind of confusing and could be fatal
to your system load if done incorrectly.

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


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: [PHP] Adding HTTP URL Code

2003-01-09 Thread Robert Fisher
I found this in the archives of this list
message title: php parsing problem with chat 
message number: 103717 
by: Deadsam 


// // URL PARSER FOR MESSAGE $msg = ereg_replace
("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]]", "\\0",
$msg); //$msg =
ereg_replace("\[url\]([^\[]+)\[/url\]", "\\1",
$msg); 

Might load the file in, do line by line search for
this pattern if it passes then save it or do what you
want.

PSEUDO CODE

Get File;
Foreach file_line {
   if contains URL {
  do action;
   }
}
Close File;


Robert Fisher
Axis Solutions, Inc.


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Re: [PHP-GEN] Directory Listing with php on unix boxes

2003-01-07 Thread Robert Fisher
I didn't see any sorting in your code.  so maybe I
missed something, however you could try natcasesort()
function.

your new line would look like this:

while (false !== ($file = readdir($handle))) 
$filenames[] = natcasesort($file);

please note that this sorts in alphanumeric order and
not case sensitive.

Hope this helps,

Robert Fisher
Axis Solutions, Inc.



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] timing out a for loop, fopen

2003-01-15 Thread ROBERT MCPEAK
Dear PHP Gurus:

I'm looking for a way to timeout an fopen function.  I'm doing some link checking 
inside of a for loop and some links "hang" rather than return a definitive "can't 
connect" or "can connect."  (Pardon the highly technical jargon there...)

In cases where my link hangs, I'd like to simply display a message (i.e., "hanging") 
and advance to the next loop.  

I have search the docs/forumns far and wide and can't find anything definitive.  As 
far as I can tell socket_set_timeout won't quite do what I want it to.

Any ideas?  Here's the important part of my code:

for ()
{
echo "Checking: $link : \n"; flush();

$fp = @fopen($link, "r");
if (!$fp) { echo "The link is 
dead!"; }
else { fclose($fp); echo "The link is 
working!"; }
echo "";

echo "";
}

Thanks in advance!


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




[PHP] Problems to compile php (cvs)

2003-01-26 Thread Robert Mena
Hi, I usually fetch php from cvs a couple of times in
order to try new features etc.

Unfortunately since the beginning of this week I have
been unable to compile, no matter what I do.

I have been cvsing daily, buildconf and the same
./configure settings I have been using for ages.

./configure --with-apxs2 --enable-gd-native-ttf
--with-xml --with-openssl --with-zlib --with-dom
--with-gd --with-ttf

The error :

home/php4/ext/standard/basic_functions.c: In function
`php_simple_ini_parser_cb':
/home/php4/ext/standard/basic_functions.c:2827:
`ZEND_INI_PARSER_POP_ENTRY' undeclared (first use in
this function)
/home/php4/ext/standard/basic_functions.c:2827: (Each
undeclared identifier is reported only once
/home/php4/ext/standard/basic_functions.c:2827: for
each function it appears in.)

Any tips ?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] strange behaviour with 4.3.0 : warning of an unspecified open_basedir

2003-01-29 Thread Robert Mena
Hi,  I've upgraded the php version from 4.2.2 to 4.3.0
yesterday and some of my users started complaining
about errors in php scripts.

The errors do not occur all the times and the messages
shown are weird (for me at least) !

The user is accessing a php file located under
/var/www/html/site.com/private/alt.php3. It performs a
mysql query.

I have a virtual host in apache so
/var/www/html/site.com/ is mapped as www.site.com.

The error messages :
Warning: Unknown(): open_basedir restriction in
effect. File(/var/www/html/site.com/private/alt.php3)
is not within the allowed path(s):
(/home/httpd/html/anothersite.com/) in Unknown on line
0

Warning:
Unknown(/var/www/html/site.com/private/alt.php3):
failed to create stream: Operation not permitted in
Unknown on line 0

Warning: Unknown(): Failed opening
'/var/www/html/site.com/private/alt.php3' for
inclusion
(include_path='.:/usr/local/lib/php/:/home/httpd/html/php/:/home/httpd/html/include/php/')
in Unknown on line 0


The strange part is that the safe_mode is off and it
mentions a directory from another virtual host
(anothersite.com).


ServerAdmin webmaster
DocumentRoot /home/httpd/html/site.com/
ServerName www.site.com.br
ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/

#php_admin_value doc_root
"/home/httpd/html/site.com/"
php_admin_flag safe_mode off
#php_admin_value open_basedir
"/home/httpd/html/site.com/:/tmp/"



System : Linux / Redhat 7.3 / Apache 1.3

'./configure' '--with-gd' '--with-apxs' '--with-xml'
'--with-ftp' '--enable-session' '--enable-trans-sid'
'--with-zlib' '--enable-inline-optimization'
'--with-mcrypt=/usr/local' '--with-imap=../imap-2001a
' '--with-kerberos'
'--with-oci8=/u01/app/oracle/product/8.1.7/'
'--enable-sigchild' '--with-gettext' '--with-freetype'
'--with-ttf' '--with-ftp' '--enable-ftp'

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] PHP Compile Error

2003-01-30 Thread Robert Fitzpatrick
Running Redhat 8.0
PHP 4.3.0

When I try to configure with the following:
./configure --with-apxs=/web_root/bin/apxs --enable-track-vars
--enable-versioning --with-mysql=/usr/mysql --with-gd=/usr/local
--with-jpeg-dir=/usr/local/bin/  --with-png-dir=/usr/lib
--with-zlib-dir=/usr/lib --with-zlib --enable-xslt --enable-cli
--disable-debug --with-xslt-sablot

I get the following error:
...
configure: error: libjpeg.(a|so) not found.

Any ideas?

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




[PHP] Problems with 4.3.0 cli and paths

2003-01-31 Thread Robert Mena
Hi,

I have upgraded my server with the 4.3.0 version.  The
cli was upgraded also and all my scripts started to
crash.

I ususally put a #!/husr/local/bin/php -q in all
scripts that need to be executed from the crontab.

All the sudden the scripts ended with error messages
such as Warning: main(../php/define.php)
[http://www.php.net/function.main]: failed to create
stream: No such file or directory in
/home/httpd/html/script.php on line 11

What's going on ?

Do I need to put the full path now ?

regards.

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] another problem with 4.3.0 : imagecreatefromjpeg undefined

2003-01-31 Thread Robert Mena
Hello again,

another problem with 4.3.0. I have gd support but
after the upgrade my scripts started complaing :

Fatal error: Call to undefined function:
imagecreatefromjpeg()

My ./configure (the same used for ages).

'./configure' '--with-apxs' '--with-ttf' '--with-xml'
'--with-gd' '--with-ftp' '--enable-session'
'--enable-trans-sid' '--with-zlib'
'--enable-inline-optimization' '--with-mcrypt'
'--enable-sigchild' '--with-config-file-path=/etc' '--with-freetype'

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Forward mail via PHP

2003-02-06 Thread Robert Covell
Looking for a better solution to forward mail from an IMAP account via PHP
to another account.

Right now I am utilizing the built in imap functions (i.e.
imap_fetchstructure, imap_fetchbody, imap_header among others) to get the
individual parts and a MimeMessage class to rebuild the message.  Once the
message is rebuilt I change the "To:" and then send it on.  The problem is
that messages are rebuilt successfully about 95% of the time.

Can anyone suggest a better way to do this?  Can I not just login to the
account get the entire message, change the "To:" and send it on it's way
leaving the message structure in tact?  If so does anyone know of any
pre-existing classes to take a message as input, change the "TO:" and use
the result of this to send it out?

Thanks,
-Bob


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




Re: [PHP] Re: Static functions (java/php)

2003-02-09 Thread Robert Cummings
Chris Hayes wrote:
> 
> At 23:09 9-2-2003, you wrote:
> >you may find the following link interesting
> >http://www.tek271.com/articles/JavaOrPhp.html
> >
> >David Eisenhart
> I cannot suppress the feeling that someone out there has a slight prejudice
> in favour of Java!

God yes, the guy seems to think that OOP is the do all end all style of coding...
personally I like to hybrid OOP and prcoedural concepts which you can't do in
Java. Also lots of other issues that he doesn't take into consideration such
as the task at hand and the appropriateness of one solution over another for
that task.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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




[PHP] Sax-like : accessing form fields elements

2003-02-16 Thread Robert Mena
Hi,

I am developing an application which will have to
parse a html page and extract information about the
forms found.

I tried the HTMLSAX class
(http://www.phpclasses.org/browse.html/package/678.html)
which is ok except by the fact that I can not retrieve
the default/checked status from the elements.

Ie. 

Any ideias ?

Since the html will usually be ill-formed a standard
DOM-tree (with builtin functions at least) wont be possible.

__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




Re: [PHP] long running PHP application

2003-02-16 Thread Robert Cummings
I run a fantasy MUD and I have a PHP based daemon which checks for in game
player mail and if found and the player has registered an email address, then
it sends the MUD mail out to the player's email address. The program wakes up
once a minute to check the database and then goes back to sleep. It's been
running for months without a problem.

Cheers,
Rob.

Ilja Polvanovas wrote:
> 
> Does anybody have minds about problems running long running PHP scripts as
> standalone programs (ex. like servers, daemons). For example there is a
> "simple TCP/IP server" in Sockets chapter of the Manual. Have anybody any
> ideas how long can the script run ? is there any garbage collector in PHP,
> if it is, is it enough solution? Can the script run for unlimited time ? is
> there any restrictions ? Is it stable enough ?
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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




[PHP] Correct number format (curency)

2003-02-20 Thread Robert Mena
Hi,

I have one application where the users enter a curency
value.

Unfortunately even tough I write the "correct" format
I keep receiving all kinds.

Example

1.000,00
1000.00
1,000.00

I would like to convert those to a single format
1000.00

Is there any function in php that already does that ? 
Or perhaps any code snippets ?

thanks.

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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




[PHP] bcpowmod() and BigIntegers

2003-02-22 Thread Robert Kofler
is there a possibility to implement bcpowmod() in a 
version prior than PHP5?

bcpowmod() ist the only way to calculate a blind signature
as described by David CHAUM 1982 -> digicash
(openssl does not work here).

now I use the "shell_exec" command and an external java applet.
(btw. java has a great implemetation of the BigInteger.class)
-- 
/dev/robert

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



Re: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths..........

2003-02-22 Thread Robert Cummings
I don't know if it helps... but you should take a look at the ini_set()
function. Perhaps you can set the appropriate stuff using that.

Cheers,
Rob.


CF High wrote:
> 
> Hey Tom.
> 
> Thanks for the idea; however, since we're not hosting the site on our own
> server, we don't have permissions for altering the php.ini file..
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] A question of time...

2003-03-10 Thread Robert Cummings
Hi all,

I recently had a freelancing experience that has left me somewhat sour and
questioning myself. Unfortunately I don't feel I can fairly evaluate myself
and so I owuld like to put the question to my peers who populate the PHP
forum as to whether I have performed competently.

Last week I took upon myself the task of fixing a clients shopping cart
system by way of adding session support and proper user registration
validation. To give you some idea of the parameters of the job...

- VNC development connection
- live server with no error output
- no session support whatsoever
- cart had no input validation, except basic javascript
- user registration permitted clobbering of other users
  and had no validation either
- PHP code was ad-hoc sprinkled through the pages
- comments were almost non-existent

The first day I decided it would be best to mirror the server so that
development time would be minimized (VNC is terrible for devlopment). This was
done without charge to the client despite it's time saving effect.

The second day I spent 13 hours familiarizing myself with their code and
pages, and on this day I also implemented a session management library for
easily accessing and setting session data (this included hooks for permanent
cookie data storage). I also fixed the user registration process and add
security validation to ensure user information could not accidentally (or
deliberately via form hacking) be accessed by someone other than the
registrant. Previously re-registration of an existing email address regardless
of password would clobber existing customer. At this time I also fixed the
cart and ensured prepopulation of forms for updating registration information.

The third day I first wasted an hour making my changes work on their
server because they decided to rename all the files I had changed thus
breaking all of the include() paths. After that I spent another 3 hours adding
support for returning to previous page before entering any of the cart
checkout or customer registration pages. At this time a response page was also
added to thank the customer for their purchase. Of course all of this was
tested to be functional and where necessary broken pre-existing code was
replaced or fixed to provide the correct functionality.

On the fourth day I spent 3 hours adding support for input validation
feedback to the registration validation so that customer's would know exactly
why they could not continue. I also added support for a password reminder to
inform the user of their password when forgotten. This included adding the
page, adding the form, validating that the user id existed and outputting
appropriate feedback if the user did not exist - and of course testing.

All in all I spent 20 hours total for the client at a rate of $40 USD/hr
which I believe is on the low end of freelance. I myself have 3 years
experience devloping PHP web applications. So the question I ask is whther
this time frame is reasonable, or am I just a slow crappy programmer that is
ripping these people off? They seem to think I should have had this done in
just a few hours, but my experience thus far indicates to me that they got
just service. Additionally it seems before I took the job, they had went
through several other PHP developers would said they couldn't do it (and I
don't really blame them considering the VNC connection and lack of comments or
error feedback).

If it turns out that I am incompetent, then I will happily send them a
bill for zero hours, otherwise I would like to take comfort that I am not
ripping them off.

Sincerely,
Robert Cummings
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] A question of time...

2003-03-10 Thread Robert Cummings
"CPT John W. Holmes" wrote:
> 
> [snip]
> > If it turns out that I am incompetent, then I will happily send them a
> > bill for zero hours, otherwise I would like to take comfort that I am not
> > ripping them off.
> 
> Just my humble opinion, of course, but I think you did the job quickly
> considering what you were given to start with. $40/hour is pretty cheap,
> too.
> 
> No one likes paying and it always seems like a "little change" to those on
> the outside.
> 
> It would of been hard to nail down a contract given the circumstances, but
> that's what you should have done. Always get it in writing. If you agreed on
> $40/hour before hand without a "maximum" number of hours where you had to
> get back to them, then they have to pay.

Thanks, I did estimate 20 to 30 hours for them after I had set up the mirror
server and before the actual work began. At the same time I asked if they wanted
me to stop to which they replied that I should continue.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] ^M in PHP

2003-03-13 Thread Robert Cummings
I know there's a binary for doing exactly that in linux but I can't for the
life of me remember the name. If you're text editor is any good you should
be able to do a search and replace for "\r" with "". I use joe, but that's
hardly the editor of choice for most.

Cheers,
Rob.

Liam Gibbs wrote:
> 
> I'm downloading a file from Windows to Linux through PHP. Understandably,
> there are ^Ms at the end of my lines. Is there a PHP function I can use to
> delete them?

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] PHP newbie ... function with several returns ?

2003-03-15 Thread Robert Dyke
Hi ... PHP newbie here.

I'm migrating from ASP/vbScript.

I'd like to set up a subroutine that will change several variables at once.

In VB, I can say:

Private Sub Change_Variables ($variable1, $variable2)
$variable1 = "Something different from it's original value"
$variable2 = "I'm changed also!!"
End Sub

// in my code I can call it like this:
$My_variable1 = "This is the original value of variable1"
$My_variable2 = "This is the original value of variable2"

Call Change_Variables ($My_variable1, $My_variable2)

// after calling this subroutine the variables are changed:

print $My_variable1  // yeilds: "Something different from it's original
value"
print $My_variable2  // yields: "I'm changed also!!"

I try to convert this to PHP, and I'm getting stuck.  I'm sure there's a
kind of function that can do this.

Any ideas?

TIA



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



[PHP] Re: PHP newbie ... function with several returns ?

2003-03-15 Thread Robert Dyke

"Jome" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Robert Dyke wrote:
> > Hi ... PHP newbie here.
> >
> > I'm migrating from ASP/vbScript.
> >
> > I'd like to set up a subroutine that will change several variables at
> > once.
> >
> > In VB, I can say:
> >
> > Private Sub Change_Variables ($variable1, $variable2)
> > $variable1 = "Something different from it's original value"
> > $variable2 = "I'm changed also!!"
> > End Sub
> >
> > // in my code I can call it like this:
> > $My_variable1 = "This is the original value of variable1"
> > $My_variable2 = "This is the original value of variable2"
> >
> > Call Change_Variables ($My_variable1, $My_variable2)
> >
> > // after calling this subroutine the variables are changed:
> >
> > print $My_variable1  // yeilds: "Something different from it's
> > original value"
> > print $My_variable2  // yields: "I'm changed also!!"
> >
> > I try to convert this to PHP, and I'm getting stuck.  I'm sure
> > there's a kind of function that can do this.
> >
> > Any ideas?
>
> VB defaults to pass by reference while PHP defaults to pass by
> value.
>
> Read more at: http://www.php.net/manual/en/language.references.pass.php
>
>   Jome

THANKS!!  I inserted the ampersands and it works beautifully ...





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



Re: [PHP] Do query strings get spidered by Google?

2003-03-16 Thread Robert Cummings
I don't think Google follows URLS to every variation based on a query string.
I know to have some of my pages indexed I had to rewrite the URL so the query
string looked like a directory path.

Cheers,
Rob.

-{ Rene Brehmer }- wrote:
> 
> Judging from how Google has indexed my site, it simply follows all links
> it encounters on the site, since I atleast can find several of my pages
> that are a bunch of links deep inside the site...
> 
> Rene
> 
> On Sat, 15 Mar 2003 10:26:05 -0700, Mike Hillyer wrote about "[PHP] Do
> query strings get spidered by Google?" what the universal translator
> turned into this:
> 
> >I am trying to decide how to lay out a site with a lot of articles, and I am
> >wondering if query strings get spidered by Google. I was thinking it would
> >make for an easy search engine if I could put the articles in fulltext
> >searchable MySQL columns, but I do not want to lose the ability of search
> >engines to spider them. Otherwise, I believe there is a way to convert the
> >quert string to a trailing / so it looks like directory structure, does
> >anyone have info on that?
> 
> --
> Rene Brehmer
> 
> This message was written on 100% recycled spam.
> 
> Come see! My brand new site is now online!
> http://www.metalbunny.net
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] PHP 4.3.0/4.3.2 - Strange problem with exec / move_uploaded_file

2003-07-04 Thread Robert Mena
Hi,

I am faciing a strange problem.  I have some php
script to  receive images (via file upload).

The script is failling to work because it can't
move/copy the file.

I've added a sleep(x) in order to make the temporary
file stick around.

  20 -rw---1 apache   apache  19402 Jul  4
10:49 /tmp/phpFj6Irk

I've added apache to an upload group

upload:x:1098:apache

And changed the owner of the directory.

ls -sla /home/httpd/html/foo.com/img/news/
total 24
   4 drwxrwxr-x6 webmaste upload   4096 Jul  4
10:11 .
   4 drwxrwxr-x5 webmaste webmaste 4096 Jun 10
15:55 ..
   4 drwxrwxr-x2 webmaste upload   4096 Jun  4
09:41 1
   4 drwxrwxr-x2 webmaste upload   4096 Jul  4
10:48 10
   4 drwxrwxr-x2 webmaste upload   4096 Jul  4
09:54 2

And the both commands below fail.

move_uploaded_file($tmpfile,$destination)
exec("/bin/cp $tmpfile $destination",$array)

The var_dump in array shows 

array(0) { }

The $destination var has (checked with echo)

/home/httpd/html/foo.com/img/news/10/xxx.jpg

Any ideias ?

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP] Snarl, hiss, growl (frustration)

2003-07-04 Thread Robert Cummings
On Fri, 2003-07-04 at 12:44, Rasmus Lerdorf wrote:
> The difference is that you are getting a string from the file and not
> casting it to an integer.  You could also have fixed it by doing:
> 
>   $counter = (int) fread(...);

The cast isn't necessary, PHP happily transforms it for him when he
applies the ++ operator.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] Snarl, hiss, growl (frustration)

2003-07-04 Thread Robert Cummings

On Fri, 2003-07-04 at 13:13, Rasmus Lerdorf wrote:
> On Fri, 4 Jul 2003, Robert Cummings wrote:
> 
> > On Fri, 2003-07-04 at 12:44, Rasmus Lerdorf wrote:
> > > The difference is that you are getting a string from the file and not
> > > casting it to an integer.  You could also have fixed it by doing:
> > >
> > >   $counter = (int) fread(...);
> >
> > The cast isn't necessary, PHP happily transforms it for him when he
> > applies the ++ operator.
> 
> ;)  You are sure about that right?  Or else you wouldn't have posted this
> to 1000's of people.

I am absolutely sure of thus since I cut and pasted the original problem
code to a shell script to test. This was before I noticed the answer
mentioning the closing if block had already been posted. 

> 
> So what do you think this will output?
> 
> $a = "123\n";
> $a++;
> echo $a;
> 
> Try it.

Undoubtedly the above will work as we both know, the output will be
"123"; however, if you look at the original code in question, there is
no "\n" tailing the output written to the counter file and thus the
increment works fine (unless of course when he created the file to begin
he had a newline - something I did not do in my test :)

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] does anyone know how to tell if a PHP scrip is beingexecuted from the command line not a server HTTP request??

2003-07-06 Thread Robert Cummings
I don't know if it is a great way, but it has worked for me for a long
time now. I make the following test:

isset( $HTTP_SERVER_VARS['SERVER_PORT']

Cheers,
Rob.

On Sun, 2003-07-06 at 04:48, Jeffrey D. Means wrote:
> I am trying to write a script but for security I need to verify that it is
> not executed by a web server.  At this point I have just placed it outside
> the htdocs tree but would like to build into the script a test to die if it
> is being executed by a web server.
> 
> Thanks
> 
> Jeff Means
> CIO for MeansPC
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] [ML] Are there any announcement rules for this list? (wasRe: [PHP] Re: NEW SPAMMER ...)

2003-07-08 Thread Robert Cummings
Personally I like to hear about new releases of PHP related products
here too. For how often it occurs, I can't see how 1 in 80 emails a day
is really going to impact the list. Especially since 10 to 20 emails are
generated in support or indignation for such announcements :)

+1

Cheers,
Rob.

On Tue, 2003-07-08 at 20:59, Joel Rees wrote:
> > I've just read the other thread about spammers and such.
> > Indeed, my announcement - even for a free platform - was not complying
> > to the posting guidelines as it not a response to any questions asked.
> > 
> > I apologize.
> 
> Where? The only guidelines that I can find for posting to this list are
> at 
> 
> http://www.php.net/mailing-lists.php
> 
> I see nothing there at all concerning announcements.
> 
> I personally appreciate brief announcements of related products,
> regardless of licensing. A tag, [ANNOUNCEMENT] or [ANN], in the subject
> line would be helpful, but that's the only comment I have on the subject.
> 
> If the list maintainers do have rules or guidelines about announcements,
> maybe one of them would speak up now?

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] tcp sockets

2003-07-10 Thread Robert C.
I have a java server running to handle xml requests and send back a
response to the sender.
It runs on one port for tcp and another for udp.
I got the udp version working fine, but I am having problems with the
tcp version.
Watching the debug output on the java server, I can see that it is
receiving the request from the php client and sending the response.
However, the php client hangs up when trying to read the response.
I'm guessing the problem is in the socket read function because when
I comment that part out it executes fine.
Also I am not using a while loop for the reading because I know the
response is only one line and < 1024 bytes.
Code snippet posted below. Any help would be greatly appreciated.

$xml = "blah blah
blah";
$port = 1234;
$address = gethostbyname( "www.mysite.com" );

$socket = socket_create( AF_INET, SOCK_STREAM, getprotobyname( "tcp"
) );
if( $socket == FASLE ) {
//error out...
}

$result = socket_connect( $socket, $address, $port );
if ( $result == FALSE ) {
//error out...
}

if( socket_write( $socket, $xml, strlen ($xml) ) == FALSE ) {
//error out...
}

$response = socket_read( $socket, 1024, PHP_NORMAL_READ );

socket_close($socket);

print "$response";

//now parse the response
$p = xml_parser_create();
xml_parser_set_option( $p, XML_OPTION_CASE_FOLDING, 0 );
xml_parser_set_option( $p, XML_OPTION_SKIP_WHITE, 1 );
xml_parse_into_struct( $p, $response, $vals, $index);
xml_parser_free( $p );

//this will show you whats in the array
print "xml response array: ";
print_r( $vals );


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



RE: [PHP] nlist

2003-07-10 Thread Robert C.
http://www.php.net/readdir

 Original Message 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], 
Subject: RE: [PHP] nlist
Date: Thu, 10 Jul 2003 16:17:30 -0700

>Hi all,
>Is there a local filesystem-based function comparable to the 
>ftp-based
>'nlist' that lists files in a directory?
>
>Johnny
>
>-- 
>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] Need hep with mysql function

2003-07-10 Thread Robert Cummings
This has been discussed a lot on many of the PHP forums in the past few
weeks. Mysql is not longer bundled with PHP. You need to use the
configuration option and set the location of your mysql base directory.

Cheers,
Rob.

On Thu, 2003-07-10 at 21:30, zlut arch wrote:
> Hi,
> 
> I encountered a problem that I have never seen in my 3 years of using php 
> and mysql. Yesterday, I installed MySql, php5, and apache2 on my new laptop. 
> php5 worked fine with apache2, and MySql was working fine on its own. But 
> when I tried to connect to MySql database, I get a strange error message: 
> "Fatal error: Call to undefined function: mysql_connect()". I thought this 
> is very strange since mysql_connect() is a built-in function in php5. How 
> can it be an undefined function? Does anyone know what is going on?
> 
> Thanks,
> 
> Zlutarch
> 
> _
> Add photos to your messages with MSN 8. Get 2 months FREE*.  
> http://join.msn.com/?page=features/featuredemail
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] Code and Good Design Methods

2003-07-13 Thread Robert Cummings
Let's be honest, XSL is is one big logic step itself -- moreover it's a
whole other language to learn.

Cheers,
Rob.

On Sun, 2003-07-13 at 02:07, Ray Hunter wrote:
> Also u could build your own system that is php xml and xslt based. That
> will really help you separate the logic from the presentation.
> 
> Check out (dom)xml and (dom)xslt. Sometimes there is still logic in the
> presentation with template systemswith xslt however, it might be to
> much for the design (interface) guys.
> 
> Those should help u out.
> 
> --
> BigDog
> 
> 
> On Sat, 2003-07-12 at 20:08, Dan J. Rychlik wrote:
> > I am reading PHP and MySQL web development 2nd edition book.  Chapter 6 talks 
> > about displaying dynamic web content using class objects.  For the type of project 
> > that I am building, this is not optimal.  How do I keep my self from having html 
> > mixed with my PHP code?  In other words how do I serperate the two.  I need to 
> > concentrate on writing good code and not designing a nice looking website.  
> > (someone else is going to do that)  
> > 
> > Can I assign include() statements to a variable ?  How would you guys accomplish 
> > this?
> > 
> > Thanks so much in advance,
> > Daniel 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] Re: fake .php extension

2003-07-15 Thread Robert Hawke
- simply go into the apache config file
- search for php
- somewhere it should say at the end of the line .php .phtml .

- no just add your extension


"Nabil" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> How can confugure Apache to execute a real php files but with fake
extention
> like .foo  or .pl or even .html?
>
> Regards
> Nabil
>
>



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



Re: [PHP] Passing $Vars between 2 php pages

2003-07-16 Thread Robert Cummings
Use the GET method (URL parameters). If you want to pass (foo=5) then
do the following:

 A link label 

Cheers,
Rob.

On Wed, 2003-07-16 at 12:44, Valentin wrote:
> Hi,
> is any way to pass a $Var from one to other php pages without using 
> and Cookies?
> 
> Thanks,
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] Test (ignore)

2003-07-16 Thread Robert Cummings
Some of my mail hasn't appeared on list for a while,
just testing if connection is working.

IGNORE THIS MESSAGE :)

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] Too much of $GLOBALS[] a problem??

2003-07-17 Thread Robert Cummings
Rather than having the following scenario:

$GLOBALS['foo'] = 'foo';
$GLOBALS['fee'] = 'fee';

The following would be much cleaner and portable while still allowing
the ease of use of $GLOBALS based configuration:

$GLOBALS['myProjectName']['foo'] = 'foo';
$GLOBALS['myProjectName']['fee'] = 'fee';

Cheers,
Rob.


On Thu, 2003-07-17 at 22:58, Curt Zirzow wrote:
> Ow Mun Heng <[EMAIL PROTECTED]> wrote:
> > Hi All,
> > 
> > Just a quick question on this. In my scripts, I'm using A LOT Of
> > $GLOBALS['my_parameter'] to get the declared values/string. 1 example  below
> > :
> > 
> > function display_menu_html()
> > {
> > echo ''."\n";
> > echo ''."\n";
> > echo "\t".''."\n";
> > echo "\t".'' . $GLOBALS['home'] . "
> >
> > [...]
> >  
> > }
> > 
> > This isn't really a Problem but.. is it bad programming practice?? Or I
> > should just write another function that can return the values/string?
> 
> 
> yes and no, that is rather a debatable question.  
> 
> To make my functions that echo stuff cleaner I usually do stuff like:
> 
> function show_html() {
>  
>   
> 
>   
> 
>   
> 
> ?>
> }
>  
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] classes v. functions

2003-07-18 Thread Robert Cummings
On Fri, 2003-07-18 at 18:19, Andu wrote:
> 
> Say I have a database class with all kinds of functions for connection, 
> data manipulation, errors, etc:
> 
> $db = new db_sql;
> $db->connect();
> $db->do_this();
> $db->do_that();
> 
> How would that be different from an include file with a bunch of functions 
> doing the same thing?
> Is there any performance benefit one way or the other?
> I used EZ_Sql which is cool but didn't seem to speed things up in 
> comparison to the said include file.
> Still don't see the beef.
> 

Using your above example, the above would keep all of the internal data
that keeps track of the resource ID (for the connection), the current
result set, and the current row, etc. within the object instance scope.
Thus everytime you invoke a method on the object it works with it's own
set of data. In all honesty you can do this with functions also, but
then you would have something like the following:

$dbId = db_connect();
$data = db_do_this( $dbId );
$moreData = db_do_that( $dbId, $data )

As you can see this quickly can become cumbersome becaus eof the lack of
encapsulation. However, the OOP paradigm goes even further. Lets imagine
you now want log all use of your functions (methods :). To do this in
OOP you just extend the class and override the methods while still
allowing invocation of the inheritted methods. Thus your usage of your
new object code would look something like follows:

$db = new custom_db_sql;
$db->connect();
$db->do_this();
$db->do_that();

Whereas the function code would resemble the following:

$dbId = custom_db_connect();
$data = custom_db_do_this( $dbId );
$moreData = custom_db_do_that( $dbId, $data )

As you can see updating the function based code required more work. It
wasn't as modular since it couldn't take advantage of inheritance. This
is a trivial example btw, it's not perfect since there are books and
books written on this topic and I'm obviously glossing over a lot of
details. Once you get into design patterns you'll also see other
advantages of using objects versus functions. I hope this helps a teeny
weeny bit.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] Re: classes v. functions

2003-07-20 Thread Robert Cummings
On Sun, 2003-07-20 at 02:28, Andu wrote:
> 
> One shouldn't apply industrial theories to just everything.
> 

Object Oriented Design is not an industrial theory. It's a tried and
true practice with over a decade of computer science and practical use
behind it. Procedural programming is a subset of Object oriented
programming. Someday you'll need the higher level features OOD offers,
but until then it probably just won't make sense unless you actually go
and learn the principles from a good book or teacher. Trying to
formulate an opinion about OOD from the PHP mailing list is like trying
to form an opinion about nuclear physics from your buddy that watched
some show on nuclear power plants (maybe not that extreme, but hopefully
you get the point).

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] controlling winamp with COM

2003-07-21 Thread Robert Cummings
Depending on exactly how you intend to use this technology there are
several ways to go about it. One is to create a PHP C extension that you
compile into the PHP engine itself -- this I imagine can hook into the
API to control the open application. Then you can choose to use these
new extension functions in either a shell script to control the winamp
program from the current computer (or shell-script on a remote computer
that you SSH or telnet into), or you can create a PHP-based Web front
end to control the winamp application. The other alternative, is to just
have the PHP script call existing programs than can access the API on
the OS via the backtick or system(), etc... functions (this solution was
mentioned below :). It might even be possible that Winamp itself
provides hooks to a running instance of itself via command line
parameters (one can hope) which would simplify the task greatly.

Cheers,
Rob.


On Mon, 2003-07-21 at 23:40, Diego Fulgueira wrote:
> Look, i don't know if you already received a reply for your message, but i
> can tell you i know a lot about PHP and i have absolutely no idea how to do
> this.
> 
> I will just remind you that PHP is intended to be used as a server to client
> technology and that it might have some indirect interaction with winamp, but
> only on the server.
> 
> What you need is a lower level techonolgy. To do this, i would try to
> approach the problem with C/C++ or VisualBasic and then build an interface
> to make it work from PHP. But this would be kinda messy.
> 
> Good luck. I really hope you don't give up on this, because i think noone
> has ever done anything like it, and is always good to know that we people on
> this mailing list, are each day more powerful.
> 
> CHEERS.
> Diego.
> 
> - Original Message -
> From: "John Herren" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 21, 2003 9:25 PM
> Subject: [PHP] controlling winamp with COM
> 
> 
> > Is there any way to control an open winamp application in php? I want to
> > use php as a scheduler to play Winamp. The API has system calls to do
> > so, but I don't know how to implement the windows calls.
> >
> >
> > --
> > 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
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] bug in addslashes command?

2003-07-22 Thread Robert Cummings
I recently upgraded from 4.1.2 all the way to 4.3.2 without a single
bump -- your experience may vary :)

Cheers,
Rob.

On Tue, 2003-07-22 at 16:11, Merlin wrote:
> there is definatelly a bug in 4.2.1 since this sentence:
> 
> Argostoli is the 'capitol' of Kefalonia / Kefallinia. One of the Greek
> Ionian islands.
> 
> will be escaped by - instead of  \
> 
> other examples run fine.
> 
> Does anybody know if there are any serious changes between the new php
> version and 4.2.1
> Can I upgrade without feering loosing functionality?
> 
> Thanx for your help,
> 
> Merlin
> 
> "David Nicholson" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
> Hello,
> 
> This is a reply to an e-mail that you wrote on Tue, 22 Jul 2003 at
> 20:51, lines prefixed by '>' were originally written by you.
> > Hello there,
> > I am running php 4.2.1 on a linux machine. Not sure, but I think
> there
> > might
> > be a bug in there.
> > While putting data into the db I do get an error in a verry rar
> case.
> > All
> > values are escaped by addslashes commands.
> > This is the original string:
> > the 'capitol-' of Kefalonia
> > This is the string after addslashes:
> > the 'capitol-' of Kefalonia
> > Which leaves the last ' unescaped.
> 
> On my PHP 4.3.2 installation, echo addslashes("the 'capitol-' of
> Kefalonia"); displays:
> the 'capitol-' of Kefalonia
> which appears to be correct.
> 
> David.
> 
> --
> phpmachine :: The quick and easy to use service providing you with
> professionally developed PHP scripts :: http://www.phpmachine.com/
> 
>   Professional Web Development by David Nicholson
> http://www.djnicholson.com/
> 
> QuizSender.com - How well do your friends actually know you?
>  http://www.quizsender.com/
> (developed entirely in PHP)
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] USB Hard Drive

2003-07-23 Thread Robert Cummings
On Wed, 2003-07-23 at 12:49, Digital Directory USA, Inc wrote:
> I need to get a USB Hard Drive to "Auto Run" a flash movie when plugged
> into a USB port on all platforms of a PC (Win98, 2000, XP, ME). Can 
 ^^^
Off Topic but I must protest...

You forgot Linux in your list -- a gross oversight I'm sure!

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



RE: [PHP] I'm really getting annoyed with PHP

2003-07-23 Thread Robert Cummings
On Thu, 2003-07-24 at 23:24, Beauford.2005 wrote:
> It's obvious though that PHP can not handle it. This is why I am forced
> to use javascript. I have already spent a week on this and am not going
> to waste any further time. I have posted all my code and if someone can
> see a problem I'll look at it, but it just ain't worth the effort at
> this point.

PHP handles it fine -- I've been using it in my code for years now
without a single hiccup. With thousands (millions?) of others using it,
the assertion that PHP cannot handle "it" seems unequivocally incorrect.
That said it is more likely than not, that you yourself are unable to
handle "it". Furthermore, your style and mannerisms remind me of a
troll.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] php4 vs php5

2003-07-24 Thread Robert Janeczek
hi, i`m working on presentation of php5 features and i would like to add
some comparison between php4 and php5. new coding features are of course
available in doc on php.net, but i`m wondering where can i find benchmarks
that show speed differences between the two. if there are none i would like
to hear from core developers about which types (loops, math operations,
objects code) of code will show the differences so i could write my own
benchmark.

rash



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



  1   2   3   4   5   6   7   8   9   10   >