[PHP] need to alter FROM address when sending with PHP forms
My company has a RH ES4 web server running apache/2.2.2 and PHP 5.1.4. Our PHP programmer has developed quite a few PHP email forms and each time an email is sent, the FROM: address is [EMAIL PROTECTED] I don't know if this is a PHP problem or apache problem (or even a sendmail problem for that matter) so I am asking both lists for help. I have tried lookup up apache docs and PHP docs to alter the FROM: address to no avail. No matter what I and my programmer try in PHP or apache the from address stays coming from the user apache runs as @webserver.domain.com (obviously I mean the FQDN of the server). We would like to be able to alter the FROM: address per form as we should be able to do in PHP. If there is a PHP fix for this any help would be appreciated. If this is definitely NOT a PHP problem, please let me know and I will move on from there. Thank you. Dylan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using ($test)?$true:$false in a string
Hi Is it possible to use the ($test)?$true:$false construction in a (double quoted) string without dropping out of the string and concatenating? I have many lines like: $var = first part of string .(($a==$b)?$c:$d). rest of string; and I feel it would be more elegant to be able to do something like: $var =first part of string {(($a==$b)?$c:$d)} rest of string; Cheers Dylan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using ($test)?$true:$false in a string
Richard Lynch wrote: On Fri, November 18, 2005 2:13 pm, Dylan wrote: Is it possible to use the ($test)?$true:$false construction in a (double quoted) string without dropping out of the string and concatenating? I have many lines like: $var = first part of string .(($a==$b)?$c:$d). rest of string; and I feel it would be more elegant to be able to do something like: $var =first part of string {(($a==$b)?$c:$d)} rest of string; You could try it faster than I could answer... If it doesn't work, maybe do: $z = $a==$b ? $c : $d; $var = first part of string $z rest of string; Burying too much login in the middle of your data/string is probably a Bad Idea (tm) anyway. I already discounted that since we're talking about a couple of hundred instances, each of which would need a different $z. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: open or save problem
Thanks so much for the quick reply, it was helpful. It sounds like neither of us know WHY the open or save thing happens with no-cache or no-store. That's what I'd really like to know. Is this by design, or is it a bug in IE? If you run across any more info on this, please let me know. Thanks for your help. Dylan Miller Solimar Systems, Inc. -Original Message- From: Daniel Grace [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 30, 2002 2:59 PM To: Dylan Miller Cc: [EMAIL PROTECTED] Subject: Re: open or save problem I've CC'd a copy of your message plus this reply to the PHP mailing list for the benefit of the rest of the PHP community as well. (That and one of them might have a solution to this) I never found a clean solution to this problem with PDF files with cache: no-cache set. There are a couple of ways around this that I know of: 1. Rather than outputting the PDF file, physically create it in a web-accessible directory (with some randomly-generated filename, md5(uniqid(pdf)) . .pdf would work) and redirect the user to it. 2. Better, dump the entire PDF file into a database using some uniqid() to reference it and a timestamp, and redirect to a PHP script that doesn't use sessions/doesn't send the cache-control header (or uses cache-control: private) which pulls the PDF back out of the database and feeds it to the user. The timestamp can be used to automatically delete the file after a short time, 5-30 minutes later depending on the length of the PDF. Neither of these solutions are perfect, however, and if the PDF contains security-sensitive information you still have the same problem as they'll be cached. If you want to do further research into this, I periodically hear something about an issue between Apache and PDF, but I don't know the details of that. It's possible the problems are related -- if so, there may be a fix somewhere on the Apache site. -- Daniel Grace - Original Message - From: Dylan Miller [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 30, 2002 1:17 PM Subject: open or save problem Daniel Grace, Hi, I saw a post of yours on the php.general message board: http://groups.google.com/groups?hl=enlr=ie=UTF-8oe=UTF8selm=20020302062 856.49458.qmail%40pb1.pair.com I'm writing a program to send a PDF file to a browser, and I get the exact problem you describe when I set Cache-Control to no-cache. If I remove the Cache-Control header, everything works fine, but with it in there, I get the open or save dialog with open grayed out. For security reasons, I'd like to avoid caching. I was just wondering if you ever found out anything more about this. I've been reading and searching the web, and your post was the only thing I could find related to this issue. I'd really appreciate any insight you could give me. Thanks, Dylan Miller Solimar Systems, Inc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.2.0 and the GET method URLs
Hello- I recently installed PHP 4.2.0 and Apache2, and everything finally seems to be working nicely...except for GET method (which I believe it http://sitename/pagename.php?var=valuevar=valuevar=value; perhaps that's POST, sue me...). The variables simply aren't passed to the PHP script. At all. Register_globals shouldn't have anything to do with this, but it's on anyway...see http://cinotes.tnt.2y.net and click on pretty much anything for an example. (Note that the modules.php file most of those links fire off to displays 'Sorry, you can't access this file directly' if and only if no name=modulename variable is passed to it.) Many thanks in advance! -- Dylan Fitzgerald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular Expression Question
Hello, I was wondering if there is a way to match a pattern, then delete the entire line containing the pattern. I.E. (if I was searching for pattern in a file containing pattern:info:info:info pattern2:info:info:info pattern3:info:info:info is there a way to delete the entire, and only the first line?) or is there an easier way to just remove a line from a file? thank you Dylan Finney www.healthcoast.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Include Paths
Hello, I am fairly new to PHP and so far I love it. One question I have is how to call include files outside of their directory without hard coding the real path to the file itself. Is there map path or a similar function in PHP? Also when i use readfile() or fpassthru() when I echo the result what I assume is the file size is added to the end of the line. i.e.( blah blah blah will produce a 14 at the end of the line ) I was curious as to if there is a flag i'm missing that is causing them to do that. Thank you for the help! Dylan Finney www.healthcoast.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Stack trace function would be really useful!
Back in my rough-and-ready PHP days, I used to report runtime errors using include("some long description of the error");, which would report: file "some long description of the error" not found in foo.php line 32. Which is great for developers, but awful if a Real User ever sees it. So, lately I've been using a function, handleException(String errorType), which draws a nice page describing gently that something has gone wrong, etc. Unfortunately this way can't report the line number of the function that called it and I'd rather not have to manually include that info at each calling site. If there was a PHP function that printed out the call-stack, I'd be totally set. Is there such a function (I looked, but perhaps with the wrong keywords), or if not, could it be easily added? thanks, dylan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Can I fork a PHP thread?
There are occasions when I'd like to execute some long-running task in the background, in response to some user action. It seems that PHP has all the neccesary mechanisms to allow me to do this, but in my perusing of the manuals/FAQ's/digests, etc, I don't see such a facility. For example, I'd like to do something like this: function long_running_background_task() { ... } function handle_some_action() { ... fork (long_running_background_task); } In the cases I'd like to do this, I can manage synchronization externally... (i.e., implement join by waiting for a /tmp file to appear or something), so I'm not asking for a join, or any sychronization facilities. Does anyone agree that this would be useful? Is there another way to accomplish this? Better yet, does this function already exist, but has managed to hide for all this time...? thanks, dylan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]