RE: [PHP] Open source portal systems???

2005-02-28 Thread Christo van Rooyen
Try MAMBO, not to sure where you can find it. Google should know

Cheers ,

Christo van Rooyen 


I've got an order for the media portal. Thus, I'm looking for an open source
portal systems. First that comes to my mind is PHP-Nuke, but I heared that
it requires a powerful server and i'll have just a middle-level one. So,
could someone knows another PHP-based open source portal systems? Thank you
in advance.

--
Best regards,
 Kostyantyn  mailto:[EMAIL PROTECTED]


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

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



[PHP] Semi-OT: Anti-password trading/sharing solutions

2005-02-28 Thread Dan Trainor
Hello, all -
First, I'd like to appologize for treading a bit off-topic here, but I 
think that it will cover a lot of questions that others may have.

My company hosts several Adult-oriented Web Sites.  Among other tools 
that we use to combat Password Trading are ProxyPass and iProtect. 
They're both amazing products, which stop the use of Shared Passwords by 
detecting multiple logins from different IPs, and they also maintain a 
database of known abused proxies that are often used in conjunction with 
these shared/traded passwords, and block connections from them accordingly.

The real magic comes about when you consider how these pieces of 
software actually work.  They don't modify any existing authentication 
systems, but rather, they're both Apache modules.  I've been unable to 
find an Open Source version of these programs, which I've been looking 
for, for quite some time.  At more than $50.00 per license for ProxyPass 
and $300.00+ for iProtect, this would be more than a handful back in the 
pockets of my company, and ultimately, mine, when you consider the 
amount of our servers that run these tools.

I've found one solution that looks promising called PureMember, but this 
too, costs a bit.  Seeing that is what prompted me to write to the PHP 
list, because it makes itself into an Apache module using an mmencode 
procedure.

With that being said, what kind of solutions might the PHP community 
suggest to combat the trading and abusing of shared or traded passwords? 
 These solutions cannot modify the existing authentication procedures - 
meaning, I cannot convert a site that relies on .htaccess/.htpasswd 
authentication to a SQL-based authentication.  The solution needs to 
have some sort of logging, either locally or remotely.  The solution 
also has to be Open Source.

I eagerly await some feedback on this, because like I said, I'm sure 
there are others that have some of these same questions.

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


[PHP] Re: Hmmm

2005-02-28 Thread Lester Caine
Jason Bennett wrote:
I just installed a new MYSQL version 4.1 (from 4.0) and now none of my
PHP scripts work anymore.  They are all complaining about attempting to
login as root.  Normally, I referance a class like:
Not a MySQL user, but don't you have to change drivers between 4.0 and 
4.1 - the security system changed, so you need the php_mysqli driver?
http://uk2.php.net/manual/en/ref.mysqli.php

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Open source portal systems???

2005-02-28 Thread Christo van Rooyen
You can find it here:

http://www.mamboserver.com/ 

Christo van Rooyen 

Try MAMBO, not to sure where you can find it. Google should know

Cheers ,

Christo van Rooyen 


I've got an order for the media portal. Thus, I'm looking for an open
source portal systems. First that comes to my mind is PHP-Nuke, but I heared
that it requires a powerful server and i'll have just a middle-level one.
So, could someone knows another PHP-based open source portal systems? Thank
you in advance.

--
Best regards,
 Kostyantyn  mailto:[EMAIL PROTECTED]


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

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

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



[PHP] Pop-up message

2005-02-28 Thread Lester Caine
At the risk of being shouted at because *I* know it's not a PHP problem!
I have a page that is being refreshed every 30 seconds or so, and 
displays a list of 'tickets' waiting to be dealt with on a list from a 
database query. No problems there, but a couple of sites now want me to 
add a pop-up warning when a ticket is added that has a staff ID matching 
the logged in user.

I can drive a sounder in the target browser, but need kicking in the 
right direction for a method of adding a pop-up window. Ideally it needs 
to be browser agnostic, which is where the problem comes given the 
pop-up blockers and other 'toys' that are being added to the browser end 
of things.

So can anybody point me in the right direction for a CURRENT method of 
achieving this, many of the bits I've found so far are somewhat 
antiquated, and fail in one way or another :(

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] seach engines that don't suck

2005-02-28 Thread Zouari Fourat
 I wrote all search code
 to split words on commas and then builds SQL using LIKE statements (i know,
 i know it's bad but i was a newbie when i wrote it).

What is the professional way so ?


On Sun, 27 Feb 2005 17:04:31 +0300, Burhan Khalid [EMAIL PROTECTED] wrote:
 Colin Olkowski wrote:
  Hi All,
 
  So I've been using my own php to search my site
  (http://hiptingle.spydigital.com) and for a while it was fine...But recently
  I put in a logging system just to see what people were searching for and
  realized they aren't finding what they're seeking.  I wrote all search code
  to split words on commas and then builds SQL using LIKE statements (i know,
  i know it's bad but i was a newbie when i wrote it).
 
 [ snip ]
 
  Or if there's something totally fly that I don't know about do tell.
 
 http://www.mnogosearch.com -- its fly enough for www.mysql.com, so I
 guess your site would be just fine.
 
 --
 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] problems with several JPEGs in GD2

2005-02-28 Thread Mario Lopez
Hi,

PHP 4.3.10, GD2

I've noticed that there is a group of JPEG files
that cannot be operated with GD2 functions.

For example, if you try to imagecreatefromjpeg(my.jpg) it
replies:

Warning: imagecreatefromjpeg(): 'my.jpg' is not a valid JPEG file
in C:\Program Files\Apache Group\Apache2\htdocs\test.php on line 20

(this is not a scripting error, it works with lots of other jpegs)

Meanwhile the same my.jpg file can be shown in web browser by
HTML tag img src=my.jpg, can be opened in PhotoShop.. and other
programs..

But GD2 thinks that it is not a valid JPEG..

Any suggestions how to deal with these types of JPEGs in GD2?
Any workaround?

Thanks,
Mario

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



[PHP] Problem submitting a POST request by hand

2005-02-28 Thread Vallo Reima
Hello!
I send the parameters from one php script to another via POST method. 
The solution works (see example  below) but the receiver page loads ONLY 
if I include the echo $c; command after send_host (see PROBLEM!!! line). 
Otherwise a blank page loads without any error messages. The problem is 
same with Microsoft-IIS/5.1-PHP/5.0.3 and Apache/2.0.51-PHP/4.3.10... 
What can I do to get rid of this?
Thanks!
Vallo

function send_host($host,$path,$query,$others=''){
	$d=POST $path HTTP/1.1\r\nHost: $host\r\nContent-type: 
application/x-www-form-urlencoded\r\n${others}User-Agent: Mozilla 
4.0\r\nContent-length: .strlen($query).\r\nConnection: 
close\r\n\r\n$query;
	if (!$h = fsockopen($host,80)) {
		return -1;
	}
	else {
		stream_set_timeout($h,10);
	}
	if (fputs($h,$d) === FALSE) {
		return -2;
		}	
	else {
		$r = '';
	while(!feof($h)) {
   	$r .= fgets($h, 128);
		}
	}
	if (fclose($h) === FALSE) {
		return -3;
		}
	else {
		return $r;
	}
}

/* ... */
$c = send_host($host_name,$redirect,$par);
if ($c  0) {
   echo BERROR $c/B;
} else {
   echo $c; /* PROBLEM!!! */
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Getting PHP to work with MySQL 4.1.10 under Fedora Core 3

2005-02-28 Thread John Swartzentruber
On 2/28/2005 2:47 AM M. Sokolewicz wrote:
well, for some reason it didn't compile in the mysql extension at all... 
even though it was configured to. That's strange, and I have no idea why 
it would do that. However, since you're using mysql 4.1.x, you should be 
using the mysqli interface anyway. Even phpmyadmin has the option to use 
mysqli instead of mysql; you just need to configure it that way (via 
config.inc.php)

- tul
I'll try that, but I'd really like to know why it didn't compile in the 
mysql extension. That was my impression as well, but I couldn't see why 
that would be the case and am too new to know for sure that this was the 
case.

Where would I look for the mysqli interface documentation? Is it in the 
MySQL documentation or the PHP documentation (or both or neither)?


John Swartzentruber wrote:
I have installed MySQL 4.1.10 from RPMs from MySQL. I have installed 
PHP 5.0.3 from source and specified --with-mysql=shared,/usr on the 
configure line. Things seem to build and load correctly, but (after 
restarting Apache) when I try to run phpMyAdmin, I get the following 
error:

cannot load mysql extension,
please check PHP Configuration
Documentation
I looked at the documentation and I understand what it is saying, but 
I don't understand why it isn't able to load the mysql.so file.

I'm a real newbie who wants to learn PHP and MySQL and doesn't know 
either of them very much yet. I would greatly appreciate it if someone 
could look at my phpInfo() output and point out anything I am missing. 
You can see it at:

http://john.swartzentruber.us/test.php
I copied the mysql.so file from /usr/local/src/php-5.0.3/modules/ to 
/usr/lib/httpd/modules/. I'm running Apache 2.0.52 from the Fedora RPM.

I appreciate any help anyone can provide.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Getting PHP to work with MySQL 4.1.10 under Fedora Core 3

2005-02-28 Thread Robby Russell
On Mon, 2005-02-28 at 07:30 -0500, John Swartzentruber wrote:
On 2/28/2005 2:47 AM M. Sokolewicz wrote:
 well, for some reason it didn't compile in the mysql extension at all... 
 even though it was configured to. That's strange, and I have no idea why 
 it would do that. However, since you're using mysql 4.1.x, you should be 
 using the mysqli interface anyway. Even phpmyadmin has the option to use 
 mysqli instead of mysql; you just need to configure it that way (via 
 config.inc.php)
 
 - tul

I'll try that, but I'd really like to know why it didn't compile in the 
mysql extension. That was my impression as well, but I couldn't see why 
that would be the case and am too new to know for sure that this was the 
case.

Where would I look for the mysqli interface documentation? Is it in the 
MySQL documentation or the PHP documentation (or both or neither)?


Do you have mysql-devel installed? (since you installed via RPM). 

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] Re: Getting PHP to work with MySQL 4.1.10 under Fedora

2005-02-28 Thread John Swartzentruber
On 2/28/2005 8:27 AM Robby Russell wrote:
On Mon, 2005-02-28 at 07:30 -0500, John Swartzentruber wrote:
On 2/28/2005 2:47 AM M. Sokolewicz wrote:
well, for some reason it didn't compile in the mysql extension at all... 
even though it was configured to. That's strange, and I have no idea why 
it would do that. However, since you're using mysql 4.1.x, you should be 
using the mysqli interface anyway. Even phpmyadmin has the option to use 
mysqli instead of mysql; you just need to configure it that way (via 
config.inc.php)

- tul
I'll try that, but I'd really like to know why it didn't compile in the 
mysql extension. That was my impression as well, but I couldn't see why 
that would be the case and am too new to know for sure that this was the 
case.

Where would I look for the mysqli interface documentation? Is it in the 
MySQL documentation or the PHP documentation (or both or neither)?


Do you have mysql-devel installed? (since you installed via RPM). 
Yes, I installed MySQL-server, MySQL-client, MySQL-devel, and 
MySQL-bench, in addition to the shared compatibility libs.

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


[PHP] [MondayMorningRant] Re: [PHP] Semi-OT: Anti-password trading/sharing solutions

2005-02-28 Thread Jochem Maas
if you any of the following might apply to you, please hit delete now:
1. easily offended.
2. think this email _needs_ a reply.
3. no sense of humour.
4. can't accept that humour varies from person to person.
thanks, that will save alot of heart-ache and bandwidth...
LETS RANT BABY :-)
Dan Trainor wrote:
Hello, all -
First, I'd like to appologize for treading a bit off-topic here, but I 
think that it will cover a lot of questions that others may have.

My company hosts several Adult-oriented Web Sites.  Among other tools 
dunno about the rest of the list but that sounds like pr0n to me.
that we use to combat Password Trading are ProxyPass and iProtect. 
They're both amazing products, which stop the use of Shared Passwords by 
right up there with Clippy(tm) and the AOL webbrowser.
detecting multiple logins from different IPs, and they also maintain a 
database of known abused proxies that are often used in conjunction with 
these shared/traded passwords, and block connections from them accordingly.

The real magic comes about when you consider how these pieces of 
software actually work.  They don't modify any existing authentication 
systems, but rather, they're both Apache modules.  I've been unable to 
find an Open Source version of these programs, which I've been looking 
for, for quite some time.  At more than $50.00 per license for ProxyPass 
and $300.00+ for iProtect, this would be more than a handful back in the 
pockets of my company, and ultimately, mine, when you consider the 
amount of our servers that run these tools.
so you spend 350 dollars per server, you wouldn't do it unless it made 
money,
besides I'll bet the clients actually pay it (or you spend your own money to
provide free hosting to hard-up 'adult content providers') - so really your
looking for a OS variation so that you can pocket the extra 350.
ah do all the other pr0n peddlers have TWO porsches'? poor little Dan must be
feeling left out.
I've found one solution that looks promising called PureMember, but this 
too, costs a bit.  Seeing that is what prompted me to write to the PHP 
list, because it makes itself into an Apache module using an mmencode 
procedure.

With that being said, what kind of solutions might the PHP community 
suggest to combat the trading and abusing of shared or traded passwords? 
solution: try re-prioritizing other peoples misery above your own greed...
tada.
I CAN HONESTLY SAY I DON'T GIVE A F*** ABOUT YOUR ABUSED pr0n PASSWDS,
on the contrary I hope your whole insdustry gets pirated and hacked into
oblivion, I wish upon your inbox 1 times the number of sick spam messages
all your clients have ever sent out.
 These solutions cannot modify the existing authentication procedures - 
meaning, I cannot convert a site that relies on .htaccess/.htpasswd 
authentication to a SQL-based authentication.  The solution needs to 
have some sort of logging, either locally or remotely.  The solution 
also has to be Open Source.

I eagerly await some feedback on this, because like I said, I'm sure 
there are others that have some of these same questions.
can anyone else see a good reason to sit down a write a a free OS
apache module that stops passwd sharing so that some porn peddler
can make more money?
sarcasm
I for one would love to donate all my free time to making you rich,
but only on the condition that you can prove at 50% of all the females
portrayed in the media offered by 'your clients' can truthfully have
the following said about them:
1. they have been forced fed drugs.
2. they have had their passport withheld.
3. they are beaten/raped regularly.
4. they have Shires Horses forced upon them.
/sarcasm
 or maybe you could go f*** yourself (no doubt one of your clients can
provide an instruction video).
Thanks for your time
Thanks for continuing and support a wholy abusive industry and mindset, 
thanks
for destroying/perverting/twisting the sexuality of millions, nice one ace.
PS - anyone who might get the impression I some kind of fanatical religious
virgin: I have a kid, I have utter contempt for organised religion and I'm just
to lazy to be fanatical about anything. BUT p0rn as an industry ain't no good
for peoples state of being... otherwise the Kama Sutra would have a
'throatf***ing' edition. Or maybe everyone disagrees, maybe I'm just a lone nut,
maybe the objectification of women is the way, the truth and the light
PPS - Here in Holland, we have a current top 'musical' 10 which includes a 
'song'
entitled - I just want to call you my bitch, which is simultaneously the 
complete
lyrics to said 'song' - super smashing great, a truly inspirational piece of art
sprung forth from the fertile cultural environment we live in - hiphip hooray 
for
pr0n peddlers everywhere!
PPPS - anyone still reading is probably trying to avoid doing real work
so even if you think that whatever I wrote is crap/evil/stupid/annoying/etc its 
still
served a useful purposed.
S - any pr0n peddlers arguing that 

Re: [PHP] Problem submitting a POST request by hand

2005-02-28 Thread Jochem Maas
Vallo Reima wrote:
Hello!
I send the parameters from one php script to another via POST method. 
The solution works (see example  below) but the receiver page loads ONLY 
if I include the echo $c; command after send_host (see PROBLEM!!! line).

AFAICS $c contains the response output of the URL which you POSTed to using
fputs() - which is the return value of send_host(), so unless you echo the
contents of $c (assuming you are not outputting anything else) you will
not see the output returned when you do a POST request to the URL passed to
the send_host() function ...
I might be missing the point completely, but what exactly is the problem?
you seem to do a POST hit on a url get some output returned and then display
this as if it were your own page... and that seems to be what you want it to 
do...?
rgds  not-quite-seeing-the-problem,
Jochem
Otherwise a blank page loads without any error messages. The problem is 
same with Microsoft-IIS/5.1-PHP/5.0.3 and Apache/2.0.51-PHP/4.3.10... 
What can I do to get rid of this?
Thanks!
Vallo

function send_host($host,$path,$query,$others=''){
$d=POST $path HTTP/1.1\r\nHost: $host\r\nContent-type: 
application/x-www-form-urlencoded\r\n${others}User-Agent: Mozilla 
4.0\r\nContent-length: .strlen($query).\r\nConnection: 
close\r\n\r\n$query;
if (!$h = fsockopen($host,80)) {
return -1;
}
else {
stream_set_timeout($h,10);
}
if (fputs($h,$d) === FALSE) {
return -2;
}   
else {
$r = '';
while(!feof($h)) {
   $r .= fgets($h, 128);
}
}
if (fclose($h) === FALSE) {
return -3;
}
else {
return $r;
}
}

/* ... */
$c = send_host($host_name,$redirect,$par);
if ($c  0) {
   echo BERROR $c/B;
} else {
   echo $c; /* PROBLEM!!! */
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Syntax Highlighting variables not appearing

2005-02-28 Thread Tom Whitbread
Can anyone explain why this is happening.
I am using the following code For giving code examples on my website 
with syntax highlighting

$text = 'lt;?php \$my_code = echo 'text text text text'; \$foo = 'bar';; example_function(\$my_code); ?gt';
$body = preg_replace('/lt;(.*?)gt;/es', 'highlight_string(\\1, true)', $text);
echo $body; //Returns: ?php = 'echo \'text text text text\'\';  = \'bar\'; highlight_string(, true); ? 
		//I want:  ?php $my_code = echo 'text text text text'; $foo = 'bar';; example_function($my_code); ? 

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


Re: [PHP] Problem submitting a POST request by hand

2005-02-28 Thread Vallo
The problem is that the URL which I posted to doesn't display in a 
browser again. I want to do the following:
1) www.someserver.com/feedback.phtml sends the user-entered form data to 
www.someserver.com/mailer.php
2) www.someserver.com/mailer.php (the example below) checks these data 
and submits resulting parameter list via POST method back to 
www.someserver.com/feedback.phtml and loads it again
3) www.someserver.com/feedback.phtml displays again in a browser 
according to received POST parameters...
PROBLEM: www.someserver.com/feedback.phtml doesn't load again (a blank 
page is displayed). I discovered by accidant that if I add the echo $c; 
line then the page loades but the c value's string is seen on the top. 
How can I get the www.someserver.com/feedback.phtml loaded again without 
this trick?

Vallo
Jochem Maas wrote:
Vallo Reima wrote:
Hello!
I send the parameters from one php script to another via POST method. 
The solution works (see example  below) but the receiver page loads 
ONLY if I include the echo $c; command after send_host (see PROBLEM!!! 
line).

AFAICS $c contains the response output of the URL which you POSTed to using
fputs() - which is the return value of send_host(), so unless you echo the
contents of $c (assuming you are not outputting anything else) you will
not see the output returned when you do a POST request to the URL passed to
the send_host() function ...
I might be missing the point completely, but what exactly is the problem?
you seem to do a POST hit on a url get some output returned and then 
display
this as if it were your own page... and that seems to be what you want 
it to do...?

rgds  not-quite-seeing-the-problem,
Jochem
Otherwise a blank page loads without any error messages. The problem 
is same with Microsoft-IIS/5.1-PHP/5.0.3 and 
Apache/2.0.51-PHP/4.3.10... What can I do to get rid of this?
Thanks!
Vallo

function send_host($host,$path,$query,$others=''){
$d=POST $path HTTP/1.1\r\nHost: $host\r\nContent-type: 
application/x-www-form-urlencoded\r\n${others}User-Agent: Mozilla 
4.0\r\nContent-length: .strlen($query).\r\nConnection: 
close\r\n\r\n$query;
if (!$h = fsockopen($host,80)) {
return -1;
}
else {
stream_set_timeout($h,10);
}
if (fputs($h,$d) === FALSE) {
return -2;
}   else {
$r = '';
while(!feof($h)) {
   $r .= fgets($h, 128);
}
}
if (fclose($h) === FALSE) {
return -3;
}
else {
return $r;
}
}

/* ... */
$c = send_host($host_name,$redirect,$par);
if ($c  0) {
   echo BERROR $c/B;
} else {
   echo $c; /* PROBLEM!!! */
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How to retrieve form data?

2005-02-28 Thread Gregg Nelson
You are correct, and I must apologize.
In addition to the modifications below I added a pair of brackets
to the select clause:
select name=item[] 

After removing those the $_POST array looks much better
and I was able print the selected item using
echo Selected item is: .$_POST['item'];

Results now:
---
Using printr, $_POST array contains:
Array
(
[item] = select item 1
)

Selected item is: select item 1
---

Thank you very much for your responses and willingness to help one who is
just beginning
to learn how to use PHP.  I am now on my way.

John Nichel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Gregg Nelson wrote:
 snip
  Clicking on the submit button now produces:
  --
  Request Method: POST
  Using foreach loop, $_POST array contains:
  Array
  Using printr, $_POST array contains:
 
  Array
  (
  [item] = Array
  (
  [0] = select item 1
  )
 
  )
  -So what exactly does
this
  mean?:  $Post is an array thatconsists of one item that is also an
array,
  that being the item array consisting of one entry containing the
select
  string?If so, can I access the item array itself? I tried this in the
  script but nothing was echoed:echo $item[0]

 No, that's not how it should be coming across.  Not unless you modified
 your original form to send item as an array (like you would do if it was
 a multi-select).  If your HTML form hasn't changed from how you have it
 below, and 'item' is still coming across as an array, you have a problem
 sowhere else.


 original form?
 ---
 html
 form action=?php $_SERVER['PHP_SELF'] ? method=post 
select name=item 
  option value=select item 1  item 1 /option
  option value=select item 2  item 2 /option
/select
 input type=submit value=Submit
 /form
 
 ?php
 echo Request Method: .$_SERVER['REQUEST_METHOD'].br /;
 
 if ($_SERVER['REQUEST_METHOD'] == POST):
echo '$_POST array contains:'.br /;
foreach ($_POST as $value) {echo $value.br /;}
 endif;
 ?/html

 -- 
 By-Tor.com
 ...it's all about the Rush
 http://www.by-tor.com

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



[PHP] textarea posting duplicate text

2005-02-28 Thread Elizabeth Lawrence
Hello. I have been asked to look at a PHP issue for someone, and I can't
figure out what the problem is. I'm hoping one of you experts can help!

 

They are using Red Hat Linux / Ensim Pro 4.0.2, PHP 4.3.10, and Apache 2.0.

 

The problem: When a lot of text is entered into a textarea on a form, the
text that shows up in the $_POST['textarea'] variable has the text that was
entered, but it is duplicated. This is causing problems for their forums.
Here is a very simple script I placed on the server:
www.tidefans.com/textarea_test.php (code below)

When I place the same script on another server I have access to, the
textarea text is posted fine.

Is this a PHP setting somewhere that I'm missing?

 

Here is the code for the PHP script mentioned above:

html

head

titleTest PHP Script/title

/head

body

form method=post action=textarea_test.php name=Form1

textarea cols=50 rows=20 name=textarea

//[a bunch of text goes here]

/textareabr

input type=text name=text size=20 value=This is some textbr

input type=submit name=Submit value=Submit

?php

if ($_POST[Submit] != )

{

  echo h1_POST values/h1;

  echo pTextarea submitted:/p;

  echo pre . $_POST[textarea] . /pre;

  echo pTextbox submitted:/p;

  echo pre . $_POST[text] . /pre;

  echo pSubmit submitted:/p;

  echo pre . $_POST[Submit] . /pre;

}

?

/form

?php

phpinfo();

? 

/body

/html

 

If anyone can point me in the right direction, I would appreciate it so
much!

Elizabeth

 

Elizabeth Lawrence

[EMAIL PROTECTED]

 



Re: [PHP] how to move files from one place to another ?

2005-02-28 Thread Rory Browne
I think you should read his post before telling him to RTFM. AFAICT He
wants to move the files, not copy them. I think the command he is
looking for is infact http://www.php.net/rename , which isn't
immediately obvious, when you are infact moving and not just renaming.
It's only something you'd consider, when you have a background of
using the move command on unix(mv) to rename.


On Sun, 27 Feb 2005 17:02:36 +0300, Burhan Khalid [EMAIL PROTECTED] wrote:
 Vaibhav Sibal wrote:
  Hello,
  Can some please guide me as to how should I move files from one
  directory to another on the server itself using PHP ? I use PHP 5.0.3
  and Apache2 and Mysql.
 
 Please, RTFM  http://www.php.net/manual/en/function.copy.php
 Please, don't cross post.
 
 --
 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] function to resize images

2005-02-28 Thread Bosky, Dave
Does anyone have a nice function that will resize an uploaded image to
specific width/height dimensions?

I wanted to find something that would work for only GIF and JPG image types.
I've converted my shopping cart

application from Cold Fusion to PHP and need to create thumbnails and reduce
the size of large uploaded images.

 

I've already done a google search and found an example but can't get it to
work for some reason and it includes a 

bunch of other stuff that's not needed and too much trouble to remove.

 

 

Thanks,

Dave

 



HTC Disclaimer:  The information contained in this message may be privileged 
and confidential and protected from disclosure. If the reader of this message 
is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify us 
immediately by replying to the message and deleting it from your computer.  
Thank you.


[PHP] Improving a MySQL Search

2005-02-28 Thread James Nunnerley
I'm creating a serious of pages that show various aspects from a Syslog
output.

The main information is currently stored in one MySQL table - which after
having been run for about 2 and a bit months has got nearly 100 records.
With this amount of information, it's taking a large time to carryout even
the simplest query.

 

Someone has suggested I look at setting up an archive, for slower searches,
and a more recent table for quicker searching, but I'm reluctant to do this,
as it would take quite a bit of time to copy all the information across as
it stands, and then also to run a cron which transfers between the live and
archive.

 

Can anyone suggest some quick easy methods for speeding up the search?

 

Cheers

James



Re: [PHP] function to resize images

2005-02-28 Thread Frank Arensmeier
Dave!
I would start by reading the PHP manual. Look for a function called 
'imagecopyresized()'. This might help.

/frank
2005-02-28 kl. 16.34 skrev Bosky, Dave:
Does anyone have a nice function that will resize an uploaded image to
specific width/height dimensions?
I wanted to find something that would work for only GIF and JPG image 
types.
I've converted my shopping cart

application from Cold Fusion to PHP and need to create thumbnails and 
reduce
the size of large uploaded images.


I've already done a google search and found an example but can't get 
it to
work for some reason and it includes a

bunch of other stuff that's not needed and too much trouble to remove.


Thanks,
Dave


HTC Disclaimer:  The information contained in this message may be 
privileged and confidential and protected from disclosure. If the 
reader of this message is not the intended recipient, or an employee 
or agent responsible for delivering this message to the intended 
recipient, you are hereby notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.  
If you have received this communication in error, please notify us 
immediately by replying to the message and deleting it from your 
computer.  Thank you.

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


Re: [PHP] function to resize images

2005-02-28 Thread Robby Russell
On Mon, 2005-02-28 at 10:34 -0500, Bosky, Dave wrote:
Does anyone have a nice function that will resize an uploaded image to
specific width/height dimensions?

I wanted to find something that would work for only GIF and JPG image types.
I've converted my shopping cart

application from Cold Fusion to PHP and need to create thumbnails and reduce
the size of large uploaded images.

 

I've already done a google search and found an example but can't get it to
work for some reason and it includes a 

bunch of other stuff that's not needed and too much trouble to remove.


Some info in this post might help you:

http://blog.planetargon.com/archives/44-Image-Watermarks-in-PHP.html


-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] Improving a MySQL Search

2005-02-28 Thread Gareth Williams
Create some indexes.  I spend most of my day messing around with a 
table of 200 records, and indexes increased the speed from 40 
seconds to 55 minutes for a query, down to the longest being less than 
5 seconds.

On 28 Feb 2005, at 16:42, James Nunnerley wrote:
I'm creating a serious of pages that show various aspects from a Syslog
output.
The main information is currently stored in one MySQL table - which 
after
having been run for about 2 and a bit months has got nearly 100 
records.
With this amount of information, it's taking a large time to carryout 
even
the simplest query.


Someone has suggested I look at setting up an archive, for slower 
searches,
and a more recent table for quicker searching, but I'm reluctant to do 
this,
as it would take quite a bit of time to copy all the information 
across as
it stands, and then also to run a cron which transfers between the 
live and
archive.


Can anyone suggest some quick easy methods for speeding up the search?

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


Re: [PHP] uploading files with a single quote in the filename

2005-02-28 Thread AdamT
On 24 Feb 2005 08:22:39 -0600, Bret Hughes [EMAIL PROTECTED] wrote:
 On Thu, 2005-02-24 at 01:04, Dotan Cohen wrote:
   that.  A little javascript goes a  long way in these sort of situations
 
  You don't want to do that will javascript. I, for one, surf with
  javascript turned off. The malicious script kiddie, I would presume,
  also would be very happy to send you a silly filename without letting
  javascript check it.
 
Javascript and client-side HTML bounds checking can be very useful. 
It's a hell of a lot easier to be able to have the web browser tell
the user that what they've put in is invalid, rather than have them
upload their stuff, have the web server check it all over, and then
send back a 'sorry, this is broken' message.  Just don't rely on it
for security.

-- 
AdamT
Justify my text?  I'm sorry, but it has no excuse.

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



Re: [PHP] Problem submitting a POST request by hand

2005-02-28 Thread Chris
Vallo Reima wrote:
Hello!
I send the parameters from one php script to another via POST method. 
The solution works (see example  below) but the receiver page loads 
ONLY if I include the echo $c; command after send_host (see PROBLEM!!! 
line). Otherwise a blank page loads without any error messages. The 
problem is same with Microsoft-IIS/5.1-PHP/5.0.3 and 
Apache/2.0.51-PHP/4.3.10... What can I do to get rid of this?
Thanks!
Vallo

[snip]
So you calling that function, but then the page stops loading when you do?
A possible solution woul be to put \r\n\r\n after $query in your $d 
string. That would signify the end of the Request body (and the server 
should not send a response until it gets that.)

I'm not sure it'll fix your problem, but it's worth a shot
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php DBMS

2005-02-28 Thread Gerben
Hi,

I'm wondering if there is any DBMS, like MySQL, which is (fully) implemented
in php. This so you don't have to buy a MySQL database.

I'm currently trying to put something together, but this would be a waste of
time if it already exists.

greetings
Gerben
Holland

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



[PHP] Problem configuring mhash

2005-02-28 Thread Srinadh Sannidhanam
Hi
  I am trying to configure mhash. I installed mhash. But I found that I have to 
compile php with 
--with-mhash option. But I am unable to found configure command corresponding 
to PHP. Where can I found that. Are there any other ways to configure the same. 
Can't I configure that in php.ini file?
 
--srinadh.


-
Do you Yahoo!?
 Yahoo! Mail - now with 250MB free storage. Learn more.

Re: [PHP] sentence case

2005-02-28 Thread Stephen Johnson
OK -- dumb question -- what is an OP?


?php
/*

Stephen Johnson c | eh
The Lone Coder

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

562.924.4454 (office)
562.924.4075 (fax) 

continuing the struggle against bad code

*/ 
?

 From: John Nichel [EMAIL PROTECTED]
 Date: Wed, 23 Feb 2005 14:13:20 -0500
 To: php Mailing Lists php-general@lists.php.net
 Subject: Re: [PHP] sentence case
 
 
 What if the OP doesn't like touching worms?  ;)

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



Re: [PHP] php DBMS

2005-02-28 Thread John Holmes
Gerben wrote:
I'm wondering if there is any DBMS, like MySQL, which is (fully) implemented
in php. This so you don't have to buy a MySQL database.
I'm currently trying to put something together, but this would be a waste of
time if it already exists.
SQLite is probably what you're after. It comes with PHP5 and can be 
built into PHP4, iirc. Of course, I'm assuming what you mean by fully 
implemented is included with PHP, not written with it. A database 
written in PHP would not be good, imo.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] sentence case

2005-02-28 Thread John Nichel
Stephen Johnson wrote:
OK -- dumb question -- what is an OP?
Original Poster
--
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] Mailing List Tool

2005-02-28 Thread The Disguised Jedi
this list runs on emlzm i do believe...and that is a tool you could use...


On Sun, 27 Feb 2005 19:11:21 -0500, GH [EMAIL PROTECTED] wrote:
 Does someone know of a mailing list tool that runs via PHP that can
 check periodically (ie via a scheduled task) an email account for a
 message and then send it out to an entire list of addresses?
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
The Disguised Jedi
[EMAIL PROTECTED]

Now you have my $0.02.  Or .01 Pounds, .014 Euros, or $0.025 CAN.  I'm
world-wide BABY!
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

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



Re: [PHP] Problem submitting a POST request by hand

2005-02-28 Thread Chris Shiflett
--- Vallo Reima [EMAIL PROTECTED] wrote:
 I send the parameters from one php script to another via POST method.
 The solution works (see example  below) but the receiver page loads
 ONLY if I include the echo $c; command after send_host (see PROBLEM!!!
 line).

Without looking at your code, I can tell that this seems to not be a
problem at all but rather a misunderstanding about what you're doing.

A client sends a request to a server, and the content of the response is
displayed. This is an oversimplified explanation of how a typical HTTP
transaction works.

In your case, the client sends a request to the server (you), and you're
sending a request to another server while the client waits on your
response. If you don't send anything, the client won't receive anything -
it's pretty simple, really. :-)

In other words:

Client   ---   You   ---   Other Server

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming Soon http://httphandbook.org/

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



Re: [PHP] php DBMS

2005-02-28 Thread Bret Hughes
On Mon, 2005-02-28 at 11:31, Gerben wrote:
 Hi,
 
 I'm wondering if there is any DBMS, like MySQL, which is (fully) implemented
 in php. This so you don't have to buy a MySQL database.
 
 I'm currently trying to put something together, but this would be a waste of
 time if it already exists.
 

Does MySQL cost money?  I thought it was open source and available at no
cost.  

Bret

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



Re: [PHP] function to resize images

2005-02-28 Thread Andre Dubuc
On Monday 28 February 2005 10:34 am, Bosky, Dave wrote:
 Does anyone have a nice function that will resize an uploaded image to
 specific width/height dimensions?

 I wanted to find something that would work for only GIF and JPG image
 types. I've converted my shopping cart

 application from Cold Fusion to PHP and need to create thumbnails and
 reduce the size of large uploaded images.



 I've already done a google search and found an example but can't get it to
 work for some reason and it includes a

 bunch of other stuff that's not needed and too much trouble to remove.





 Thanks,

 Dave



This one works for me: currently I have a max of 600kb on upload which is 
reduced to 10% (60kb). Assumes you have a 'pix' directory where you load 
jpegs etc:


if ($_FILES[pix][type] == image/jpeg)
{
$pix_file = $_FILES[pix][name];
$pix_temp_file = $_FILES[pix][tmp_name];

/* Rename file with id and 'U' for upload */

$new_pix_file = U{$_SESSION['rid']}-{$_SESSION['sid']}.jpg;


if(is_uploaded_file($pix_temp_file)){
move_uploaded_file($pix_temp_file, 
/your_site/web/pix/{$_SESSION['rid']}-{$_SESSION['sid']}.jpg);
}

$original = 
/your_site/pix/{$_SESSION['rid']}-{$_SESSION['sid']}.jpg;

/* Resize the uploaded picture */

$dest_h = 190;
$dest_w = 117;

// create the blank limited-palette image
$base_image = imageCreate($dest_w, $dest_h);

move_uploaded_file($base_image, /your_site/pix/convert.jpg);

// convert and save it to temp.jpg
imagejpeg($base_image, '/your_site/pix/convert.jpg');



// get the image pointer to the temp jpeg
$image = imageCreateFromJpeg('/your_site/pix/convert.jpg');

// get the image pointer to the original image
$imageToResize = 
imageCreateFromJpeg(/your_site/pix/{$_SESSION['rid']}-{$_SESSION['sid']}.jpg);
$src_w = imagesx($imageToResize);   // Current Image 
Width
$src_h = imagesy($imageToResize);   // Current Image 
Height

// resize the original image over temp.jpg
// since you have GD2, you could also use imageCopyResampled
imageCopyResized($image, $imageToResize, 0, 0, 0, 0, $dest_w, 
$dest_h,
$src_w, $src_h);

// values for output jpeg quality
$jpegQuality = 75;

// create the resized image
imageJpeg($image,   
/your_site/pix/{$_SESSION['rid']}-{$_SESSION['sid']}.jpg, $jpegQuality);

// cleanup temp files
}
}

Hth,
Andre

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



Re: [PHP] php DBMS

2005-02-28 Thread Jochem Maas
Bret Hughes wrote:
On Mon, 2005-02-28 at 11:31, Gerben wrote:
Hi,
I'm wondering if there is any DBMS, like MySQL, which is (fully) implemented
what do you mean by 'fully' - there are lots of DB drivers implemented (as 
extensions)
for php.
in php. This so you don't have to buy a MySQL database.
sqlite might be interesting for you.
I'm currently trying to put something together, but this would be a waste of
time if it already exists.
what kind of thing are you trying to put together - I assume your not 
trying to
build a database engine in php???


Does MySQL cost money?  I thought it was open source and available at no
cost.  
true its free, but you can also run a comcercial version which gives you
indemnity and support and stuff Google for instance are known to run MySQL,
companies like that like to have support contracts - at MySQL they are glad to 
oblige,
just unlike some other very fairplaying non-antitrust type businesses they don't
force feed you the license fee :-)
Bret
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: [MondayMorningRant] Re: [PHP] Semi-OT: Anti-password trading/sharing solutions

2005-02-28 Thread dan
Jochem Maas wrote:
if you any of the following might apply to you, please hit delete now:
1. easily offended.
2. think this email _needs_ a reply.
3. no sense of humour.
4. can't accept that humour varies from person to person.
thanks, that will save alot of heart-ache and bandwidth...
LETS RANT BABY :-)
Dan Trainor wrote:
Hello, all -
First, I'd like to appologize for treading a bit off-topic here, but I 
think that it will cover a lot of questions that others may have.

My company hosts several Adult-oriented Web Sites.  Among other tools 

dunno about the rest of the list but that sounds like pr0n to me.
that we use to combat Password Trading are ProxyPass and iProtect. 
They're both amazing products, which stop the use of Shared Passwords by 

right up there with Clippy(tm) and the AOL webbrowser.
detecting multiple logins from different IPs, and they also maintain a 
database of known abused proxies that are often used in conjunction 
with these shared/traded passwords, and block connections from them 
accordingly.

The real magic comes about when you consider how these pieces of 
software actually work.  They don't modify any existing authentication 
systems, but rather, they're both Apache modules.  I've been unable to 
find an Open Source version of these programs, which I've been looking 
for, for quite some time.  At more than $50.00 per license for 
ProxyPass and $300.00+ for iProtect, this would be more than a handful 
back in the pockets of my company, and ultimately, mine, when you 
consider the amount of our servers that run these tools.

so you spend 350 dollars per server, you wouldn't do it unless it made 
money,
besides I'll bet the clients actually pay it (or you spend your own 
money to
provide free hosting to hard-up 'adult content providers') - so really your
looking for a OS variation so that you can pocket the extra 350.

ah do all the other pr0n peddlers have TWO porsches'? poor little Dan 
must be
feeling left out.

I've found one solution that looks promising called PureMember, but 
this too, costs a bit.  Seeing that is what prompted me to write to 
the PHP list, because it makes itself into an Apache module using an 
mmencode procedure.

With that being said, what kind of solutions might the PHP community 
suggest to combat the trading and abusing of shared or traded passwords? 

solution: try re-prioritizing other peoples misery above your own greed...
tada.
I CAN HONESTLY SAY I DON'T GIVE A F*** ABOUT YOUR ABUSED pr0n PASSWDS,
on the contrary I hope your whole insdustry gets pirated and hacked into
oblivion, I wish upon your inbox 1 times the number of sick spam 
messages
all your clients have ever sent out.

 These solutions cannot modify the existing authentication procedures 
- meaning, I cannot convert a site that relies on .htaccess/.htpasswd 
authentication to a SQL-based authentication.  The solution needs to 
have some sort of logging, either locally or remotely.  The solution 
also has to be Open Source.

I eagerly await some feedback on this, because like I said, I'm sure 
there are others that have some of these same questions.

can anyone else see a good reason to sit down a write a a free OS
apache module that stops passwd sharing so that some porn peddler
can make more money?
sarcasm
I for one would love to donate all my free time to making you rich,
but only on the condition that you can prove at 50% of all the females
portrayed in the media offered by 'your clients' can truthfully have
the following said about them:
1. they have been forced fed drugs.
2. they have had their passport withheld.
3. they are beaten/raped regularly.
4. they have Shires Horses forced upon them.
/sarcasm
 or maybe you could go f*** yourself (no doubt one of your clients can
provide an instruction video).
Thanks for your time

Thanks for continuing and support a wholy abusive industry and mindset, 
thanks
for destroying/perverting/twisting the sexuality of millions, nice one ace.

PS - anyone who might get the impression I some kind of fanatical religious
virgin: I have a kid, I have utter contempt for organised religion and 
I'm just
to lazy to be fanatical about anything. BUT p0rn as an industry ain't no 
good
for peoples state of being... otherwise the Kama Sutra would have a
'throatf***ing' edition. Or maybe everyone disagrees, maybe I'm just a 
lone nut,
maybe the objectification of women is the way, the truth and the 
light

PPS - Here in Holland, we have a current top 'musical' 10 which includes 
a 'song'
entitled - I just want to call you my bitch, which is simultaneously 
the complete
lyrics to said 'song' - super smashing great, a truly inspirational 
piece of art
sprung forth from the fertile cultural environment we live in - hiphip 
hooray for
pr0n peddlers everywhere!

PPPS - anyone still reading is probably trying to avoid doing real work
so even if you think that whatever I wrote is 
crap/evil/stupid/annoying/etc its still
served a useful purposed.


Re: [PHP] Problem submitting a POST request by hand

2005-02-28 Thread Vallo
I send something using fsockopen()  fputs() :-)
Client sends request (submits form to my script) to me (i.e. server) and 
I want to send back to client a page with POST parameters from my 
script. But the page doesn't display in the clients browser (blank page 
opens). Question: what is missing in this script?

Vallo
Chris Shiflett wrote:
--- Vallo Reima [EMAIL PROTECTED] wrote:
I send the parameters from one php script to another via POST method.
The solution works (see example  below) but the receiver page loads
ONLY if I include the echo $c; command after send_host (see PROBLEM!!!
line).

Without looking at your code, I can tell that this seems to not be a
problem at all but rather a misunderstanding about what you're doing.
A client sends a request to a server, and the content of the response is
displayed. This is an oversimplified explanation of how a typical HTTP
transaction works.
In your case, the client sends a request to the server (you), and you're
sending a request to another server while the client waits on your
response. If you don't send anything, the client won't receive anything -
it's pretty simple, really. :-)
In other words:
Client   ---   You   ---   Other Server
Hope that helps.
Chris
=
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming Soon http://httphandbook.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Problem submitting a POST request by hand

2005-02-28 Thread Chris Shiflett
--- Vallo [EMAIL PROTECTED] wrote:
 I send something using fsockopen()  fputs() :-)

Yes, you send something to another server, not the client. You send stuff
to the client by using things like echo.

 Client sends request (submits form to my script) to me (i.e. server)
 and I want to send back to client a page with POST parameters from my
 script. But the page doesn't display in the clients browser (blank
 page opens). Question: what is missing in this script?

Output.

If you send nothing to the client, the client gets nothing. I promise I'm
telling the truth. :-)

It doesn't matter what else you do. You can connect to a thousand
different servers, collect data from a thousand different databases, and
do stuff more complex than any PHP developer has ever done before.
However, if you never output anything, the client is going to see a blank
page.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming Soon http://httphandbook.org/

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



Re: [PHP] Problem submitting a POST request by hand

2005-02-28 Thread John Holmes
Vallo wrote:
  Client sends request (submits form to my script) to me (i.e. server) 
and
I want to send back to client a page with POST parameters from my 
script. But the page doesn't display in the clients browser (blank page 
opens). Question: what is missing in this script?
echo and/or print?
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: [MondayMorningRant] Re: [PHP] Semi-OT: Anti-password trading/sharing solutions

2005-02-28 Thread Robert Cummings
On Mon, 2005-02-28 at 14:37, dan wrote:
 Well I'll be God Damned.  You're pretty clever.  You're surly going to 
 Heaven, now!

Oh no, he'll surely terrorize all of heaven with his surliness ;)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Authentication fails

2005-02-28 Thread John Swartzentruber
Somehow my PHP 5.0.3 or something is configured incorrectly. When I try 
to get past an authentication input, nothing happens. For example, I 
have phpMyAdmin configured now to use mysqli, but when I enter the 
username and password, the screen doesn't change. In previous testing, I 
saw that an incorrect authentication was detected and reported, but a 
correct authentication had no affect.

My phpinfo() output is at http://john.swartzentruber.us/test.php
For example, I'm trying to use a simple file upload script called file 
thingie that is at http://www.solitude.dk/filethingie/download.php

I have edited the original file only to decrease the maximum file size 
to 500 bytes and limit uploads to text files. I hope no one here tries 
to be nasty. The user name is USERNAME2 and the password is PASSWORD.

Can anyone check this out and give me some clues or things to look into? 
Is there some setting that would cause _POST data to disappear? How 
would I go about debugging this?

Thanks for any help or pointers.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Apache and PHP

2005-02-28 Thread Gustav Wiberg
Hi there!
I've just installed Apache on a new computer. (just for testing)
It's Windows XP. I've then installed PHP and it says that Apache could be 
not configured automatically.

Newbies question as hell probably but here it goes:
I can access my Apache-server, I have the document-root to c:\webb and the 
apace-files is in c:\program\Apache
I've changed a little in httpd.conf file and restarted the Apace-service. I 
have changed the documentRoot and another parameter that was very alike 
documentRoot...

But my problem...
The sourcecode for PHP shows when I access the http-server with php-files.
I don't cant getting any full support answers on this, just give me hints... 
:-)

/G
@varupiraten.se 

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


Re: [PHP] Problem configuring mhash

2005-02-28 Thread Richard Lynch
Srinadh Sannidhanam wrote:
   I am trying to configure mhash. I installed mhash. But I found that I
 have to compile php with
 --with-mhash option. But I am unable to found configure command
 corresponding to PHP. Where can I found that. Are there any other ways to
 configure the same. Can't I configure that in php.ini file?

You probably have PHP installed as an RPM or some other kind of
pre-packaged binary from your Linux distribution.

You can either search for PHP mhash module with the *SAME* version
numbers of PHP, or you can un-install the pre-packaged stuff and compile
from source code.

Had you compiled from source code, the configure part would be
self-evident, as that is the first step in compiling from source code.

It's also possible you are using Windows, in which case you need to search
for a php_mhash.dll (or similar name) again from the *SAME* version, or
you need to buy Visual C++ compiler and attempt (and probably not have
much success for a long time) to compile PHP from source.

Do *NOT* attempt to use an mhash Module unless you are 100% certain it was
compiled with the same PHP version as what you have (see
http://php.net/phpinfo).  If you do attempt to do that, it might even
work for awhile, but will cause huge problems sooner or later.

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

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



Re: [PHP] Apache and PHP

2005-02-28 Thread dan
Gustav Wiberg wrote:
Hi there!
I've just installed Apache on a new computer. (just for testing)
It's Windows XP. I've then installed PHP and it says that Apache could 
be not configured automatically.

Newbies question as hell probably but here it goes:
I can access my Apache-server, I have the document-root to c:\webb and 
the apace-files is in c:\program\Apache
I've changed a little in httpd.conf file and restarted the 
Apace-service. I have changed the documentRoot and another parameter 
that was very alike documentRoot...

But my problem...
The sourcecode for PHP shows when I access the http-server with php-files.
I don't cant getting any full support answers on this, just give me 
hints... :-)

/G
@varupiraten.se
Check out:
http://www.php.net/manual/en/install.windows.apache2.php
Pay particular attention to the AddType directives.  This will make 
Apache process PHP files.

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


Re: [PHP] php DBMS

2005-02-28 Thread Richard Lynch
Gerben wrote:
 I'm wondering if there is any DBMS, like MySQL, which is (fully)
 implemented
 in php. This so you don't have to buy a MySQL database.

MySQL is free...

So is PostgreSQL:
http://postgresql.org

But both packages are external software packages with API modules to use
with PHP.

 I'm currently trying to put something together, but this would be a waste
 of
 time if it already exists.

[shudder] I also sure hope you're not trying to implement an DBMS in PHP.

Perhaps if you explained your concerns/issues for using MySQL as a
separate package, the list could better advise you.

At the moment, I think you're just a little naive or under-informed, if
not a bit crazy. :-) :-) :-)

PHP + MySQL is free and running on a zillion sites.  Go with that. It works.

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

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



Re: [PHP] Apache and PHP

2005-02-28 Thread Mike Smith
For Apache2.x: http://www.php.net/manual/en/install.windows.apache2.php

For Apache1.x: http://www.php.net/manual/en/install.windows.apache1.php

Mike

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



Re: [PHP] php DBMS

2005-02-28 Thread rogerk
Quoting Richard Lynch [EMAIL PROTECTED]:

 Gerben wrote:
  I'm wondering if there is any DBMS, like MySQL, which is (fully)
  implemented
  in php. This so you don't have to buy a MySQL database.

 MySQL is free...

MySQL is free for use with applications that are themselves open source.  If
you're going to use it with a commercial or non-open-source application, you
need to buy a commercial license.

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



[PHP] header('www-Authenticate ...') Problem

2005-02-28 Thread dpgirago
I can't remember where the example below came from, but the event handler 
for the 're-authenticate' button doesn't allow a re-authentication 
following a successful login. If you run the code, it allows you to login 
the first time, or even catch the incorrect password and display via the 
line with the comments in the authenticate function after 3 failures. But 
after a successful login, trying to re-authenticate by hitting the button 
only redisplays the network login box without the password. And after 3 
failures, 
Password =  . $_SERVER['PHP_AUTH_PW'] displays just Password =  so 
obviously $_SERVER['PHP_AUTH_PW'] is never getting a value the second time 
through. 

This IS NOT a mission critical problem, but it is bugging me. It perhaps 
is an Apache issue...?

Testing environment is Win2k, Apache 1.3.31 with SSL ( though behavior is 
the same on Apache without SSL), and PHP 4.3.7.

Comment very welcomed.

Thanks much,

David

?php

ERROR_REPORTING(E_ALL ^ E_NOTICE);

  function authenticate()
  {
header('WWW-Authenticate: Basic realm=Test Authentication 
System');
header('HTTP/1.0 401 Unauthorized');
/** ? **/  echo Password =  . $_SERVER['PHP_AUTH_PW'] . BR; // used 
for debugging
echo You must enter a valid login name and password to access 
this resource\n;
exit;
  }

$qualifiedUsers = array('user1, user2');
$qualifiedPasswords = array('password1, password2');

/**
 *  reset event handler does not work as expected*
 **/
if(IsSet($_POST['authenticator'])  $_POST['authenticator'])
{
unset($qualifiedUsers);
unset($qualifiedPasswords);
unset($_SERVER['PHP_AUTH_USER']);
unset($_SERVER['PHP_AUTH_PW']);
unset($_POST['authenticator']);
}
/***/

// no username
if(!isset($_SERVER['PHP_AUTH_USER']))
{
authenticate();
}
//username but not on list
elseif(isset($_SERVER['PHP_AUTH_USER']) 
!in_array($_SERVER['PHP_AUTH_USER'], $qualifiedUsers))
{
authenticate();
}
//username ok, but no PW or not on list
elseif(isset($_SERVER['PHP_AUTH_USER']) 
in_array($user = $_SERVER['PHP_AUTH_USER'], 
$qualifiedUsers) 
!isset($_SERVER['PHP_AUTH_PW']) ||
!in_array($_SERVER['PHP_AUTH_PW'], $qualifiedPasswords))
{
authenticate();
}

//username / PW ok
elseif(isset($_SERVER['PHP_AUTH_USER'])  
in_array($user = $_SERVER['PHP_AUTH_USER'], $qualifiedUsers) 
isset($_SERVER['PHP_AUTH_PW']) 
in_array($pw = $_SERVER['PHP_AUTH_PW'], $qualifiedUsers))
{
echo Welcome, {$_SERVER['PHP_AUTH_USER']}, using password 
{$_SERVER['PHP_AUTH_PW']}.;
echo form action='$_PHP_SELF' METHOD='POST'\n;
echo input type='hidden' name='SeenBefore' value='1'\n;
echo input type='submit' name=authenticator value='Re 
Authenticate'\n;
echo /form/p\n;
}

unset($_SERVER['PHP_AUTH_USER']);
unset($_SERVER['PHP_AUTH_PW']);

?

Re: [PHP] function to resize images

2005-02-28 Thread Richard Lynch
Bosky, Dave wrote:
 Does anyone have a nice function that will resize an uploaded image to
 specific width/height dimensions?

Not a function, per se, but I use this script:

?php
  $path = $_SERVER['PATH_INFO'];
  ereg(.*/target/([0-9]*).*, $path, $target);
  $target = isset($target[1])  $target[1] ? $target[1] : 50;
  $path = ereg_replace(/target/[0-9]*, , $path);

  list($junk1, $junk2, $type) = @getimagesize($path);
  $type = isset($type)  $type ? $type : IMAGETYPE_JPEG;
  switch ($type){
case IMAGETYPE_JPEG: $fullsize = imagecreatefromjpeg($path); break;
case IMAGETYPE_GIF: $fullsize = imagecreatefromgif($path); break;
case IMAGETYPE_PNG: $fullsize = imagecreatefrompng($path); break;
  }
  $width = imagesx($fullsize);
  $height = imagesy($fullsize);
  if ($width  $height){
$scale = $target/$width;
  }
  else{
$scale = $target/$height;
  }
  if ($scale  1){
$w = round($scale * $width);
$h = round($scale * $height);
$thumbnail = imagecreatetruecolor($w, $h);
imagecopyresized($thumbnail, $fullsize, 0, 0, 0, 0, $w, $h, $width,
$height);
header(Content-type: image/jpeg);
imagejpeg($thumbnail);
  }
  else{
imagejpeg($fullsize);
  }
?

So for 50x50 images, I just use:
http://example.com/scale.php/full/path/to/originalfile.jpg

If I want some other size, I just use:
http://example.com/scale.php/target/150/full/path/to/originalfile.jpg

where 150 is the max width/height I want.

 I wanted to find something that would work for only GIF and JPG image
 types.

Looks like I just output a JPEG no matter what the input is -- You'll have
to add another 'switch' statement much like the one near the top to decide
which kind of image to output.

Probably be a good idea to add some error-checking right after the
getimagesize call, and if that failed, just die().

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

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



[PHP] HTTP Include Error

2005-02-28 Thread Suhas
Hi

This issue has been discusses many times before, but no perticular
solution found.

include '/www/.../file.php'  = works fine
include 'http://google.com/'  = works fine

include 'http://myserver.com/file.php'  = 

Warning: main(http://myserver.com/file.php): failed to open stream:
HTTP request failed! HTTP/1.1 404 Not Found in /www/myserver/file2.php
on line 4

Warning: main(): Failed opening 'http://myserver.com/file.php' for
inclusion (include_path='') in . 4

allow_url_fopen  = ON
The file is on same machine. It is not a file access prblem, I have
ried with OPEN (777) permissions.

Can anyone please shed some light on this?

Thanks
SP

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



Re: [PHP] Problem configuring mhash

2005-02-28 Thread Srinadh Sannidhanam
Thank you very much for the information. As you expected PHP installed as an 
RPM in my server. 
If I found the PHP mhash module with the *SAME* version numbers of PHP, is 
that going to work with existing PHP(installed as RPM) ?
Also, what kind of  PHP mhash module should I look for? RPM or any other?
Please help me in this regard. I need this urgenlty.
 
Thanks again,
--srinadh

Srinadh Sannidhanam wrote:
 I am trying to configure mhash. I installed mhash. But I found that I
 have to compile php with
 --with-mhash option. But I am unable to found configure command
 corresponding to PHP. Where can I found that. Are there any other ways to
 configure the same. Can't I configure that in php.ini file?

You probably have PHP installed as an RPM or some other kind of
pre-packaged binary from your Linux distribution.

You can either search for PHP mhash module with the *SAME* version
numbers of PHP, or you can un-install the pre-packaged stuff and compile
from source code.

Had you compiled from source code, the configure part would be
self-evident, as that is the first step in compiling from source code.

It's also possible you are using Windows, in which case you need to search
for a php_mhash.dll (or similar name) again from the *SAME* version, or
you need to buy Visual C++ compiler and attempt (and probably not have
much success for a long time) to compile PHP from source.

Do *NOT* attempt to use an mhash Module unless you are 100% certain it was
compiled with the same PHP version as what you have (see
http://php.net/phpinfo). If you do attempt to do that, it might even
work for awhile, but will cause huge problems sooner or later.

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





-
Do you Yahoo!?
 Yahoo! Mail - now with 250MB free storage. Learn more.

Re: [PHP] textarea posting duplicate text

2005-02-28 Thread Richard Lynch
Elizabeth Lawrence wrote:
 Hello. I have been asked to look at a PHP issue for someone, and I can't
 figure out what the problem is. I'm hoping one of you experts can help!

 They are using Red Hat Linux / Ensim Pro 4.0.2, PHP 4.3.10, and Apache
 2.0.

 The problem: When a lot of text is entered into a textarea on a form, the
 text that shows up in the $_POST['textarea'] variable has the text that
 was
 entered, but it is duplicated.

Have you verified that the POST data itself is doubled?...

This sounds REALLY weird to me...

 This is causing problems for their forums.
 Here is a very simple script I placed on the server:
 www.tidefans.com/textarea_test.php (code below)

 When I place the same script on another server I have access to, the
 textarea text is posted fine.

 Is this a PHP setting somewhere that I'm missing?

There's certainly on double long POST data setting :-)

It could be a bug in PHP or Apache -- Search their bug databases.
http://bugs.php.net/ for PHP.
http://apache.org/ should lead you to it for Apache.
You're on your own for Ensim Pro, whatever that is.

I would also recommend that you start LOGGING the text inputs that are
giving problems as they come in.

EG:
?php
  $input = $_POST['input'];
  $len = strlen($input);
  if ($len  10  substr($input, 0, $len/2) == substr($input, $len/2)){
error_log(Double Input: $input);
  }
?

This may lead you to finding some commonality in the input text other than
length that is not immediately apparent right now.

Actually, I guess you *COULD* just use the code above or similar to
automatically strip out the doubled text -- But document/comment the hell
out of that unless you want to confuse every developer that ever looks at
it!!!

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

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



Re: [PHP] php DBMS

2005-02-28 Thread Bret Hughes
On Mon, 2005-02-28 at 13:35, Jochem Maas wrote:
 Bret Hughes wrote:
  Does MySQL cost money?  I thought it was open source and available at no
  cost.  
 
 true its free, but you can also run a comcercial version which gives you
 indemnity and support and stuff Google for instance are known to run 
 MySQL,
 companies like that like to have support contracts - at MySQL they are glad 
 to oblige,
 just unlike some other very fairplaying non-antitrust type businesses they 
 don't
 force feed you the license fee :-)


So if he is looking for a non licensed dbms MySQL would still work
albeit without formal support lie the rest of the open source world.

Bret

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



Re: [PHP] Apache and PHP

2005-02-28 Thread Gustav Wiberg
Hi there!
Thanx! :-)
I hope I can solve this myself now... :-)
/G
@varupiraten.se
- Original Message - 
From: dan [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Monday, February 28, 2005 11:23 PM
Subject: Re: [PHP] Apache and PHP


Gustav Wiberg wrote:
Hi there!
I've just installed Apache on a new computer. (just for testing)
It's Windows XP. I've then installed PHP and it says that Apache could be 
not configured automatically.

Newbies question as hell probably but here it goes:
I can access my Apache-server, I have the document-root to c:\webb and 
the apace-files is in c:\program\Apache
I've changed a little in httpd.conf file and restarted the Apace-service. 
I have changed the documentRoot and another parameter that was very alike 
documentRoot...

But my problem...
The sourcecode for PHP shows when I access the http-server with 
php-files.

I don't cant getting any full support answers on this, just give me 
hints... :-)

/G
@varupiraten.se
Check out:
http://www.php.net/manual/en/install.windows.apache2.php
Pay particular attention to the AddType directives.  This will make Apache 
process PHP files.

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


Re: [PHP] Syntax Highlighting variables not appearing

2005-02-28 Thread Richard Lynch
Tom Whitbread wrote:
 Can anyone explain why this is happening.

 I am using the following code For giving code examples on my website
 with syntax highlighting

 $text = 'lt;?php \$my_code = echo 'text text text text'; \$foo =
 'bar';; example_function(\$my_code); ?gt';

This is not a valid PHP statement.

The ' directly before 'text text text text' will match the first ', and
the rest of this is gibberish.

Let's assume, however, that you actually have \ in front of each embedded
' in your string.

To avoid confusion, I'd also change each \$ to \\$ so that it is clear
that you want the \ to be embedded in your string.

 $body = preg_replace('/lt;(.*?)gt;/es', 'highlight_string(\\1,
 true)', $text);

At this point, you are replacing HTML entities lt; and gt; with their
corresponding charactes  and  which is fine, I suppose, but...

 echo $body; //Returns: ?php = 'echo \'text text text text\'\';  =
 \'bar\'; highlight_string(, true); ?

Here you are *NOT* going to see the PHP source, because to the *BROWSER*
the  and  look like an HTML tag.

The browsers will simply IGNORE tags they don't understand and won't
display/do anything with them.

   //I want:  ?php $my_code = echo 'text text text text'; $foo = 
 'bar';;
 example_function($my_code); ?

You may or may not need to NOT do the ereg_replace you are doing, and you
may or may not want to use http://php.net/htmlentities and/or
http://php.net/highlight_string

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

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



Re: [PHP] problems with several JPEGs in GD2

2005-02-28 Thread Richard Lynch
Mario Lopez wrote:
 I've noticed that there is a group of JPEG files
 that cannot be operated with GD2 functions.

 For example, if you try to imagecreatefromjpeg(my.jpg) it
 replies:

 Warning: imagecreatefromjpeg(): 'my.jpg' is not a valid JPEG file
 in C:\Program Files\Apache Group\Apache2\htdocs\test.php on line 20

 (this is not a scripting error, it works with lots of other jpegs)

 Meanwhile the same my.jpg file can be shown in web browser by
 HTML tag img src=my.jpg, can be opened in PhotoShop.. and other
 programs..

 But GD2 thinks that it is not a valid JPEG..

 Any suggestions how to deal with these types of JPEGs in GD2?
 Any workaround?

I encountered this recently (except the PhotoShop part), and it turned out
that:

1. The JPEG in question was *NOT* a JPEG at all.
2. The JPEG in question was *REALLY* an .art (ART) file.
3. ART files are an AOL invention in a proprietary format.
4. AOL takes an image (JPEG or GIF)
   Converts it to the other format (GIF or JPEG)
   Blindly chooses the smaller file size,
   Saves it as an .ART file.
   But sometimes simplifies life for AOL Users by pretending it's a JPEG
5. So *YOU* end up with a file that ends in .jpg but isn't a JPEG
6. And most/some non-AOL browsers happily display these ART files

The Linux file command is what properly identified the file for me, I
*think*...  Not 100% sure on that part.

Oooh, maybe IrfanView was the tool that tipped me off that I was dealing
with a bogus JPEG.  IrfanView Rocks!

Try the GIMP too -- Almost for sure not that, as I was using a Windows box
at the time, so wouldn't have had GIMP installed.  (Yes, I know GIMP runs
on Windows now)

AFAIK, You can undo the ART packaging *only* by installing all of AOL
(ugh!) and then opening up the image in their editor and doing a Save
As...

It only took me 10 minutes to figure out that after starting AOHell, I
could *CLOSE* the window that looks like a modal dialog that pushes me to
connect/signup with AOL and then I can use the Tools menu (or whatever it
was) to open/edit/save the image.  If you Google for ART JPEG AOL
Convert you should find the same pages I did that led me down this path
to success.  YMMV  NAIAA  IANAL

Somebody from the OpenSource community who wants to fix this issue by
writing some quick hack utilities to easily identify and un-package ART
files to non-proprietary... errr, less-proprietary, formats would probably
gain a lot of reputation quickly and easily.  I don't grok enough about
image formats to do it myself.

Of course, *YOUR* images may not be ART images, and might just be broken
JPEGs.

They might also be using some fancy JPEG thing that GD2 doesn't support...
Interlacing?  GD2 does that, though, I think...  Maybe something like
that.

So maybe they *ARE* JPEGs, but are using a feature of JPEGs that GD2
doesn't do -- Open up a bunch of good images in PhotoShop, and bunch of
bad ones and see what they have in common in terms of features like
Interlacing and Gradients (?) and, err, other PhotoShop-y things of which
I'm ignorant.

PhotoShop: I click on the buttons a lot, and if it's pretty, I go on, and
if it's not, I hit Undo  I think some monkeys would be better at
PhotoShop than me. :-)

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

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



Re: [PHP] HTTP Include Error

2005-02-28 Thread Marek Kilimajer
Suhas wrote:
Hi
This issue has been discusses many times before, but no perticular
solution found.
include '/www/.../file.php'  = works fine
include 'http://google.com/'  = works fine
include 'http://myserver.com/file.php'  = 

Warning: main(http://myserver.com/file.php): failed to open stream:
HTTP request failed! HTTP/1.1 404 Not Found in /www/myserver/file2.php
on line 4
Warning: main(): Failed opening 'http://myserver.com/file.php' for
inclusion (include_path='') in . 4
allow_url_fopen  = ON
The file is on same machine. It is not a file access prblem, I have
ried with OPEN (777) permissions.
Can anyone please shed some light on this?
Thanks
SP
the file not was found, it's not a php problem, but rather apache or dns 
 misconfiguration. You can try

wget http://myserver.com/file.php
from the server shell and you should see the same response.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Pop-up message

2005-02-28 Thread Richard Lynch
Lester Caine wrote:
 At the risk of being shouted at because *I* know it's not a PHP problem!

Actually, it's a client problem :-)

 I have a page that is being refreshed every 30 seconds or so, and
 displays a list of 'tickets' waiting to be dealt with on a list from a
 database query. No problems there, but a couple of sites now want me to
 add a pop-up warning when a ticket is added that has a staff ID matching
 the logged in user.

Your first task is to convince the client what an incredibly stupid idea
this is.

And that it won't work with all the popup blockers.

And if it did work, it would just annoy the [bleep] out of their users.

I know I'm preaching to the choir, here, but I have to go on record with
this statement.

 I can drive a sounder in the target browser, but need kicking in the

A sounder?  You mean like make my browser make noise?  ICK!!!

 right direction for a method of adding a pop-up window. Ideally it needs
 to be browser agnostic, which is where the problem comes given the
 pop-up blockers and other 'toys' that are being added to the browser end
 of things.

You're not going to defeat the popup blockers in the long run.

You are better off using clean simple code in an onLoad in your body tag
to open the new window.  Something like:
body onLoad=window.open(URL);
where the URL loads in that user's recently added items.

Either the users will accept the popup and whitelist it in their popup
blocker, or they won't.

And if a lot of them don't accept it, as they shouldn't, that tells you
right there what a dumb idea this was. :-)

But running around to find code to defeat the popup blockers will be a
total waste of time -- and you'll end up with something so hacked and so
un-maintainable that you'll have to fix it every six months, even if the
popup blockers don't find workarounds to block your workarounds that popup
the windows that they don't want popped up.

 So can anybody point me in the right direction for a CURRENT method of
 achieving this, many of the bits I've found so far are somewhat
 antiquated, and fail in one way or another :(

Perhaps it would be better to segregate the tickets into those associated
with the User logged in, and those that are not.

Or to at least sort them that way, regardless of their other sorting options.

For that matter, don't even *BOTHER* to show me items that aren't mine,
unless I specifically ask for them.

Build a system that detects tickets that sit un-assigned for too long, and
randomly assigns them, or, better yet, assigns them based on factors such
as:
Ticket features (IE, interface tickets to interface team members)
Productivity (IE, don't assign as many tickets to your slow team members
as your fast ones)
User Status (IE, if I'm on vacation, don't assign me anything)
.
.
.

That way, no tickets is left sitting there too long but nobody has to
deal with tickets that aren't assigned to them.

Just an idea.

In general, though, I only mean:

Come back at the client with more than just That's a dumb idea (which it
is)

Come back with a Here's a MUCH better way to do this proposal.

That's a dumb idea just gets you more headaches.

A solution for a better solution makes you look real smart. :-)

Yes, this may turn out to be a waste of your time, because the client is
REALLY dead set on these popups, and you'll end up being miserable about
them not taking your proposal as well...  Time to start looking for a new
client. :-v

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

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



Re: [PHP] Apache and PHP

2005-02-28 Thread Jochem Maas
Gustav Wiberg wrote:
Hi there!
Thanx! :-)
I hope I can solve this myself now... :-)
If you get stuck another good line of approach might be
to install a preconfigured bundle (php/apache/mysql) and
then possibly compare you configs with theres e.g:
http://www.devside.net/
http://www.apachefriends.org/en/xampp-windows.html
http://www.en.wampserver.com/
I have no experience with any of these - but if time is short
they may help you out.
for a php5 as an apache module you would add something like:
LoadModule php5_module C:/php/php5apache2.dll
AddType application/x-httpd-php .php
to httpd.conf. if you get stuck don't forget to mention
binary versions and php sapi your using (cgi or module).
/G
@varupiraten.se
- Original Message - From: dan [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Monday, February 28, 2005 11:23 PM
Subject: Re: [PHP] Apache and PHP

Gustav Wiberg wrote:
Hi there!
I've just installed Apache on a new computer. (just for testing)
It's Windows XP. I've then installed PHP and it says that Apache 
could be not configured automatically.

Newbies question as hell probably but here it goes:
I can access my Apache-server, I have the document-root to c:\webb 
and the apace-files is in c:\program\Apache
I've changed a little in httpd.conf file and restarted the 
Apace-service. I have changed the documentRoot and another parameter 
that was very alike documentRoot...

But my problem...
The sourcecode for PHP shows when I access the http-server with 
php-files.

I don't cant getting any full support answers on this, just give me 
hints... :-)

/G
@varupiraten.se

Check out:
http://www.php.net/manual/en/install.windows.apache2.php
Pay particular attention to the AddType directives.  This will make 
Apache process PHP files.

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

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


Re: [PHP] Semi-OT: Anti-password trading/sharing solutions

2005-02-28 Thread Richard Lynch
Dan Trainor wrote:

I'm not quite sure why you chose the PHP community as a recipient -- There
are quite a few Apache modules out there.

And Modules such as mod_auth_mysql and mod_auth_ldap (?) and, really, any
old mod_auth_XYZ module would be a closer match for what you want, I
think.

I know absolutely nothing about how ProxyPass, iProtect, and PureMember
work, however, so perhaps there is something about them that just screams
use PHP to do this  [I doubt it though]

It seems to me, however, that you're still a bit off-target on
PHP-General, as your target audience is not those who use PHP, but those
who wrote it and maintain it, particularly the Apache Module part of it.

I believe, in fact, that the Apache Module part of it boils down to the
code Rasmus Lerdorf wrote ages and ages ago, and that mostly Rasmus (I
think) has maintained since then.

Perhaps with Apache 2, somebody else stepped up to write/maintain that
code, and I'm under-informed.

Or maybe Rasmus hasn't touched that code in ages, and somebody else is
doing it now.  Apologies to those individuals who I've slighted by not
naming them at this time.

At any rate, you're trying to get in contact with a handful of people by
sending email to thousands.  Bad Idea #1.

NOTE: Contacting Rasmus directly and offering him $$$ to do this would
maybe not be a Bad Idea.  Asking him to do it for free would be really
stupid.

Next, let's look at your proposal:

You want something that Member Sites need, to avoid the theft/sharing of
username/passwords.

So, in particular, only for-pay Member Sites need this, mostly, as there's
not much point in stealing/sharing a username/password if you can just get
one for free.

So, basically, it's a for-profit motivator that drives this request.

Yet nowhere do I see an offer of recompense for the developers who write
this software for you.  Bad Idea #2.

I highly recommend you figure out what it would be worth to you and some
of your colleagues/friends to have an OpenSource solution to rival the
current proprietary technologies.

Take up a collection or form a very loose consortium with some of your
colleagues to fund the project.

Then write up a specification for what you want done, and make an offer to
PAY somebody and fund the resources needed to get the project from its
current state (gleam in your eye) to a usable state.

You could and probably should still make it OpenSource -- Perhaps with
Funded by:  attributions on all source code and materials to plug your
consortium and its members -- and then when it's at the stage of
usefulness that you need, you will probably find that some people are
willing to maintain it for little or no money at all.

Right now, though, you've got a lot of people seeing:

I want you to work for me for free so I can save thousands of dollars
every month

That ain't gonna happen, dude.

People wrote PHP and Apache and other OpenSource software because THEY
needed it for THEIR own use, and were willing to give it to you for FREE
because they knew that giving away 10,000 free copies would get them one
(1) more Developer to help build/improve the software.

They did *NOT* do it because they wanted you to be able to run your
company on free software.

Which is not to say that they *MIND* that you can do that -- Only that
they're not going to just up and code something just because *YOU* happen
to need it to run your company more efficiently.

You've got zero incentive for the Developer here -- They don't need the
Module you want, and you're not paying them.  [shrug]

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

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



Re: [PHP] get_defined_vars in all scopes?

2005-02-28 Thread Richard Lynch
Anguz wrote:
 John Holmes wrote:

I'm using this at the end of a script

echo 'pre'; var_dump(get_defined_vars()); echo '/pre';

but it only returns what get_defined_vars gives, which is what's
available in the current scope. Is there any way to get also the vars
used in functions that weren't globalized?


 No, not unless you call this in the functions, also. The variables don't
 exist after the function is completed.

 ---John Holmes...

 UCCASS - PHP Survey System
 http://www.bigredspark.com/survey.html

 I see. Thank you John.

 Many functions may end at different places, they not alway reach the
 end, so I guess I could do it globalizing every var/arr, at least the
 ones I'm most interested in.

Gak!

Don't *DO* that!

When you make a variable global, you will introduct all *KINDS* of problems.

Better to find all your function definitions and do:

require 'dumbvars.inc';

inside of them.

You can then have dumpvars.inc dump out whatever variables you are trying
to track.

You could even set up dumpvars.inc to let you tweak a configuration file
or something to check the current file (__FILE__) or function and
http://php.net/define a global 'DEBUG' setting that will tell dumpvars.inc
whether to print out variables or not.

 Is there some program I can use that'll monitor the vars when executing
 the script? I think Xdebug [http://xdebug.org/] does that with
 functions, but am not sure if it'll work with vars.

What you describe is known as a debugger which typically comes in an
Integrated Development Environment (aka IDE)

So if you Google for PHP IDE debugger you will find your choices.

Zend Studio, Komodo (sp?), PHPEd, PHPEditor, spring to mind, but I'm sure
there are dozens of them out there.

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

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



Re: [PHP] Mailing List Tool

2005-02-28 Thread Richard Lynch
GH wrote:
 Does someone know of a mailing list tool that runs via PHP that can
 check periodically (ie via a scheduled task) an email account for a
 message and then send it out to an entire list of addresses?

http://php.net/imap
http://php.net/mail

I think all the code you need is in the User Contributed notes on these
two pages.

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

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



Re: [PHP] Charset and filenames

2005-02-28 Thread Richard Lynch
Gustavo Lopes wrote:
 I'm building a script that makes a list of files available in a directory
 (PHP 4.3.10, Apache 2.0.53, windows, NTFS file system). The XHTML is
 served
 as ISO-8859-1. However, I'm having trouble in generating correct links for
 files with accents, etc.
 The problem is rawurlencode() appears to convert strings by translating

I don't suppose there's any way to just rename the file...

You may be able to do the urlencode() and then un-do the %3E back to, err
whatever it was.

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

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



Re: [PHP] php DBMS

2005-02-28 Thread Manuel Lemos
Hello,
on 02/28/2005 07:21 PM [EMAIL PROTECTED] said the following:
I'm wondering if there is any DBMS, like MySQL, which is (fully)
implemented
in php. This so you don't have to buy a MySQL database.
MySQL is free...
MySQL is free for use with applications that are themselves open source.  If
you're going to use it with a commercial or non-open-source application, you
need to buy a commercial license.
You are confused. You only need to buy a commercial license if you want 
to distribute MySQL server itself with closed source applications. If 
you develop closed source applications but you do not distribute MySQL 
with them, you do not need to buy any licenses.

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


Re: [PHP] break/exit

2005-02-28 Thread Richard Lynch
timothy johnson wrote:
 I have a single php script that I am using to upload my gaim logs to a
 mysql server, but I want to put in some type of means to where if that
 log was already added then it will exit. what ways would you
 recommend?

How do you know if one gaim log matches another one is pretty much your
only question, right?

I mean, http://php.net/exit will take care of the quit part, and if/else
takes care of the PHP part of it.

So, tell us, what do the filenames look like on a gaim log (whatever that
is) and what's inside them, and how do you currently think you know which
one is which?

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

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



[PHP] Re: Problem submitting a POST request by hand

2005-02-28 Thread Manuel Lemos
on 02/28/2005 08:19 AM Vallo Reima said the following:
Hello!
I send the parameters from one php script to another via POST method. 
The solution works (see example  below) but the receiver page loads ONLY 
if I include the echo $c; command after send_host (see PROBLEM!!! line). 
Otherwise a blank page loads without any error messages. The problem is 
same with Microsoft-IIS/5.1-PHP/5.0.3 and Apache/2.0.51-PHP/4.3.10... 
What can I do to get rid of this?
You may want to try this HTTP client class treats with the HTTP POST 
requests without problems:

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


Re: [PHP] How to handle actions that may take a long time?

2005-02-28 Thread Richard Lynch
Cajus Pollmeier wrote:
 I'd like to know your opinion about how to handle events that may take
 more than a minute to finish in PHP. In this case,  the code is
 performing a recursive action on a large LDAP tree where I'd like to
 present something like a status page (Please wait, blah blah with
 some animated gif or so), while the action takes place in background.

 Is it possible to fork away this PHP code and set some SESSION vars to
 trigger the end of the status page? Or do I have to put this action
 behind a one pixel image and act when the page is really complete?
 Also I'm not sure how to handle the script execution timeout problem...

Do you really expect the user wants to sit there for all the time waiting
for the process to finish?

Is there ANY way to factor out that code and do it before they get there? 
Obviously not for a search where the user types in what they want, but is
that what you are doing?  You don't say; I can't guess.

Basically, if I have to sit there waiting, then I'm not really all that
impressed with an animated gif or whatever...

Perhaps you have them logged in already, and you could record their search
parameters and assign it an ID, and perform the search in the background,
and then have a page to deliver the results to later.

In other words, let me start up a couple searches, go do something else,
and come back later for my answers if I can't have them RIGHT NOW.

The web is all about RIGHT NOW :-)

There are a lot of possible answers, really, but unless you provide
context for the rest of your application and how the LDAP search fits in,
we can't give you much.

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

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



[PHP] Inline Frame and php

2005-02-28 Thread Todd Cary
My client insists on using inline Frames that uses my php pages.  As an 
example, this is on one page:

IFRAME target=_top frameborder=0 
SRC=search.php?search_text=?echo($search_text);? WIDTH=592 HEIGHT=282
/IFRAME

This works well with the control being given to search.php.  What I do 
not understand is that within search.php, I have a statement that is 
suppose to pass control to anther page.  The line is

header(location: http://192.168.0.23/mypath/mypage.php;);
Rather than going to the page, it opens mypage.php in the inline frame.
Is there a way to leave the inline frame?
[Excuse my nomenclature e.g. control, leave]
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] convert MS DOC - PDF

2005-02-28 Thread Richard Lynch




mbneto wrote:
 Hi,

 I have a bunch of M$ WORD documents (rtf and doc) that I'd like to
 transform to pdf.

 It would simple except that I'd like to allow the user to fill a
 couple of variables (name, email, telephone) and replace this before
 if generates the pdf.

 After searching the net I found some classes but in order to use it
 seems that I have to rewrite the entire document and some documents
 have tables/images.

 Any tips ?

Use MS Word templates or form letters or whatever they are called, and
you can provide the CSV file to feed it?

Then you just have to convert the Word doc to PDF, which is sort of
straight-forward.

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

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



RE: [PHP] PHP slowness

2005-02-28 Thread Richard Lynch
Gerard wrote:
 I'm no expert on this stuff, but I'd be checking my swap space usage and
 RAM usage with 'top' or any other tools available...  I suppose you
 probably already did that, but...

 Top shows that there's still normal non-swap memory available, so I don't
 think that's it.

What exactly are you using in httpd.conf to make PHP work?

Do you have any mod_rewrite rules going on in httpd.conf?

Do you perhaps have mod_rewrite's engine LOGGING turned on, and cranked up
really high, when rules that involve PHP kick in?

Just a Wild Guess, but perhaps you have some real funkiness going on
before PHP ever gets involved, it just LOOKS like a PHP problem.

Another test:
Did you happen to compile a PHP CGI/CLI at the same time as the PHP Module
you are using?

If so, how long does it take to run php -f /path/to/your/test/file.php
from the command line?

Granted, it's not EXACTLY the same code base as the PHP Module, but if
that's fast and the Module is slow you have more indication that the
problem is really *before* PHP kicks in.

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

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



Re: [PHP] Semi-OT: Anti-password trading/sharing solutions

2005-02-28 Thread dan
Richard Lynch wrote:
Dan Trainor wrote:
I'm not quite sure why you chose the PHP community as a recipient -- There
are quite a few Apache modules out there.
And Modules such as mod_auth_mysql and mod_auth_ldap (?) and, really, any
old mod_auth_XYZ module would be a closer match for what you want, I
think.
I know absolutely nothing about how ProxyPass, iProtect, and PureMember
work, however, so perhaps there is something about them that just screams
use PHP to do this  [I doubt it though]
It seems to me, however, that you're still a bit off-target on
PHP-General, as your target audience is not those who use PHP, but those
who wrote it and maintain it, particularly the Apache Module part of it.
I believe, in fact, that the Apache Module part of it boils down to the
code Rasmus Lerdorf wrote ages and ages ago, and that mostly Rasmus (I
think) has maintained since then.
Perhaps with Apache 2, somebody else stepped up to write/maintain that
code, and I'm under-informed.
Or maybe Rasmus hasn't touched that code in ages, and somebody else is
doing it now.  Apologies to those individuals who I've slighted by not
naming them at this time.
At any rate, you're trying to get in contact with a handful of people by
sending email to thousands.  Bad Idea #1.
NOTE: Contacting Rasmus directly and offering him $$$ to do this would
maybe not be a Bad Idea.  Asking him to do it for free would be really
stupid.
Next, let's look at your proposal:
You want something that Member Sites need, to avoid the theft/sharing of
username/passwords.
So, in particular, only for-pay Member Sites need this, mostly, as there's
not much point in stealing/sharing a username/password if you can just get
one for free.
So, basically, it's a for-profit motivator that drives this request.
Yet nowhere do I see an offer of recompense for the developers who write
this software for you.  Bad Idea #2.
I highly recommend you figure out what it would be worth to you and some
of your colleagues/friends to have an OpenSource solution to rival the
current proprietary technologies.
Take up a collection or form a very loose consortium with some of your
colleagues to fund the project.
Then write up a specification for what you want done, and make an offer to
PAY somebody and fund the resources needed to get the project from its
current state (gleam in your eye) to a usable state.
You could and probably should still make it OpenSource -- Perhaps with
Funded by:  attributions on all source code and materials to plug your
consortium and its members -- and then when it's at the stage of
usefulness that you need, you will probably find that some people are
willing to maintain it for little or no money at all.
Right now, though, you've got a lot of people seeing:
I want you to work for me for free so I can save thousands of dollars
every month
That ain't gonna happen, dude.
People wrote PHP and Apache and other OpenSource software because THEY
needed it for THEIR own use, and were willing to give it to you for FREE
because they knew that giving away 10,000 free copies would get them one
(1) more Developer to help build/improve the software.
They did *NOT* do it because they wanted you to be able to run your
company on free software.
Which is not to say that they *MIND* that you can do that -- Only that
they're not going to just up and code something just because *YOU* happen
to need it to run your company more efficiently.
You've got zero incentive for the Developer here -- They don't need the
Module you want, and you're not paying them.  [shrug]

Go ahead and look at my first email.  For some reason you didn't get the 
idea that I was looking for solutions.  Ideas.  I wasn't looking for 
anything solid.

The reason why I wrote to the PHP community was to get some ideas. 
Aside from the two people who have sent me hatemail today, the PHP 
comunity is very intelligent, very clever, and might have worked on 
something like this in the past.  That's the information that I was after.

Rasmus?  Waht's he got to do with anything?  Sure, I value and credit 
the work he's put into PHP, but I really think that using his name in 
this context has no point.

Who asked anyone to write any software for me?  Again, let's focus on 
the primary purpose of this email - to gather information so that I can 
do some further investigation.

You know, you're right.  It's stupid for me to think that Open Source 
software is used in for-profit situations.  PHP, Apache, MySQL, Linux in 
general - it's really stupid to think that they might actually help 
someone make money, isn't it.  This is what you are saying, as per 
Stupid Idea #2.

I'm not going to get into an argue with you over the moral values of 
Open Source software.  I understand them fully.  Gratitude and in some 
cases money is given to people left and right for their technical 
abilities by myself and others.  I will always regret not being ABLE to 
contribute more.

But again, who said anything about actually using a product?  

Re: [PHP] getting mac id

2005-02-28 Thread Richard Lynch
Tyler Replogle wrote:
 I'm working at this site that has an MMORPG, a big online game, and we
 have
 this ban script. it bans the ip for the user and the user acount for an
 amount of time. This doesn't seem to be doing its job because people just
 change there ip and make a new user.

There's no way you can stop them from changing their IP -- Hell, for most
of them, there's no way *THEY* can stop their IP from changing if their
ISP wants to change it out from under them.

So using their IP is a Bad Idea.

Get rid of that part of the code now, before you piss of a real user whose
ISP change their IP out from under them.

There is NO WAY to identify a user unless *YOU* id them on *YOUR* server.

So the only part of this process you control is make a new user

Now, you probably don't want to out and out CHARGE money for people to
play MMORPG, do you?

Thought not.

But, in order to remove the problem people, what would your userbase say
to this:

New Members, who are not already 'proven' to be not trouble-makers, will
pay a DEPOSIT of $25.00 via PayPal.

DEPOSIT will be refunded when:
  A) A user closes out their account by their own choice
  B) A user has proven their ability to play well with others

B) is totally at the whim and discretion of the Game Master

DEPOSIT will be *LOST* if you get booted off for causing trouble.

So now if they want to make a new user and cause problems, it's gonna cost
them $25.00 every time.

Don't think you'll have too many users doing that for very long.  And if
you do, well, hell, you've got a pile of money out of it at least. :-)

Just one thing:  Don't even *THINK* of borrowing money from that DEPOSIT
to cover any kind of emergency expense or anything like that.  You'll end
up in deep deep trouble if you do.

You may need to give other people (GMs) the ability to vet people and
refund the deposit on their say-so.

Then set it up so a GM has some money on DEPOSIT as well.

If they clear somebody who then turns into a trouble-maker, guess what?

The $25 comes out of the GMs DEPOSIT.

Yeah, you're gonna lose some players.

Yeah, you may have to approach this *REAL* delicately and get the existing
GMs to agree that *something* has to be done, and if having $25 on deposit
is the only answer, so be it.

But you'll never keep out the problems without some kind of control on
YOUR end that makes it very expensive on their end to keep making up new
usernames.

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

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



Re: [PHP] header('www-Authenticate ...') Problem

2005-02-28 Thread Richard Lynch
[EMAIL PROTECTED] wrote:
 I can't remember where the example below came from, but the event handler
 for the 're-authenticate' button doesn't allow a re-authentication
 /**
  *  reset event handler does not work as expected*
  **/
 if(IsSet($_POST['authenticator'])  $_POST['authenticator'])
 {
 unset($qualifiedUsers);
 unset($qualifiedPasswords);
 unset($_SERVER['PHP_AUTH_USER']);
 unset($_SERVER['PHP_AUTH_PW']);
 unset($_POST['authenticator']);

Remember how these values come in to this point:

The *BROWSER* remembers your login credentials, and re-sends them with
each request.

unset($_SERVER['PHP_AUTH_USER']);

is kinda pointless.

It will unset() it for this script, but the browser is gonna re-send them
on the next page hit.

Ain't no way to make it *NOT* send them, cuz the HTTP spec didn't plan for
that.  Sorry.

What you gotta do is change the REALM out from under them.

In other words, if user X is logged in with HTTP Basic authentication, and
you want to log them out, from that moment forward, send:

header('WWW-Authenticate: Basic realm=Some other Realm');

So you'll need to track used realms, or perhaps keep a $counter going
for each user, and when they log out, Whammo change the Realm out from
under them.

At least, that's how I was told to do it.

Somebody said there was a way to log somebody out with other headers, but
I always forget what it is...

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

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



Re: [PHP] header('www-Authenticate ...') Problem

2005-02-28 Thread Jochem Maas
Richard Lynch wrote:
[EMAIL PROTECTED] wrote:
I can't remember where the example below came from, but the event handler
for the 're-authenticate' button doesn't allow a re-authentication
/**
*  reset event handler does not work as expected*
**/
if(IsSet($_POST['authenticator'])  $_POST['authenticator'])
{
   unset($qualifiedUsers);
   unset($qualifiedPasswords);
   unset($_SERVER['PHP_AUTH_USER']);
   unset($_SERVER['PHP_AUTH_PW']);
   unset($_POST['authenticator']);

Remember how these values come in to this point:
The *BROWSER* remembers your login credentials, and re-sends them with
each request.
unset($_SERVER['PHP_AUTH_USER']);
is kinda pointless.
It will unset() it for this script, but the browser is gonna re-send them
on the next page hit.
doesn't the browser only send the AUTH_USER  AUTH_PW if it gets
the WWW-Authenticate header?
Ain't no way to make it *NOT* send them, cuz the HTTP spec didn't plan for
that.  Sorry.
What you gotta do is change the REALM out from under them.
In other words, if user X is logged in with HTTP Basic authentication, and
you want to log them out, from that moment forward, send:
header('WWW-Authenticate: Basic realm=Some other Realm');
So you'll need to track used realms, or perhaps keep a $counter going
for each user, and when they log out, Whammo change the Realm out from
under them.
At least, that's how I was told to do it.
Somebody said there was a way to log somebody out with other headers, but
I always forget what it is...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: Like ternary but without the else.

2005-02-28 Thread Chris W. Parker
Richard Lynch mailto:[EMAIL PROTECTED]
on Monday, February 28, 2005 5:12 PM said:

 Course, I gotta say that maybe you're coming at this wrong in the
 first place, if you have to change $this based on $something to $that
 but $this already has a value...
 
 Maybe you should have figured out what $this should be back when you
 first initialized it?
 
 Maybe not.  Can't tell without seeing more code.

Hmm.. possible. I'll have to go back and look at it as I haven't messed
with it in a few days.



Thanks,
Chris.

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



Re: [PHP] Not able to add data to a MySQL database

2005-02-28 Thread Richard Lynch
Vaibhav Sibal wrote:
 Hi,
 I am not able to insert data into my mysql database using php even if
 i use a simple code as follows :
 ?php
 $link=mysql_connect(localhost,username,password);
 mysql_select_db(test_db);
 $query=INSERT INTO 'login' ('uname','access') VALUES ('try','super');
 mysql_query($query,$link);
 ?

ADD SOME ERROR CHECKING!!!

http://php.net/die

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

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



Re: [PHP] Not able to add data to a MySQL database

2005-02-28 Thread John Holmes
Richard Lynch wrote:
Vaibhav Sibal wrote:
Hi,
I am not able to insert data into my mysql database using php even if
i use a simple code as follows :
?php
$link=mysql_connect(localhost,username,password);
mysql_select_db(test_db);
$query=INSERT INTO 'login' ('uname','access') VALUES ('try','super');
mysql_query($query,$link);
?

ADD SOME ERROR CHECKING!!!
http://php.net/die
and http://us2.php.net/mysql_error ;)
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Charset and filenames

2005-02-28 Thread Gustavo Lopes
I appreciate your reply but I'm not satisfied.

Richard Lynch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Gustavo Lopes wrote:
 I'm building a script that makes a list of files available in a directory
 (PHP 4.3.10, Apache 2.0.53, windows, NTFS file system). The XHTML is
 served
 as ISO-8859-1. However, I'm having trouble in generating correct links
 for
 files with accents, etc.
 The problem is rawurlencode() appears to convert strings by translating

 I don't suppose there's any way to just rename the file...
I don't want to rename any file, just change a link destination by encoding
the filename differently.

 You may be able to do the urlencode() and then un-do the %3E back to, err
 whatever it was.
What? Where did you get that %3E from?

Gustavo Lopes

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



RE: [PHP] Re: Like ternary but without the else.

2005-02-28 Thread Richard Lynch
Chris W. Parker wrote:
 Jason Barnett mailto:[EMAIL PROTECTED]
 on Friday, February 25, 2005 2:10 PM said:

 $this = $something ? $that : null;

 That won't work because I'm setting a default value for $this and want
 it to change only if it has to. The long winded way to write this would
 be:

If you *KNOW* you set the default value:

$this = $something ? $that : $this;

Crude, but effective, Captain   -- Spock

If you're not *SURE* $this has a value:

$this = ($something ? $that : (isset($this) ? $this : NULL));

Some of those parens might be un-needed, but I'd get confused without
them, never mind PHP being confused or not :-)

Course, I gotta say that maybe you're coming at this wrong in the first
place, if you have to change $this based on $something to $that but $this
already has a value...

Maybe you should have figured out what $this should be back when you first
initialized it?

Maybe not.  Can't tell without seeing more code.

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

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



Re: [PHP] Charset and filenames

2005-02-28 Thread Jochem Maas
Gustavo Lopes wrote:
I appreciate your reply but I'm not satisfied.
Richard Lynch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Gustavo Lopes wrote:
I'm building a script that makes a list of files available in a directory
(PHP 4.3.10, Apache 2.0.53, windows, NTFS file system). The XHTML is
served
as ISO-8859-1. However, I'm having trouble in generating correct links
for
files with accents, etc.
The problem is rawurlencode() appears to convert strings by translating
I don't suppose there's any way to just rename the file...
I don't want to rename any file, just change a link destination by encoding
the filename differently.

You may be able to do the urlencode() and then un-do the %3E back to, err
whatever it was.
What? Where did you get that %3E from?
I think he was just typing off memory and quoted a different encoded char...
my encoding battles are always a trail and error affair until 'it'
does what I want... but maybe these 2 functions may help you:
http://nl2.php.net/manual/en/function.utf8-encode.php
http://nl2.php.net/manual/en/function.utf8-decode.php

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


Re: [PHP] Charset and filenames

2005-02-28 Thread Gustavo Lopes
Jochem Maas [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Gustavo Lopes wrote:
 I appreciate your reply but I'm not satisfied.

 Richard Lynch [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]

Gustavo Lopes wrote:

I'm building a script that makes a list of files available in a 
directory
(PHP 4.3.10, Apache 2.0.53, windows, NTFS file system). The XHTML is
served
as ISO-8859-1. However, I'm having trouble in generating correct links
for
files with accents, etc.
The problem is rawurlencode() appears to convert strings by translating

I don't suppose there's any way to just rename the file...

 I don't want to rename any file, just change a link destination by 
 encoding
 the filename differently.


You may be able to do the urlencode() and then un-do the %3E back to, err
whatever it was.

 What? Where did you get that %3E from?

 I think he was just typing off memory and quoted a different encoded 
 char...
 my encoding battles are always a trail and error affair until 'it'
 does what I want... but maybe these 2 functions may help you:

 http://nl2.php.net/manual/en/function.utf8-encode.php
 http://nl2.php.net/manual/en/function.utf8-decode.php



 Gustavo Lopes


Thank you, utf8_encode() is in fact the solution to my problem. A function 
$s - htmlentities(rawurlencode(utf8_encode($s))) seems to be able to 
produce correct output for every file.

Gustavo Lopes 

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



[PHP] Current dilema for Novice

2005-02-28 Thread James Marcinek
Hello Everyone,

I'm somewhat new to PHP. I've read quite a bit of material and have a background
with perl and Apache and Linux.

Let me explain my situation.

- Fedora Core 3 with Apache 2 and PHP 
- Using SSL.
- Each Directory under $_SERVER['DOCUMENT_ROOT'] is an NFS mounted directory
(read only).
- The directories may contain various numbers of subdirectories
- New directories may be created by various individuals
- The application data being stored can be accessed by an application created
.htm file.
- The .htm file created by the application always has the same name.

My goals are:
- provide encrypted connection
- provide security for each directory (and sub-directory) under
$_SERVER['DOCUMENT_ROOT'].
- Find all files with a .htm suffix by recursively going through all
sub-directories.
- Create links for each .htm file on a single page.
- Use parent directory of each .htm file (since there will be only one) as the
name of the link to the file
- Prevent displaying of other directories under $_SERVER['DOCUMENT_ROOT']
- Single Sign page for all customers
- Each user will only have access to one directory under
$_SERVER['DOCUMENT_ROOT']
- Authentication process should move customer to appropriate directory under
$_SERVER['DOCUMENT_ROOT']

What I've done so far:

First, let me state that some of the requirments weren't initially present when
the design started...

- The server has been set up with SSL and is working properly
- The SSL site goes to $DOCUMENT_ROOT (which is currently a blank index.htm)
file, preventing users from drilling down
- Each site is currently configured to use Apache Digest Authentication. My
experience with PHP site design comes from the book 'PHP and MySQL Web
Development' which mainly dealt with web sites as Applications (e-commerce,
blog, etc) and not from a file system stand point. Most was object oriented with
includes and what not which would require pages in every subdirectory under the
DOCUMENT_ROOT in order to comply with the application design. Having a solution
to require this would not be practical; however I'm not sure if there's another
way to approach. By using the Digest Authentication I know that the Directories
in the realm would be covered...
- My original index.php script (that I need to debug as it's not working yet)
was designed to be placed in each respective directory directly under
DOCUMENT_ROOT. The script, hopefully, will go through each directory, find out
what files are directories or files. If it's a file I'm trying to push basename
(but needs to get the directory name it resides instead) and the URL if the file
suffix ends with .htm. If it's a directory, it should push the directory to an
array. Calling a function in a while loop and shifting the array should
recursively take me through all subdirectories. The end result should be a table
on the index file that the user's would be able to click on to take to the .htm
file. Right now I'm having a problem with my foreach statement...

What's needed:
- Simple but effective. It's not going to be feasible to add a lot of .php files
to subdirectories. These directories are really working directories so this is a
headache. There are more that just .htm files. That is not the problem. Just
don't want the people to have to dig down.
-A single sign-on would be great. Each user only needs to access one directory
under DOCUMENT_ROOT. I know that SSL uses the IP address and I can't break up
the SSL into multiple virtual hosts so I can't do that. The security must
provide protection from somebody trying to get in from a subdirectory

From my limited knowledge of PHP, I would think that creating a solution to
support this would take some time. But like I said I sure don't know everything.

If anyone has any suggestions (and estimations of time it would take) I would
appreciate it.

Thanks,

James

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



[PHP] _POST not working (using mini_httpd) - 2 attachments

2005-02-28 Thread overbored
Hi all, I'm learning PHP and I'd need to create a simple Web-based ifconfig 
tool for a Soekris box (running Pebble). However, I've been unsuccessful at 
getting PHP working with mini_httpd. In particular, the POST data is not 
being received. Here's what I did...

First, I applied (only) the SCRIPT_FILENAME and index.php modifications to 
mini_httpd.c, as suggested in:

http://m0n0.ch/wall/list/?action=show_msgactionargs[]=15actionargs[]=11

Then I built  installed this on a (regular) Debian box, which had php4 
installed from apt. (This doesn't seem related, but for some reason, when I 
start up, I get a warning: socket: Address family not supported by 
protocol.)

Next, I created some simple PHP files, and I found that POST data isn't 
getting through at all. Googling didn't really turn up much, and I know 
this is possible because the m0n0wall project does just this (download 
their rootfs and look at the PHP files under /usr/local/www).

I've attached a simple test.php that doesn't work (always prints no 
post), along with my /etc/php4/cli/php.ini. If you uncomment the stdin-
reading lines, the server won't respond (I think because it's trying to 
read stdin that's not there, or that has no EOF.) Here is the page's 
initial output:

HTTP_ENV_VARS:
/usr/local/bin:/usr/ucb:/bin:/usr/bin
/usr/local/lib:/usr/lib
mini_httpd/1.19 19dec2003
dell400
CGI/1.1
HTTP/1.0
8000
GET
/test.php
/home/a/web/htdocs/localhost/test.php
192.168.1.101
Opera/7.54u1 (Windows NT 5.1; U) [en]
192.168.1.104:8000

And here is its output after a submit (when I set method to post):

HTTP_ENV_VARS:
/usr/local/bin:/usr/ucb:/bin:/usr/bin
/usr/local/lib:/usr/lib
mini_httpd/1.19 19dec2003
dell400
CGI/1.1
HTTP/1.0
8000
POST
/test.php
/home/a/web/htdocs/localhost/test.php
192.168.1.101
http://192.168.1.104:8000/test.php
Opera/7.54u1 (Windows NT 5.1; U) [en]
192.168.1.104:8000
application/x-www-form-urlencoded
22

Here is its output when I set method to get:

HTTP_ENV_VARS:
/usr/local/bin:/usr/ucb:/bin:/usr/bin
/usr/local/lib:/usr/lib
mini_httpd/1.19 19dec2003
dell400
CGI/1.1
HTTP/1.0
8000
GET
/test.php
/home/a/web/htdocs/localhost/test.php
alpha=asdfasdf?=Submit
192.168.1.101
http://192.168.1.104:8000/test.php
Opera/7.54u1 (Windows NT 5.1; U) [en]
192.168.1.104:8000

Basically, _POST/_GET/_REQUEST never exist, and it seems the only way I can 
get the data is with GET and parsing the HTTP_ENV_VARS.

I've also tried with different browsers. What's going on? Any help would be 
tremendously appreciated. Thanks in advance.

Yang

begin 644 php.ini
M6U!(4%T*CL[.SL[.SL[.SL[[EMAIL PROTECTED]CL[.SL[.SL[.SL[CL@
M5AIR!IR!T:[EMAIL PROTECTED]5F875L=!S971T:6YGR!F:6QE(9OB!N97@4$A0
M(ENW1A;QA=EO;G,N[EMAIL PROTECTED]@95F875L=[EMAIL 
PROTECTED](ENW1A;QS(ET
MV5L9B!W:71H([EMAIL PROTECTED])A=EO;B!S=6ET86)L92!F;W(*.R!D979E
M;]P;65N=!P=7)P;W-E[EMAIL PROTECTED](I.3U0J(9OB!PF]D=6-T:6]N('!U
MG!O[EMAIL PROTECTED]($9OB!S979EF%L('-E8W5R:71Y+6]R:65N=5D(-O;G-I
M95R871I;VYS('1H870@VAO=6QD()E('1A:V5N[EMAIL PROTECTED];W)E(=O:6YG
M(]N;EN92!W:71H('EO=7(@VET92P@QE87-E(-O;G-U;'0@AP+FEN
M:2UR96-O;6UE;F1E9`H[(%N9!H='1P.B\OAP+FYE=]M86YU86PO96XO
MV5C=7)I='DN[EMAIL PROTECTED]CL[.SL[.SL[.SL[.SL[.SL[.SL*.R!!8F]U=!T
M:ES(9I;[EMAIL PROTECTED][EMAIL PROTECTED]AIR!F:6QE(-O
M;G1R;VQS(UA;[EMAIL PROTECTED]R!O9B!02%`GR!B96AA=FEOBX@($EN(]R
M95R(9O[EMAIL PROTECTED]\*.R!R96%D(ET+!I=!M=7-T()E(YA;65D(=P
M:'`N:6YI)RX@(%!(4!L;V]KR!F;W(@:70@:[EMAIL PROTECTED]AE(-UG)E;G0*.R!W
M;W)K:6YG(1IF5C=]R2P@:[EMAIL PROTECTED]AE('!A=@@95S:6=N871E9!B2!T
M:[EMAIL PROTECTED]:7)O;FUE;[EMAIL PROTECTED]:6%B;[EMAIL 
PROTECTED](EN('1H92!P
M871H('[EMAIL PROTECTED](1E9FEN960@:[EMAIL PROTECTED]EL92!T:6UE(AI;B!T:%T
M(]R95R*2X*.R!5;F1EB!7:6YD;W=S+!T:[EMAIL PROTECTED]EL92UT:6UE('!A
M=@@:7,@=AE(%=I;F1O=W,@9ER96-T;W)[EMAIL PROTECTED]AECL@%T:!I;B!W
M:EC:!T:4@AP+FEN:2!F:6QE(ES(QO;VME9!F;W(@8V%N()E(]V
M97)R:[EMAIL PROTECTED];F*.R!T:[EMAIL PROTECTED],@87)G=6UE;G0@:[EMAIL 
PROTECTED];6%N9!L
M:6YE(UO94NCL*.R!4:4@WEN=%X(]F('1H92!F:6QE(ES(5X=')E
M;65L2!S:6UP;4N(!7:ET97-P86-E(%N9!,:6YEPH[()E9VEN;FEN
M9R!W:71H($@V5M:6-O;]N(%R92!S:6QE;G1L2!I9VYOF5D(AAR!Y
M;W4@')O8F%B;'[EMAIL PROTECTED]W-E9DN[EMAIL 
PROTECTED]EO;B!H96%D97)S(AE+FN
M(%M;V]=*2!A[EMAIL PROTECTED];R!S:6QE;G1L2!I9VYOF5D+!E=F5N('1H;W5G
M:`H[('1H97D@;6EG:'0@;65A;B!S;VUE=AI;F@:[EMAIL PROTECTED]AE(9U='5R92X*
M.PH[($1IF5C=EV97,@87)E('-P96-I9FEE9!UVEN9R!T:[EMAIL PROTECTED];]W
M:6YG('-Y;G1A#H*.R!D:7)E8W1I=F4@/2!V86QU90H[($1IF5C=EV92!N
M86UER!A[EMAIL PROTECTED]V4@V5NVET:79E*B`M(9O;SUB87(@:7,@9EF9F5R
M96YT(9R;[EMAIL PROTECTED]//6)ABX*.PH[([EMAIL PROTECTED]@82!S=')I
M;FL($@;G5M8F5R+!A(%!(4!C;VYS=%N=`H92YG+B!%7T%,3!OB!-
M7U!)*2P@;VYECL@;[EMAIL PROTECTED]AE($E.22!C;VYS=%N=',@*$]N+!/9F8L(%1R
M=64L($9A;'-E+!997,L($YO(%N9!.;VYE*2!OB!A;B!E'!R97-S:6]N
M[EMAIL PROTECTED][EMAIL PROTECTED]@)B!^15].3U1)0T4I+!OB!A('%U;W1E9!S=')I
M;F@*)F;V\B*2X*.PH[($5X')EW-I;VYS(EN('1H92!)[EMAIL PROTECTED]
MF4@;EM:71E9!T;R!B:71W:7-E(]P97)A=]RR!A;F0@%R96YT:5S
M97,Z[EMAIL PROTECTED]`@(`@([EMAIL PROTECTED]/[EMAIL 

Re: [PHP] Semi-OT: Anti-password trading/sharing solutions

2005-02-28 Thread Comm23A
On 28 Feb 2005 dan wrote:

 Go ahead and look at my first email.  For some reason you didn't get the 
 idea that I was looking for solutions.  Ideas.  I wasn't looking for 
 anything solid.

It really wasn't so clear what you were looking for.  It is to you, but not 
necessarily to the reader.

Richard gave you some good feedback.  You may not like what he said but the 
sarcastic rejoinders aren't going to get you much help, which presumably is 
what you came looking for.

On the response you've gotten ... You are asking questions to support a 
business that a lot of people don't like and don't want to have anything to do 
with 
because they think it's immoral.  Frankly it's not especially different from 
someone asking if they can get some help with a Ku Klux Klan or John Birch 
Society web site.  I wouldn't even consider being helpful with such a project, 
or 
with yours.

You can say all those who disagree with what you're doing are religious 
fanatics or lacking in manhood, as you did with the person who posted the rant. 
 
But you'd be pretty far wrong.  Do you expect to just get help because it's a 
business with an interesting programming problem even though a lot of people 
find the product morally objectionable?  If so you are not paying attention 
to 
how most people operate.

People tend to not only refuse to help with things they find immoral, but to 
(surprise!)  speak up about them.  This is a good thing even if it is 
inconvenient for those like you who are the recipients.


RE: [PHP] Re: Like ternary but without the else.

2005-02-28 Thread David Robley
Chris W. Parker wrote:

 Richard Lynch mailto:[EMAIL PROTECTED]
 on Monday, February 28, 2005 5:12 PM said:
 
 Course, I gotta say that maybe you're coming at this wrong in the
 first place, if you have to change $this based on $something to $that
 but $this already has a value...
 
 Maybe you should have figured out what $this should be back when you
 first initialized it?
 
 Maybe not.  Can't tell without seeing more code.
 
 Hmm.. possible. I'll have to go back and look at it as I haven't messed
 with it in a few days.
 
 
 
 Thanks,
 Chris.

Just a side note here; the variable $this will probably bite you if/when you
upgrade to php 5 :-)

David

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



Re: [PHP] Re: Like ternary but without the else.

2005-02-28 Thread anirudh dutt
dunno if u've read the options ppl have given u or u've ignored their answers:

imho, these are the answers to ur question:

On Sat, 26 Feb 2005 00:46:36 +0100, rich [EMAIL PROTECTED] wrote:
 
 is this what you're after?
 
 $this = ($something ? $that : $this)
 
 rich
 

On Fri, 25 Feb 2005 17:35:03 -0800, Chris W. Parker
[EMAIL PROTECTED] wrote:
 Jason Barnett mailto:[EMAIL PROTECTED]
 on Friday, February 25, 2005 2:10 PM said:
 
  $this = $something ? $that : null;
 
 That won't work because I'm setting a default value for $this and want
 it to change only if it has to. The long winded way to write this would
 be:
 
 ?php
 
   $myVariable = default;
 
   if($somethingElse == a value)
   {
 $myVariable = new value;
   }
   else
   {
 // don't do anything
   }
 
 ?
 
 Chris.
 

so this one still applies:

On Sat, 26 Feb 2005 01:03:51 +0100, Jochem Maas [EMAIL PROTECTED] wrote:
 or one of these might work for you;
 
 $this = ($something) ? $that: $this; // if $this already exists.
 
 or
 
 $this = ($something) ? $that: null; // if $this does not exist and your happy 
 to use is_null()
 

to put it simply, use:
$this = ($something ? $that : $this)

it does have the else part of the ternary operator, but it's the closest.

it assumes that 'this' has a value it already should have and unless
the condition 'something' is true, the value remains the same (or
remains null/not set). in which case...

On Mon, 28 Feb 2005 17:12:15 -0800 (PST), Richard Lynch [EMAIL PROTECTED] 
wrote:
 If you're not *SURE* $this has a value:
 
 $this = ($something ? $that : (isset($this) ? $this : NULL));
 

u've also mentioned:
On Fri, 25 Feb 2005 17:28:13 -0800, Chris W. Parker
[EMAIL PROTECTED] wrote:
 Justin Lilly mailto:[EMAIL PROTECTED]
 on Friday, February 25, 2005 3:10 PM said:
 
  This should do the trick:
 
  $something ? $this=$that
 
 Actually that gives a synax error. But I've figured it out based on your
 suggestion.
 
 It's actually:
 
 ?php
 
   $something  $this = $that;
 
 ?

this seems to do the trick as per Like ternary but without the else.

for those who want to know, u can even use:
$a  print this only prints if 'a' is non false
but not echo since it doesn't return a value.

?php
$b = 2;
$a = !true;
$a  $b = 5;
$a  print $a, $b (boolean-in-a-line worked)br\n;
echo $a, $b :: echo line;
?

u get either:
1, 5 (boolean-in-a-line worked)
1, 5 :: echo line
- OR -
, 2 :: echo line
depending on combos with $a = true or $a = !true.
true prints as 1.

so u've found ur answer.

-- 
]#
Anirudh Dutt


...pilot of the storm who leaves no trace
like thoughts inside a dream

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



[PHP] Logging with PHP to SMTP server

2005-02-28 Thread kioto
Hi all, there is a way to create log-system to authenticate to smtp 
server ?
Thanks so much to all.

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


[PHP] problem with mail() and attachment

2005-02-28 Thread Stefan Sturm
Hi,

I'm using the script below to send ascii files attached to mails via mail().
I'm running the script on different servers and it works fine. Now I got a
problem on windows server 2003. The attachment of the mail is disturbed, the
first 76 characters are missing, the rest of the attachment is correct. When
I looked at the mail headers of the mail I recieved I recognized that there
were some lines missing. Also the first line of the attachment part in the
header is mssing. As I use chunk_split without the chunklen paramter the
lines are all 76 characters long. So it just looks like that the server
ommits lines in the header. I marked the missing lines in the script with
comments. Has anybody got an idea where the problem could be?

Thank in advance

Stefan

  $unique_sep =md5(uniqid(time()));
  $headers = From: egrade questionaire\n;
  $headers .= MIME-Version: 1.0\nContent-Type:
multipart/mixed;boundary=\$unique_sep\;\n;

#The second \n at the end of the next command is ommited, the resulting
empty line is not in the header of the received mail
  $headers .= charset=\iso-8859-1\\nContent-Transfer-Encoding:7bit\n\n;
  $headers .= egrade-result\n;
  $headers .= If you read this text your mail server is not supporting MIME
Format.\n;
  $headers .= --$unique_sep\n;
  $headers .= Content-Type: text/plain; charset=\iso-8859-1\\n;
#The second \n at the end of the next command is ommited, the resulting
empty line is not in the header of the received mail
   $headers .= Content-Transfer-Encoding: 7bit\n\n;
#From the next command only a single \n is  in the header of the received
mail, the text and the other \n are missing
  $headers .= egrade-result\n\n;
  $headers .= --$unique_sep\n;
# filename holds the path to the ascii file
  $headers .= Content-Type: {text/plain}; name=\{$filename}\\n;
  $headers .= Content-Transfer-Encoding: base64\n;
  $headers .= Content-Disposition: attachment\n\n;
  $filedata = implode(file($filename), '');
  $headers .= chunk_split(base64_encode($filedata));
  $headers .= --$unique_sep--\n;
  if(mail([EMAIL PROTECTED],subject,egrade-result,$headers) or die(An
error occured! The questionnaire has not been processed));

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



[PHP] Problem with mail() and attachment

2005-02-28 Thread Stefan Sturm
Hi,

I'm using the script below to send ascii files attached to mails via mail().
I'm running the script on different servers and it works fine. Now I got a
problem on windows server 2003. The attachment of the mail is disturbed, the
first 76 characters are missing, the rest of the attachment is correct. When
I looked at the mail headers of the mail I recieved I recognized that there
were some lines missing. Also the first line of the attachment part in the
header is mssing. As I use chunk_split without the chunklen paramter the
lines are all 76 characters long. So it just looks like that the server
ommits lines in the header. I marked the missing lines in the script with
comments. Has anybody got an idea where the problem could be?

Thank in advance

Stefan

  $unique_sep =md5(uniqid(time()));
  $headers = From: egrade questionaire\n;
  $headers .= MIME-Version: 1.0\nContent-Type:
multipart/mixed;boundary=\$unique_sep\;\n;

#The second \n at the end of the next command is ommited, the resulting
empty line is not in the header of the received mail
  $headers .= charset=\iso-8859-1\\nContent-Transfer-Encoding:7bit\n\n;
  $headers .= egrade-result\n;
  $headers .= If you read this text your mail server is not supporting MIME
Format.\n;
  $headers .= --$unique_sep\n;
  $headers .= Content-Type: text/plain; charset=\iso-8859-1\\n;
#The second \n at the end of the next command is ommited, the resulting
empty line is not in the header of the received mail
   $headers .= Content-Transfer-Encoding: 7bit\n\n;
#From the next command only a single \n is  in the header of the received
mail, the text and the other \n are missing
  $headers .= egrade-result\n\n;
  $headers .= --$unique_sep\n;
# filename holds the path to the ascii file
  $headers .= Content-Type: {text/plain}; name=\{$filename}\\n;
  $headers .= Content-Transfer-Encoding: base64\n;
  $headers .= Content-Disposition: attachment\n\n;
  $filedata = implode(file($filename), '');
  $headers .= chunk_split(base64_encode($filedata));
  $headers .= --$unique_sep--\n;
  if(mail([EMAIL PROTECTED],subject,egrade-result,$headers) or die(An
error occured! The questionnaire has not been processed));

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



Re: [PHP] _POST not working (using mini_httpd) - 2 attachments

2005-02-28 Thread Burhan Khalid
overbored wrote:
Hi all, I'm learning PHP and I'd need to create a simple Web-based ifconfig 
tool for a Soekris box (running Pebble). However, I've been unsuccessful at 
getting PHP working with mini_httpd. In particular, the POST data is not 
being received. Here's what I did...
What version of PHP are you running? $_POST and other $_* variable are 
only available in PHP versions 4.2.+ iirc.

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