[PHP] Re: readdir behavior I cannot understand

2004-09-20 Thread Jason FB
Greg-
Hey, thanks.
Yea I suppose I am relatively new to PHP, been working with for about 
a year and a half now, so sometimes there are gaps in my knowledge, 
like this one. I'm fairly good at different debugging techniques, but 
I get this error when I run the script from the manual which is why 
I'm so confused by it.

T_ECHO is echo.  there's no echo anywhere near to line 6 - are 
you sure that 
D:\Inetpub\wwwroot\imagesexotic\Fall04\admin\check_set.php is the 
file you posted to the php-general list?

No,  I must be confusing everybody like nuts. The actual first two 
lines of my LOCAL copy is

$root_dir = /Users/jason/Sites/;
$folder_on_server  = ;
NOT the one I had posted-- that was from my server copy. Actually the 
error message I get when I run it locally is

Parse error: parse error, unexpected T_ECHO in 
/Users/jason/Sites/images_exotic/REDESIGN2 FALL 
04/admin/check_set_local.php on line 8

It comes out T_PRINT when I changes the echo to print -- which 
is more like line 4.

I was only testing it on two servers in the off chance that it was a 
versioning and/or windows ISS/apache problem -- but it did not appear 
to be either.

The LOCAL script I am working with is as follows:
?php
// Note that !== did not exist until 4.0.0-RC2
$root_dir = /Users/jason/Sites/;
$folder_on_server  = ;
if ($handle = opendir($root_dir . $folder_on_server)) {
echo Directory handle: $handle\n;
echo Files:\n;
 /* This is the correct way to loop over the directory. */
 while (false !== ($file = readdir($handle))) {
echo $file\n;
}
 closedir($handle);
 }
?
Do you see the same parse error (T_ECHO) as described above?  I think 
the problem has to do with how I've used opendir() maybe-- but I 
guess I'm asking for help because the manual seems to have incomplete 
or inaccurate information I was wondering if anyone else had seen 
this before.

Thanks again for your help
-Jason-


What I would look for first is check every line - make sure it 
concludes with a ;

Also, don't start out by trying the same script on two servers.  The 
script is simple enough, you should get it working in a closed 
environment first, and then try it elsewhere.  This should cut down 
on the WTF factor quite a bit :)

General debugging rules:
1) on any parse error make sure every line near the line number ends with ;
2) make sure that when you type if (blah) { you type } before you 
fill in the details.  The same goes for every control structure
3) don't use if/while/for/foreach without {} and you'll save trouble 
down the line
4) familiarize yourself with the list of tokens - it will help a lot 
in understanding what the parser is telling you.

http://us4.php.net/manual/en/tokens.php
Other than that, I also find tricky parse error bugs by deleting 
lines, then adding them back in one by one until the parse error 
returns.

The most useful debugging tool I've found is Zend IDE.  You can get 
a free personal license that will disable some of the niftier 
features, but you will get the on-the-fly php validation which is 
REALLY useful. The bar along the right will have little red lines at 
every single parse error.  It's brilliant.  Plus you can step 
through the scripts, which is unmeasurably useful for learning the 
language.

Greg



Re: [PHP] PHP5 Book Recommendation?

2004-09-20 Thread Justin French
Thanks to everyone for their input -- my Amazon wishlist is a lot 
fatter right now :)

---
Justin French
http://indent.com.au
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] List Etiquette

2004-09-20 Thread Octavian Rasnita

- Original Message - 
From: John Nichel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 20, 2004 7:06 AM
Subject: Re: [PHP] List Etiquette


 Octavian Rasnita wrote:
 snip
  In other words it's easier for you to reach your Delete key when you top
  post than when you bottom post ???
  --
 
  Ok, I have bottom posted, and have trimmed the end of the message. But
this
  was a little text only, while the header of this message is still there,
and
  it is bigger.
  Well, I said that is harder to delete the head of the message and then
go to
  the end and delete the tail also.
  That's why is easier to trim the message when top posting.
 
  It would be easier for everyone if everyone would use Outlook Express
and
  not many other email clients that use a different style of headers they
put
  in the message, or that put the cursor in other positions by default.
 
  But most users use Outlook Express as the email client, and not other
  programs...
  And this not only because it is included by default in Windows, but
because
  for some features it is the best program, like the accessibilitty for
the
  blind for example.

 Most use Outlook or Outlook Express?  I think you'd be hard pressed to
 find _most_ users of a mailing list which deals with something in the
 Open Source Community (like php) using a Microsoft mailer.  Most of the
 newbies, probably; but the people who are on this list, day in and day
 out, are more than likely not...even if they are using a Microsoft OS.
 However, the, my mail client puts the cursor at the top is still a
 pretty weak reason to top post.



Why is it a pretty weak reason? I found it a very big one.
You don't know how easy is to use an email client when you can't read but
just listen to a robotic voice made by the computer. ...or you probably
don't care. Well, in that case, why should I care that you don't like top
posting?

See, I have bottom posted this time. So? The trimmed part at the end of the
message is much smaller than the one from the top of the message, so bottom
posting doesn't help trimming the message as you said.

Teddy

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



Re: [PHP] List Etiquette

2004-09-20 Thread Jason Davidson
are we still on top posting.. shessh. i only top post cuase im lazy...

J

Octavian Rasnita [EMAIL PROTECTED] wrote: 
 
 
 - Original Message - 
 From: John Nichel [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, September 20, 2004 7:06 AM
 Subject: Re: [PHP] List Etiquette
 
 
  Octavian Rasnita wrote:
  snip
   In other words it's easier for you to reach your Delete key when you top
   post than when you bottom post ???
   --
  
   Ok, I have bottom posted, and have trimmed the end of the message. But
 this
   was a little text only, while the header of this message is still there,
 and
   it is bigger.
   Well, I said that is harder to delete the head of the message and then
 go to
   the end and delete the tail also.
   That's why is easier to trim the message when top posting.
  
   It would be easier for everyone if everyone would use Outlook Express
 and
   not many other email clients that use a different style of headers they
 put
   in the message, or that put the cursor in other positions by default.
  
   But most users use Outlook Express as the email client, and not other
   programs...
   And this not only because it is included by default in Windows, but
 because
   for some features it is the best program, like the accessibilitty for
 the
   blind for example.
 
  Most use Outlook or Outlook Express?  I think you'd be hard pressed to
  find _most_ users of a mailing list which deals with something in the
  Open Source Community (like php) using a Microsoft mailer.  Most of the
  newbies, probably; but the people who are on this list, day in and day
  out, are more than likely not...even if they are using a Microsoft OS.
  However, the, my mail client puts the cursor at the top is still a
  pretty weak reason to top post.
 
 
 
 Why is it a pretty weak reason? I found it a very big one.
 You don't know how easy is to use an email client when you can't read but
 just listen to a robotic voice made by the computer. ...or you probably
 don't care. Well, in that case, why should I care that you don't like top
 posting?
 
 See, I have bottom posted this time. So? The trimmed part at the end of the
 message is much smaller than the one from the top of the message, so bottom
 posting doesn't help trimming the message as you said.
 
 Teddy
 
 -- 
 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] readdir behavior I cannot understand

2004-09-20 Thread Jason Wong
On Monday 20 September 2004 11:44, Jason FB wrote:

 Hereis my script, I copied and pasted Example 1 from this page:

 http://us4.php.net/manual/en/function.readdir.php


 You will see that the only way that I changed I initialize two
 variables at the very top that set the directory of the directory to
 open. The script should read the contents of the directory and print
 them to the resulting page.

 Instead, it returns a the following parse error

 Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in
 /Users/jason/Sites/images_exotic/REDESIGN2 FALL
 04/admin/check_set_local.php on line 4

If you did literally copy and pasted the code from the manual then that's 
probably what's causing the problem. Sometimes c  p from say a browser can 
introduce spurious characters into your code (usually the TAB character I 
think). Try *typing* in the code.

-- 
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
--
/*
If the master dies and the disciple grieves, the lives of both have
been wasted.
*/

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



Re: [PHP] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Jason Wong
On Monday 20 September 2004 10:11, Afan Pasalic wrote:

 I have right now on my server php 4.3.4 without GD2 support. Actually,
 doesn't have GD support at all (nothing on phpinfo(); ).
 How can I turn it on? :)

You can try performing an erotic dance in front of it or you can read manual  
Image Functions.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
YOW!!!  I am having fun!!!
*/

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



[PHP] problem with header-dispotition in IE

2004-09-20 Thread adwinwijaya
Hi all ...


I have script that looks like :

if(file_exists($filename)){
  $len = filesize($filename);
  //header(Content-type: attachment/pdf);
  header('Content-Type: application/pdf');
  //header(Content-Type: application/octet-stream);
  header(Content-Type: application/force-download);
  header(Content-Length: $len);
  
   if(preg_match(/MSIE/, $_SERVER[HTTP_USER_AGENT])){
header(Content-Disposition: attachment; 
filename=.$name..pdf,pdf);
   }else
   {
header(Content-Disposition: attachment; 
filename=.$name..pdf,pdf);
   }  
  
  //header(Content-Disposition: attachment; 
filename=personal_inventory_forms.pdf);
  readfile($filename);
} else
{   
echo $filename ; 
echo ' ERROR :  file is not exist' ;
}

This script works very well on Mozilla, Opera and Safari..but doesnt
work with IE. can someone help me to solve this problem ?

thx


-- 
Best regards,
adwin
www.kuya-kuya.net
There is a story living in us that speaks of our 
place in the world. 
It is a story that invites us to love what we love 
and simply be ourselves.

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



Re: [PHP] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Niklas Lampén
I vote for the first option. xD
Niklas
Jason Wong wrote:
On Monday 20 September 2004 10:11, Afan Pasalic wrote:

I have right now on my server php 4.3.4 without GD2 support. Actually,
doesn't have GD support at all (nothing on phpinfo(); ).
How can I turn it on? :)

You can try performing an erotic dance in front of it or you can read manual  
Image Functions.

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


Re: [PHP] math in PHP

2004-09-20 Thread Hatem Ben Yacoub
?php
 $var = 1+1+1+1;
 eval(echo $var;); // return 4

// OR

 eval(\$res = $var;);
echo $res; // return 4 also ...
?

-Hatem

- Original Message - 
From: Whitehawk Stormchaser [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, September 18, 2004 11:15 PM
Subject: [PHP] math in PHP


 Hi!
 I have been trying to make some sort of calculator in PHP, but I have
stumbled
 on a problem... I have been make some kind of dynamical calculator, unlike
 most I have seen, that had $value1 [math operator] $value2 strict, but a
 calculator, that can calculate basically anything ( even something like
 (5*(8-3)+2*(4-1))^3 ), and can be put in as string variable...

 I have tried things like this:

 $var = 1+1+1+1;
 echo $var + 0; //returns 1

 or

 $var = 1+1+1+1;
 echo eval(\$var;); //returns blank

 or

 $var = 1+1+1+1;
 echo (int) $var; //returns 1

 things like that...

 Now my question is: is it possible to calculate the value of the string
 somehow?

 Thanks. Stormy.

 -- 
 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] problem with header-dispotition in IE

2004-09-20 Thread Marek Kilimajer
adwinwijaya wrote:
Hi all ...
I have script that looks like :
if(file_exists($filename)){
  $len = filesize($filename);
  //header(Content-type: attachment/pdf);
  header('Content-Type: application/pdf');
  //header(Content-Type: application/octet-stream);
  header(Content-Type: application/force-download);
  header(Content-Length: $len);
  
   if(preg_match(/MSIE/, $_SERVER[HTTP_USER_AGENT])){
header(Content-Disposition: attachment; filename=.$name..pdf,pdf);
   }else
   {
header(Content-Disposition: attachment; filename=.$name..pdf,pdf);
   }  
  
  //header(Content-Disposition: attachment; filename=personal_inventory_forms.pdf);
  readfile($filename);
} else
{   
echo $filename ; 
echo ' ERROR :  file is not exist' ;
}

This script works very well on Mozilla, Opera and Safari..but doesnt
work with IE. can someone help me to solve this problem ?
I suppose you are trying to force IE to download the pdf file, but it is 
always displaying it - you did not tell what is your problem.

IE determines the type of file from the extension, if it is a known 
extension it ignores the content-type header. You might want to try 
adding space char after the filename, I've heard it works.

PS: Second param to header should be bool
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] follow-up readdir behavior I cannot understand

2004-09-20 Thread Marek Kilimajer
Jason FB wrote:
PHP General List,
Regarding my the previous post -- the script had another bug in it which 
I felt silly for having posted since it's so obvious at the very top (a 
misisng = sign).

However, I am still having a problem with this script practically copied 
and pasted from the PHP manual.

The revised script is below, the parse error I am actually seeing now 
after adding the = sign is as follows:

 Parse error: parse error, unexpected T_ECHO in 
D:\Inetpub\wwwroot\imagesexotic\Fall04\admin\check_set.php on line 6

Thanks...
-JFB-
?php
// Note that !== did not exist until 4.0.0-RC2
$root_dir = /Users/jason/Sites/;
$folder_on_server  = ;
This is line 6 . The closest echo statement is couple lines below. 
Please COPY and PASTE your actual code, DO NOT retype it. You can 
introduce errors that are not in your original code, or fix it like this 
time.


if ($handle = opendir($root_dir . $folder_on_server)) {
print Directory handle: $handle\n;
print Files:\n;
 /* This is the correct way to loop over the directory. */
 while (false !== ($file = readdir($handle))) {
echo $file\n;
}
 closedir($handle);
 }
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Media file browser cache question --- second try

2004-09-20 Thread Marek Kilimajer
Daniel Guerrier wrote:
I'm using this code to dynamically retrieve windows
media files and send it to the browser.  I thought the
cache header would prevent the file from being cached.
The only problems is the .wmv file still ends up in my
IE temp files folder.  How can I prevent this from
happening?
The headers have influence on the asx file, .wmv files are served by the 
webserver (no php involved) and the webserver doesn't send no-cache headers.

You need to either:
1. Configure webserver to send the right headers for .wmv files.
2. Use php to send .wmv files, you can then send the headers from php

?php
require_once(../admin/constant.php);
header(Content-Type: video/x-ms-wmv);
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .
 GMT);
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);
header(Cache-Control: no-store, no-cache,
must-revalidate); 
header(Cache-Control: post-check=0, pre-check=0,
false);
header(Pragma: no-cache);
$file = DATAURL . /media/ . $_GET['mediafile'];
?
ASX VERSION=3.0
ENTRY
REF HREF =?php echo $file; ? /
/ENTRY
/ASX
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: How can I re-code?

2004-09-20 Thread Marek Kilimajer
John Taylor-Johnston wrote:
No one?
Noone knows the structure of your table. Is the table properly 
normalized? From the original array it seems you need at least 2 tables 
to properly hold the information.


I had an $array, with a list of authors and an entry number. Below is the code I used. 
Now I
have compiled it all into a table. I don't know how to re-code these lines:
foreach (array_count_values ($authors) as $author=$count)
foreach ($author_list[$author] as $ausid)
---new code---
$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);
$news = mysql_query(select ccl_id,AUS from $table ORDER by AUS);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Yet another Apache 2 question

2004-09-20 Thread Duncan Maitland
I'm currently using a PHP/Apache 2.0 (prefork) combination which seems to be 
running reasonably well, however I've just become familiar with the 
potential issues with PHP/Apache 2.0 so I intend to roll back to Apache 1.3 
some time soon.

I have a question about a particular error I have received with this setup:

Many of the virtual hosts on my server have custom php_value settings. A 
user has reported that a particular error occurred in a PHP script, and the 
message indicated to me that the script had actually been loaded as if it 
were in another virtual host (ie. the specific php_value settings for the 
other virtual host were loaded instead).

Both the user and I have never been able to replicate it and I have received 
no reports of similar errors. Could this be one of those unpredictable 
errors which the FAQ describes, or could this be attributed to some other 
problem?

If anyone could shed some light on this it would be much appreciated!

Many thanks,
Duncan. 

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



Re: [PHP] Yet another Apache 2 question

2004-09-20 Thread Jason Wong
On Monday 20 September 2004 18:57, Duncan Maitland wrote:

 I have a question about a particular error I have received with this setup:

 Many of the virtual hosts on my server have custom php_value settings. A
 user has reported that a particular error occurred in a PHP script, and the
 message indicated to me that the script had actually been loaded as if it
 were in another virtual host (ie. the specific php_value settings for the
 other virtual host were loaded instead).

There was a thread way back which discussed something similar. Not sure what 
the conclusion was and not sure what keywords you would have to search for to 
find that thread.

-- 
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
--
/*
Work smarter, not harder, and be careful of your speling.
*/

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



Re: [PHP] List Etiquette

2004-09-20 Thread - Edwin -
Hi,

(I know a lot has already been said but...)

On Sat, 18 Sep 2004 17:37:59 -0400
Andre Dubuc [EMAIL PROTECTED] wrote:

 Hi,
 
 After googling 'Web Etiquette, Top Posting', I still am
 puzzled why some people on this list insist that top
 posting is bad form, rather than personal preference. The
 arguments seem to be balanced on either side.

Let me just point out that it's NOT only on *this* list but 
even in others (that I'm subscribed to) most prefer that 
people bottom post AND trim as much as possible.

[...]

-- 
- E -
copperwalls was here ;)

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



Re: [PHP] List Etiquette

2004-09-20 Thread - Edwin -
On Sun, 19 Sep 2004 06:11:17 +0800
Jason Wong [EMAIL PROTECTED] wrote:

 On Sunday 19 September 2004 05:37, Andre Dubuc wrote:

[...]

  Seems to me much easier to scan the Subject, see how it's
  developing by reading the reply on the top, rather than
  have to wade through even snipped old material.
 
 And if you jumped into the middle of the thread, how would
 you know what was going on without scrolling down to find
 out?

Just want to add/emphasize one thing regarding this point:
When I try to find out something, I usually spend time 
googling and reading the archives, it's really quite 
annoying to read/scroll from bottom to top--this is not how
people learned to read. (At least, I hope not :)

Also, it's good that we're not writing programs from bottom 
to top as well... imagine that! (That'd worst than spaghetti
code ;)

?

}
  echo 'Please trim your post(s). Thanks!';
} else {
  echo 'You trimmed your post(s). Thanks!';
if ($trimmed) {

php?

-- 
- E -
copperwalls was here ;)

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



Re: [PHP] List Etiquette

2004-09-20 Thread - Edwin -
Hi,

On Mon, 20 Sep 2004 04:01:47 +0300
Octavian Rasnita [EMAIL PROTECTED] wrote:
 My email client (Outlook Express) puts a lot of information
 at the top of the message automaticly, like:
 
 The signature,
 --- original message ---
 The From line
 - The to line
 - The date line
 - The subject line.

There should be a way to customize that, no?

[...]

-- 
- E -
copperwalls was here ;)

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



Re: [PHP] PHP5 Book Recommendation?

2004-09-20 Thread - Edwin -
FWIW...

On Sat, 18 Sep 2004 14:46:37 -0700 (PDT)
Chris Shiflett [EMAIL PROTECTED] wrote:

 --- Justin French [EMAIL PROTECTED] wrote:
  Can someone recommend a decent PHP5 book?
 
 I think Upgrading to PHP 5 is a particularly good book:
 
 http://www.oreilly.com/catalog/upgradephp5/

+1 on this--reading halfway through it now.

-- 
- E -
copperwalls was here ;)

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



[PHP] Creating Dropdown Menus From Tables

2004-09-20 Thread Harlequin
Hi all.

Hoping this might be relatively easy...

I'm wondering if I can create a dropdown menu (optionABCDE/option) by 
using a select statement and then populating this using PHP...?

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
- 

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



Re: [PHP] List Etiquette

2004-09-20 Thread - Edwin -
Hi Jason,

On Sun, 19 Sep 2004 23:42:09 -0700
Jason Davidson [EMAIL PROTECTED] wrote:

 are we still on top posting.. shessh. i only top post cuase
 im lazy...

Maybe we should talk about one-liners next time...

Anyway, I'm sure many people will appreciate it if you trim
your posts.

Thanks!

-- 
- E -
copperwalls was here ;)

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



Re: [PHP] List Etiquette

2004-09-20 Thread Peter Risdon
- Edwin - wrote:
On Sun, 19 Sep 2004 06:11:17 +0800
Jason Wong [EMAIL PROTECTED] wrote:
On Sunday 19 September 2004 05:37, Andre Dubuc wrote:
[...]
Seems to me much easier to scan the Subject, see how it's
developing by reading the reply on the top, rather than
have to wade through even snipped old material.
This is certainly true for some active subscribers to this and many 
other lists. But it isn't the point.

And if you jumped into the middle of the thread, how would
you know what was going on without scrolling down to find
out?

Just want to add/emphasize one thing regarding this point:
When I try to find out something, I usually spend time 
googling and reading the archives, 
This is the point.
Note that pro top-posters generally say it's more convenient for them 
whereas people who advocate appropriate posting (normally threaded, 
sometimes bottom, rarely top) say it works better when using the posts 
as a reference.

If you google for a solution before wasting the time of volunteers over 
a frequently answered question, and choose the concluding post in a 
relevant thread, it's a far better reference if some discipline has been 
observed while the thread has been developing. The point of lists like 
this is twofold - to answer questions now and to provide a reference 
archive for the future.

Top posters seem to neglect this aspect entirely in favour of immediate 
personal convenience. And even that is arguable. The conventional reply 
on this topic is along the lines of:

Because it destroys the flow of an argument.
Why is top posting bad?
Peter.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Creating Dropdown Menus From Tables

2004-09-20 Thread - Edwin -
On Thu, 16 Sep 2004 13:02:31 +0100
Harlequin [EMAIL PROTECTED] wrote:

 Hi all.
 
 Hoping this might be relatively easy...
 
 I'm wondering if I can create a dropdown menu
 (optionABCDE/option) by using a select statement and
 then populating this using PHP...?

Yes.

Hint: Do a foreach on the result (of the query) then 
inside the loop, just do an 

  echo option$value/option; 

or something like that.

-- 
- E -
copperwalls was here ;)

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



Re: [PHP] Yet another Apache 2 question

2004-09-20 Thread Marek Kilimajer
Duncan Maitland wrote:
I'm currently using a PHP/Apache 2.0 (prefork) combination which seems to be 
running reasonably well, however I've just become familiar with the 
potential issues with PHP/Apache 2.0 so I intend to roll back to Apache 1.3 
some time soon.

I have a question about a particular error I have received with this setup:
Many of the virtual hosts on my server have custom php_value settings. A 
user has reported that a particular error occurred in a PHP script, and the 
message indicated to me that the script had actually been loaded as if it 
were in another virtual host (ie. the specific php_value settings for the 
other virtual host were loaded instead).

Both the user and I have never been able to replicate it and I have received 
no reports of similar errors. Could this be one of those unpredictable 
errors which the FAQ describes, or could this be attributed to some other 
problem?

If anyone could shed some light on this it would be much appreciated!
I think yes, it is one of those problems. It should occur only with 
worker multi-processing module that uses threads to serve requests. You 
should revert back to prefork module. Check 
http://httpd.apache.org/docs-2.0/mpm.html

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


RE: [PHP] mysql_connect does not connect

2004-09-20 Thread Jay Blanchard
[snip]
I definitely mind. I don't believe in rewarding bad behavior. It is
reasonable to contribute to the productive development of solutions, but
the attitude in this group is not productive. I have the impression that
the 
real reason you want answers is so that you can continue in unproductive
directions.
[/snip]


Sam,

You have nmentioned the word 'insistance' many times in this thread, and
the only one I found to be obstinate about things is you. Continue in
unproductive directions? What is that about, sport? Rewarding bad
behavior? Regardless of the fact that there might be several who could
benefit from the solution (who had nothing to do with the folks you are
so against right now) you are now the one exercizing unproductive
behavior.

JB

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



Re: [PHP] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Afan Pasalic
Ha, ha, ha (sarcastic...)
10 points for Jason and Niklas.
Guys, please, if you don't want to help - keep your stupid comments for
yourself. This is a place to help people, not make a laugh at them.
Yes, I am beginner and I am not ashamed of it. But, you have to be
ashamed of your comments.
Afan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Creating Dropdown Menus From Tables

2004-09-20 Thread Marek Kilimajer
Living in the past?
Harlequin wrote:
Hi all.
Hoping this might be relatively easy...
I'm wondering if I can create a dropdown menu (optionABCDE/option) by 
using a select statement and then populating this using PHP...?

Yes, it is relatively easy, and it is answered in virtualy every PHP 
book. I recomend you get one.

Some (pseudo) code:
$res = query(select id, name from table);
while($row = get_result($res)) {
echo option value='$row[id]'$row[name]/option;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Jay Blanchard
[snip]
Ha, ha, ha (sarcastic...)
10 points for Jason and Niklas.
Guys, please, if you don't want to help - keep your stupid comments for
yourself. This is a place to help people, not make a laugh at them.
Yes, I am beginner and I am not ashamed of it. But, you have to be
ashamed of your comments.
[/snip]

Easy ace, no need to call people stupid. Jason correctly pointed you to
image functions. He could have easily said STFA, STFW or RTFM...all of
which contain the answers. Please start here
http://us4.php.net/image

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



Re: [PHP] thumbnail of webpage

2004-09-20 Thread Ed Curtis

 If you have a Linux box available here's something to try although it
does have some required software.

http://www.babysimon.co.uk/khtml2png/index.html

There is also a link on the site for a commercial product for Windows that
does the same thing.

I can't endorse either one as I have not used them. Just giving the
information.

Ed


On Sat, 18 Sep 2004, raditha dissanayake wrote:

 Michael Mao wrote:

  Is there a way to capture a snapshot of a html page and save it as a
  jpg  using php?
 
 This is something that's very very hard to do with PHP but can be easily
 done with Java.




 --
 Raditha Dissanayake.
 
 http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
 Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
 Graphical User Inteface. Just 128 KB | with progress bar.

 --
 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] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Afan Pasalic
As you said: easy ace: I didn't call THEM stupid - I am not so stupid. 
It was about their COMMENTS.
Also, I spend lat two days trying to figure out what would be solution 
for me and wasn't able. I cheked php manual (installation, imge 
functions and many more), google-ed many sites and - no clear answer 
to me.
And THEN I tryed here.

Afan
Jay Blanchard wrote:
[snip]
Ha, ha, ha (sarcastic...)
10 points for Jason and Niklas.
Guys, please, if you don't want to help - keep your stupid comments for
yourself. This is a place to help people, not make a laugh at them.
Yes, I am beginner and I am not ashamed of it. But, you have to be
ashamed of your comments.
[/snip]
Easy ace, no need to call people stupid. Jason correctly pointed you to
image functions. He could have easily said STFA, STFW or RTFM...all of
which contain the answers. Please start here
http://us4.php.net/image
 


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


[PHP] Converting PHP code and db schema from PostgreSQL to MySQL

2004-09-20 Thread Stefan Moldoveanu
Hello, folks,
 
Is there any tool/script to convert PostgreSQL code from PHP scripts into
MySQL (pg_connect  mysql_connect and so forth)?
I'm talking about a website with thousands of code lines.
 
Also, any script which can convert PostgreSQL db data schema to MySQL? I
only found tutorials for MySQL  PostgreSQL conversion.
 
 
Any link / tutorial / etc. would be highly appreciated.
 
 
Thank you,
Stefan
 
 


RE: [PHP] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Jay Blanchard
[snip]
As you said: easy ace: I didn't call THEM stupid - I am not so stupid.
It was about their COMMENTS.
Also, I spend lat two days trying to figure out what would be solution
for me and wasn't able. I cheked php manual (installation, imge
functions and many more), google-ed many sites and - no clear answer
to me.
And THEN I tryed here.
[/snip]

What do you mean no clear answer? Did you reconfigure PHP with GD
support? If so, did you restart your web server? Does the configure line
(when running phpinfo() ) look anything like this...

'./configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs'
'--with-gd=/usr/local/' '--with-jpeg-dir=/usr/local/'
'--with-zlib=/usr/local/' '--with-png-dir=/usr/local/' '--enable-ftp' 

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



[PHP] Weird characters output

2004-09-20 Thread Angelo Zanetti
Hi all, 

I have recently moved a site over to a new server. Now certain
characters are being replaced by weird characters. EG: the ' single
quote is being replaced by a question mark and other characters are also
affected. the information that contains these characters is inside a
mysql database. The webserver is Apache and it is running on a linux, I
have googled and found that it is an Apache PHP issue but have yet to
come up with a solution. If anyone knows whats causing the problem and
could help that would be great. 

thanks in advance.

Angelo

Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Afan Pasalic
running phpinfo() I'm getting this:
'./configure' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' 
'--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' 
'--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/lib' 
'--localstatedir=/var/lib' '--sharedstatedir=/usr/com' 
'--mandir=/usr/share/man' '--infodir=/usr/share/info' 
'--enable-discard-path' '--disable-force-cgi-redirect' '--enable-shared' 
'--disable-static' '--disable-debug' '--disable-rpath' '--enable-pic' 
'--enable-inline-optimization' '--enable-memory-limit' 
'--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php' 
'--with-pear=/usr/share/pear' '--enable-magic-quotes' 
'--enable-debugger' '--enable-track-vars' '--with-exec-dir=/usr/bin' 
'--with-versioning' '--with-mod_charset' '--with-regex=php' 
'--enable-track-vars' '--enable-trans-sid' '--enable-safe-mode' 
'--enable-ctype' '--enable-ftp' '--with-gettext=/usr' '--enable-posix' 
'--enable-session' '--enable-sysvsem' '--enable-sysvshm' '--enable-yp' 
'--with-openssl=/usr' '--without-kerberos' '--with-ttf' 
'--with-freetype-dir=/usr' '--with-zlib=/usr' '--with-zlib=/usr' 
'--with-zlib-dir=/usr' '--without-pear'

no GD
also found this:
... Extensions listed here are (or will be soon) available as external 
modules. To install one or all of these, use urpmi php-EXTENSION_NAME :
mysql pgsql sqlite gd imap ldap bcmath bz2 calendar cpdf crack curl 
cyrus db dba dba_bundle dbase dbx dio domxml exif fbsql fdf filepro 
fribidi gmp hwapi hyperwave iconv imagick informix ingres_ii interbase 
ircg java mbstring mcal mcrypt mcve mhash mime_magic ming mnogosearch 
msession msql mssql ncurses notes oci8 odbc oracle overload ovrimos 
pam_auth pcntl pdf pfpro pspell qtdom readline recode rrdtool shmop snmp 
smbauth sockets swf sybase sybase_ct sysvmsg tokenizer wddx xml xmlrpc 
xslt yaz zip adodb mmcache apd cybercash cybermut mono mqseries netools 
python spplus spread inifile 

Thanks Jay,
Afan
Jay Blanchard wrote:
[snip]
As you said: easy ace: I didn't call THEM stupid - I am not so stupid.
It was about their COMMENTS.
Also, I spend lat two days trying to figure out what would be solution
for me and wasn't able. I cheked php manual (installation, imge
functions and many more), google-ed many sites and - no clear answer
to me.
And THEN I tryed here.
[/snip]
What do you mean no clear answer? Did you reconfigure PHP with GD
support? If so, did you restart your web server? Does the configure line
(when running phpinfo() ) look anything like this...
'./configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs'
'--with-gd=/usr/local/' '--with-jpeg-dir=/usr/local/'
'--with-zlib=/usr/local/' '--with-png-dir=/usr/local/' '--enable-ftp' 

.
 

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


[PHP] Automating the process of creating overviews of data

2004-09-20 Thread Markus Fischer
Hi,
[Warnung: pretty long email about trying to make use of MVC and php5]
I'm seeking some input in (architectually) designed my code so I can reach the 
following:
- overview from the subject is defined as a table rows/columns displaying simple or 
complex results from an sql query
- it is part of a backend for administrating data, e.g. displayig the procuts, 
customers, etc
In simple ascii, the visual output would be:
id | name | last login
---+--+---
1  | schubert | yesterday
2  | haydn| last year
Ok, so far nothing new; I just want to make clear what I'm talking about.
The feature list this overview should have:
- sortable rows, i.e. clicking on a column header sorts the select row
- clicking on a row links to editing the specific entry
- optional: provides ability (e.g. via small graphical buttons) to move an entry 
up/down (aka sorting)
- optional: display a checkbox next to each entry; UI to delete all selected entries
To achive this, I've currently separated the code into a few classes:
abstract class OverviewController
abstract class OverviewData
interface OverviewView
OverviewData:
Knows what colums are defined and how they're set up (e.g. which columns are sortable, 
what type they display) and also knows how to fetch the data and convert it into a format so 
OverviewView can work with it.
OverviewView:
Knowns how to draw the output, e.g. the table/columns/rows/links for the 
client (browser)
OverviewController:
Takes OverviewData and OverviewView and controls them to generated the 
relevant output.
The classes only define the basic architecture and don't work immidiately. The 
implementation of OverviewView should idially work with any class extending 
OverviewData; so I've kept CustomOverviewView generic to handle this.
As I've started working on it, a few things have shown up which I need to resolve as 
intellegent as possible so I don't screw up the design:
- How to a build the the links in the OverviewView output which control simple things 
like sorting for a specific column?
What's the deal here? Well, OverviewView should be generic, not bound to anything specific. So when I integrate it into a application, the 
application definitely needs some GET/POST parameters which need to be present to handle its own state, not related to the OverviewView at all. So 
I started to give each instance of CustomOverviewView a distinct name by which the OverviewView known it can refer to itself without 
interfering with other variables used in the GET request. In the specific implementation, I'm using name as the basis for an array, so 
every state which needs to be remembered will be a entry in that array, e.g. name is procuctView then all states will be 
handled as productView[sortby], etc. But this alone doesn't fix the complete problem. There are certainly parameters which 
additionally need to be passed from the application itself. Therefore I've added a setParameterGetCallback method on the OverviewView 
interface by which a callback handler will be
set; this callback is into the application itself, because this is the best place (I 
could think of) where this should be handled. The application _knows_ its state. The callback 
handler just additionally takes the parameters which need to be set by the CustomOverviewView 
implementation and returns the complete content for the GET request (e.g. for the 
href-Attribute).
The next thing about sorting is: somewhere I need to know which column to sort. Idially 
(for me) this would be in the OverviewData implementation. Because this is where I fetch 
the data and I plan to have it fetched and stored for OverviewView right the way it is 
needed - sorted correctly by the choosen column.
On the other hand, I need to sorting column information still in the OverviewView 
implementation too, because I need visual indication (up/down arrow).
- The next thing: when I want to move an entry up/down (e.g. manuall sort), basically I'm fireing off a 
command: this entry ID whatever should be sorted UP. But I'm not quite sure where these action should be 
done. Is it part of the OverviewData implementation to execute this action (because it already does some action 
for sorting after the right column, albeit this is more a read only thing, whereas sorting an entry 
manually is like writing to the database, updating existing entries). Or is it a Controller thing? 
Or something I haven't yet thought off?
And still, things I haven't completely considered are:
- searching (not too different from sorting, anyway)
- deleting (same problem as moving manually entries I guess: need to write to the 
database, but where from?)
For simplicity I haven't included user-level permissions yet, but they've to come (but 
may currently be part of the Application itself).
I do not want to make the design too complex; I want to make it practical. The current design 
for me is practical. I just use another CustomOverviewView and the table 

RE: [PHP] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Jay Blanchard
[snip]
running phpinfo() I'm getting this:
no GD

also found this:

... Extensions listed here are (or will be soon) available as external 
modules. To install one or all of these, use urpmi php-EXTENSION_NAME
:
mysql pgsql sqlite gd imap ldap bcmath bz2 calendar cpdf crack curl 
cyrus db dba dba_bundle dbase dbx dio domxml exif fbsql fdf filepro 
fribidi gmp hwapi hyperwave iconv imagick informix ingres_ii interbase 
ircg java mbstring mcal mcrypt mcve mhash mime_magic ming mnogosearch 
msession msql mssql ncurses notes oci8 odbc oracle overload ovrimos 
pam_auth pcntl pdf pfpro pspell qtdom readline recode rrdtool shmop snmp

smbauth sockets swf sybase sybase_ct sysvmsg tokenizer wddx xml xmlrpc 
xslt yaz zip adodb mmcache apd cybercash cybermut mono mqseries netools 
python spplus spread inifile 
[/snip]

Then you need to install GD and reconfigure PHP. Don't forget to restart
your web server afterwards.

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



RE: [PHP] List Etiquette

2004-09-20 Thread Dan Joseph
Hi,

  Happy top posting,
 
 Have fun driving on the wrong side of the road.

Hey that can be fun!  Especially in crowded downtown areas.  It's a
real challenge!

-Dan Joseph

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



Re: [PHP] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Afan Pasalic
Ok. That was my thought too.
When I connect to my server (using putty) I found in root directory also
gd.rpm/
gd-2.0.26/
gd-2.0.26.tar.gz
means - I have gd installed on comp. Just have to recompile server, right?


Jay Blanchard wrote:
[snip]
running phpinfo() I'm getting this:
no GD
also found this:
... Extensions listed here are (or will be soon) available as external 
modules. To install one or all of these, use urpmi php-EXTENSION_NAME
:
mysql pgsql sqlite gd imap ldap bcmath bz2 calendar cpdf crack curl 
cyrus db dba dba_bundle dbase dbx dio domxml exif fbsql fdf filepro 
fribidi gmp hwapi hyperwave iconv imagick informix ingres_ii interbase 
ircg java mbstring mcal mcrypt mcve mhash mime_magic ming mnogosearch 
msession msql mssql ncurses notes oci8 odbc oracle overload ovrimos 
pam_auth pcntl pdf pfpro pspell qtdom readline recode rrdtool shmop snmp

smbauth sockets swf sybase sybase_ct sysvmsg tokenizer wddx xml xmlrpc 
xslt yaz zip adodb mmcache apd cybercash cybermut mono mqseries netools 
python spplus spread inifile 
[/snip]

Then you need to install GD and reconfigure PHP. Don't forget to restart
your web server afterwards.
 

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


Re: [PHP] Converting PHP code and db schema from PostgreSQL to MySQL

2004-09-20 Thread Greg Donald
On Mon, 20 Sep 2004 16:18:26 +0300, Stefan Moldoveanu
[EMAIL PROTECTED] wrote:
 Is there any tool/script to convert PostgreSQL code from PHP scripts into
 MySQL (pg_connect  mysql_connect and so forth)?
 I'm talking about a website with thousands of code lines.

In vi:
:%s/pg_/mysql_/g

 Also, any script which can convert PostgreSQL db data schema to MySQL? I
 only found tutorials for MySQL  PostgreSQL conversion.

That's because you're a minority.  Most people upgrade to Postgres,
not downgrade to MySQL.  If it were me I'd see what my2pg.pl does and
reverse the logic.

 Any link / tutorial / etc. would be highly appreciated.

I recommend using ADOdb, just in case you change your mind later and
want to switch databases again you'd be set:
http://adodb.sourceforge.net/


-- 
Greg Donald
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Jason Wong
Please do not top post.

On Monday 20 September 2004 21:56, Afan Pasalic wrote:
 Ok. That was my thought too.
 When I connect to my server (using putty) I found in root directory also
 gd.rpm/
 gd-2.0.26/
 gd-2.0.26.tar.gz
 means - I have gd installed on comp. Just have to recompile server, right?

Not if PHP was installed using RPM ...

 ... Extensions listed here are (or will be soon) available as external
 modules. To install one or all of these, use urpmi php-EXTENSION_NAME

... and from the information you've given so far, it looks like you have 
installed PHP using RPM. I would suggest you get help from your distro's 
mailing list.

-- 
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
--
/*
Send lawyers, guns and money...
-- Lyrics from a Warren Zevon song
*/

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



Re: [PHP] mysql_connect does not connect

2004-09-20 Thread Steve Brown
 I definitely mind. I don't believe in rewarding bad behavior. It is
 reasonable to contribute to the productive development of solutions, but the
 attitude in this group is not productive. I have the impression that the
 real reason you want answers is so that you can continue in unproductive
 directions.

Boy, for someone who has over 12k posts on some VC++ forum, you don't
seem to have a positive and productive attitude here.  Personally, I
just think your an arogant ass.

BTW, for those of you who can't read between the lines, this means it
was a firewall issue.  Egads!

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



Re: [PHP] filtering out text in a string

2004-09-20 Thread Burhan Khalid
Merlin wrote:
Hi there,
I want to filter out ip adresses out of a given text string. They are 
inside a logfile and values are seperated by tabs. I tryed sub_str which 
works fine if you know the length of the characters. In case of the ip 
adress this is not the case, since they are sometimes shorter than others.
Has anybody an idea how to filter the ip adress out? Maybe magically 
with any regex or somehow with tab recognicion.

This is an example of parts of the text
20:03:20[MSG]   192.168.0.129  bla bla
Given:
?php
  $string=sprintf(20:03:20\t[MSG]\t192.168.0.129\tbla bla);
  print_r(explode(\t,$string));
?
Output is :
Array
(
[0] = 20:03:20
[1] = [MSG]
[2] = 192.168.0.129
[3] = bla bla
)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] turn on GD2 lib on php 4.3.4

2004-09-20 Thread Marek Kilimajer
Afan Pasalic wrote:
also found this:
... Extensions listed here are (or will be soon) available as external 
modules. To install one or all of these, use urpmi php-EXTENSION_NAME :
mysql pgsql sqlite gd ...
then do it:
# urpmi php-gd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] password-protecting with PHP, help plz

2004-09-20 Thread Burhan Khalid
[snip]
And here is the action page, testing2.php.
if ($_POST['user'] == 'Andrew')  ($_POST['pass'] == 'pass') {
echo Welcome, Andrew.; }
And (shocker!) I got a blank page. So I turned out display errors and got 
this:

Parse error: syntax error, unexpected T_BOOLEAN_AND in 
c:\TSW\pages\testing2.php on line 3
PLEASE ... read the manual on basic syntax.
Line 3 being the line with the  stuff. I'm not sure if the whole  thing 
is right...obviously not. How do I password protect with more than one factor?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] password-protecting with PHP, help plz

2004-09-20 Thread John Nichel
Burhan Khalid wrote:
[snip]
And here is the action page, testing2.php.
if ($_POST['user'] == 'Andrew')  ($_POST['pass'] == 'pass') {
echo Welcome, Andrew.; }
And (shocker!) I got a blank page. So I turned out display errors and 
got this:

Parse error: syntax error, unexpected T_BOOLEAN_AND in 
c:\TSW\pages\testing2.php on line 3

PLEASE ... read the manual on basic syntax.
And read here too.
http://us4.php.net/manual/en/language.control-structures.php#control-structures.if
--
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] Creating a new window

2004-09-20 Thread Todd Cary
I am using PHP to create a button on a window so that a new window is 
created when the button is clicked using javaScript.  Is there a way to 
create a new window inline; that is create a window on top of the 
current window without having the surfer press a button?

Here is my current onClick code:
input name=btnView type=button value=View 
onClick=MM_openBrWindow('claim_pdf.php?session_id=1095690357pdf_file=1000481.pdf','','toolbar=no,status=no,scrollbars=no,resizable=yes');nbsp; 
  /td

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


[PHP] Auto escaping an apostrophy...

2004-09-20 Thread Todd Cary
I have noticed that an apostrophy is automatically escaped with a \, 
or at least appears to be if the surfer enters an apostrophy in a text 
field.  Has this always been the case or is there a setting in the 
php.ini file that contols this?

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


Re: [PHP] Creating a new window

2004-09-20 Thread Jason Davidson
this is javascript question isnt it.. but to end the thread quickly...
just dont put your js in the button.. just print it ..

print scriptwin-=open(...);win.focus();/script;

that wiill open a win when the browser parses it.

Jason


Todd Cary [EMAIL PROTECTED] wrote: 
 
 I am using PHP to create a button on a window so that a new window is 
 created when the button is clicked using javaScript.  Is there a way to 
 create a new window inline; that is create a window on top of the 
 current window without having the surfer press a button?
 
 Here is my current onClick code:
 
 input name=btnView type=button value=View 
 onClick=MM_openBrWindow('claim_pdf.php?session_id=1095690357pdf_file=1000481.pdf','','toolbar=no,status=no,scrollbars=no,resizable=yes');
  
 
/td
 
 Todd
 
 -- 
 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] Auto escaping an apostrophy...

2004-09-20 Thread Jason Davidson
Turn off magic_quotes_gpc in the php.ini file, they are bad bad abd.. 
magic_quotes_gpc 0

Jason

Todd Cary [EMAIL PROTECTED] wrote: 
 
 I have noticed that an apostrophy is automatically escaped with a \, 
 or at least appears to be if the surfer enters an apostrophy in a text 
 field.  Has this always been the case or is there a setting in the 
 php.ini file that contols this?
 
 Todd
 
 -- 
 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] Creating a new window

2004-09-20 Thread Miles Thompson
JavaScript, not a PHP question., but chekc out onload()
MT
At 11:42 AM 9/20/2004, Todd Cary wrote:
I am using PHP to create a button on a window so that a new window is 
created when the button is clicked using javaScript.  Is there a way to 
create a new window inline; that is create a window on top of the current 
window without having the surfer press a button?

Here is my current onClick code:
input name=btnView type=button value=View 
onClick=MM_openBrWindow('claim_pdf.php?session_id=1095690357pdf_file=1000481.pdf','','toolbar=no,status=no,scrollbars=no,resizable=yes');nbsp; 
/td

Todd
--
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] Auto escaping an apostrophy...

2004-09-20 Thread John Legg
Todd,

From the PHP manual:

magic_quotes_gpc boolean 
Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When magic_quotes 
are on, all ' (single-quote),  (double quote), \ (backslash) and NUL's are escaped 
with a backslash automatically. 

  Note: If the magic_quotes_sybase directive is also ON it will completely override 
magic_quotes_gpc. Having both directives enabled means only single quotes are escaped 
as ''. Double quotes, backslashes and NUL's will remain untouched and unescaped. 

See also get_magic_quotes_gpc() 

Rgds

John

---


I have noticed that an apostrophy is automatically escaped with a \, 
or at least appears to be if the surfer enters an apostrophy in a text 
field.  Has this always been the case or is there a setting in the 
php.ini file that contols this?

Todd

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



Re: [PHP] Creating a new window

2004-09-20 Thread John Nichel
Todd Cary wrote:
I am using PHP to create a button on a window so that a new window is 
created when the button is clicked using javaScript.  Is there a way to 
create a new window inline; that is create a window on top of the 
current window without having the surfer press a button?
PHP cannot open new windows.  It is server side.
--
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] Auto escaping an apostrophy...

2004-09-20 Thread John Nichel
Todd Cary wrote:
I have noticed that an apostrophy is automatically escaped with a \, 
or at least appears to be if the surfer enters an apostrophy in a text 
field.  Has this always been the case or is there a setting in the 
php.ini file that contols this?
Magic quotes.
http://us2.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime
--
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] Auto escaping an apostrophy...

2004-09-20 Thread Todd Cary
Many thanks to all.
Todd
John Legg wrote:
Todd,
From the PHP manual:
magic_quotes_gpc boolean 
Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When magic_quotes are on, all ' (single-quote),  (double quote), \ (backslash) and NUL's are escaped with a backslash automatically. 

  Note: If the magic_quotes_sybase directive is also ON it will completely override magic_quotes_gpc. Having both directives enabled means only single quotes are escaped as ''. Double quotes, backslashes and NUL's will remain untouched and unescaped. 

See also get_magic_quotes_gpc() 

Rgds
John
---
I have noticed that an apostrophy is automatically escaped with a \, 
or at least appears to be if the surfer enters an apostrophy in a text 
field.  Has this always been the case or is there a setting in the 
php.ini file that contols this?

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


[PHP] Fork PHP script X at a time.

2004-09-20 Thread John Wards
Hi, I have a bit of a cold today so I probably would have figured this
out for myself eventually but hey ;-)

Right I have a script that I need to run around 90 times thru a cron job
but passing a different i.d. to it each time.

I have experimented with running all 90 at once and its a no go as it
just makes the server run to slow and the session cookies I use time out
(I am doing some libcurl things).

Also running them in a loop one at a time is no use because it takes
about 8 hours.

What I would like to do is fork off say 5-10 at a time and when one is
done start another one in its place, as they all take different length
of times to compleate.

Any clues at where to start? Here is my fork all 90+ code...


$sql = SELECT * FROM locations WHERE parent = '0';
$res = mysql_query($sql) or die ($sql.mysql_error());
while($data = mysql_fetch_array($res)){
exec(/usr/local/bin/php fork.php .$_data[id].  /dev/null );
}

Cheers
John Wards

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



Re: [PHP] Weird characters output

2004-09-20 Thread Wouter van Vliet
 I have recently moved a site over to a new server. Now certain
 characters are being replaced by weird characters. EG: the ' single
 quote is being replaced by a question mark and other characters are also
 affected. the information that contains these characters is inside a
 mysql database. The webserver is Apache and it is running on a linux, I
 have googled and found that it is an Apache PHP issue but have yet to
 come up with a solution. If anyone knows whats causing the problem and
 could help that would be great.

Most likely this is one of many occurences of the UTF problem. Try
adding the line
AddDefaultCharset iso-8859-1

to your httpd.conf, either within your vhost specification or by
replacing the main one. Then restart Apache. Should work.

If you don't have root access - try adding it to an .htaccess file,
but I don't know of this directive is allowed in there ..

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



Re: [PHP] Fork PHP script X at a time.

2004-09-20 Thread Wouter van Vliet
 Hi, I have a bit of a cold today so I probably would have figured this
 out for myself eventually but hey ;-)
 
 Right I have a script that I need to run around 90 times thru a cron job
 but passing a different i.d. to it each time.
 
 I have experimented with running all 90 at once and its a no go as it
 just makes the server run to slow and the session cookies I use time out
 (I am doing some libcurl things).
 
 Also running them in a loop one at a time is no use because it takes
 about 8 hours.
 
 What I would like to do is fork off say 5-10 at a time and when one is
 done start another one in its place, as they all take different length
 of times to compleate.
 
 Any clues at where to start? Here is my fork all 90+ code...
 
 $sql = SELECT * FROM locations WHERE parent = '0';
 $res = mysql_query($sql) or die ($sql.mysql_error());
 while($data = mysql_fetch_array($res)){
exec(/usr/local/bin/php fork.php .$_data[id].  /dev/null );
 }

You should be able to find out about the PID's for every forked
process, and use a loop (advisable with a sleep() in it) to see how
many procs are still running.. When the amount drops somewhat, spawn
another ..

Hope will get you somewhere!

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



RE: [PHP] thumbnail of webpage

2004-09-20 Thread Gryffyn, Trevor
Some great recommendations, but my first thought is wondering if you can
interface with IE via COM or something.   Or open the URL via IE and use
the Windows API to do a PRINT SCREEN or ALT-PRINT SCREEN to capture it
to the clipboard and do something funny that way.

If I had time right now, I'd love to dig into this, but I wanted to at
least share the thought in case it helped.

Good luck!  Let us know if you find a good way to do this via PHP.

-TG

 -Original Message-
 From: Michael Mao [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 17, 2004 7:54 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] thumbnail of webpage
 
 
 Is there a way to capture a snapshot of a html page and save 
 it as a jpg  
 using php?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP] Fork PHP script X at a time.

2004-09-20 Thread John Wards
On Mon, 2004-09-20 at 16:45, Wouter van Vliet wrote:
  
  What I would like to do is fork off say 5-10 at a time and when one is
  done start another one in its place, as they all take different length
  of times to compleate.
  
  Any clues at where to start? Here is my fork all 90+ code...
  
  $sql = SELECT * FROM locations WHERE parent = '0';
  $res = mysql_query($sql) or die ($sql.mysql_error());
  while($data = mysql_fetch_array($res)){
 exec(/usr/local/bin/php fork.php .$_data[id].  /dev/null );
  }
 
 You should be able to find out about the PID's for every forked
 process, and use a loop (advisable with a sleep() in it) to see how
 many procs are still running.. When the amount drops somewhat, spawn
 another ..

Hmm, first off how would I get the PID for each process?

I could store each PID and then sleep for a minute, then check to see if
those PIDs are still valid (How would I do that?!) then fork some more
and loop till fade...

Think I will sleep on it.

John

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



Re: [PHP] Fork PHP script X at a time.

2004-09-20 Thread Marek Kilimajer
play around with popen() and stream_select()
John Wards wrote:
Hi, I have a bit of a cold today so I probably would have figured this
out for myself eventually but hey ;-)
Right I have a script that I need to run around 90 times thru a cron job
but passing a different i.d. to it each time.
I have experimented with running all 90 at once and its a no go as it
just makes the server run to slow and the session cookies I use time out
(I am doing some libcurl things).
Also running them in a loop one at a time is no use because it takes
about 8 hours.
What I would like to do is fork off say 5-10 at a time and when one is
done start another one in its place, as they all take different length
of times to compleate.
Any clues at where to start? Here is my fork all 90+ code...
$sql = SELECT * FROM locations WHERE parent = '0';
$res = mysql_query($sql) or die ($sql.mysql_error());
while($data = mysql_fetch_array($res)){
exec(/usr/local/bin/php fork.php .$_data[id].  /dev/null );
}
Cheers
John Wards
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Fork PHP script X at a time.

2004-09-20 Thread John Wards
On Mon, 2004-09-20 at 16:56, Marek Kilimajer wrote:
 play around with popen() and stream_select()

Oooh that looks handy.

More night time reading I think!

Any further ideas to save a man with a cold from using his brain would
be great!

Cheers
John

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



Re: [PHP] Fork PHP script X at a time.

2004-09-20 Thread raditha dissanayake
John Wards wrote:
Hi, I have a bit of a cold today so I probably would have figured this
out for myself eventually but hey ;-)
Right I have a script that I need to run around 90 times thru a cron job
but passing a different i.d. to it each time.
 

not suprised.
I have experimented with running all 90 at once and its a no go as it
just makes the server run to slow and the session cookies I use time out
(I am doing some libcurl things).
Also running them in a loop one at a time is no use because it takes
about 8 hours.
 

if your script consumes lots of CPU, lots of memory, lots of bandwidth 
or any combination of these you may not see a significant improvement by 
using threads. If you sleep you might find that the total running time 
will actually increase, so this is something you might want to go about 
carefully. PHP isn't the easiest language to use when you have to do 
your own threading but since others have already given good advice on 
the howto i will refrain from adding my 0.02


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Fork PHP script X at a time.

2004-09-20 Thread Greg Donald
On Mon, 20 Sep 2004 16:36:51 +0100, John Wards [EMAIL PROTECTED] wrote:
 Right I have a script that I need to run around 90 times thru a cron job
 but passing a different i.d. to it each time.
 
 I have experimented with running all 90 at once and its a no go as it
 just makes the server run to slow and the session cookies I use time out
 (I am doing some libcurl things).
 
 Also running them in a loop one at a time is no use because it takes
 about 8 hours.
 
 What I would like to do is fork off say 5-10 at a time and when one is
 done start another one in its place, as they all take different length
 of times to compleate.
 
 Any clues at where to start? Here is my fork all 90+ code...
 
 $sql = SELECT * FROM locations WHERE parent = '0';
 $res = mysql_query($sql) or die ($sql.mysql_error());
 while($data = mysql_fetch_array($res)){
 exec(/usr/local/bin/php fork.php .$_data[id].  /dev/null );

I'd write a scheduler.  Insert the jobs into the database whenever
they need to run.  Then have a script that runs via cron that will
monitor system load, and start and stop jobs as required.

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


-- 
Greg Donald
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] thumbnail of webpage

2004-09-20 Thread raditha dissanayake
Gryffyn, Trevor wrote:
Some great recommendations, but my first thought is wondering if you can
interface with IE via COM or something.   Or open the URL via IE and use
the Windows API to do a PRINT SCREEN or ALT-PRINT SCREEN to capture it
to the clipboard and do something funny that way.
 

Good ideas but then you would need to run PHP on the client side and not 
on the server (assuming of course that the original poster is not runnig 
his  server on an OS that does not have any security features).

There was a similar question on 'the list' and someone suggested and 
image magick would be able to do this.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Media file browser cache question --- second try

2004-09-20 Thread Daniel Guerrier
And how would I do 
1. Configure webserver to send the right headers for
.wmv files.
--- Marek Kilimajer [EMAIL PROTECTED] wrote:

 Daniel Guerrier wrote:
  I'm using this code to dynamically retrieve
 windows
  media files and send it to the browser.  I thought
 the
  cache header would prevent the file from being
 cached.
  
  The only problems is the .wmv file still ends up
 in my
  IE temp files folder.  How can I prevent this from
  happening?
 
 The headers have influence on the asx file, .wmv
 files are served by the 
 webserver (no php involved) and the webserver
 doesn't send no-cache headers.
 
 You need to either:
 
 1. Configure webserver to send the right headers for
 .wmv files.
 
 2. Use php to send .wmv files, you can then send the
 headers from php
 
  
  
  ?php
  require_once(../admin/constant.php);
  header(Content-Type: video/x-ms-wmv);
  header(Last-Modified:  . gmdate(D, d M Y
 H:i:s) .
   GMT);
  header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);
  header(Cache-Control: no-store, no-cache,
  must-revalidate); 
  header(Cache-Control: post-check=0, pre-check=0,
  false);
  header(Pragma: no-cache);
  $file = DATAURL . /media/ . $_GET['mediafile'];
  ?
  ASX VERSION=3.0
  ENTRY
  REF HREF =?php echo $file; ? /
  /ENTRY
  /ASX
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[PHP] New site: www.thephpwtf.com

2004-09-20 Thread Benson Wong
Hi People, 

I launched The PHP WTF last night. It is for showcasing examples of
bad code we all run across while developing PHP or working with other
people's code. Hopefully it'll help demonstrate good design from bad
design.

If you guys have any code samples that you would like to submit please
submit them at http://www.thephpwtf.com.

props
I got the idea from Alex of The Daily WTF
(http://www.thedailywtf.com). His site features a lot of examples of
bad VB/Java code.
/props

Ben
-- 
blog: http://benzo.tummytoons.com

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



Re: [PHP] Creating Dropdown Menus From Tables

2004-09-20 Thread James Lobley
On Thu, 16 Sep 2004 13:02:31 +0100, Harlequin
[EMAIL PROTECTED] wrote:
 Hi all.
 
 Hoping this might be relatively easy...
 
 I'm wondering if I can create a dropdown menu (optionABCDE/option) by
 using a select statement and then populating this using PHP...?
 
 --
 -
 Michael Mason
 Arras People
 www.arraspeople.co.uk
 -

for a recent project, I needed an easily adaptable form, with a lot of
different, often changing elements, so I came up with the following
function (amongst others!):

// dropdown boxes
function dropdown($fieldname, $currentvalue='', $onchange='') {
   $var_val = $fieldname . '_val';
   $var_disp = $fieldname . '_disp';
   global ${$var_val}, ${$var_disp};
   if($onchange  '') $onchange = 'ONCHANGE=' . $onchange . '';
   echo('SELECT NAME=' . $fieldname . ' ' . $onchange. '');
   for($loopy=1; $loopy=sizeof(${$var_val}); $loopy++) {
   echo('OPTION VALUE=' . ${$var_val}[$loopy] . '');
   if($currentvalue == ${$var_val}[$loopy]) echo(' SELECTED');
   echo('' . ${$var_disp}[$loopy]);
   }
   echo('/SELECT');
}

I have an include file with the options for each form element -
meaning options can be added or removed easily - an example is:

// Sex
$Sex_val[1] = 'M';
$Sex_disp[1]= 'Male';
$Sex_val[2] = 'F';
$Sex_disp[2]= 'Female';

The function would be called by:
// create dropdown
dropdown('Sex');

// create dropdown, select a matching value
dropdown('Sex',$current_sex);

// create dropdown, select a matching value and run a javascript
function when element is changed
dropdown('Sex',$current_sex, 'checkSex()');

HTH

j
;-}

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



[PHP] gmail accounts

2004-09-20 Thread Greg Donald
I have some gmail accounts of anyone wants one.  Email me off list. 
Limited supply, first requests, etc..

And now for my php question:

Which do you prefer, echo() or print() ?

I find that after I've done a bunch of Perl coding and I'm back on
some PHP work I use print.  But then after I do a bunch of PHP coding
I start to use echo again because it's one character shorter and I'm
lazy like that.  What about you?


-- 
Greg Donald
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Media file browser cache question --- second try

2004-09-20 Thread Marek Kilimajer
Daniel Guerrier wrote:
And how would I do 
1. Configure webserver to send the right headers for
.wmv files.
Depends on your webserver.
For apache, place .htaccess file to the media directory with some Header 
directives, more here or on apache mailing list:

http://httpd.apache.org/docs/mod/mod_headers.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RE: **[SPAM]** [PHP] gmail accounts

2004-09-20 Thread Jay Blanchard
[snip]
Which do you prefer, echo() or print() ?
[/snip]

http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40

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



[PHP] (0x00) in on line error message

2004-09-20 Thread Raghu
Hi,

We migrated from PHP 4 to PHP 5 and we are seeing this error message((0x00)
in on line) on almost all pages. Has anyone seen this message? What is the
cause of this message? Also I couldn't get the line number and file
information also.

Thanks in advance
Raghu

[EMAIL PROTECTED]

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



[PHP] RE: **[SPAM]** [PHP] Correct context

2004-09-20 Thread Jay Blanchard
[snip]
Before I go screwing this code up I thought I would ask for the
formatting. How would you write the following in PHP?

if $entry not equal to Copy Change
OR
Banner Change
OR
Price Change

AND

$row['photo_check'] not equal to 
[/snip]

There are several ways  here is one

if(( != $row['photo_check'])  ((Copy Change != $entry) || (Banner
Change != $entry) || (Price Change != $entry)))

Note the parentheses to define preference order.

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



[PHP] RE: **[SPAM]** [PHP] Correct context

2004-09-20 Thread Ed Curtis


On Mon, 20 Sep 2004, Jay Blanchard wrote:

 There are several ways  here is one

 if(( != $row['photo_check'])  ((Copy Change != $entry) || (Banner
 Change != $entry) || (Price Change != $entry)))

 Note the parentheses to define preference order.

 That's what I was looking for.

Thanks again,

Ed

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



Re: [PHP] RE: **[SPAM]** [PHP] Correct context

2004-09-20 Thread Mattias Thorslund
Jay Blanchard wrote:
[snip]
Before I go screwing this code up I thought I would ask for the
formatting. How would you write the following in PHP?
if $entry not equal to Copy Change
OR
Banner Change
OR
Price Change
AND
$row['photo_check'] not equal to 
[/snip]
There are several ways  here is one
if(( != $row['photo_check'])  ((Copy Change != $entry) || (Banner
Change != $entry) || (Price Change != $entry)))
Note the parentheses to define preference order.
 

How about :
if( != $row['photo_check'])){
	switch($entry){
	case Copy Change: 
	case Banner Change:
	case Price Change:
		break;
	default:
		//put your code here
	}
}

Longer but seems more readable to me.
Disclaimer: I have probably left a silly typo somewhere.
/Mattias
--
http://www.thorslund.us
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] RE: **[SPAM]** [PHP] Correct context

2004-09-20 Thread Mattias Thorslund
Mattias Thorslund wrote:
Disclaimer: I have probably left a silly typo somewhere. 

Sure did:
My old nemesis, end parethesis (either too few or too many).
It should be:
if( != $row['photo_check']){
   switch($entry){
   case Copy Change:
   case Banner Change:
   case Price Change:
   break;
   default:
   //put your code here
   }
}

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


[PHP] Re: gmail accounts

2004-09-20 Thread Markus Fischer
Greg Donald wrote:
I have some gmail accounts of anyone wants one.  Email me off list. 
Limited supply, first requests, etc..
I would be interested if there's still one left ;)
And now for my php question:
Which do you prefer, echo() or print() ?
I find that after I've done a bunch of Perl coding and I'm back on
some PHP work I use print.  But then after I do a bunch of PHP coding
I start to use echo again because it's one character shorter and I'm
lazy like that.  What about you?
I prefer echo ... even without the parentheses. The nice about it is, you can pass 
multiple arguments, separated by commas, without parentheses. You can't do that with 
print. Albeit that, they're identical I think (both are core language construct, no 
real functions).
I don't use print at all, but only 'printf' and 'sprintf', I do use them a lot for 
string formating (especially SQL and HTML output).
For long text I also use the HEREDOC (also in Perl, afaik) Syntax
echo HTML
html.../html
HTML;
I don't know your editor, but I once suggested to the php vim syntax author to make 
the highlighting of strings inside heredocs based on the HEREDOC terminator string; 
that is: HTML highlighted HTML/JS, SQL, maybe some other to (JAVASCRIPT) ?
HTH
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] RE: **[SPAM]** [PHP] Correct context

2004-09-20 Thread Jay Blanchard
[snip]
There are several ways  here is one

Longer but seems more readable to me.
[/snip]

Another way 

$arrFoo = array (
'Copy Change', 
'Banner Change',
'Price Change',
);

if(!(in_array($entry))  ( != $row['photo_check']))

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



RE: [PHP] thumbnail of webpage

2004-09-20 Thread Gryffyn, Trevor
True, you'd have to run it on the web client end, but you can run IE on
the server to access the HTML the server is err..serving.  The server
can also be a client, in other words.  So your server can generate a
thumbnail of what it's serving out by acting as a client for a second.

As long as their security allows them to execute IE or interface with it
and possibly the windows API.

There are complexities, but it's the path I would explore if I had to
create my own thumbnailing system (in the absence of some quick and easy
utility that already did it).

-TG

 -Original Message-
 From: raditha dissanayake [mailto:[EMAIL PROTECTED] 
 Sent: Monday, September 20, 2004 12:28 PM
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] thumbnail of webpage
 
 
 Gryffyn, Trevor wrote:
 
 Some great recommendations, but my first thought is 
 wondering if you can
 interface with IE via COM or something.   Or open the URL 
 via IE and use
 the Windows API to do a PRINT SCREEN or ALT-PRINT SCREEN to 
 capture it
 to the clipboard and do something funny that way.
 
   
 
 Good ideas but then you would need to run PHP on the client 
 side and not on the server (assuming of course that the original
 poster is not runnig his  server on an OS that does not have any
 security features).
 
 There was a similar question on 'the list' and someone suggested and 
 image magick would be able to do this.
 
 
 -- 
 Raditha Dissanayake.

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



RE: [PHP] RE: Correct context

2004-09-20 Thread Jay Blanchard
[snip]
Another way 

$arrFoo = array (
'Copy Change', 
'Banner Change',
'Price Change',
);

if(!(in_array($entry))  ( != $row['photo_check']))
[/snip]

Oops

$arrFoo = array (
'Copy Change', 
'Banner Change',
'Price Change',
);

if(!(in_array($entry, $arrFoo))  ( != $row['photo_check']))

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



Re: [PHP] RE: Correct context

2004-09-20 Thread Mattias Thorslund
Jay Blanchard wrote:
Oops
 

Yeah, some of us (including myself) could use a php validator in our 
mail clients...  Maybe a plugin for T-bird?

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


RE: [PHP] thumbnail of webpage

2004-09-20 Thread Stefan Holmes
 -Original Message-
 From: raditha dissanayake [mailto:[EMAIL PROTECTED]
 Sent: 18 September 2004 03:22
 To: Michael Mao
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] thumbnail of webpage
 
 Michael Mao wrote:
 
  Is there a way to capture a snapshot of a html page and save it as a
  jpg  using php?
 
 This is something that's very very hard to do with PHP but can be easily
 done with Java.

I would guess the easiest way would be to find some external program that
retrieves the page and then renders to an image file.  I don't offhand the
names of any utils that do this, but I'm sure there must be at least /one/
available!

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



Re: [PHP] thumbnail of webpage

2004-09-20 Thread Jonathan Haddad

Stefan Holmes wrote:
-Original Message-
From: raditha dissanayake [mailto:[EMAIL PROTECTED]
Sent: 18 September 2004 03:22
To: Michael Mao
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] thumbnail of webpage
Michael Mao wrote:
   

Is there a way to capture a snapshot of a html page and save it as a
jpg  using php?
 

This is something that's very very hard to do with PHP but can be easily
done with Java.
   

I would guess the easiest way would be to find some external program that
retrieves the page and then renders to an image file.  I don't offhand the
names of any utils that do this, but I'm sure there must be at least /one/
available!
 

if you're feeling extremely ambitiious, how about taking the gecko 
source and rendering the result to a PDF or JPG file instead of the 
screen?  come on guys get with it.

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


[PHP] Re: gmail accounts

2004-09-20 Thread Ricardo Cezar
I have some invitations too! If you wants one, ask me off list.
Limited supply, first requests, etc, like Greg said!

Greg Donald [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
 I have some gmail accounts of anyone wants one.  Email me off list.
 Limited supply, first requests, etc..

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



Re: [PHP] thumbnail of webpage

2004-09-20 Thread Michael Mao
Great link. This tool is exactly what I'm looking for. Thanks!


On Mon, 20 Sep 2004 08:01:15 -0500 (EST), Ed Curtis [EMAIL PROTECTED] wrote:
 
 If you have a Linux box available here's something to try although it
 does have some required software.
 
 http://www.babysimon.co.uk/khtml2png/index.html
 
 There is also a link on the site for a commercial product for Windows that
 does the same thing.
 
 I can't endorse either one as I have not used them. Just giving the
 information.
 
 Ed
 
 
 
 
 On Sat, 18 Sep 2004, raditha dissanayake wrote:
 
  Michael Mao wrote:
 
   Is there a way to capture a snapshot of a html page and save it as a
   jpg  using php?
  
  This is something that's very very hard to do with PHP but can be easily
  done with Java.
 
 
 
 
  --
  Raditha Dissanayake.
  
  http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
  Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
  Graphical User Inteface. Just 128 KB | with progress bar.
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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



Re: [PHP] Re: OT gmail accounts

2004-09-20 Thread Rick Fletcher
Ricardo Cezar wrote:
I have some invitations too! If you wants one, ask me off list.
Limited supply, first requests, etc, like Greg said!
Greg Donald [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
I have some gmail accounts of anyone wants one.  Email me off list.
Limited supply, first requests, etc..
Please stop talking about gmail invites on the list.  Anyone who wants 
one, or who has some to give away, just do a google search for a place 
to get or give them.

Sites like this one (the 3rd result for free gmail invites) are acting 
as a proxy for free invites: http://isnoop.net/gmailomatic.php

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


Re: [PHP] Re: OT gmail accounts

2004-09-20 Thread Ricardo Cezar
Sorry, will never happen again!

I was justing trying to help.   :(

Rick Fletcher [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
 Ricardo Cezar wrote:
  I have some invitations too! If you wants one, ask me off list.
  Limited supply, first requests, etc, like Greg said!
 
  Greg Donald [EMAIL PROTECTED] escreveu na mensagem
  news:[EMAIL PROTECTED]
 
 I have some gmail accounts of anyone wants one.  Email me off list.
 Limited supply, first requests, etc..

 Please stop talking about gmail invites on the list.  Anyone who wants
 one, or who has some to give away, just do a google search for a place
 to get or give them.

 Sites like this one (the 3rd result for free gmail invites) are acting
 as a proxy for free invites: http://isnoop.net/gmailomatic.php

 --Rick

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



Re: [PHP] Re: gmail accounts

2004-09-20 Thread John Holmes
From: Markus Fischer [EMAIL PROTECTED]
Which do you prefer, echo() or print() ?
Albeit that, they're identical I think (both are core language construct, 
no real functions).
Come on... all good bottom-posting-firewall-turning-off PHP programmers know 
that print() is a function and returns a value while echo does not. We're 
all using templates, anyhow, so your code wouldn't have but one echo 
statement, right? ;)

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


Re: [PHP] Re: OT gmail accounts

2004-09-20 Thread Greg Donald
On Mon, 20 Sep 2004 12:15:18 -0700, Rick Fletcher [EMAIL PROTECTED] wrote:
 Please stop talking about gmail invites on the list.  Anyone who wants
 one, or who has some to give away, just do a google search for a place
 to get or give them.
 
 Sites like this one (the 3rd result for free gmail invites) are acting
 as a proxy for free invites: http://isnoop.net/gmailomatic.php

You are a hypocrite.

You say to please stop talking about gmail invites, and then you
proceed to talk about where to get free ones, and even post a URL, as
if my free ones weren't good enough.  Pffft.

Meanwhile you offered no insight into my query about echo and print usage.

I think offering free email accounts to people who use email often is
very on-topic.  It's not like I posted a link to an ebay page.  GMail
has message threading, something every list serve member should be
using, and not all email clients support very well.

 
-- 
Greg Donald
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Re: OT gmail accounts

2004-09-20 Thread John Nichel
Rick Fletcher wrote:
Ricardo Cezar wrote:
I have some invitations too! If you wants one, ask me off list.
Limited supply, first requests, etc, like Greg said!
Greg Donald [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
I have some gmail accounts of anyone wants one.  Email me off list.
Limited supply, first requests, etc..

Please stop talking about gmail invites on the list.  Anyone who wants 
one, or who has some to give away, just do a google search for a place 
to get or give them.

Sites like this one (the 3rd result for free gmail invites) are acting 
as a proxy for free invites: http://isnoop.net/gmailomatic.php

--Rick
Yeah...what he said.  Don't you people dare try to be nice on this list. 
 Here we are trying to compete with the qmail list for nastiness, and 
y'all try to do something nice.  Jerks.

--
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] Re: gmail accounts

2004-09-20 Thread Greg Donald
On Mon, 20 Sep 2004 15:25:40 -0400, John Holmes
[EMAIL PROTECTED] wrote:
 Come on... all good bottom-posting-firewall-turning-off PHP programmers know
 that print() is a function and returns a value while echo does not. We're
 all using templates, anyhow, so your code wouldn't have but one echo
 statement, right? ;)

You mean that bloated overkill they call Smarty?  No way.

eval() is good enough for me  :)


-- 
Greg Donald
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Re: OT gmail accounts

2004-09-20 Thread Aaron Gould
John Nichel wrote:
Yeah...what he said.  Don't you people dare try to be nice on this list. 
 Here we are trying to compete with the qmail list for nastiness, and 
y'all try to do something nice.  Jerks.
Ahhh, you guys have been cracking me up the past several days.  It's 
been a good week.  :)

--
Aaron Gould
Parts Canada - Web Developer
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] External Files

2004-09-20 Thread GH
Hi

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



Re: [PHP] External Files

2004-09-20 Thread John Nichel
GH wrote:
Hi
I think I may know what's causing your problem, but just to be sure, can 
you provide just a bit more information?

--
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] External Files (take 2)

2004-09-20 Thread GH
Hi... 

Sorry about the last post... did not realize i hit the wrong button

Here is my question. Sorry if it is a basic answer... new to php

I have PHP/mySQL and would like to know how i can set use an external
file to prevent myself for having to code everytime the
connection/login to mysql.



I was thinking of making an external file but was not sure if it
should have just variables or should it have more?

also, does the content of the external file need to be enclosed in
?PHP   ?'s

Thanks for your help


Gary

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



RE: [PHP] External Files (take 2)

2004-09-20 Thread Jay Blanchard
[snip]
I have PHP/mySQL and would like to know how i can set use an external
file to prevent myself for having to code everytime the
connection/login to mysql.
[/snip]

http://www.php.net/include

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



Re: [PHP] External Files (take 2)

2004-09-20 Thread Daniel Kushner
Hi Gary,

Look up http://php.net/include

It's just like copy and pasting the code in the external file in the
one your including it into.

Best,
Daniel Kushner





__
Director of Education
Zend Technologies Ltd.

[EMAIL PROTECTED]
http://www.zend.com

==
Learn PHP from the experts, sign up for Zend's 
online training starting October 11th
http://www.zend.com/store/education/zend-online-training.php

==  


On Mon, 20 Sep 2004 16:14:07 -0400, GH [EMAIL PROTECTED] wrote:
 Hi...
 
 Sorry about the last post... did not realize i hit the wrong button
 
 Here is my question. Sorry if it is a basic answer... new to php
 
 I have PHP/mySQL and would like to know how i can set use an external
 file to prevent myself for having to code everytime the
 connection/login to mysql.
 
 
 
 I was thinking of making an external file but was not sure if it
 should have just variables or should it have more?
 
 also, does the content of the external file need to be enclosed in
 ?PHP   ?'s
 
 Thanks for your help
 
 Gary
 
 --
 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] External Files (take 2)

2004-09-20 Thread Marek Kilimajer
GH wrote:
Hi... 

Sorry about the last post... did not realize i hit the wrong button
Here is my question. Sorry if it is a basic answer... new to php
I have PHP/mySQL and would like to know how i can set use an external
file to prevent myself for having to code everytime the
connection/login to mysql.

I was thinking of making an external file but was not sure if it
should have just variables or should it have more?
The usual way to solve it is to have a config file (can be php, ini file 
or some other format). Then you have some main php script that is 
included at the top of every php script. Main script reads the config 
file, makes connection to db, starts session, includes other files that 
are necessery etc.

also, does the content of the external file need to be enclosed in
?PHP   ?'s
Yes, it's in the manual, read it.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] External Files (take 2)

2004-09-20 Thread John Nichel
GH wrote:
Hi... 

Here is my question. Sorry if it is a basic answer... new to php
I have PHP/mySQL and would like to know how i can set use an external
file to prevent myself for having to code everytime the
connection/login to mysql.

I was thinking of making an external file but was not sure if it
should have just variables or should it have more?
also, does the content of the external file need to be enclosed in
?PHP   ?'s
Thanks for your help
Gary
http://us2.php.net/include/
Yes, the php content of the external file needs to be enclosed.
--
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] External Files (take 2)

2004-09-20 Thread GH
So i would not need to use ?PHP / ? correct...

Also as to the other question I asked: 

WHat should I use in the other file? the complete connection code or
just the values as variables?


On Mon, 20 Sep 2004 13:23:20 -0700, Daniel Kushner [EMAIL PROTECTED] wrote:
 Hi Gary,
 
 Look up http://php.net/include
 
 It's just like copy and pasting the code in the external file in the
 one your including it into.
 
 Best,
 Daniel Kushner
 
 __
 Director of Education
 Zend Technologies Ltd.
 
 [EMAIL PROTECTED]
 http://www.zend.com
 
 ==
 Learn PHP from the experts, sign up for Zend's
 online training starting October 11th
 http://www.zend.com/store/education/zend-online-training.php
 
 ==
 
 
 
 
 On Mon, 20 Sep 2004 16:14:07 -0400, GH [EMAIL PROTECTED] wrote:
  Hi...
 
  Sorry about the last post... did not realize i hit the wrong button
 
  Here is my question. Sorry if it is a basic answer... new to php
 
  I have PHP/mySQL and would like to know how i can set use an external
  file to prevent myself for having to code everytime the
  connection/login to mysql.
 
  
 
  I was thinking of making an external file but was not sure if it
  should have just variables or should it have more?
 
  also, does the content of the external file need to be enclosed in
  ?PHP   ?'s
 
  Thanks for your help
 
  Gary
  
  --
  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] External Files (take 2)

2004-09-20 Thread Jay Blanchard
[snip]
So i would not need to use ?PHP / ? correct...

Also as to the other question I asked: 

WHat should I use in the other file? the complete connection code or
just the values as variables?
[/snip]

Put the entire connection string and error checking for the connection
in the 'other file'.

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



  1   2   >