Re: [PHP] Class function calling another function in class

2005-05-18 Thread Chris
You keep on appending $this->str to itself. Comments are inline.
Charles Kline wrote:
Hi all,
Not sure if I am doing this right and I can't figure it out, was  
hoping someone here can help.

I have an organization table in mySQL. Pretty standard. My first  
function getDepts() is working as I intend and returning the tree  
just as I like it. The new piece I added in there that is not working  
now is the call to getPositions() within the first function. What I  
am trying to do is once I get a Department, I want to loop through  
the Positions table and get the positions that are under that  
Department. This code goes haywire and loops for ever printing a huge  
list to the screen. Eventually I need to return this data not to the  
screen but into an array. Anyone see what I might have wrong in my  
logic?

I have a class and it contains these two functions.
function getDepts ( $parent = 0, $level = 1 ) {
$sql = 'SELECT BudgetedOrganization.* ';
$sql .= 'FROM BudgetedOrganization ';
$sql .= 'WHERE BudgetedOrganization.boSuperiorOrgID = ' .  
$parent;

$rs = $this->retrieveData($sql);
if ($rs)
{
while($row = mysql_fetch_array($rs)){
$num = 1;
while ($num <= $level) {
$this->str .= "\t";
$num++;
}
$this->str .= $row['boOrgID'] . ", " . $row 
['boOrgName'] . "\n";

   // just added this and it ain't working
$this->str .= $this->getPositions($row['boOrgID']);
here you are appending the result of ::getPostions() to ->str
$this->getDepts($row['boOrgID'],$level+1);
}
}
return($this->str);
}
function getPositions ( $org = 0 ) {
$sql = 'SELECT BudgetedPosition.* ';
$sql .= 'FROM BudgetedPosition ';
$sql .= 'WHERE BudgetedPosition.bp_boOrgID = ' . $org;
//echo $sql;
$rs = $this->retrieveData($sql);
if ($rs)
{
while($row = mysql_fetch_array($rs)){
$this->str .= " - " . $row['bpPositionID'] . "\n";
appending the row to ->str
}
}
return($this->str);
from getPositions you are returning ->str , so getPositions is appending 
each row to ->str , then returning ->str , which is then being appended 
to ->str

}
Later
$depts = $org->getDepts();
echo "" . $depts . "";
Thanks,
Charles
I'd say just don't append what ::getPositions() is returning.. and 
remove the return call if it makes sense to do so.

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


RE: [PHP] html editor written in PHP

2005-05-18 Thread Murray @ PlanetThoughtful
> Has anyone seen an example of a HTML editor written in PHP (no JS)?
> You know the ones - for adding HTML tags to a text field, etc.
> 
> Thanks!

You've already received a number of responses indicating that it's not
possible to have a pure PHP browser enabled HTML editor, mainly due to the
fact that the editing itself takes place on the client (which requires a
client-side language, such as JavaScript), while PHP is only run at the
server.

One lateral solution, however, would be using something like the PHP ports
of either the Markdown or Textile classes to provide HTML markup using a
simpler syntax.

Using Markdown as an example, you would type:

_This sentence will be displayed with emphasis_

When you next retrieve this content and pass it through the Markdown class,
it automatically becomes:

This sentence will be displayed with emphasis

The differences between the two classes is that Textile is more featured,
but in my personal opinion less intuitive, while Markdown is obviously less
featured, but easier to use 'without thinking about it' as you go about
generating content. [1]

Both of these classes are used extensively to provide content markup in
blogging systems such as MovableType and WordPress, etc. There may be
similar classes out there (another one is BBCode, which is popular on forum
applications such as Invision PowerBoard).

PHP Markdown: http://www.michelf.com/projects/php-markdown/

PHP Textile: http://jimandlissa.com/project/textilephp

Hope this helps,

Murray

[1] Note: which one you might use would depend on how comfortable you are
with their applicable syntaxes and how varied your markup needs are.

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



[PHP] multiple inserts into a db

2005-05-18 Thread mayo
I'm putting ordered items into a db. The information is stored in
session variables.
 
Session_variable_with_itemID_has(1001,1002,1003,1004) however when
inserted into the db only 0,0,0,0 is recorded.
 
Assuming that this was the 40th recorded order the table should look
like this
 
TABLE: orderedItems
 
orderedItemsID -- orderID - itemID
 
159 - 40 - 1001
160 - 40 - 1002
161 - 40 -- 1003 
162 - 40 - 1004
 
What comes out is:
 
orderedItemsID -- orderID - itemID
 
159 - 40 - 0
160 - 40 - 0
161 - 40 -- 0 
162 - 40 - 0
 
 
The loop itself works as intended. However it is not inserting this
variable.
 
$ses_basket_items  is the total number of items
$orderID = the orderID which these items are a part of
$ses_basket_id = is the itemID number
 
 
 
for ($i=0;$i<$ses_basket_items;$i++){
 
$query = "INSERT INTO orderedItems (orderID,itemID) VALUES
('$orderID','$ses_basket_id')";
 
mysql_query($query) or die('Error, insert query failed');
 
}
 
mysql_close($conn);
 
thx
 


Re: [PHP] array_diff odities

2005-05-18 Thread José Luis Palacios Vergara
-unsubscribe-digest- 
- Original Message - 
From: "Pablo Gosse" <[EMAIL PROTECTED]>
To: "PHP" 
Sent: Wednesday, May 18, 2005 11:03 PM
Subject: [PHP] array_diff odities


Howdy folks.  I'm running into something strange with array_diff that
I'm hoping someone can shed some light on.
I have two tab-delimited text files, and need to find the lines in the
first that are not in the second, and vice-versa.
There are 794 records in the first, and 724 in the second.  

Simple enough, I thought.  The following code should work:
$tmpOriginalGradList = file('/path/to/graduate_list_original.txt');
$tmpNewGradList = file('/path/to/graduate_list_new.txt');
$diff1 = array_diff($tmpOriginalGradList, $tmpNewGradList);
$diff2 = array_diff($tmpNewGradList, $tmpOriginalGradList);
I expected that this would set $diff1 to have all elements of
$tmpOriginalGradList that did not exist in $tmpNewGradList, but it
actually contains many elements that exist in both.
The same is true for $diff2, in that many of its elements exist in both
$tmpOriginalGradList and $tmpNewGradList as well.
Since this returns $diff1 as having 253 elements and $diff2 as having
183, it sort of makes sense, since the difference between those two
numbers is 70, which is the difference between the number of lines in
the two files.  But the bottom line is that both $diff1 and $diff2
contain elements common to both files, which using array_diff simply
should not be the case.
However, when I loop through each file and strip out all the tabs:
foreach ($tmpOriginalGradList as $k=>$l) {
$tmp = str_replace(chr(9), '', $l);
$tmpOriginalGradList[$k] = $tmp;
}
foreach ($tmpNewGradList as $k=>$l) {
$tmp = str_replace(chr(9), '', $l);
$tmpNewGradList[$k] = $tmp;
}
I get $diff1 as having 75 elements and $diff2 as having 5, which also
sort of makes sense since there numerically there are 70 lines
difference between the two files.
I also manually replaced the tabs and checked about 20 of the elements
in $diff1 and none were found in the new text file, and none of the 5
elements in $diff2 were found in the original text file.
However, if in the code above I replace the tabs with a space instead of
just stripping them out, then the numbers are again 253 and 183.
I'm inclined to think the second set of results is accurate, since I was
unable to find any of the 20 elements I tested in $diff1 in the new text
file, and none of the elements in $diff2 are in the original text file.
Does anyone have any idea why this is happening?  The tab-delimited
files were generated from Excel spreadsheets using the same script, so
there wouldn't be any difference in the formatting of the files.
This one has me confused as I really thought the simple code posted
above should have worked.
If anyone can pass along any advice I would greatly appreciate it.
Cheers and TIA,
Pablo
--
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] array_diff odities

2005-05-18 Thread Pablo Gosse
Howdy folks.  I'm running into something strange with array_diff that
I'm hoping someone can shed some light on.

I have two tab-delimited text files, and need to find the lines in the
first that are not in the second, and vice-versa.

There are 794 records in the first, and 724 in the second.  

Simple enough, I thought.  The following code should work:

$tmpOriginalGradList = file('/path/to/graduate_list_original.txt');
$tmpNewGradList = file('/path/to/graduate_list_new.txt');

$diff1 = array_diff($tmpOriginalGradList, $tmpNewGradList);
$diff2 = array_diff($tmpNewGradList, $tmpOriginalGradList);

I expected that this would set $diff1 to have all elements of
$tmpOriginalGradList that did not exist in $tmpNewGradList, but it
actually contains many elements that exist in both.

The same is true for $diff2, in that many of its elements exist in both
$tmpOriginalGradList and $tmpNewGradList as well.

Since this returns $diff1 as having 253 elements and $diff2 as having
183, it sort of makes sense, since the difference between those two
numbers is 70, which is the difference between the number of lines in
the two files.  But the bottom line is that both $diff1 and $diff2
contain elements common to both files, which using array_diff simply
should not be the case.

However, when I loop through each file and strip out all the tabs:

foreach ($tmpOriginalGradList as $k=>$l) {
$tmp = str_replace(chr(9), '', $l);
$tmpOriginalGradList[$k] = $tmp;
}

foreach ($tmpNewGradList as $k=>$l) {
$tmp = str_replace(chr(9), '', $l);
$tmpNewGradList[$k] = $tmp;
}

I get $diff1 as having 75 elements and $diff2 as having 5, which also
sort of makes sense since there numerically there are 70 lines
difference between the two files.

I also manually replaced the tabs and checked about 20 of the elements
in $diff1 and none were found in the new text file, and none of the 5
elements in $diff2 were found in the original text file.

However, if in the code above I replace the tabs with a space instead of
just stripping them out, then the numbers are again 253 and 183.

I'm inclined to think the second set of results is accurate, since I was
unable to find any of the 20 elements I tested in $diff1 in the new text
file, and none of the elements in $diff2 are in the original text file.

Does anyone have any idea why this is happening?  The tab-delimited
files were generated from Excel spreadsheets using the same script, so
there wouldn't be any difference in the formatting of the files.

This one has me confused as I really thought the simple code posted
above should have worked.

If anyone can pass along any advice I would greatly appreciate it.

Cheers and TIA,

Pablo

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



Re: [PHP] libxml_set_streams_context

2005-05-18 Thread Bill Hoffman
On May 18, 2005, at 7:07 PM, Jared Williams wrote:
Heh, yes indeed most baffling... Libxml must be performing some  
sort of cacheing, I guess. Doesn't appear to be requesting twice
(once with the if-modified-since header, and again without atleast)
well, thanks for the confirm on that. I thought of a possible double  
request also (with header, then without) as well; I guess I'll have  
to break out the packet sniffer and see if that tells me anything.

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


Re: [PHP] Responses in my email.

2005-05-18 Thread Greg Donald
On 5/18/05, Rob Agar <[EMAIL PROTECTED]> wrote:
> because remembering
> to hit reply-to-all gets on my nerves too..

It's fairly painless once you get used to it.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



RE: [PHP] libxml_set_streams_context

2005-05-18 Thread Jared Williams
 

> -Original Message-
> From: Bill Hoffman [mailto:[EMAIL PROTECTED] 
> Sent: 19 May 2005 00:46
> To: php-general@lists.php.net
> Subject: Re: [PHP] libxml_set_streams_context
> 
> 
> On May 18, 2005, at 4:10 PM, Jared Williams wrote:
> 
> > Sure the server is checking if modified since headers?
> 
> I'm capturing the response headers from the remote server, so 
> I can see that.
> 
> > Just tried a bit of code here and it seems to be working as 
> expected 
> > (5.0.4 Win32)
> 
> 1) I made an initial mistake by running my PHP script(s) from 
> the command line and not from a server.
> 2) but now when running my PHP script(s) from a server I see that:
> 
> file_get_contents() with a conditional get in a stream 
> context works as expected; that is, the remote server returns 
> a 304 not modified HTTP response header only. (if doing this 
> with file_get_contents(), then the 
> libxml_set_streams_context() function call is of course irrelevant).
> 
> DOMDocument::load() with a conditional get in a stream 
> context set via libxml_set_streams_context() shows odd 
> results; that is, the remote server returns a 304 not 
> modified in the HTTP response header, but also returns the 
> file contents as well (!!??).
> 
> That's a bit baffling -- a server shouldn't do that, since 
> the 304 response header ends with "connection: close", so I 
> don't know how or why the file contents are being captured 
> too. I would think a 304 response header means that the 
> request header was properly interpreted and nothing but a 
> header would be returned. Hard to know if the problem is on 
> my end or on the remote server side. I note also that stream 
> contexts send only as HTTP/1.0, and the remote server is 
> returning HTTP/1.1, and I just don't know if that's a 
> possible factor in this or not.

Warning: DOMDocument::load(http://localhost/test.php) [function.load]: failed 
to open stream: HTTP request failed! HTTP/1.1 304
Undescribed in C:\Inetpub\evildocs\www\load.php on line 12
  
 mcal_next_recurrence
Returns the next recurrence of the event 

Heh, yes indeed most baffling... Libxml must be performing some sort of 
cacheing, I guess. Doesn't appear to be requesting twice
(once with the if-modified-since header, and again without atleast)

> 
> Anyhow, I have a workable solution which is sort of ok -- use
> file_get_contents() with a conditional get in a stream 
> context to fetch a remote file on an "if-modified-since" 
> basis, then stuff the string result into a new DOMDocument() 
> object and have at it that way.
> 
> But of course I'm puzzled as to why 
> libxml_set_streams_context() is doing what it's doing, and it 
> would be nice to know how to get it to work if it can and 
> should work elsewhere for others.
> 
> Thanks for a helpful reply.
> 
> --
> 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] Responses in my email.

2005-05-18 Thread Esteamedpw
Yeah, I think I've replied to people rather than the list, sorry to those I  
sent mail to... 8-(


RE: [PHP] html editor written in PHP

2005-05-18 Thread Pablo Gosse

Has anyone seen an example of a HTML editor written in PHP (no JS)?  
You know the ones - for adding HTML tags to a text field, etc.


I think what you're asking for is a logical impossibility.  PHP is
server side, so without javascript a browser-based wysiwyg editor would
be impossible, since there would be no client-side functionality to
respond to any action by the user.

If I'm somehow being incredibly obtuse here and have misconstrued your
question, I apologize.  However I think that what you're thinking about
just isn't possible.

Cheers,

Pablo

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



Re: [PHP] html editor written in PHP

2005-05-18 Thread Mark Cain
I have not seen any and I know that you don't have time to read the replies
of everyone who hasn't seen something.  So let me tell you why it's most
likely that there is not one (PHP HTML editor w/o JS).

PHP is server side.  Every click of the mouse would have to cause a page to
be refreshed (a trip to the server and a trip back to the browser.)  JS is
client side (it runs in your browser on your computer).  all of the editing
and tweaking can be done without a trip back to the server.  The only time a
trip is made to the server is to save the data after the editing is over.

Most guys who write code ask themselves "Where is the best place to run it?"
Usually for this type of app the answer is JS client side.  Now, there may
be a need for server side editors -- in the case of Mac JS not behaving the
same way as windows JS.  I have a couple of installations of JS CMS which
work wonderfully well on windows machine and appear broken on Macs.

Mark Cain



- Original Message -
From: "Dustin Krysak" <[EMAIL PROTECTED]>
To: "PHP" 
Sent: Wednesday, May 18, 2005 6:02 PM
Subject: [PHP] html editor written in PHP


> Has anyone seen an example of a HTML editor written in PHP (no JS)?
> You know the ones - for adding HTML tags to a text field, etc.
>
> Thanks!
>
> d
>
> --
> 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] cancel <20050519000845.2346.qmail@lists.php.net>

2005-05-18 Thread herojoker
This message was cancelled from within Mozilla.

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



[PHP] Re: html editor written in PHP

2005-05-18 Thread Manuel Lemos
Hello,
on 05/18/2005 07:02 PM Dustin Krysak said the following:
Has anyone seen an example of a HTML editor written in PHP (no JS)?  You 
know the ones - for adding HTML tags to a text field, etc.
You may want to take a look at these PHP classes that generate the 
necessary HTML and Javascript to edit HTML in a Web page:

http://www.phpclasses.org/of_htmlarea
http://www.phpclasses.org/wysarea
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Mindbuster - uploading works in some directories

2005-05-18 Thread Mario netMines
Hi all
this is so weird but here it goes:
PHP version: 4.3.11
Operating system: win XP SP2
I have been using the same uploading script for a while. I just got a new 
Athlon 64bit and I installed PHP and the rest as always.

The only problem is that now my images are not getting to the directory I 
tell them to go.

Here is the script:
$thepathwithoutslash = "c:/Inetpub/wwwroot/mario/cms-front";
$subpath = "images/uploaded";
$unique_id = time();
$num = 0;
$unique_id = time() + $num;
$picture = "fileup$num"."_name";
$picture1 = $$picture;
$picture2 = "fileup$num";
$picture3 = $$picture2;
$picture1 = $unique_id ."-". $picture1;
$picture1 = str_replace(" ", "_", $picture1);
if($picture3 != "none") {
move_uploaded_file($picture3, "$thepathwithoutslash/$subpath/$picture1");
}
When I do error checking I get no errors.
on the form side I have:


and 
Now the funny bit is that if I change the path to c:\Inetpub it works but if 
I change it to c:\Inetpub\wwwroot it doesn't.

There is no security on the dirs, the php.ini is as it was in all the other 
machines I worked on...

Can enyone help?

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


[PHP] Class function calling another function in class

2005-05-18 Thread Charles Kline
Hi all,
Not sure if I am doing this right and I can't figure it out, was  
hoping someone here can help.

I have an organization table in mySQL. Pretty standard. My first  
function getDepts() is working as I intend and returning the tree  
just as I like it. The new piece I added in there that is not working  
now is the call to getPositions() within the first function. What I  
am trying to do is once I get a Department, I want to loop through  
the Positions table and get the positions that are under that  
Department. This code goes haywire and loops for ever printing a huge  
list to the screen. Eventually I need to return this data not to the  
screen but into an array. Anyone see what I might have wrong in my  
logic?

I have a class and it contains these two functions.
function getDepts ( $parent = 0, $level = 1 ) {
$sql = 'SELECT BudgetedOrganization.* ';
$sql .= 'FROM BudgetedOrganization ';
$sql .= 'WHERE BudgetedOrganization.boSuperiorOrgID = ' .  
$parent;

$rs = $this->retrieveData($sql);
if ($rs)
{
while($row = mysql_fetch_array($rs)){
$num = 1;
while ($num <= $level) {
$this->str .= "\t";
$num++;
}
$this->str .= $row['boOrgID'] . ", " . $row 
['boOrgName'] . "\n";

   // just added this and it ain't working
$this->str .= $this->getPositions($row['boOrgID']);
$this->getDepts($row['boOrgID'],$level+1);
}
}
return($this->str);
}
function getPositions ( $org = 0 ) {
$sql = 'SELECT BudgetedPosition.* ';
$sql .= 'FROM BudgetedPosition ';
$sql .= 'WHERE BudgetedPosition.bp_boOrgID = ' . $org;
//echo $sql;
$rs = $this->retrieveData($sql);
if ($rs)
{
while($row = mysql_fetch_array($rs)){
$this->str .= " - " . $row['bpPositionID'] . "\n";
}
}
return($this->str);
}
Later
$depts = $org->getDepts();
echo "" . $depts . "";
Thanks,
Charles
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Responses in my email.

2005-05-18 Thread Rob Agar


> From: Rory Browne 
> This is primarly a mailing list. Not a news group. The whole idea of a
> mailing list is that you get every message mailed to you.

uh, I think the OP is complaining about the emails that *don't* go via
the list, because this list is set up so that hitting reply goes to the
poster, not the list.  Thought I'd stick my oar in because remembering
to hit reply-to-all gets on my nerves too..

Rob

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



[PHP] Re: html editor written in PHP

2005-05-18 Thread Hero Wanders
Hello!
Has anyone seen an example of a HTML editor written in PHP (no JS)?  You 
know the ones - for adding HTML tags to a text field, etc.
I think the FCKEditor on http://www.fckeditor.net is quite good, but it 
uses JS.

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


Re: [PHP] libxml_set_streams_context

2005-05-18 Thread Bill Hoffman
On May 18, 2005, at 4:10 PM, Jared Williams wrote:
Sure the server is checking if modified since headers?
I'm capturing the response headers from the remote server, so I can  
see that.

Just tried a bit of code here and it seems to be working as  
expected (5.0.4 Win32)
1) I made an initial mistake by running my PHP script(s) from the  
command line and not from a server.
2) but now when running my PHP script(s) from a server I see that:

file_get_contents() with a conditional get in a stream context works  
as expected; that is, the remote server returns a 304 not modified  
HTTP response header only. (if doing this with file_get_contents(),  
then the libxml_set_streams_context() function call is of course  
irrelevant).

DOMDocument::load() with a conditional get in a stream context set  
via libxml_set_streams_context() shows odd results; that is, the  
remote server returns a 304 not modified in the HTTP response header,  
but also returns the file contents as well (!!??).

That's a bit baffling -- a server shouldn't do that, since the 304  
response header ends with "connection: close", so I don't know how or  
why the file contents are being captured too. I would think a 304  
response header means that the request header was properly  
interpreted and nothing but a header would be returned. Hard to know  
if the problem is on my end or on the remote server side. I note also  
that stream contexts send only as HTTP/1.0, and the remote server is  
returning HTTP/1.1, and I just don't know if that's a possible factor  
in this or not.

Anyhow, I have a workable solution which is sort of ok -- use  
file_get_contents() with a conditional get in a stream context to  
fetch a remote file on an "if-modified-since" basis, then stuff the  
string result into a new DOMDocument() object and have at it that way.

But of course I'm puzzled as to why libxml_set_streams_context() is  
doing what it's doing, and it would be nice to know how to get it to  
work if it can and should work elsewhere for others.

Thanks for a helpful reply.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Fwd: [PHP] Display a database image from MSSQL database

2005-05-18 Thread Richard Lynch
On Wed, May 18, 2005 3:10 pm, Alaor Barroso said:
> I try to cut out the stripslashes and it also not work, and yes, the
> images are valid, i can use it in delphi apps with no errors.

Okay, take one of the images you get out of Delphi.

Open it in a text editor.

Take one of the images you get out of PHP.

Open it in a text editor.

What's different?

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Image Verification - Problems in Safari, Mac OS X

2005-05-18 Thread Richard Lynch
Your image is *NOT* a DOCTYPE HTML PUBLIC blah blah!!!

It's a *IMAGE*

Get rid of all the HMTL stuff.

You actually need to separate this into two different files.

One has all the HTML in it, with a SRC=/URL/to/image.php/image.png

The other is JUST the image stuff.

If IE actually displays it as-is, that's pretty broken...  But IE is
pretty broken as it is, so one more broken-ness shouldn't surprise
anybody.


On Wed, May 18, 2005 12:51 pm, Rahul S. Johari said:
> Ave,
>
> A simple Image Verification script is working perfect in IE on Windows...
> But isn¹t working in Safari on Mac OS X! It displays a blank page instead
> of
> the image with the form. Here¹ s the Script:
>
>  header("Content-Type: image/png");
> session_start();
> $new_string;
> session_register('new_string');
> ?>
>  "http://www.w3.org/TR/html4/loose.dtd";>
> 
> 
> 
> Verification : IMSAFM
> 
> 
>  $im = ImageCreate(200, 40);
>
> $white = ImageColorAllocate($im, 255, 255, 255);
> $black = ImageColorAllocate($im, 0, 0, 0);
>
> srand((double)microtime()*100);
> $string = md5(rand(0,));
> $new_string = substr($string, 17, 5);
> ImageFill($im, 0, 0, $black);
> ImageString($im, 4, 96, 19, $new_string, $white);
> ImagePNG($im, "verify.png");
> ImageDestroy($im);
> ?>
>
> 
> Type the code you see in the image in the box below. (case sensitive)
> 
> 
> 
> 
> 
> 
>
> Any tips to make it work in Safari as well?
>
> Thanks,
>
> Rahul S. Johari
> Coordinator, Internet & Administration
> Informed Marketing Services Inc.
> 251 River Street
> Troy, NY 12180
>
> Tel: (518) 266-0909 x154
> Fax: (518) 266-0909
> Email: [EMAIL PROTECTED]
> http://www.informed-sources.com
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] libxml_set_streams_context

2005-05-18 Thread Jared Williams
> 
> I'm trying to use libxml_set_streams_context() to load a 
> remote xml file via HTTP conditional GET with 
> DOMDocument::load() by stuffing an
> 'If-Modified-Since: --- " HTTP header into the stream, but no 
> matter how I try it I always get an HTTP 200 response when I 
> know the last- modified date is well before my if-modified 
> date string.
> 
> I've confirmed via curl -H on the command line that I can do 
> it properly and get an HTTP 304 as expected, but I don't know 
> what I'm not doing right with libxml_set_streams_context(). 
> Here's my code:
> 
> $opts = array('http'=>array('method'=>"GET", 'header'=>"If-Modified-
> Since: Wed, 18 May 2005 23:55:29 GMT\r\n")); $context = 
> stream_context_create($opts); libxml_set_streams_context($context);
> $doc->load('http://www.somewhere.com/somefile.xml');
> echo $doc->saveXML();
> 
> using the same $context resource, this also produces the same 
> result, when I expect it should work.
> 
> file_get_contents('http://www.somewhere.com/somefile.xml', 
> false, $context);
> 
> I have php 5.0.4 compiled with libxml2 (2.6.16) on Mac OS X 
> 10.4. I imagine I'm not doing something correctly, but can't 
> figure out what it is.
> 
> Any help?

Sure the server is checking if modified since headers?

Just tried a bit of code here and it seems to be working as expected (5.0.4 
Win32)

$opts = array('http'=>array('method'=>"GET", 'header'=>"If-Modified-Since: Wed, 
18 May 2005 23:55:29 GMT\r\n"));
$context = stream_context_create($opts); libxml_set_streams_context($context);
 file_get_contents('http://localhost/headersave.php', FALSE, $content); 

headersave.php

file_put_contents('headers.txt', var_export($_SERVER, TRUE));
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])
{
header('HTTP/1.0 304 Not Modified');
exit;
}


Jared

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



Re: [PHP] PHP Applications?

2005-05-18 Thread Rasmus Lerdorf
> I can't say for sure, but I'm betting that APC doesn't support the 
version of PHP that you are > trying to use.  Specifically, I don't 
think it supports PHP5+

Correct, APC is currently PHP4 only.
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Applications?

2005-05-18 Thread Rasmus Lerdorf
Evert | Rooftop wrote:
Chris Shiflett wrote:
Danny Brow wrote:
> Zend sells a compiler to speed up your PHP code. Since it's compiled,
> it also does not contain the source code in readable form. You should
> visit the Zend website.
Any free ones?

http://pecl.php.net/package/APC
APC won't work for me, segmentation faults all around =( suprisingly 
this doesn't occur the first time I load a page, only the second time !
If the current CVS version does this, please send me a backtrace.  This 
code works on thousands of servers just fine.

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


Re: [PHP] gather reply from POST

2005-05-18 Thread Jeremy Reynolds
On Wed, May 18, 2005 11:55 am, Jeremy Reynolds said:
 I received this useful bit of code for storing a page into a variable
 instead of loading it as an include.  But how can I modify this to
 submit some parameters to a page and collect the returned page / HTML
 into a variable??
 Jeremy
 --
 
 $text = file_get_contents('DocumentA.php');
 echo $text;
 ?>
Try:

If that doesn't work, go to http://php.net/curl
--
Like Music?
http://l-i-e.com/artists.htm
--
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] Image Verification - Problems in Safari, Mac OS X

2005-05-18 Thread Marek Kilimajer
Rahul S. Johari wrote:
Ave,
A simple Image Verification script is working perfect in IE on Windows...
But isn¹t working in Safari on Mac OS X! It displays a blank page instead of
the image with the form. Here¹ s the Script:
Because only Safari gets it right. With the above line you are saing 
this html page is a PNG image. The png file is saved, not output. Remove 
the line.

BTW, you might not be concerned about it much, but you have a race 
condition in your script.

session_start(); 
$new_string; 
session_register('new_string');
?>

"http://www.w3.org/TR/html4/loose.dtd";>



Verification : IMSAFM



$im = ImageCreate(200, 40);

$white = ImageColorAllocate($im, 255, 255, 255);
$black = ImageColorAllocate($im, 0, 0, 0);
srand((double)microtime()*100);
$string = md5(rand(0,));
$new_string = substr($string, 17, 5);
ImageFill($im, 0, 0, $black);
ImageString($im, 4, 96, 19, $new_string, $white);
ImagePNG($im, "verify.png");
ImageDestroy($im); 
?>


Type the code you see in the image in the box below. (case sensitive)






Any tips to make it work in Safari as well?
Thanks,
Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180
Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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


[PHP] html editor written in PHP

2005-05-18 Thread Dustin Krysak
Has anyone seen an example of a HTML editor written in PHP (no JS)?  
You know the ones - for adding HTML tags to a text field, etc.

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


[PHP] Re: Blank page in browser

2005-05-18 Thread zzapper
On Tue, 17 May 2005 11:41:56 +0300,  wrote:

>Dear All,
>
>I'm new to PHP programming and I just try to display small information from
>database on web page but its shows blank page. So my code is mention below
>and let me know what's wrong in it but when I execute same program on
>command prompt then its shows all result correctly with HTML Tags 
>

I was getting freaked by this , as unknowingly I'd error reporting switched off 
(in php.ini).

But you can set the following in your code

error_reporting(E_ALL);  // switch on full error reporting

.. code

.. code

// Turn off all error reporting
error_reporting(0);

http://uk2.php.net/manual/en/function.error-reporting.php

-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips

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



[PHP] Re: PHP Complex Data Structures

2005-05-18 Thread zzapper
On Wed, 18 May 2005 09:02:01 -0400,  wrote:

>I find PHP arrays easier than Perl's data structures. Probably because 
>PHP just has arrays, there really is no differentiation between arrays 
>(Perl @) and hashes (Perl %). And PHP references arrays the same way as 
>variables ($), which may or may not be confusing. You could probably 
>look at PHP arrays as Perl hashes (name/value pairs). The functions are 
>just about the same: push, pop, shift, unshift, etc.
>
>If you think of all PHP arrays as Perl hashes, you should grasp things 
>pretty quick.
>
>On May 17, 2005, at 4:17 PM, zzapper wrote:
>
>> Hi,
>> I seem to remember that you access/use PHP data in the same/similar 
>> way to Perl data and that you
>> can create complex data structures ie
>> arrays of arrays, arrays of records etc.
>>
>> For once Google let me down so can any one point at any doc info.
>>
>>
>-- 

I am delighted with the PHP data structure I have been able to create

Populating/creating the data structure (array of records)

foreach ($results_products_cnt as $l3key => $count)
   {
  $cathash[$l3key]['href']=$catalog_href;
  $cathash[$l3key]['count']=$count;
  $cathash[$l3key]['title']=$title;
}

accessing it

   foreach ($cathash as $v2 => $v1) 
   {
  $href=$v1['href'];
  $count=$v1['count'];
  $catalog_h1=$v1['title'];
   $html.="$v2 ($count)";
   }

As you say Brent it's really intuitive.

I've been able to drastically shrink my PHP code

-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips

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



Re: [PHP] Image Verification - Problems in Safari, Mac OS X

2005-05-18 Thread Jason Wong
On Thursday 19 May 2005 03:51, Rahul S. Johari wrote:

> A simple Image Verification script is working perfect in IE on
> Windows... But isnÂt working in Safari on Mac OS X! It displays a blank
> page instead of the image with the form. Here s the Script:

That's because IE is severely broken? In short, you're trying to display 
an image, so get rid of all the HTML stuff.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

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



Fwd: [PHP] Display a database image from MSSQL database

2005-05-18 Thread Alaor Barroso
Thankz the atention.

I try to cut out the stripslashes and it also not work, and yes, the
images are valid, i can use it in delphi apps with no errors.

={

2005/5/18, Richard Lynch <[EMAIL PROTECTED]>:
> On Wed, May 18, 2005 10:28 am, Alaor Barroso said:
> > Hi... I need to display some images that exists inside one MSSQL
> > server in a BLOB datatype field, but my code don't work...
> >
> > My code:
>
> ... contains NO error checking.  That's bad.
>
> >  > $arg = $_GET["codPessoa"];
> > mssql_connect("server", "web", "web");
> > $sql = "SELECT Foto FROM Foto WHERE CodPessoa=$arg";
> > $result = mssql_query($sql);
> > $data = mssql_result($result, 0, "Foto");
> > $data = stripslashes($data);
>
> Nooo!
>
> If you are calling stripslashes() on data coming out of your databsae, you
> have almost for sure really screwed up much earlier in the process, by
> having both Magic Quotes "on" and calling addslashes() (or
> mysql_real_escape_string) or something similar.
>
> You would only do stripslashes() here if you've hacked php.ini to use
> Magic Quotes on data coming *OUT* of the database, which is really quite
> rare to do -- You'd want that only on a site where, what?, you were
> shlepping a bunch of stuff out of one database and into another???
>
> > header("Content-type: image/gif");
> > echo $data;
> > exit;
> > ?>
> >
> > And I access this page sending in the URL the text:
> > .../showimage.php?codPessoa=xxx.
> >
> > I receive a strange code like
> > Fh54757eFg554257eFrgtth547d54e7t8h54j87j85fd54ss7f.. Accessing
> > this page by IE nothing happens but when a I try to access in Mozilla
> > Firefox I got an error saying that the image cointain errors and
> > cannot be displayed... If i try to show inside an img TAG in other
> > page like  the code display a X error img,
> > like if the image don't exist, but the code keep returning the strange
> > code, so I believe that this is the image in a "string format" and
> > something makes with the conversion for a real image format don't work
> > very well.
>
> Your stripslashes() corrupted the image, assuming it was valid in the
> first place.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
>

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



Re: [PHP] Responses in my email.

2005-05-18 Thread Jason Barnett
Rory Browne wrote:
This is primarly a mailing list. Not a news group. The whole idea of a
mailing list is that you get every message mailed to you.
I use this solely as a news group.  The news group seems to lag the 
email responses a little, but not too badly.  For those that are 
interested I use Mozilla Thunderbird to connect to the news.php.net news 
server and overall I'm pretty happy about it.

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


Re: [PHP] novice: char to varchar

2005-05-18 Thread Philip Hallstrom
On Wed, May 18, 2005 11:15 am, tony yau said:
Hi all,
I try to do the following:
CREATE TABLE IF NOT EXISTS Invoice(
  PKey INTEGER,
  Received DATETIME,
  Cost DECIMAL(10,2),
  FileName VARCHAR(50),
  RefNum CHAR(10),
  PRIMARY KEY (PKey)
) TYPE=MyISAM COMMENT='Invoice Data';
but it keep generating  RefNum VARCHAR(10)  instead of CHAR(10)
I don't understand, please help (or point me to RTFM page)
WILD GUESS!!!
In *some* impelementations of SQL, the performance benefit of CHAR over
VARCHAR is lost after the first VARCHAR column.
That's exactly it...
http://dev.mysql.com/doc/mysql/en/silent-column-changes.html
If any column in a table has a variable length, the entire row becomes 
variable-length as a result. Therefore, if a table contains any 
variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer 
than three characters are changed to VARCHAR columns. This doesn't affect 
how you use the columns in any way; in MySQL, VARCHAR is just a different 
way to store characters. MySQL performs this conversion because it saves 
space and makes table operations faster. See Chapter 14, MySQL Storage 
Engines and Table Types.

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


Re: [PHP] libxml_set_streams_context

2005-05-18 Thread Bill Hoffman
On May 18, 2005, at 1:20 PM, Richard Lynch wrote:
*YOU* have check their return value to see if it's 'false' or -1 or  
0 and,
if so, *YOU* have to call another function to get the error message  
and
error code.

This is what I am suggesting is missing big-time in your code.
Yes, you made your point in your first reply -- I'm clueless and  
don't know the first thing about basic defensive coding. Thanks for  
going out of your way -- twice -- to be so helpful.

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


Re: [PHP] libxml_set_streams_context

2005-05-18 Thread Richard Lynch
On Tue, May 17, 2005 11:12 pm, Bill Hoffman said:
>
>
> On May 17, 2005, at 10:24 PM, Richard Lynch wrote:
>
>> I don't know much about that fancy new stream stuff, or the XML
>> crap, but
>> you've got zero (0) lines of code in there to do anything useful
>> when the
>> functions fail.
>
> no functions fail.

If none of them failed, your script would work :-)

> what I'm expecting is that with libxml_set_streams_context(), I've

I'm betting most of these functions do *NOT* print an error message for
you when they fail.

*YOU* have check their return value to see if it's 'false' or -1 or 0 and,
if so, *YOU* have to call another function to get the error message and
error code.

This is what I am suggesting is missing big-time in your code.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] gather reply from POST

2005-05-18 Thread Richard Lynch
On Wed, May 18, 2005 11:55 am, Jeremy Reynolds said:
> I received this useful bit of code for storing a page into a variable
> instead of loading it as an include.  But how can I modify this to
> submit some parameters to a page and collect the returned page / HTML
> into a variable??
>
> Jeremy
> --
>  /** DocumentB.php */
>
> $text = file_get_contents('DocumentA.php');
> echo $text;
>
> ?>

Try:


If that doesn't work, go to http://php.net/curl

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Blank page in browser

2005-05-18 Thread Richard Lynch
On Tue, May 17, 2005 10:59 pm, Nayeem said:
> I found same error in error_log file which I face on command prompt before
> then I install PHP 5.0 with --with-oci8=$ORACLE_HOME compilation so that
> problem solved. Now I'm facing same problem on Apache. So can you tell me
> where should I define the environment variables on Apache.

If http://php.net/SetEnv doesn't do it, I don't know where to start...

http://php.net/oci8 I guess.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Tomcat and PHP

2005-05-18 Thread Richard Lynch
To the guy trying to use PHP with Tomcat...

I thought of this after deleting all those posts, naturally. :-(

In the distant past, when people said "You can use PHP with XYZ web
server" I was able to successfully use PHP with those other web-servers by
finding good documentation for installing Perl/cgi with them, and then
just switching out things like "C:\perl\perl.exe" for "C:\php\php.exe"

I can't promise this will work with Tomcat, but it's worth a shot.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] directory listing from text file

2005-05-18 Thread Richard Lynch
What I know about Windows mapped drives could fit in a matchbook with room
for every Playmate's phone number...

But the answer I always hear when people are trying to do what you are
trying to do is "Samba"

HTH

On Wed, May 18, 2005 7:37 am, dreiph said:
> Thank you Chris,
>
> but this is not I needed.
>
> Let me explain my situation.
>
> I have a big server with a lot of audio files, working within LAN, with
> Windows 2000 Pro on it. Let's call it as "FileServer". Also I have another
> server with Apache2 and PHP installed, windows 2000 PRO too, let's say it
> is
> "WebServer". Web Server is standalone with two NIC cards, firewall, etc. I
> don't want to make Fileserver be accessible form Internet.
>
> The problem is that PHP and/or Apache on WebServer does not understand
> mapped drives from a FileServer, so readdir() or opendir() is not working
> correctly, by the way, it looks like Windows "dir" command works a little
> bit faster than readdir();
>
> It take me some time to play with simple Windows command line utility, to
> get directory listing on FileServer and deliver plain text file to a
> WebServer. Command line was the following:
>
> exec('cmd /c dir /b /s /d /a:d \\\FileServer\\audiofiles >
> audiofiles.txt');
>
> $hi = fopen("audiofiles.txt", "r");
> $line = fread($hi,filesize("audiofiles.txt"));
> fclose($hi);
> $line=explode("\n", $line);
>
>
> At this point I've got FileServer directories [only directories, not
> files!]
> scanned into file audiofiles.txt and this file was written to a WebServer.
> So, I have plain text file with correct directory structure, including
> subdirectories.
>
> The problem is, that "dir" command in Windows command prompt scans
> directories in weird format - each directory in new line, eg:
>
> \first
> \second
> \second\first
> \second\second
> \third
>
> I immagine, to show directory tree, I need to make some like array in PHP,
> and I think, this should be a recursive function [could not find out how
> to
> write it]. So final variable should be array like this:
>
> $directories = Array('\\first', '\\second" => Array('\\first',
> '\\second'),
> '\\third');
>
> How??
>
> Thanks,
>
> Bye, Dreiph
>
>
> "Chris Ramsay" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> Dreiph,
>
> If you're familiar with PEAR, take a look at this:
>
> http://pear.php.net/package/HTML_TreeMenu
>
> regards
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] PHP and PayPal

2005-05-18 Thread Andy Pieters
Hi Robert

I am just in implementing PayPal as one of the Payment providers on an order.

I realize the PayPal documention is a bit too exhausive and is easy to lose 
track of what is important.

I will introduce two items to you:

IPN (Instant Payment Notification)

You should have a script that handles callbacks from PayPal.  The PayPal 
system itself calls the script whenever something important happened.  The 
security is that you get all the data PayPal sent, send it back to a POST and 
retrieve the reply "VERIFIED" or "FAILED".  This script should create the 
keys and send emails to the customer with these keys.


PDT (Payment Data Transfer)
PDT is used by PayPal when the payment is completed and the PayPal system 
forwards the user back to your page.  Use the PDT to look up in your database 
if you already received an IPN from PayPal regarding this order.

PayPal alows you to check your system by the use of a Sandbox.  They also have 
a forum where you can ask specific questions.



With kind regards


Andy Pieters
Straight-A-Software

-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C$(+++) UL>$ P-(+)>++
L+++>$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>$@ h++(*) r-->++ y--()>
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

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



[PHP] Re: gather reply from POST

2005-05-18 Thread Jason Barnett
Jeremy Reynolds wrote:
I received this useful bit of code for storing a page into a variable 
instead of loading it as an include.  But how can I modify this to 
submit some parameters to a page and collect the returned page / HTML 
into a variable??

Jeremy
--

$text = file_get_contents('DocumentA.php');
echo $text;
?>
You'll probably want to use cURL for this task, although Rasmus' 
posttohost might also give you something useful.

http://php.net/manual/en/ref.curl.php
http://www.php-faq.com/postToHost.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Reprocessing text

2005-05-18 Thread Richard Lynch
On Wed, May 18, 2005 6:25 am, Michael Satterwhite said:
> I have a site that extracts HTML page code from a database and prints it
> to the page being generated. A user has requested that I allow this text
> to be dynamic. I can code process functions for the code that I pull
> from the database, but it would be so much better if I could simply get
> PHP to process the text for me.
>
> Does anyone know a way to cause this to happen?

Yes, but...

If you mean you want to allow your users to write PHP code in their HTML,
and have your script execute that PHP code, then you want:
http://php.net/eval

But

This would be incredibly dangerous unless you REALLY REALLY REALLY trust
ALL your users. They could do some really nasty things with PHP if you let
them.

Tell us more about the data and the user and what you really want -- We
might have a safer answer for you...

One simple one might be to allow them to give you a URL where you will get
the text, and then you get their current text, instead of whatever is in
your databsae.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Responses in my email.

2005-05-18 Thread Rory Browne
This is primarly a mailing list. Not a news group. The whole idea of a
mailing list is that you get every message mailed to you.

If you don't want this then unsubscribe. 

You could always filter out any email sent to php-general, or
containing the term [PHP] in the subject.

On 5/18/05, Robert Meyer <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> When I post a question here, I get an email for every response posted.  I
> only want the response posted, not emailed to me.  The other newsgroups I
> belong to don't send me an email.  What are my options if any and how do I
> implement them?
> 
> Regards,
> 
> 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: [PHP] RSS news feed (slightly 0T)

2005-05-18 Thread Richard Lynch
On Wed, May 18, 2005 6:26 am, Ryan A said:
> Can anyone suggest a few places where i can get some decent
> tech/programming/php news feeds?

The New York PHP User Group seems to have a pretty hip PHP news feed on
their home page, last time I checked.

Figure out where they get their news, if you can...

I keep meaning to do that on the Chicago PHP User Group site, but it
hasn't happened yet... :-(

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Image Verification - Problems in Safari, Mac OS X

2005-05-18 Thread Rahul S. Johari
Ave,

A simple Image Verification script is working perfect in IE on Windows...
But isn¹t working in Safari on Mac OS X! It displays a blank page instead of
the image with the form. Here¹ s the Script:


http://www.w3.org/TR/html4/loose.dtd";>



Verification : IMSAFM





Type the code you see in the image in the box below. (case sensitive)







Any tips to make it work in Safari as well?

Thanks,

Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180

Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: [EMAIL PROTECTED]
http://www.informed-sources.com



Re: [PHP] Display a database image from MSSQL database

2005-05-18 Thread Richard Lynch
On Wed, May 18, 2005 10:28 am, Alaor Barroso said:
> Hi... I need to display some images that exists inside one MSSQL
> server in a BLOB datatype field, but my code don't work...
>
> My code:

... contains NO error checking.  That's bad.

>  $arg = $_GET["codPessoa"];
> mssql_connect("server", "web", "web");
> $sql = "SELECT Foto FROM Foto WHERE CodPessoa=$arg";
> $result = mssql_query($sql);
> $data = mssql_result($result, 0, "Foto");
> $data = stripslashes($data);

Nooo!

If you are calling stripslashes() on data coming out of your databsae, you
have almost for sure really screwed up much earlier in the process, by
having both Magic Quotes "on" and calling addslashes() (or
mysql_real_escape_string) or something similar.

You would only do stripslashes() here if you've hacked php.ini to use
Magic Quotes on data coming *OUT* of the database, which is really quite
rare to do -- You'd want that only on a site where, what?, you were
shlepping a bunch of stuff out of one database and into another???

> header("Content-type: image/gif");
> echo $data;
> exit;
> ?>
>
> And I access this page sending in the URL the text:
> .../showimage.php?codPessoa=xxx.
>
> I receive a strange code like
> Fh54757eFg554257eFrgtth547d54e7t8h54j87j85fd54ss7f.. Accessing
> this page by IE nothing happens but when a I try to access in Mozilla
> Firefox I got an error saying that the image cointain errors and
> cannot be displayed... If i try to show inside an img TAG in other
> page like  the code display a X error img,
> like if the image don't exist, but the code keep returning the strange
> code, so I believe that this is the image in a "string format" and
> something makes with the conversion for a real image format don't work
> very well.

Your stripslashes() corrupted the image, assuming it was valid in the
first place.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] novice: char to varchar

2005-05-18 Thread Richard Lynch
On Wed, May 18, 2005 11:15 am, tony yau said:
> Hi all,
>
> I try to do the following:
>
> CREATE TABLE IF NOT EXISTS Invoice(
>   PKey INTEGER,
>   Received DATETIME,
>   Cost DECIMAL(10,2),
>   FileName VARCHAR(50),
>   RefNum CHAR(10),
>
>   PRIMARY KEY (PKey)
> ) TYPE=MyISAM COMMENT='Invoice Data';
>
> but it keep generating  RefNum VARCHAR(10)  instead of CHAR(10)
>
> I don't understand, please help (or point me to RTFM page)

WILD GUESS!!!

In *some* impelementations of SQL, the performance benefit of CHAR over
VARCHAR is lost after the first VARCHAR column.

In other words, it's making it VARCHAR because there is NO benefit to it
being CHAR because there is a column earlier (FileName) that is already
VARCHAR.

Try moving the RefNum to be *before* the FileName column.

If that fixes it, you're all set.

I don't know if MySQL is such an implementation.  I don't know if MySQL's
VARCHAR and CHAR have any difference at all in MyISAM.  I don't know... 
There's a lot I don't know.  The above was all just guess-work based on
other SQL implementations. http://mysql.com should document what's
happening and why.  Search for VARCHAR and CHAR there, and you should find
it.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Re: novice: char to varchar

2005-05-18 Thread tony yau
found the answer sorry about this

"Tony Yau" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> I try to do the following:
>
> CREATE TABLE IF NOT EXISTS Invoice(
>   PKey INTEGER,
>   Received DATETIME,
>   Cost DECIMAL(10,2),
>   FileName VARCHAR(50),
>   RefNum CHAR(10),
>
>   PRIMARY KEY (PKey)
> ) TYPE=MyISAM COMMENT='Invoice Data';
>
> but it keep generating  RefNum VARCHAR(10)  instead of CHAR(10)
>
> I don't understand, please help (or point me to RTFM page)
> Tony Yau

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



Re: [PHP] novice: char to varchar

2005-05-18 Thread John Nichel
tony yau wrote:
Hi all,
I try to do the following:
CREATE TABLE IF NOT EXISTS Invoice(
  PKey INTEGER,
  Received DATETIME,
  Cost DECIMAL(10,2),
  FileName VARCHAR(50),
  RefNum CHAR(10),
  PRIMARY KEY (PKey)
) TYPE=MyISAM COMMENT='Invoice Data';
but it keep generating  RefNum VARCHAR(10)  instead of CHAR(10)
I don't understand, please help (or point me to RTFM page)
How about the MySQL website, and/or a MySQL mailing list?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] novice: char to varchar

2005-05-18 Thread Jay Blanchard
[snip]
I try to do the following:

CREATE TABLE IF NOT EXISTS Invoice(
  PKey INTEGER,
  Received DATETIME,
  Cost DECIMAL(10,2),
  FileName VARCHAR(50),
  RefNum CHAR(10),

  PRIMARY KEY (PKey)
) TYPE=MyISAM COMMENT='Invoice Data';

but it keep generating  RefNum VARCHAR(10)  instead of CHAR(10)

I don't understand, please help (or point me to RTFM page)
[/snip]

http://www.mysql.com

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



Re: [PHP] Sending a string with $_POST/$_GET

2005-05-18 Thread Rory Browne
You don't set $_GET variables, like $_GET['name'] = whaever and expect
to do something along the lines of echo $_GET['name'] in another page.

To assign a value as a GET variable on another page, then you make the
url of the other page whatever.php?name=value

Then in whatever.php you can do something like 


On 5/17/05, Ross <[EMAIL PROTECTED]> wrote:
> I want to write a string to a variable and use $_POST or $_GET to retrieve
> it on another page.
> 
> I keep gettting an undefined index errror. Can someone show me how this is
> done?
> 
> Do I have to use session_start() ?
> 
> Have checked the documentation, can't find a really basic example.
> 
> R.
> 
> --
> 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] gather reply from POST

2005-05-18 Thread Jeremy Reynolds
I received this useful bit of code for storing a page into a variable 
instead of loading it as an include.  But how can I modify this to 
submit some parameters to a page and collect the returned page / HTML 
into a variable??

Jeremy
--

$text = file_get_contents('DocumentA.php');
echo $text;
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Jakarta Tomcat and PHP

2005-05-18 Thread Rory Browne
I don't know if you checked out www.php.net/java but it seems to be
what you're looking for.

On 5/18/05, Evert | Rooftop <[EMAIL PROTECTED]> wrote:
> My guess would be looking for how to use PHP as a CGI in tomcat. So
> check out the manual for CGI stuff.
> 
> grt,
> Evert
> 
> Chris Holden wrote:
> 
> >Hi, I hope this is the right place to ask...
> >
> >I am running Tomcat 5.5.7 (jdk 1.5) on Windows XP quite happily. I have
> >MySQL set up and that all works fine too. But I would also like to be able
> >to run PHP under Tomcat rather than having to install Apache to handle PHP
> >file and forward JSP requests to Tomcat... I'll only be doing some small
> >test pages in PHP but I really dont want to have to install another server.
> >
> >I read on the Tomcat Wiki site that it *is* possible to connect PHP and
> >Tomcat, and I tried but got nowhere, I dont even get errors when opening
> >..php files!
> >
> >I'd really appreciate it if someone could give me or point me in the
> >direction of an idiots guide to getting PHP working with Tomcat. I've gone
> >through every result from google to no avail :(
> >
> >
> >Cheers,
> >
> >
> >Chris.
> >
> >
> >
> 
> --
> 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] Pfpro PHP

2005-05-18 Thread Rezk Mekhael
 


> > I am getting  this error when I try to run configure pfpro with PHP, 
> > any idea?
> >
> > mkdir: too few arguments
> > Try `mkdir --help' for more information.
> > configure: creating ./config.status
> > config.status: creating config.h
> > config.status: config.h is unchanged
> >
> > 
> > Sincerely,
> > Rezk Mekhael
> >


Incoming / Outgoing Mail scanned for known Viruses by CLUnet(R)

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



Re: [PHP] Re: why are session only working with cookies?

2005-05-18 Thread Jason Barnett
Please keep questions regarding PHP problems on the list instead of in 
my inbox.  Thanks.

Brian V Bonini wrote:
> On Wed, 2005-05-18 at 12:58, Jason Barnett wrote:
>
>>Brian V Bonini wrote:
>>
>>>On Mon, 2005-05-16 at 22:10, Richard Lynch wrote:
>>>
>>>
Let him fight with phpIniDir some other day.
>>>
>>>
>>>Something interesting maybe:
>>>http://gfx.gfx-design.com/session_test.php
>>>Hit your browsers refresh button.
>>>
>>>I would think SID is NOT supposed to change with every page refresh..??
>>>
>>
>>Except that the SID is NOT in any POST / GET parameter.  So since PHP
>>doesn't recieve a SID on any refresh, it assumes that it is starting a
>>new session each time.  This is expected behavior.
>
>
> Thanks for clarifying... Does not really have any bearing on my original
> problem, but... At least I know THAT is nothing to look at further...
>
> -B
>
But it *does* have bearing on your original problem!  If you *don't* use 
*cookies* then the only way to continue a session is by passing the SID 
through *POST* or *GET* parameters!  That has been the whole point of 
the discussion about trans_sid!  Simple as that!

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


Re: [PHP] hey dip shit

2005-05-18 Thread John Nichel
Jay Blanchard wrote:
[snip]
John has my vote for what it's worth :-)
[/snip]
So, you're voting John in as dip shit? I second that. :)
Thanks professor. ;)
You knew it wasn't going to be too long before I weighed in on this.
Agree with not releasing every post (posts are taking a long time to
show up NOW), but handling all that little admin work? Sure, someone
really needs to do that.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] novice: char to varchar

2005-05-18 Thread tony yau
Hi all,

I try to do the following:

CREATE TABLE IF NOT EXISTS Invoice(
  PKey INTEGER,
  Received DATETIME,
  Cost DECIMAL(10,2),
  FileName VARCHAR(50),
  RefNum CHAR(10),

  PRIMARY KEY (PKey)
) TYPE=MyISAM COMMENT='Invoice Data';

but it keep generating  RefNum VARCHAR(10)  instead of CHAR(10)

I don't understand, please help (or point me to RTFM page)
Tony Yau

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



Re: [PHP] hey dip shit

2005-05-18 Thread Rory Browne
> > Hell, I'll do it...if there are no objections from the established list
> > members (like that will happen ;)
> 
> John has my vote for what it's worth :)

Ah why not? The man has a vision. 
/me seconds Jochams vote for John.

> 
> >
> 
> --
> 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] hey dip shit

2005-05-18 Thread Ryan A
mine too


On 5/18/2005 6:05:46 PM, Jochem Maas ([EMAIL PROTECTED]) wrote:
> John Nichel wrote:
> > Jason Barnett wrote:
> >
> >> John Nichel wrote:
> >>
> >>> Jason Motes wrote:
> >>>
>  HAH
> 
> >>>
> >>> This list could really use an active moderator.
> >>>
> >>
> >> Did Mr. Nichel just volunteer for that task...
> >>
> >
> > Hell,
> I'll do it...if there are no objections from the established list
> > members (like that will happen ;)
> 
> John has my vote for what it's
> worth :-)
> 
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 266.11.12 - Release Date: 5/17/2005

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



[PHP] Display a database image from MSSQL database

2005-05-18 Thread Alaor Barroso
Hi... I need to display some images that exists inside one MSSQL
server in a BLOB datatype field, but my code don't work...

My code:

 

And I access this page sending in the URL the text:
.../showimage.php?codPessoa=xxx.

I receive a strange code like
Fh54757eFg554257eFrgtth547d54e7t8h54j87j85fd54ss7f.. Accessing
this page by IE nothing happens but when a I try to access in Mozilla
Firefox I got an error saying that the image cointain errors and
cannot be displayed... If i try to show inside an img TAG in other
page like  the code display a X error img,
like if the image don't exist, but the code keep returning the strange
code, so I believe that this is the image in a "string format" and
something makes with the conversion for a real image format don't work
very well.

Sorry my bad english...

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



Re: [PHP] Building array ?

2005-05-18 Thread Brian V Bonini
On Wed, 2005-05-18 at 12:00, Paul Nowosielski wrote:
> HI All,
> 
> I'm trying to build an array of user id's. This is the code I've written
> that does not work.
> 
>  
> while($row=mysql_fetch_array($result)){
>// put user ID's into an array;
>$uidToAdmin .= array ("$row[user_id]");
>  
>// for debugging
>echo "UID $row[user_id]";
>echo "AUID $uidToAdmin[0]";
> }
> 
> So how can I continue adding to this array in the while loop?

$uidToAdmin[] = $row["user_id"];

??

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



Re: [PHP] Re: Sending a string with $_POST/$_GET

2005-05-18 Thread Brian V Bonini
On Wed, 2005-05-18 at 11:53, Luis wrote:
> Ross wrote:
> > I want to write a string to a variable and use $_POST or $_GET to retrieve 
> > it on another page.


$string = 'this is a string';
echo 'Next page';


another_page.php:

echo $_GET["val"];


-- 

s/:-[(/]/:-)/g


BrianGnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Building array ?

2005-05-18 Thread Philip Hallstrom
I'm trying to build an array of user id's. This is the code I've written
that does not work.
while($row=mysql_fetch_array($result)){
  // put user ID's into an array;
  $uidToAdmin .= array ("$row[user_id]");
$uidToAdminArray[] = $row[user_id];
  // for debugging
  echo "UID $row[user_id]";
  echo "AUID $uidToAdmin[0]";
}
print_r($uidToAdminArray);

So how can I continue adding to this array in the while loop?
TIA
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Building array ?

2005-05-18 Thread Jochem Maas
Paul Nowosielski wrote:
HI All,
I'm trying to build an array of user id's. This is the code I've written
that does not work.
 
while($row=mysql_fetch_array($result)){
thereisnothingwrongwithwhitespaceitcanhelplegebilityofyourcode:-)
   // put user ID's into an array;
   $uidToAdmin .= array ("$row[user_id]");
you are concatenating an array (which will be cast to a string)
to a string - this won't do what you want.
also putting '$row[user_id]' in double quotes is pointless,
remember that if you don't put it in double quotes then you
have to quote the array 'key' like so (or suffer an E_NOTICE):

so to build up an (indexed) array (as opposed to associative):

$uidToAdmin = array();
while ($row = mysql_fetch_array($result)) {
// put user ID's into an array;
$uidToAdmin[] = $row['user_id'];
}
// DEBUG:
// I'll assume you will run this via your browser
// therefore a  tag is used to make the output
// readable
echo '';
var_dump( $uidToAdmin );
echo '';
?>
I would suggest you take (another?) look at the
documentation on arrays, php arrays are really very very
cool - knowing how to use them properly is a
powerful weapon in your php arsenal. :-)
have fun

   // for debugging
   echo "UID $row[user_id]";
   echo "AUID $uidToAdmin[0]";
}
So how can I continue adding to this array in the while loop?
TIA




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


RE: [PHP] hey dip shit

2005-05-18 Thread Jay Blanchard
[snip]
John has my vote for what it's worth :-)
[/snip]

So, you're voting John in as dip shit? I second that. :)



You knew it wasn't going to be too long before I weighed in on this.
Agree with not releasing every post (posts are taking a long time to
show up NOW), but handling all that little admin work? Sure, someone
really needs to do that.

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



Re: [PHP] Re: why are session only working with cookies?

2005-05-18 Thread Jason Barnett
Brian V Bonini wrote:
On Mon, 2005-05-16 at 22:10, Richard Lynch wrote:
Let him fight with phpIniDir some other day.

Something interesting maybe:
http://gfx.gfx-design.com/session_test.php
Hit your browsers refresh button.
I would think SID is NOT supposed to change with every page refresh..??
Except that the SID is NOT in any POST / GET parameter.  So since PHP 
doesn't recieve a SID on any refresh, it assumes that it is starting a 
new session each time.  This is expected behavior.

Try creating a POST form instead and see what happens when you submit 
that form.  Refreshing the page without a SID anywhere won't do anything.

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


[PHP] Re: Building array ?

2005-05-18 Thread rush
"Paul Nowosielski" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> HI All,
>
> I'm trying to build an array of user id's. This is the code I've written
> that does not work.
>
> while($row=mysql_fetch_array($result)){
>// put user ID's into an array;
>$uidToAdmin .= array ("$row[user_id]");
>
>// for debugging
>echo "UID $row[user_id]";
>echo "AUID $uidToAdmin[0]";
> }
>
> So how can I continue adding to this array in the while loop?

 while($row=mysql_fetch_array($result)){
// put user ID's into an array;
$uidToAdmin[] .= $row[user_id];
}

rush
--
http://www.templatetamer.com/
http://www.folderscavenger.com/

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



Re: [PHP] "From" in mail() header problem. - Solved!

2005-05-18 Thread Rahul S. Johari

Ave,

On 5/18/05 10:55 AM, "Philip Hallstrom" <[EMAIL PROTECTED]> wrote:

> What happens if you do it like this:
> 
> $headers  = "Content-type: text/html; charset=iso-8859-1\r\n";
> $headers .= "From: SOMETHING <[EMAIL PROTECTED]>\r\n";
> $headers .= "Reply-To: [EMAIL PROTECTED]";
> $headers .= "MIME-Version: 1.0; X-Mailer: PHP/' . phpversion() . "\r\n";
> 
> mail($to,$subject,$message,$headers);
> 
> From the manual:
> 
> 
> additional_headers (optional)
> 
> String to be inserted at the end of the email header.
> 
> This is typically used to add extra headers (From, Cc, and Bcc).
> Multiple extra headers should be separated with a CRLF (\r\n).
> 
> Note: If messages are not received, try using a LF (\n) only.
> Some poor quality Unix mail transfer agents replace LF by CRLF
> automatically (which leads to doubling CR if CRLF is used). This should
> be a last resort, as it does not comply with RFC 2822.
> 

Believe it or faint, "\r\n" was the problem. I had actually tried it with
the way it was in the Manual to begin with, with the $headers in separate
lines, as you also suggested above, but it didn't work at all. And I know
that we don't re-write headers for outbound mail from the server because a
simple "From:" header without any additional headers works fine!

I ignored the last part that you mentioned when I had first read it in the
Manual.. But when you stated it in the response you sent, I did actually try
it out... Instead of using \r\n .. I used \n alone, and it worked!

I never had the problem of not receiving the email entirely at all though..
The recipient was definitely receiving the email being sent, contrary to
what is suggested by the manual.. And in fact everything except the "From:"
header was working fine. HTML format email with all the headers in tact were
being received using \r\n. But using \n alone, the "From:" is also fixed
now, and everything is working in order.

Thanks a ton!

Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180

Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] PHP and PayPal

2005-05-18 Thread Duncan Hill
On Wednesday 18 May 2005 16:33, Robert Meyer wrote:

> Here is one way I would like it to work:
>
> 1) User fills out a form (user email address, etc.) then clicks the "Buy
> Key" button.
> 2) User, along with a link, unique ID (not Key), cost, and form data is
> sent to PayPal.

Paypal document this in their developer SDK.

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



Re: [PHP] PHP Applications?

2005-05-18 Thread Jason Barnett
Evert | Rooftop wrote:
Chris Shiflett wrote:
Danny Brow wrote:
> Zend sells a compiler to speed up your PHP code. Since it's compiled,
> it also does not contain the source code in readable form. You should
> visit the Zend website.
Any free ones?

http://pecl.php.net/package/APC
APC won't work for me, segmentation faults all around =( suprisingly 
this doesn't occur the first time I load a page, only the second time !

grt,
Evert
I can't say for sure, but I'm betting that APC doesn't support the 
version of PHP that you are trying to use.  Specifically, I don't think 
it supports PHP5+

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


RE: [PHP] RSS news feed (slightly 0T)

2005-05-18 Thread Jared Williams
> 
> Hey,
> 
> Can anyone suggest a few places where i can get some decent 
> tech/programming/php news feeds?
> 
> I presently have the PHP.net feed (but its not too good 
> because the news does not change much in days) and I am using 
> yahoo's feeds for "software", "digital music" and "internet".
> 
> I was using slashdot, but the articles are generally really 
> small, and its more of a forum based...but worst of all their 
> feed is having problems and sometimes i get it (i cache the 
> feed and update every 8 hours) sometimes i dont get it.
> 
> To be fair, taking into consideration the above categories 
> please try to refrain from posting your own feed unless you 
> think it would really help me.
> 
> Also cc the list your answer coz it would help if not 
> everyone told me to check out site "x"
> :-),
> i'll reply to the list and you.

Er
www.planet-php.net even :)

Jared

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



RE: [PHP] RSS news feed (slightly 0T)

2005-05-18 Thread Jared Williams
> Hey,
> 
> Can anyone suggest a few places where i can get some decent 
> tech/programming/php news feeds?
> 
> I presently have the PHP.net feed (but its not too good 
> because the news does not change much in days) and I am using 
> yahoo's feeds for "software", "digital music" and "internet".
> 
> I was using slashdot, but the articles are generally really 
> small, and its more of a forum based...but worst of all their 
> feed is having problems and sometimes i get it (i cache the 
> feed and update every 8 hours) sometimes i dont get it.
> 
> To be fair, taking into consideration the above categories 
> please try to refrain from posting your own feed unless you 
> think it would really help me.
> 
> Also cc the list your answer coz it would help if not 
> everyone told me to check out site "x"
> :-),
> i'll reply to the list and you.
> 

http://www.planet-php.com

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



Re: [PHP] imap_open with variable fails

2005-05-18 Thread Michael Baas
Hi,

just did want to let this sink unanswered, but I see that 6 days means quite
a lot of messages piled up. Should have answered earlier, but...

Anyway, I think I had tried the "\{" or '{"-combinations as well and it
didn't work - but I can't remember exactly and can't reproduce now, since I
was working on a user's server there. But the way I finally solved this way
to first create a string with the entire command and its arguments in it and
then eval() the thing...

Thanks

Michael


"Richard Lynch" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> { } became special characters in PHP strings, at some point...
>
> You may or may not be able to change a php.ini setting to change that...
> I wouldn't have expected it to change from 4.3.10 to 4.3.11, but I don't
> really KNOW when it changed.  I suck at tracking version numbers and small
> changes with them.  Swiss cheese memory.
>
> Or, you should be able to always use \{ inside "" and it should "work"
>
> You could also change to '' instead of "" and {} would NOT be special
> inside ''.
>
>
>
> On Wed, May 11, 2005 1:05 am, Michael Baas said:
> > Hi,
> >
> > I'm using imap_open and the script works fine on my server with 4.3.11.
> > Now
> > as user with 4.3.10 reported that the script does not work. He finally
got
> > it working by replacing my variable-names in the imap_open-command with
> > strings containing exactly the same data (except for the leading slash
> > before the { which I was using together with variables).
> >
> > The statement is
> > @imap_open("\{$host}INBOX",$user,$pwd,OP_HALFOPEN);
> > and host is "80.243.163.14/pop3".
> > I know that /notls can also be appended, but as I said: it works fine
when
> > entering these directly into the command, just when using the
> > string-parameter it fails.
> >
> > The error is: "imap_open(): Couldn't open stream"
> >
> > I've spent quite some time now googling around, searching various forums
> > etc., but could not find a solution to this. Would appreciate your help
> > very
> > much!
> >
> > Thanks
> >
> > Michael
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> -- 
> Like Music?
> http://l-i-e.com/artists.htm

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



Re: [PHP] hey dip shit

2005-05-18 Thread Rory Browne
> I didn't say anything about approval before delivery, and I really can't
> see how an active moderator would screw up the list.  You mean having
> someone around who can remove email addresses subscribed to the list
> that generate bounces would be a bad thing?  
Fair enough. That just wasn't my idea of moderation. My idea of
moderation would have been the prevention of something like this from
coming on to the list, which would have meant pre-approval.


> Someone that can remove
> email addresses that do nothing but generate auto responders?  Someone
> who can remove addresses which send out those stupid, 'verify you are
> not spam' emails?  Someone who can block spam?  

Are you volunteering?

> Sure, this post was
> harmless, but it's far from the only crap coming onto this list.
> 
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]
> 
> --
> 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] hey dip shit

2005-05-18 Thread Jochem Maas
John Nichel wrote:
Jason Barnett wrote:
John Nichel wrote:
Jason Motes wrote:
HAH
This list could really use an active moderator.
Did Mr. Nichel just volunteer for that task...
Hell, I'll do it...if there are no objections from the established list 
members (like that will happen ;)
John has my vote for what it's worth :-)

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


[PHP] Building array ?

2005-05-18 Thread Paul Nowosielski
HI All,

I'm trying to build an array of user id's. This is the code I've written
that does not work.

 
while($row=mysql_fetch_array($result)){
   // put user ID's into an array;
   $uidToAdmin .= array ("$row[user_id]");
 
   // for debugging
   echo "UID $row[user_id]";
   echo "AUID $uidToAdmin[0]";
}

So how can I continue adding to this array in the while loop?

TIA








-- 
Paul Nowosielski
Webmaster CelebrityAccess.com
303.440.0666 ext:219 

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



[PHP] Re: Sending a string with $_POST/$_GET

2005-05-18 Thread Luis
Ross wrote:
I want to write a string to a variable and use $_POST or $_GET to retrieve 
it on another page.

I keep gettting an undefined index errror. Can someone show me how this is 
done?

Do I have to use session_start() ?
or just use cookies:
setcookie('myvarname', 'some value');
and in the other page:
echo $_COOKIE['myvarname'];
will output 'some value'
regards
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] RSS news feed (slightly 0T)

2005-05-18 Thread Philip Hallstrom
Can anyone suggest a few places where i can get some decent
tech/programming/php news feeds?
I don't know if they have RSS feeds on them or not, but I'd try...
http://www.zend.com/
http://www.devshed.com/c/b/PHP/
http://www.phpbuilder.com/
And all or none of the sites listed here: http://www.php.net/links.php
-philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP and PayPal

2005-05-18 Thread Robert Meyer
Hello,

I am about ready to start my investigation into this matter, but thought I'd 
ask here first.

Here is the scenario I would like to implement.

1) User wants to buy a key that allows them to do a particular task on my 
web site.
2) I do not want to release the key to the user until payment is received.

Here is one way I would like it to work:

1) User fills out a form (user email address, etc.) then clicks the "Buy 
Key" button.
2) User, along with a link, unique ID (not Key), cost, and form data is sent 
to PayPal.
3) After PayPal receives full payment, PayPal sends user back to my site via 
the link and other data.
4) That link starts a script that confirms with PayPal that payment was made 
in full.
5) When confirmed, user is presented with key (can copy and paste) with 
option to have it emailed to them.

Another way I would like it to work:

1) User fills out a form (user email address, etc.) then clicks "Buy Key" 
button.
2) User, along with a link, unique ID (not Key), cost, and from data is sent 
to PayPal.
3) After PayPal receives payment, PayPal sends user an email with same data 
sent to it.
4) When user receives email, user clicks link containing Unique ID.
5) That link starts a script that confirms with PayPal that payment was made 
in full.
6) When confirmed, user is presented with key (can copy and paste) with 
option to have it emailed to them.

Thanks for your time.

Regards,

Robert

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



Re: [PHP] Re: why are session only working with cookies?

2005-05-18 Thread Brian V Bonini
On Mon, 2005-05-16 at 22:10, Richard Lynch wrote:
> Let him fight with phpIniDir some other day.

Something interesting maybe:
http://gfx.gfx-design.com/session_test.php
Hit your browsers refresh button.

I would think SID is NOT supposed to change with every page refresh..??

';
print_r($_SESSION);
echo "\nSession Id:" . session_id();
echo "\n" . strip_tags(SID);
echo '';
 
?>



-- 

s/:-[(/]/:-)/g


BrianGnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



[PHP] Responses in my email.

2005-05-18 Thread Robert Meyer
Hello,

When I post a question here, I get an email for every response posted.  I 
only want the response posted, not emailed to me.  The other newsgroups I 
belong to don't send me an email.  What are my options if any and how do I 
implement them?

Regards,

Robert

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



Re: [PHP] "From" in mail() header problem.

2005-05-18 Thread Philip Hallstrom
I¹ve written a simple script to send a mail out in HTML format to the
recipient. Everything is working fine... Except the ³From² header. The
recipient receives the email from ³World Wide Web Server <[EMAIL PROTECTED]>²
instead of what I have specified. Here¹s my code...

[snip]
$message = stripslashes($message);
mail($to,$subject,$message,'Content-type: text/html; charset=iso-8859-1;
From: SOMETHING <[EMAIL PROTECTED]>; Reply-To: [EMAIL PROTECTED];
MIME-Version: 1.0; X-Mailer: PHP/' . phpversion());
echo "It is done";
}
?>
... I don¹t know what I¹m doing wrong, it¹s not reading the FROM or Reply-TO
in the headers. Instead of the mail stating ³Something
<[EMAIL PROTECTED]>² at the recipient¹s end, it is stating ³World Wide
Web Server <[EMAIL PROTECTED]>² .. I have no clue why.
What happens if you do it like this:
$headers  = "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: SOMETHING <[EMAIL PROTECTED]>\r\n";
$headers .= "Reply-To: [EMAIL PROTECTED]";
$headers .= "MIME-Version: 1.0; X-Mailer: PHP/' . phpversion() . "\r\n";
mail($to,$subject,$message,$headers);
From the manual:

additional_headers (optional)
String to be inserted at the end of the email header.
This is typically used to add extra headers (From, Cc, and Bcc).
Multiple extra headers should be separated with a CRLF (\r\n).
Note: If messages are not received, try using a LF (\n) only.
Some poor quality Unix mail transfer agents replace LF by CRLF
automatically (which leads to doubling CR if CRLF is used). This should
be a last resort, as it does not comply with RFC 2822. 



Failing that, I'd check with the admin of your server.  Maybe they are
re-writing all outbound email with the *real* From header regardless of
what you put in there.
-philip
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Refresh (F5) adds another SQL record.

2005-05-18 Thread Robert Meyer
Hello to all that responded.

Thanks very much for your help.

I implemented and thoroughly tested the following:

header("Location: ".$_SERVER['PHP_SELF']);
exit;

And is works great for this particular need..

Regards,

Robert

"Robert Meyer" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hello,
>
> Scenario:
> 1) User is presented a blank form.
> 2) User fills in form.
> 3) User submits form.
> 4) Record is added to database.
> 5) Back to 1).
> All is fine to here.
> 6) User clicks refresh.
> 7) Another record is added, same data except auto-increment field.
> How do I prevent these last two steps, or at least prevent a record
> from being added when refresh is clicked?
>
> Regards,
>
> Robert 

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



Re: [PHP] Jakarta Tomcat and PHP

2005-05-18 Thread Evert | Rooftop
My guess would be looking for how to use PHP as a CGI in tomcat. So 
check out the manual for CGI stuff.

grt,
Evert
Chris Holden wrote:
Hi, I hope this is the right place to ask...
I am running Tomcat 5.5.7 (jdk 1.5) on Windows XP quite happily. I have
MySQL set up and that all works fine too. But I would also like to be able
to run PHP under Tomcat rather than having to install Apache to handle PHP
file and forward JSP requests to Tomcat... I'll only be doing some small
test pages in PHP but I really dont want to have to install another server.
I read on the Tomcat Wiki site that it *is* possible to connect PHP and
Tomcat, and I tried but got nowhere, I dont even get errors when opening
..php files!
I'd really appreciate it if someone could give me or point me in the
direction of an idiots guide to getting PHP working with Tomcat. I've gone
through every result from google to no avail :(
Cheers,
Chris.
 

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


Re: [PHP] PHP Applications?

2005-05-18 Thread Evert | Rooftop
Chris Shiflett wrote:
Danny Brow wrote:
> Zend sells a compiler to speed up your PHP code. Since it's compiled,
> it also does not contain the source code in readable form. You should
> visit the Zend website.
Any free ones?

http://pecl.php.net/package/APC
APC won't work for me, segmentation faults all around =( suprisingly 
this doesn't occur the first time I load a page, only the second time !

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


Re: [PHP] Basic PHP/HTML code question

2005-05-18 Thread Michael Satterwhite
Carlos Palomino wrote:
Hi,
I have been trying to write or find a pre-written script of a combo-box which would 
allow one to select a category from one drop-down list, then be given related options 
within a secondary list before clicking a submit button.  Is there anyone who knows 
where I can find this or an easy way to accomplish this in PHP?
Sorry if this is a basic question but I have only begun learning coding PHP so some 
items are foreign at this point.  Thanks for your understanding and any assistance.
PHP executes on the server, so you have to send the form to the server. 
The easiest way I know of to do this is to add

onChange="document..submit();"
to the  tag (obviously, change  to the name of the 
form in question.

When the form reloads, use the selected item in the first combo box to 
select the items to fill the second combo box.

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


Re: [PHP] server taking long time to make graph

2005-05-18 Thread Philip Hallstrom
I am making graph in PHP using JPGRAPH. I am not taking big data, my data is 
only 48 points.   Through TOP command in linux, I found that httpd is taking 
lot of time to make the simple x-y graph.   I found that the graph size is 
47.75kb only. 
May pls suggest if any  setting needs to be done in PHP / APACHE etc. to make 
it fast
I haven't used jpgraph much, but I seem to remember reading somewhere in 
its documentation that if you are anti-aliasing the graph it will take a 
lot longer to generate.

Maybe that's it?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] "From" in mail() header problem.

2005-05-18 Thread Chris
Rahul S. Johari wrote:
Ave,
I¹ve written a simple script to send a mail out in HTML format to the
recipient. Everything is working fine... Except the ³From² header. The
recipient receives the email from ³World Wide Web Server <[EMAIL PROTECTED]>²
instead of what I have specified. Here¹s my code...



Hi,

You have recieved a new file in the Something File Manager, with the
following details:

Name: One
Size: 94685 Bytes
Description: $desc
Date: $now

Please visit SOMETHING File Manager to login to your account and
download the file.
This is an automated notification email. Please do not reply to this email.

Regards,
SOMETHING

";
$message = stripslashes($message);
mail($to,$subject,$message,'Content-type: text/html; charset=iso-8859-1;
From: SOMETHING <[EMAIL PROTECTED]>; Reply-To: [EMAIL PROTECTED];
MIME-Version: 1.0; X-Mailer: PHP/' . phpversion());
echo "It is done";
}
?>
 

Those should not be separated by semicolons (;) , you should use \r\n. So...
mail($to,$subject,$message,"Content-type: text/html\r\ncharset=iso-8859-1\r\nFrom: 
SOMETHING <[EMAIL PROTECTED]>\r\nReply-To: [EMAIL PROTECTED]: 1.0\r\nX-Mailer: PHP/" 
. phpversion());
echo "It is done";

... I don¹t know what I¹m doing wrong, it¹s not reading the FROM or Reply-TO
in the headers. Instead of the mail stating ³Something
<[EMAIL PROTECTED]>² at the recipient¹s end, it is stating ³World Wide
Web Server <[EMAIL PROTECTED]>² .. I have no clue why.
Thanks,
Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180
Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: [EMAIL PROTECTED]
http://www.informed-sources.com
 

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


[PHP] Re: Basic PHP/HTML code question

2005-05-18 Thread Matthew Weier O'Phinney
* Carlos Palomino <[EMAIL PROTECTED]>:
> I have been trying to write or find a pre-written script of a
> combo-box which would allow one to select a category from one
> drop-down list, then be given related options within a secondary list
> before clicking a submit button.  Is there anyone who knows where I
> can find this or an easy way to accomplish this in PHP?

PHP can generate the data for the drop-downs, but to do what you want to
do, you're going to need to use javascript (which operates at the
client, i.e. browser, level). Google for javascript solutions to this,
and I'm sure you'll have no problem finding something.

> Sorry if this is a basic question but I have only begun learning
> coding PHP so some items are foreign at this point.  Thanks for your
> understanding and any assistance.

The trick is learning what falls in the realm of PHP, what falls under
the HTML/CSS umbrella, and what falls under the javascript umbrella.
Rule of thumb:

* If it's display related, it's HTML/CSS
* If it has to happen before a request is made, it's Javascript
* If it happens in response to a request, it's PHP

Good luck!

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



Re: [PHP] Help with using SPL to build a MySQL Iterator

2005-05-18 Thread Chris
V Kam wrote:
Hello all
I was trying to write an SPL Iterator for a MySQL
result set but not having any luck. Specifically I'm
not sure how to overload the key() and current/next()
methods. 

Does anyone here have a working code sample that does
this, or can offer some guidance on how to overload
the 5 Iterator methods? Any assistance much
appreciated!
Thanks!
I just put all the code that retrieves the data in the next() function. 
current() and key() just return the variables that next populated.

Don't know what else to say.
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] hey dip shit

2005-05-18 Thread John Nichel
Jason Barnett wrote:
John Nichel wrote:
Jason Motes wrote:
HAH
This list could really use an active moderator.
Did Mr. Nichel just volunteer for that task...
Hell, I'll do it...if there are no objections from the established list 
members (like that will happen ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] directory listing from text file

2005-05-18 Thread dreiph
Thank you Chris,

but this is not I needed.

Let me explain my situation.

I have a big server with a lot of audio files, working within LAN, with
Windows 2000 Pro on it. Let's call it as "FileServer". Also I have another
server with Apache2 and PHP installed, windows 2000 PRO too, let's say it is
"WebServer". Web Server is standalone with two NIC cards, firewall, etc. I
don't want to make Fileserver be accessible form Internet.

The problem is that PHP and/or Apache on WebServer does not understand
mapped drives from a FileServer, so readdir() or opendir() is not working
correctly, by the way, it looks like Windows "dir" command works a little
bit faster than readdir();

It take me some time to play with simple Windows command line utility, to
get directory listing on FileServer and deliver plain text file to a
WebServer. Command line was the following:

exec('cmd /c dir /b /s /d /a:d \\\FileServer\\audiofiles > audiofiles.txt');

$hi = fopen("audiofiles.txt", "r");
$line = fread($hi,filesize("audiofiles.txt"));
fclose($hi);
$line=explode("\n", $line);


At this point I've got FileServer directories [only directories, not files!]
scanned into file audiofiles.txt and this file was written to a WebServer.
So, I have plain text file with correct directory structure, including
subdirectories.

The problem is, that "dir" command in Windows command prompt scans
directories in weird format - each directory in new line, eg:

\first
\second
\second\first
\second\second
\third

I immagine, to show directory tree, I need to make some like array in PHP,
and I think, this should be a recursive function [could not find out how to
write it]. So final variable should be array like this:

$directories = Array('\\first', '\\second" => Array('\\first', '\\second'),
'\\third');

How??

Thanks,

Bye, Dreiph


"Chris Ramsay" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Dreiph,

If you're familiar with PEAR, take a look at this:

http://pear.php.net/package/HTML_TreeMenu

regards

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



[PHP] Re: RSS news feed (slightly 0T)

2005-05-18 Thread Matthew Weier O'Phinney
* Ryan A <[EMAIL PROTECTED]>:
> Can anyone suggest a few places where i can get some decent
> tech/programming/php news feeds?

http://planet-php.net/

Planet PHP is an aggregation of newsfeeds from PHP developers and
programmers. Not everything will necessarily be programming or PHP
oriented, but most of it will be. If nothing else, it will turn you
towards other newsfeeds that might be of interest.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



Re: [PHP] hey dip shit

2005-05-18 Thread John Nichel
Rory Browne wrote:
This list could really use an active moderator.

Um no. You can't moderate what's already in peoples mailboxes, and if
you're going to have all posts manually approved before delivery, then
you're going to seriously affect the responsiveness of the list.
Besides that post was harmless, was apologised for, and in the grand
scheme of things isn't that big of a deal. Definatly not something to
screw up the list with moderation over.
I didn't say anything about approval before delivery, and I really can't 
see how an active moderator would screw up the list.  You mean having 
someone around who can remove email addresses subscribed to the list 
that generate bounces would be a bad thing?  Someone that can remove 
email addresses that do nothing but generate auto responders?  Someone 
who can remove addresses which send out those stupid, 'verify you are 
not spam' emails?  Someone who can block spam?  Sure, this post was 
harmless, but it's far from the only crap coming onto this list.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] version difference or server difference?

2005-05-18 Thread Jay Blanchard
[snip]
Why does a Win2K installation of PHP honor max_input_time and a FreeBSD
machine does not?

I am running version 5.0.0b2-dev on the windows
machine and version 4.3.10 on the BSD machine would the version
difference cause this problem?
[/snip]

According to http://us3.php.net/ref.info max_input_time has been
available since 4.3.0

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



[PHP] RSS news feed (slightly 0T)

2005-05-18 Thread Ryan A
Hey,

Can anyone suggest a few places where i can get some decent
tech/programming/php news feeds?

I presently have the PHP.net feed (but its not too good because the news
does not change much in days)
and I am using yahoo's feeds for "software", "digital music" and "internet".

I was using slashdot, but the articles are generally really small, and its
more of a forum based...but worst of all
their feed is having problems and sometimes i get it (i cache the feed and
update every 8 hours) sometimes i dont
get it.

To be fair, taking into consideration the above categories please try to
refrain from posting your own feed unless
you think it would really help me.

Also cc the list your answer coz it would help if not everyone told me to
check out site "x"
:-),
i'll reply to the list and you.

Thanks in advance,
Ryan



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 5/17/2005

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



Re: [PHP] Basic PHP/HTML code question

2005-05-18 Thread tg-php
Since PHP is server-side, it's probably not the best option for doing what 
you're describing.  It IS possible to use a javascript "onchange" event and use 
that to trigger a new page load which would change your second select box, but 
that's kind of slow and sloppy and should probably only be used when your 
select boxes have a LOT of data or can change a lot necessitating a database 
lookup on whatever you selected in the first box.

It sounds like what you want to do would best be done in javascript totally.   
Use PHP to build the javascript code that has all the options and then use code 
like the stuff found in Example 1 on:

http://www.mattkruse.com/javascript/dynamicoptionlist/


Technically this message is "off topic" and I'm sure someone will say something 
about it, but I hope people remember when they were starting out in PHP and 
weren't sure what it could and couldn't do and remember that asking questions 
like this is part of the learning process.

Best of luck Carlos!

-TG




= = = Original message = = =

Hi,

I have been trying to write or find a pre-written script of a combo-box which 
would 
allow one to select a category from one drop-down list, then be given related 
options 
within a secondary list before clicking a submit button.  Is there anyone who 
knows 
where I can find this or an easy way to accomplish this in PHP?
Sorry if this is a basic question but I have only begun learning coding PHP so 
some 
items are foreign at this point.  Thanks for your understanding and any 
assistance.

C.


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



[PHP] Reprocessing text

2005-05-18 Thread Michael Satterwhite
I have a site that extracts HTML page code from a database and prints it
to the page being generated. A user has requested that I allow this text
to be dynamic. I can code process functions for the code that I pull
from the database, but it would be so much better if I could simply get
PHP to process the text for me.
Does anyone know a way to cause this to happen?
tia
---Michael
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] "From" in mail() header problem.

2005-05-18 Thread Rahul S. Johari
Ave,

I¹ve written a simple script to send a mail out in HTML format to the
recipient. Everything is working fine... Except the ³From² header. The
recipient receives the email from ³World Wide Web Server <[EMAIL PROTECTED]>²
instead of what I have specified. Here¹s my code...





Hi,

You have recieved a new file in the Something File Manager, with the
following details:

Name: One
Size: 94685 Bytes
Description: $desc
Date: $now

Please visit SOMETHING File Manager to login to your account and
download the file.
This is an automated notification email. Please do not reply to this email.

Regards,
SOMETHING

";
$message = stripslashes($message);
mail($to,$subject,$message,'Content-type: text/html; charset=iso-8859-1;
From: SOMETHING <[EMAIL PROTECTED]>; Reply-To: [EMAIL PROTECTED];
MIME-Version: 1.0; X-Mailer: PHP/' . phpversion());
echo "It is done";
}
?>

... I don¹t know what I¹m doing wrong, it¹s not reading the FROM or Reply-TO
in the headers. Instead of the mail stating ³Something
<[EMAIL PROTECTED]>² at the recipient¹s end, it is stating ³World Wide
Web Server <[EMAIL PROTECTED]>² .. I have no clue why.

Thanks,

Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180

Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: [EMAIL PROTECTED]
http://www.informed-sources.com



Re: [PHP] hey dip shit

2005-05-18 Thread Jason Barnett
John Nichel wrote:
Jason Motes wrote:
HAH
This list could really use an active moderator.
Did Mr. Nichel just volunteer for that task...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] server taking long time to make graph

2005-05-18 Thread Jason Barnett
Balwant Singh wrote:
Hi
I am making graph in PHP using JPGRAPH. I am not taking big data, my 
data is only 48 points.   Through TOP command in linux, I found that 
httpd is taking lot of time to make the simple x-y graph.   I found that 
the graph size is 47.75kb only.  
May pls suggest if any  setting needs to be done in PHP / APACHE etc. to 
make it fast

If you really want to make that script go fast then you might try 
contacting Johann directly.  He has both public / commercial versions 
and I'm willing to bet that the commercial version is faster than the 
public one.  That being said, the best way to improve performance is to 
cache the graph.

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


  1   2   >