Re: [PHP] Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Stephan Fiedler
Hi Rinke,
check Mime-Types..
Stephan
Rinke Hoekstra wrote:
Hi All,
I have a rather odd problem. Since a few days, my otherwise perfect SuSe 
9.0 Apache2 server started to do some funny stuff.
In general, php works fine, and I can do anything I want... after a 
little while Firefox/IE starts asking me whether I want to download/run 
the php file instead of rendering it in the browser.
Sometimes even this doesn't happen, and I just get a regular Apache2 
page stating 'Object not found' (with accompanying lines in my server's 
error_log). A few minutes later, everything works fine again.
(restarting apache also tends to help)

I think the biggest problem is that it is intermittent: sometimes it 
works, and sometimes it doesn't... no way for me to diagnose it.
weird.

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


Re: [PHP] Permissions

2004-11-19 Thread Stephan Fiedler
Hi Phil,
Phil Ewington - 43 Plc wrote:
Hi All,
I have a need for a PHP application to read/write Linux system files that
have root.root ownership. At present reading not a problem but writing
obviously is denied. I know there are probably some serious security issues
here, but what should I be doing to allow this behaviour. I am running PHP
4.3.8 on Linux Redhat Fedora 1 installed as an Apache module.
I'd write a wrapper. The wrapper has the suid and/or the sgid bit set.
Your script from the webserver opens a process for that wrapper.
The wrapper sets uid and/or gid, then reads its conf with new 
privileges; where to put the files. Next it opens stdin and reads from it.
There you php-script writes data to the process-descriptor.
The wrapper checks whether it is meaningful data, and if, it stores data 
at the place it's conf said to store it.

So your phpscript isn't exploitable that much that it can overwrite 
random system control files.

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


Re: [PHP] Submitting info from a form to a db

2004-09-15 Thread Stephan Fiedler
Hi Logan,
1stly My cristall ball tells me it's an unexpected ;
expected was a ) here.
.md5($_POST['password']).'));
---^
2ndly.
Please Submit the error you get.
3rdly.
check posted values before inserting them into db.
Have a nice day
Stephan
[oops, 1st time sent it went to the OP not to the list, sorry]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Submitting info from a form to a db

2004-09-15 Thread Stephan Fiedler
Hi Dirk,
dirk wrote:
Try it with escaped qutation marks (\)
This is completely wrong here, because mysql doesn't understand those 
marks().
The string delimiter in mysql (in sql in general) is '
(http://dev.mysql.com/doc/mysql/en/index.html)

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


Re: [PHP] Checkbox Question

2004-09-02 Thread Stephan Fiedler
Hi Nick,
Nick Wilson wrote:
Hi all, 
[...]
INPUT TYPE=checkbox NAME=a VALUE=on

so, what is it? a=what?
[...]
if a was checked a=on is posted (or 'get'ed)
if not checked a isn't set.
Thanks very much!
You're welcome
Stephan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mail() on *nix using ssmtp or an external smtp server?

2004-08-16 Thread Stephan Fiedler
Hi Markus,
do I get you right, you can't invoke mail() because php can't find the 
sendmail executable?

perhaps this does the trick:
function my_mail_inject($mail)
{
	$sendmail = ini_get(sendmail_path);
	if(!$sendmail) $sendmail = /var/qmail/bin/qmail-inject;
	$p = popen($sendmail, w);
	if($p)
	{
		fwrite($p, $mail);
		pclose($p);
		return 1;
	}
	return 0;
}
(this is something I acutally use on a beta-production-system.)
$mail must contain a complete mail with all necessary headers.
qmail-inject is ~ equal to sendmail -t (-i is ignored in qmail's sendmail.)
this solution also helpep me out of my dilemma that php reformats mail 
and adds extra headers and so on.
Here I have full control over all headers :o)

Hope you see your qmail installation in chroot'd env.
else: good luck.
I know it's not an external mta to deliver.
If this does not help you at all have a look at the sources and hack 'em 
'till they fit your needs #

Ste'reinvent the wheel'phan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mail() and the From: attribute...

2004-08-13 Thread Stephan Fiedler
Hi Tristan,
[EMAIL PROTECTED] wrote:
HAving:
...From: [EMAIL PROTECTED]); doesn't work on all recipients... BUT..
... From: justaname); Works on others... but not all...?
 
Surely this can't be? I've never come accross this before?
Any ideas what's up?
 
Well, what I do when sending mail with a spoofed sender, I do like this:
$olduser = getenv(USER);
putenv(USER=$user_i_want_act_as_for_mass_mailing);
do
{
mail(.);
}while($there_are_more_Addresses_to_spam_at);
putenv(USER=$olduser);
Not quite sure, whether I used setenv or putenv, I'm sure U'll find out.
AND: bweare sending spam to ME ;o)
Tris...
Stephan
*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

THIS is really funny in a mailing list :o)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Template Question

2004-08-13 Thread Stephan Fiedler
Hi Jonathan,
Jonathan Hadddad wrote:
 [code in a template]
Think you're right this IS a problem.
Use Templates to seperate code from the ouput 'layer'.
If you still have code in your template, maybe it's bad design.
why don't you simply add some more variables to your template and tell 
the template-class, what values to fill there?

anyway, maybe eval() is your friend, but then you have to slightliy 
modify the template, methinks.

Ste'dogmatically using templates to seperate code from output'phan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Changing MySQL Date Format

2004-08-12 Thread Stephan Fiedler
Hi Harlequin,
Harlequin wrote:
[...]

I'm just getting a little hacked of having to explode the damn things every
time I use them.
You EXPLODE them??
When you want it human readable why not simply
preg_replace(/(\d{4})-(\d{2})-(\d{2})/, $3-$2-$1 [*], $input);
it?
or preg_replace it to something machine-readable and for the output use 
strftime?

or even simpler: select unixtimestamp(mytime) and strftime later?
Stephan
[*] if you want the month leading it is $2-$3-$1...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php