[PHP] need background info on PHP Java
Hi, I know, I've posted a while back, but I still couldn't find any docuuments on how PHP and Java interact. I know what I've pulled out of the manual and I knwo I could also connect via Java Servlet (thx Ray) but that's just not enough, to satisfy. I mean if I'm using it, I sure want to know why it's working and how. To give you an rough idea on what I'm talking about here is some sampe code: ?php $system = new Java(java.lang.System); print Java version=.$system-getProperty(java.version). br\n; thx I'd really apreciate it as my boss want's an answer, too. Jan Bro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] redirecting to a url..
I have this form with 2 values under 1 name ColTemplate. I was hoping if i can redirect it to another url? on the ?? if templateone or templatetwo. Anyhelp would be good. -- code - $v_get_template = $_POST['ColTemplate']; if ($v_get_template === 'TemplateOne') { ?? } elseif ($v_get_template === 'TemplateTwo') { ?? } -- code - -- Thank you, Louie Miranda ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirecting to a url..
My solution.. echo meta http-equiv=\REFRESH\ CONTENT=\0; URL=us/index.php\; Or you may have other more advance alternatives? -- Thank you, Louie Miranda ([EMAIL PROTECTED]) - Original Message - From: Louie Miranda [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:08 PM Subject: [PHP] redirecting to a url.. I have this form with 2 values under 1 name ColTemplate. I was hoping if i can redirect it to another url? on the ?? if templateone or templatetwo. Anyhelp would be good. -- code - $v_get_template = $_POST['ColTemplate']; if ($v_get_template === 'TemplateOne') { ?? } elseif ($v_get_template === 'TemplateTwo') { ?? } -- code - -- Thank you, Louie Miranda ([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] Recovering from a time out
Is it possible to *gracefully* recover from php timing out? For example, uploading a large file, and php times out, so display Oops Timed out This also assumes that we have no means of changing php's time out value?? Thanks for your comments.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem matching multiple times
Vince LaMonica [EMAIL PROTECTED] wrote: Hi All, hello [...] function vjencode($message) { $message = . $message ; ##--- [b] and [/b] for bolding text. $message = preg_replace(/\[b\](.*?)\[\/b\]/si, b\\1/b, $message); ##--- [i] and [/i] for italicizing text. $message = preg_replace(/\[i\](.*?)\[\/i\]/si, i\\1/i, $message); btw, you know you can do this in one step: $message = preg_replace(/\[(i|b)\](.*?)\[\/(i|b)\]/si, \$1\$2/\$3, $message); [...] ##--- display photos [having problems with this] $patterns[3] = #\#\#\#Image(.*?)\#\#\##si; // this matches just fine strings like ###Image1### and ###Image2### I would change mabey make sure you catching a digit and the serpator for readabilty /###Image(\d+)###/si [...] if ($_GET[ppdid] != ) { // the ppdid var is passed in the URL $sel_image = SELECT * from ppd_photos where ppd_id = '$_GET[ppdid]' AND place_holder = '$thephoto[0]'; // in this case, the page with a ppdid of '3' has 2 images, who's // placeholders are: ###Image1### and ###Image2### $sel_image_result = safe_query($sel_image); $sel_image_row = mysql_fetch_array($sel_image_result); $image_id = $sel_image_row[image_id]; $image_name = $sel_image_row[image_name]; $caption = $sel_image_row[caption]; $width = $sel_image_row[width]; $height = $sel_image_row[height]; $image_alignment = $sel_image_row[image_alignment]; // replacements[3] is all one one line -sorry about word wrap! $replacements[3] = brtable border=0 cellspacing=2 cellpadding=0 width=\$width\ align=\$image_alignment\trtdimg src=\/uimages/$image_name\ height=\$height\ width=\$width\ border=1/td/trtrtdfont class=\caption\$captionfont/td/tr/tablebr; } The only solution I can think of is while your looping through the images they have build more pattern/replacemen array items foreach (row in db) $pattern[] = /###Image($count+1)### $$replacements[] = htmlstuff$image_name/htmlstuff; Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirecting to a url..
Louie Miranda [EMAIL PROTECTED] wrote: I have this form with 2 values under 1 name ColTemplate. I was hoping if i can redirect it to another url? on the ?? if templateone or templatetwo. header('Location: http://domain/file'); Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirecting to a url..
thanks, this is much better. -- Thank you, Louie Miranda ([EMAIL PROTECTED]) - Original Message - From: Curt Zirzow [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:29 PM Subject: Re: [PHP] redirecting to a url.. Louie Miranda [EMAIL PROTECTED] wrote: I have this form with 2 values under 1 name ColTemplate. I was hoping if i can redirect it to another url? on the ?? if templateone or templatetwo. header('Location: http://domain/file'); Curt -- -- 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] Too much of $GLOBALS[] a problem??
Rather than having the following scenario: $GLOBALS['foo'] = 'foo'; $GLOBALS['fee'] = 'fee'; The following would be much cleaner and portable while still allowing the ease of use of $GLOBALS based configuration: $GLOBALS['myProjectName']['foo'] = 'foo'; $GLOBALS['myProjectName']['fee'] = 'fee'; Cheers, Rob. On Thu, 2003-07-17 at 22:58, Curt Zirzow wrote: Ow Mun Heng [EMAIL PROTECTED] wrote: Hi All, Just a quick question on this. In my scripts, I'm using A LOT Of $GLOBALS['my_parameter'] to get the declared values/string. 1 example below : function display_menu_html() { echo 'table class=width100 cellspacing=0'.\n; echo 'tr'.\n; echo \t.'td class=menu'.\n; echo \t.'a href=home.php' . $GLOBALS['home'] . /a [...] } This isn't really a Problem but.. is it bad programming practice?? Or I should just write another function that can return the values/string? yes and no, that is rather a debatable question. To make my functions that echo stuff cleaner I usually do stuff like: function show_html() { ? table class=width100 cellspacing=0 tr td class=menu a href=someplace.php?php echo $var?/a /td /tr /table ? } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .-. | Worlds of Carnage - http://www.wocmud.org | :-: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul.| `-' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem matching multiple times
On Fri, 18 Jul 2003, Curt Zirzow wrote: } btw, you know you can do this in one step: } } $message = preg_replace(/\[(i|b)\](.*?)\[\/(i|b)\]/si, \$1\$2/\$3, $message); Doh! Thanks for the tip...that'll save some lines of code :) } $patterns[3] = #\#\#\#Image(.*?)\#\#\##si; } // this matches just fine strings like ###Image1### and ###Image2### } } I would change mabey make sure you catching a digit and the serpator for } readabilty /###Image(\d+)###/si Ok. Changed it and you're right - much easier to understand what the patern is being searched. } [...] } if ($_GET[ppdid] != ) { // the ppdid var is passed in the URL } $sel_image = SELECT * from ppd_photos where ppd_id = '$_GET[ppdid]' AND place_holder = '$thephoto[0]'; } // in this case, the page with a ppdid of '3' has 2 images, who's } // placeholders are: ###Image1### and ###Image2### } $sel_image_result = safe_query($sel_image); } $sel_image_row = mysql_fetch_array($sel_image_result); } $image_id = $sel_image_row[image_id]; } $image_name = $sel_image_row[image_name]; } $caption = $sel_image_row[caption]; } $width = $sel_image_row[width]; } $height = $sel_image_row[height]; } $image_alignment = $sel_image_row[image_alignment]; } $replacements[3] = brtable border=0 cellspacing=2 cellpadding=0 [snip] } } The only solution I can think of is while your looping through the } images they have build more pattern/replacemen array items } } foreach (row in db) }$pattern[] = /###Image($count+1)### }$$replacements[] = htmlstuff$image_name/htmlstuff; Do you mean: $patterns[3] = /###Image($count+1)###/; $replacements[3] = html stuff; The problem with this is that I don't know how many rows are going to come back, since the first/only SQL statement just returns one row [whatever the current image placeholder is...in this case, ###Image1###. So I need to loop before I run the SQL statements. Also, using $patterns[3] again overwrites the first call to it [the one you recommended i re-write for readablity]. I need to make sure the $replacements[3] contains all of the html stuff, so it needs a pattern for the preg_replace call later in the function: $message = preg_replace($patterns, $replacements, $message); Thanks for your help with this! /vjl/ -- Vince LaMonica UC Irvine, School of Social Ecology W3 Developer * 116 Social Ecology I, Irvine, CA 92697 [EMAIL PROTECTED] http://www.seweb.uci.edu/techsupport Your mouse has moved. Windows NT must be restarted for the change to take effect. Reboot now? [ OK ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using href as a submit for a form
I am using a form to submit to mysql. What I would like to do is to use a link to submit the form instead of the standard submit button. Help is appreicated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Too much of $GLOBALS[] a problem??
Very Well Explained.. now I know how to use the code which I saw in phpMyAdmin or Tiki.. Much better way to do it and a lot less conflicts to as you say,variable names. Thanks. Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Lars Torben Wilson [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 12:26 PM To: Ow Mun Heng Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Too much of $GLOBALS[] a problem?? On Thu, 2003-07-17 at 21:10, Ow Mun Heng wrote: 'Loosely-coupled' code relied much less on the environment around it. It would typically receive its values through an argument list, array of values it needs, or perhaps by being a method in a class which has attribute values for all of the necessary stuff. The $GLOBALS['parameter'] is actually defined in ONE(a config file that houses all the parameters and another a language file) place where it can be changed. So, i would say that's an argument list, is it not? No, it's a configuration file. An argument list is the bit between the parentheses when you write a function call: $retval = some_func($this, $is, $the, $argument, $list); If your config file had all of those variables in an array or something, and you passed that array to your function, *that* would be an argument list. See below: config.php: ?php $config = array('logout' = 1, 'overall_summary' = 'Here is the summary', etc); ? script.php: ?php include('config.php'); display_menu_html($config); ? Problem solved. The only thing left which can conflict is the name $config, and you could solve that by calling it something you're sure nobody else will be using (maybe $_omh_config or something). Now, you can lift your config file and display_menu_html() function and drop them into pretty much any script and be much more sure that you won't have to crawl through all the code making sure there are no variable name conflicts. The other way would be to write a function that obtains that from the argument list. But as I see it, it's basically the same thing? NO? No, because say you want to use this function in another script. First you need to make sure that this new script isn't already using any globals with any of the names you want to use--otherwise, you'll have variable clashes--where you expect one thing to be in $logout, for instance, but the script is using the name $logout for something else, and the value isn't what you expect. Class.. That's not somewhere I would want to venture, not right now anyway. Just starting out. Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 There was a discussion on this list about programming practices and books about programming--I think last week or the week before. Try a search on the archives. Anyway, there are lot of great books on programming which should help--and excellent and easy-to-read book which covers a lot of things which you *don't* want to have to figure out yourself is 'Code Complete', by Steve McConnell. -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using href as a submit for a form
Try to use javascript. a href=javascript:document.form1.submit()submit/a Change form1 as your actual form name. - To: [EMAIL PROTECTED] cc: Ron Allen Subject: [PHP] Using href as a submit for a form [EMAIL PROTECTED] 07/18/03 03:47 PM Please respond to Ron Allen I am using a form to submit to mysql. What I would like to do is to use a link to submit the form instead of the standard submit button. Help is appreicated. -- 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] Using href as a submit for a form
On Fri, 18 Jul 2003, Ron Allen wrote: } I am using a form to submit to mysql. What I would like to do is to use a } link to submit the form instead of the standard submit button. Help is } appreicated. You could use a simple GET to submit the form. Make sure you have register_globals off though! Something like this: https://www.mysite.org/submit_form.php?user=meclient=bsdbrowser=galeon The page that calls the above page would have to have form entities for the 3 fields. Then, on the submit_form page, you would take those vars and insert them in the database: $insert_user = $_GET[user]; $insert_client = $_GET[client]; $insert_browser = $_GET[browser]; Obviously the user could easily change the values in the URL before they submit [if they look at the html code behind the page]. Like all form processing, you need to make sure that the values submitted by the user are valid. register_globals being off is a step, but there are a lot of error correction functions you should run before submitting form data into a db. HTH, /vjl/ -- Vince LaMonica UC Irvine, School of Social Ecology W3 Developer * 116 Social Ecology I, Irvine, CA 92697 [EMAIL PROTECTED] http://www.seweb.uci.edu/techsupport This is like losing a game by forfeit when your team was ahead with the bases loaded and your best batter on deck. - Rep. John Conyers, on the DOJ agreeing to settle with Microsoft -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ulimit with php
Does any know how to catch the signal sent to a process called by PHP? eg. $something = `ulimit -t 30 -otherlimit; ./loop_to_death`; ulimit should return something like SIGALRM I use exec() but it only give me the exit code (always 128+9), not the signal.. because i need to know the reason of ulimit to terminated that program whether is CPU time too much, or other limits exceeded I was delighted to see proc_get_status but unluckily the machine only have PHP 4.3.0 . (can't install PHP5 because something were missing... XML? forgotten) Please help! -- - Eddy Wong __ inframatrix internet solutions http://www.inframatrix.com/ ¥¿¤KEddy Regular Octa-Eddy [EMAIL PROTECTED]@ [EMAIL PROTECTED]@¡½¢ª¢© [EMAIL PROTECTED]@[EMAIL PROTECTED]@¡½ É\¿ß¡G [EMAIL PROTECTED] [EMAIL PROTECTED]@¡½ É\¨¦¡G news://news.fixip.net/chat.ed [EMAIL PROTECTED]@[EMAIL PROTECTED]@¡½ É\®Þ¤Æ¡G news://news.fixip.net/ [EMAIL PROTECTED]@¡½¢¨¢« [EMAIL PROTECTED]@
RE: [PHP] Re: Value for entire file
-Original Message- From: Bobby Patel [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 06:11 it should be in the $_GET or $HTTP_GET_VARS array in the index.php script. put this at the top of your index.php script var_dump ($_GET); # or $HTTP_GET_VARS depending on PHP version and see if the value is there. Also, if you are using the value in a function and you have PHP 4.1.0 (I think), GET array is not global so to get this value you have to declare the array global No, $_GET has always been superglobal, it just didn't exist before 4.1.0 -- so for PHP 4.1.0 it's: function some_function () { global $HTTP_GET_VARS; echo $HTTP_GET_VARS['year']; } Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need to use META tag with variable attached
This is what I have META HTTP-EQUIV=refresh content=0; URL=./ticket_admin.php What I would like is for this to carry a variable with it. I have tried several different variations and they don't work obviously ?PHP META HTTP-EQUIV='refresh' content='0; URL=./ticket_admin.php?ID=.'$ID. ' Does someone have an idea for this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Need to use META tag with variable attached
Got it echoMETA HTTP-EQUIV='refresh' content='0; URL=./ticket_admin.php?ID=$ID'; ? Ron Allen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This is what I have META HTTP-EQUIV=refresh content=0; URL=./ticket_admin.php What I would like is for this to carry a variable with it. I have tried several different variations and they don't work obviously ?PHP META HTTP-EQUIV='refresh' content='0; URL=./ticket_admin.php?ID=.'$ID. ' Does someone have an idea for this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need to use META tag with variable attached
Hi, Try: META HTTP-EQUIV=refresh content=0; URL=./ticket_admin.php?ID=?php echo $ID; ? On 18/7/03 10:51 am, Ron Allen [EMAIL PROTECTED] wrote: This is what I have META HTTP-EQUIV=refresh content=0; URL=./ticket_admin.php What I would like is for this to carry a variable with it. I have tried several different variations and they don't work obviously ?PHP META HTTP-EQUIV='refresh' content='0; URL=./ticket_admin.php?ID=.'$ID. ' Does someone have an idea for this? Ryan Gibson --- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable not passed twixt pages..
Greetings learned PHP(eople), Scenario : User fills in text box, pushes Submit and textbox data gets passed to MySQL database.. = The code from the HTML page : form action=savemail.php method=GET target=main input type=text class=mailinput name=mailaddress value=Your Email Address == The code from savemail.php : ?php $result = @mysql_pconnect('localhost', 'user', 'pass'); $query = insert into email values (' . $_REQUEST['mailaddress'] . '); //Error stuff- $ResSaveMail = mysql_query($query); if (!$ResSaveMail) { echo(PError performing query: . mysql_error() . /P); echo(Your email has not been saved to the Delta Database.); exit(); } // ? === THe problem : The variable 'mailaddress' is not getting passed to savemail.php echo $_REQUEST['mailaddress'] reveals blank On another programmers advice I tried using POST in my form, but that don`t work either.. The database is getting populated with blank values...is my problem in the php code somewhere..I been playing with this for a while now and no joy has yet surfaced.. Any ideas greatly appreciated... -- Chris Blake Office : (011) 782-0840 Cell : 083 985 0379 Then there was the Formosan bartender named Taiwan-On. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable not passed twixt pages..
echo $HTTP_GET_VARS['mailaddress'] ; Un saludo, Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] popping up download dialog box
Hi every body ! I am writing a script which pops up download dialog box on click of a Link. Headers i m sending out for downloading jpegs are: header(Cache-control: private); header(Content-Type: image/jpeg); header(Content-Type: application/octet-stream); header(Content-Length: $size); header(Content-Disposition: attachment; filename=$fname); header(Content-Transfer-Encoding: binary); readfile($fname); All these work well in MSIE 5.0+ and Netscape 4.7+ . But on Mac I.E its not popping up the dialog box rather it opens up the jpg file in the browser window. I don know where am i doing wrong. Please suggest me . I cracked my mind for hours but in vain. So please help me out. Thanks in advance Binay
Re: [PHP] popping up download dialog box
if (!empty($file['file_data'])) { if (get_user_os() == MAC) { header(Content-Type: application/x-unknown\n); header(Content-Disposition: attachment; filename=\.$file ['file_name'].\\n); } elseif (get_browser_info() == MSIE) { $disposition = (!eregi(\.zip$, $file['file_name']) $action ! = zip $action != lightbox) ? 'attachment' : 'inline'; header(Content-Disposition: $disposition; filename=\.$file ['file_name'].\\n); header(Content-Type: application/x-ms-download\n); } elseif (get_browser_info() == OPERA) { header(Content-Disposition: attachment; filename=\.$file ['file_name'].\\n); header(Content-Type: application/octetstream\n); } else { header(Content-Disposition: attachment; filename=\.$file ['file_name'].\\n); header(Content-Type: application/octet-stream\n); } header(Content-Length: .$file['file_size'].\n\n); echo $file['file_data']; } exit; Un saludo, Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] popping up download dialog box
On Friday 18 July 2003 06:34, Binay Agarwal wrote: Hi every body ! I am writing a script which pops up download dialog box on click of a Link. Headers i m sending out for downloading jpegs are: header(Cache-control: private); header(Content-Type: image/jpeg); header(Content-Type: application/octet-stream); header(Content-Length: $size); header(Content-Disposition: attachment; filename=$fname); header(Content-Transfer-Encoding: binary); readfile($fname); All these work well in MSIE 5.0+ and Netscape 4.7+ . But on Mac I.E its not popping up the dialog box rather it opens up the jpg file in the browser window. I don know where am i doing wrong. Please suggest me . I cracked my mind for hours but in vain. So please help me out. Having two Content-Type: headers is probably confusing the poor Macs. You don't want the first one anyway so remove it. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* When the speaker and he to whom he is speaks do not understand, that is metaphysics. -- Voltaire */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] base64_encode corrupts files?
Hi, I trying to send a binary file (exe, zip, etc etc) that is attached using mail() function. I'm do a base64_encode and chunk_split after read the file, but the result is a corrupt file so i can't read the attached file with my mail client. When i call the script the attached file is corrupt. My server is Red Hat Linux 7.3, Apache 1.3.27-2, PHP 4.1.2 Any idea? Please Help. This is my chunk of code. ?php // create a MIME boundary string $boundary = =. . md5(uniqid(time())) . =; // add MIME data to the message headers $headers .= MIME-Version:1.0\r\n; $headers .= Content-Type: multipart/mixed;\r\n\tboundary=\$boundary\\r\n\r\n; // start building a MIME message $str =This is a multi-part message in MIME format.\n; $str .= -- . $boundary . \r\n; $str .= Content-Type: text/plain;\r\n\tcharset=\us-ascii\\r\n; $str .= Content-Transfer-Encoding: 7bit\r\n\r\n; $str .= Hi all.\r\n\r\n; //attach:w $str .= --.$boundary.\n; $file=mapa.zip; $str .=Content-Type: application/octet-stream; name=\.$file.\\n; $str .=Content-Transfer-Encoding: base64\n; $str .=Content-Disposition: attachment; filename=\.$file.\\n\n; $fd=fopen ($file, rb); $FileContent=fread($fd,filesize($file)); fclose ($fd); $FileContent=chunk_split(base64_encode($FileContent)); $str .=$FileContent; //attach ends $body=$str; //send mail mail([EMAIL PROTECTED], I am really desperated, $body, $headers); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Variable not passed twixt pages..
form action=savemail.php method=GET target=main ... ... ... $query = insert into email values (' . $_REQUEST['mailaddress'] Use $_GET or $_POST, according to the method used... $_GET['mailaddress'] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] popping up download dialog box
Hi jason Thanks for the quick suggestion. I tried removing the first content-type header but still the problem reamains. I don know why?? Please let me know is there other way i can do the same? Thanks Binay - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 18, 2003 4:00 PM Subject: Re: [PHP] popping up download dialog box On Friday 18 July 2003 06:34, Binay Agarwal wrote: Hi every body ! I am writing a script which pops up download dialog box on click of a Link. Headers i m sending out for downloading jpegs are: header(Cache-control: private); header(Content-Type: image/jpeg); header(Content-Type: application/octet-stream); header(Content-Length: $size); header(Content-Disposition: attachment; filename=$fname); header(Content-Transfer-Encoding: binary); readfile($fname); All these work well in MSIE 5.0+ and Netscape 4.7+ . But on Mac I.E its not popping up the dialog box rather it opens up the jpg file in the browser window. I don know where am i doing wrong. Please suggest me . I cracked my mind for hours but in vain. So please help me out. Having two Content-Type: headers is probably confusing the poor Macs. You don't want the first one anyway so remove it. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* When the speaker and he to whom he is speaks do not understand, that is metaphysics. -- Voltaire */ -- 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] osCommerce and modifications
Hello, I am helping a friend with an eCommerce site. We have decided to use osCommerce. The package looks really nice and is completely PHP. My question is, does anyone have much experience with modifying it? We have to make some changes but all of the code looks fairly intertwined. Just looking for others who have done this and what changes you made... Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] osCommerce and modifications
You might want to look at eShox, it's based on osCommerce, but in my opinion it's quite a lot better. Cheers! Rick The intuitive mind is a sacred gift and the rational mind is a faithful servant. We have created a society that honors the servant and has forgotten the gift. - Albert Einstein From: [EMAIL PROTECTED] (Edward Peloke) Date: Fri, 18 Jul 2003 09:20:44 -0400 To: [EMAIL PROTECTED] Php. Net [EMAIL PROTECTED] Subject: [PHP] osCommerce and modifications Hello, I am helping a friend with an eCommerce site. We have decided to use osCommerce. The package looks really nice and is completely PHP. My question is, does anyone have much experience with modifying it? We have to make some changes but all of the code looks fairly intertwined. Just looking for others who have done this and what changes you made... Thanks, Eddie -- 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] osCommerce and modifications
thanks Richard, I will take a look. osCommerce does a create job of creating an online marketplace. The problem is to add items, you need to go through the admin pages. We need to be able to allow users to add items, sort of like ebay without the auction. -Original Message- From: Richard Baskett [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 9:16 AM To: PHP General Subject: Re: [PHP] osCommerce and modifications You might want to look at eShox, it's based on osCommerce, but in my opinion it's quite a lot better. Cheers! Rick The intuitive mind is a sacred gift and the rational mind is a faithful servant. We have created a society that honors the servant and has forgotten the gift. - Albert Einstein From: [EMAIL PROTECTED] (Edward Peloke) Date: Fri, 18 Jul 2003 09:20:44 -0400 To: [EMAIL PROTECTED] Php. Net [EMAIL PROTECTED] Subject: [PHP] osCommerce and modifications Hello, I am helping a friend with an eCommerce site. We have decided to use osCommerce. The package looks really nice and is completely PHP. My question is, does anyone have much experience with modifying it? We have to make some changes but all of the code looks fairly intertwined. Just looking for others who have done this and what changes you made... Thanks, Eddie -- 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] eShox
Hi, I have just been browsing the list and I see a recomendation for eShox rather than OSCommerce, I did a search on google and found these 2 main sites: http://www.versiontracker.com/dyn/moreinfo/macos/17609 http://www.tenon.com/products/eshox/ and a lot others. Most of the sites are selling the software, is this commercial software or are these companies just swindling people? If its the latter can you tell me where to download the free version please? I would like to test it out being a fan of OSCommerce. Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multidimensional arrays
Hi Can anybody help me grasp multidimensional arrays please? Basically, I am retrieving all records from one table (two fields), and want to return them in an array. I am converting code from ASP to PHP, and in the former I did something like this: select id, name from customer redim custarray(recordcount,2) i = 0 while not eof custarray(i,0) = id; custarray(i,1) = name; i = i+1; movenext wend ... but all my efforts to store them in the same kind of way in PHP have proved fruitless. Any advice would be much appreciated. Many thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] popping up download dialog box
Binay Agarwal [EMAIL PROTECTED] wrote: Hi every body ! I am writing a script which pops up download dialog box on click of a Link. Headers i m sending out for downloading jpegs are: header(Cache-control: private); header(Content-Type: image/jpeg); header(Content-Type: application/octet-stream); header(Content-Length: $size); header(Content-Disposition: attachment; filename=$fname); header(Content-Transfer-Encoding: binary); readfile($fname); All these work well in MSIE 5.0+ and Netscape 4.7+ . But on Mac I.E its not popping up the dialog box rather it opens up the jpg file in the browser window. I don know where am i doing wrong. Please suggest me . I cracked my mind for hours but in vain. So please help me out. No matter what you do you cant guarantee that the pop-up box, it all depends on how the client's browswer software wants to do with that paticular mime-type. have you tried sending out something like just to see something unknown forces it to open: header(Content-Type: application/makeupyourown); Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: new browser window in php
How do I start a new browser window when using print in php? Jeffry Lester [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] eShox
I downloaded osCommerce yesterday from sourceforge...very easy to set up and looked really nice. -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 9:46 AM To: [EMAIL PROTECTED] Subject: [PHP] eShox Hi, I have just been browsing the list and I see a recomendation for eShox rather than OSCommerce, I did a search on google and found these 2 main sites: http://www.versiontracker.com/dyn/moreinfo/macos/17609 http://www.tenon.com/products/eshox/ and a lot others. Most of the sites are selling the software, is this commercial software or are these companies just swindling people? If its the latter can you tell me where to download the free version please? I would like to test it out being a fan of OSCommerce. Thanks, -Ryan -- 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] eShox
Mostly eShox you are paying for support. It's a great program and the support is unmatchable.. whenever I had questions support would email me back sometimes instantaneously, and other times.. within a couple of hours. I can get you $50 off if you would like since I work with them quite a bit for some of my clients, they give me a deal now :) Anyways I think it's a great product with a great administration area. You can most definitely download a free version I believe you can contact ben.harper [EMAIL PROTECTED] and talk to him. Cheers! Rick Every person you meet - and everything you do in life - is an opportunity to learn something. - Tom Clancy From: Ryan A [EMAIL PROTECTED] Date: Fri, 18 Jul 2003 15:45:47 +0200 To: [EMAIL PROTECTED] Subject: [PHP] eShox Hi, I have just been browsing the list and I see a recomendation for eShox rather than OSCommerce, I did a search on google and found these 2 main sites: http://www.versiontracker.com/dyn/moreinfo/macos/17609 http://www.tenon.com/products/eshox/ and a lot others. Most of the sites are selling the software, is this commercial software or are these companies just swindling people? If its the latter can you tell me where to download the free version please? I would like to test it out being a fan of OSCommerce. Thanks, -Ryan -- 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] Multidimensional arrays
snip select id, name from customer redim custarray(recordcount,2) i = 0 while not eof custarray(i,0) = id; custarray(i,1) = name; i = i+1; movenext wend /snip Not sure what kind of db you are using but I put this together using postgresql using the manual. So this is untested. $conn = pg_connect(host=localhost dbname=whatever); $result = pg_exec($conn, select id, name from customer); $i = 0; while ($row = pg_fetch_array($result)) { $custarray[$i][0] = $row[id]; $custarray[$i][1] = $row[name]; $i++; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Performance and require / include
Hello List, i have a question about the require / include functions and performance. I try to divide my application into several files (e.g. templates and common config files) and they are included with the require statement. But is this really good for the performance? With only one user on the webserver it doesn´t look like a problem. But what about 10 or 100 at the same time? Or even more? I made a test, i included 9 files (in different directories) with variable definitions and functions and it took 0.087 seconds. then i wrote all the content from these 9 files to only one file and it took 0.0005 seconds to execute. Could this be a bottle neck, when more users access the application? What do you think? Are there other ideas to scale/devide my application? Greetings from germany Thorsten Koch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] eShox
thanks Richard, I will let the guy know who I am doing this for...I really appreciated it. -Original Message- From: Richard Baskett [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 9:45 AM To: PHP General Subject: Re: [PHP] eShox Mostly eShox you are paying for support. It's a great program and the support is unmatchable.. whenever I had questions support would email me back sometimes instantaneously, and other times.. within a couple of hours. I can get you $50 off if you would like since I work with them quite a bit for some of my clients, they give me a deal now :) Anyways I think it's a great product with a great administration area. You can most definitely download a free version I believe you can contact ben.harper [EMAIL PROTECTED] and talk to him. Cheers! Rick Every person you meet - and everything you do in life - is an opportunity to learn something. - Tom Clancy From: Ryan A [EMAIL PROTECTED] Date: Fri, 18 Jul 2003 15:45:47 +0200 To: [EMAIL PROTECTED] Subject: [PHP] eShox Hi, I have just been browsing the list and I see a recomendation for eShox rather than OSCommerce, I did a search on google and found these 2 main sites: http://www.versiontracker.com/dyn/moreinfo/macos/17609 http://www.tenon.com/products/eshox/ and a lot others. Most of the sites are selling the software, is this commercial software or are these companies just swindling people? If its the latter can you tell me where to download the free version please? I would like to test it out being a fan of OSCommerce. Thanks, -Ryan -- 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
Re: [PHP] Variable not passed twixt pages..
Thanks to all who contributed, I managed to get it to work using just $mailaddress. Much appreciated. -- Chris Blake Office : (011) 782-0840 Cell : 083 985 0379 One learns to itch where one can scratch. -- Ernest Bramah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] osCommerce and modifications
On Friday 18 July 2003 21:20, Edward Peloke wrote: I am helping a friend with an eCommerce site. We have decided to use osCommerce. The package looks really nice and is completely PHP. My question is, does anyone have much experience with modifying it? We have to make some changes but all of the code looks fairly intertwined. Just looking for others who have done this and what changes you made... Modifications are pretty straightforward if you're fairly experienced with PHP. However the major drawback is that any modifications you make may need to be redone each time you change versions (upgrade). And because there is no plugin architecture most of the contributions (~plugins~) requires direct modification of the OSC files and thus are mostly attached to a specific version making upgrades very tedious. My conclusion is that if the base system does more than 95% of what you need then it should be a good choice. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I'm not a real movie star -- I've still got the same wife I started out with twenty-eight years ago. -- Will Rogers */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Recovering from a time out
change PHP's timeout value in php.ini : max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data don't know if you can have php do something like load a different script or a basic HTML page on timeout. That would be pretty cool though, anyone know? - Anthony Gerard Samuel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is it possible to *gracefully* recover from php timing out? For example, uploading a large file, and php times out, so display Oops Timed out This also assumes that we have no means of changing php's time out value?? Thanks for your comments.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem matching multiple times
Vince LaMonica [EMAIL PROTECTED] wrote: On Fri, 18 Jul 2003, Curt Zirzow wrote: [snip] } } The only solution I can think of is while your looping through the } images they have build more pattern/replacemen array items } } foreach (row in db) }$pattern[] = /###Image($count+1)### }$$replacements[] = htmlstuff$image_name/htmlstuff; Do you mean: $patterns[3] = /###Image($count+1)###/; $replacements[3] = html stuff; Actually I did mean to use the $patterns[] and $replacements[], php will automatically increase the index for you kinda makes adding different pattern/replacement arrays easier in any order. The array will by default be FIFO. The problem with this is that I don't know how many rows are going to come back, since the first/only SQL statement just returns one row [whatever the current image placeholder is...in this case, ###Image1###. So I need to loop before I run the SQL statements. snip $sel_image = SELECT * from ppd_photos where ppd_id = '$_GET[ppdid]' AND place_holder = '$thephoto[0]'; /snip What does this return? I'm a bit confused right now.. Also, using $patterns[3] again overwrites the first call to it [the one you recommended i re-write for readablity]. I need to make sure the $replacements[3] contains all of the html stuff, so it needs a pattern for the preg_replace call later in the function: by using the patters[] and replacements[] it will avoid the overwriting. $message = preg_replace($patterns, $replacements, $message); Thanks for your help with this! /vjl/ oh, i'm feeling helpful today.. another suggestion for performance: after the user enters in his stuff, he wants, in your CMS and before you save it, parse it for all the special tags you have and keep track of it somewhere. That way when you output it (in this script) you only need to apply the necessary pattern/replacements before outputing it to the browser. Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Recovering from a time out
Anthony [EMAIL PROTECTED] wrote: change PHP's timeout value in php.ini : max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data don't know if you can have php do something like load a different script or a basic HTML page on timeout. That would be pretty cool though, anyone know? I think this is what you want. http://php.net/set_error_handler curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Still problem with files
For whatever reason your suggestions still caused me problems, but I did come up with a solution that works. if (preg_match (/Alfredsson/, $buffer)) Another question though regarding \n. What I'm doing here is reading the file, omitting one entry, adding another, and saving it back to the file. When I add the entry and save it back to the file it appears beside the last entry instead of below it. How do I get it so it is below it. I have tried using a \n but no go. I am probably missing something, but not sure what. This is the first time I've played with files in PHP. i.e. Option Value=155Roy, P Option Value=77Theodore Option Value=26ThibaultOption Value=68Worrel -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: July 18, 2003 1:50 AM To: PHP Subject: Re: [PHP] Still problem with files Curt Zirzow [EMAIL PROTECTED] wrote: Beauford.2005 [EMAIL PROTECTED] wrote: i.e $p = Option Value=\131\Alfredsson; And watch out for case sensitive issues 'Option' != 'option' Curt -- -- 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] Mail From option in PHP.ini
Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Thanks! Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail From option in PHP.ini
Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: A new FREE web server can do PHP faster than Apache's mod_php
Hi there! Do you feel the need for speed? Lite Speed Technologies proudly introduces you LiteSpeed Web Server 1.0 LiteSpeed Web Server is a full featured, high performance, secure, and easy-to-use Web server that runs on Unix and Linux. It supports HTTP/1.1, SSL, CGI, FastCGI, PHP, JSP, Servlets, GZIP compression, IP level throttling, connection accounting, DoS attack prevention, and instant recovery mechanisms. Installation is very easy with pre-built binary. Administration and configuration is very easy through a Web interface (written in PHP). Our benchmark shows that LiteSpeed web server can serve static content up-to 5 times faster than Apache And our PHP implementation through Fast CGI interface outperforms Apache's mod_php up-to 50%! We are dedicated to bring the best web server products with combination of speed, security and easiness for you need, any comments, suggestions or criticisms are welcome. The Standard Edition is free for commercial use, and we doubt you can get any web server this good without shelling out thousands of dollars. For more information please visit our web site: http://www.litespeedtech.com Did any one try our product? We'd like to hear from you. :-) BTW: PHP Accelerator should work just fine. Thank you, LiteSpeed Team http://www.litespeedtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail From option in PHP.ini
the sendmail_path in php.ini is to do with where abouts the sendmail program is located, not where your sending mail from... if you define the extra headers in the mail, such as FROM and REPLY-TO, you shouldn't have any problems. basically, it's just like fake-mail, and your recipient should be none-the-wiser unless he really wants to sift through the headers. - Original Message - From: Brian S. Drexler [EMAIL PROTECTED] To: 'CPT John W. Holmes' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 18, 2003 4:10 PM Subject: RE: [PHP] Mail From option in PHP.ini I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- 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] Still problem with files
have you tried \r\n ? - Original Message - From: Beauford.2005 [EMAIL PROTECTED] To: 'Curt Zirzow' [EMAIL PROTECTED]; 'PHP' [EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:40 PM Subject: RE: [PHP] Still problem with files For whatever reason your suggestions still caused me problems, but I did come up with a solution that works. if (preg_match (/Alfredsson/, $buffer)) Another question though regarding \n. What I'm doing here is reading the file, omitting one entry, adding another, and saving it back to the file. When I add the entry and save it back to the file it appears beside the last entry instead of below it. How do I get it so it is below it. I have tried using a \n but no go. I am probably missing something, but not sure what. This is the first time I've played with files in PHP. i.e. Option Value=155Roy, P Option Value=77Theodore Option Value=26ThibaultOption Value=68Worrel -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: July 18, 2003 1:50 AM To: PHP Subject: Re: [PHP] Still problem with files Curt Zirzow [EMAIL PROTECTED] wrote: Beauford.2005 [EMAIL PROTECTED] wrote: i.e $p = Option Value=\131\Alfredsson; And watch out for case sensitive issues 'Option' != 'option' Curt -- -- 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
Re: [PHP] Mail From option in PHP.ini
... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
It's not the recipient that is the problem. The extra headers work fine for that. It's the delivery and read notifications (recipient's mail server). The From header that is generated by sendmail itself is where I'm getting the problem. If I specify the -f option in the sendmail_path it fixes the problem. Just specifying a From header works for the recipients e-mail client, but it doesn't work for their server...I also tried Content-Disposition-To, Return-Path and a few others. All unsuccessfully -Original Message- From: skate [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:16 AM To: [EMAIL PROTECTED]; 'CPT John W. Holmes'; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini the sendmail_path in php.ini is to do with where abouts the sendmail program is located, not where your sending mail from... if you define the extra headers in the mail, such as FROM and REPLY-TO, you shouldn't have any problems. basically, it's just like fake-mail, and your recipient should be none-the-wiser unless he really wants to sift through the headers. - Original Message - From: Brian S. Drexler [EMAIL PROTECTED] To: 'CPT John W. Holmes' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 18, 2003 4:10 PM Subject: RE: [PHP] Mail From option in PHP.ini I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- 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
RE: [PHP] Mail From option in PHP.ini
No, I tried this too. Here is what I've tried $hdrs = array( 'From'= ''.$FullName.' '.$Email.'', 'Return-Path' = $Email, //'From'= $Email, //'Disposition-Notification-To' = ''.$FullName.' '.$Email.'', 'Disposition-Notification-To' = $Email, 'Return-Receipt-To' = '' .$FullName.' '.$Email.'', //'Return-Path' = $Email, 'Subject' = 'Your Quote # '.$Theresult ); The commented out ones were also tried -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini ... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- 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] Re: Mail From option in PHP.ini
On Fri, Jul 18, 2003 at 11:00:18AM -0400, Brian S. Drexler wrote: Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. You can't change the Return-Path header, because it's not set by the sender. It's added by the *receiving* mail server, and reflects the from address in the SMTP envelope, rather than anything in the headers of the message itself. It sounds heinous, but one solution might be to make your sendmail_path a *wrapper* that will look at certain environment variables and come up with a -f option with which to launch sendmail. I don't recommend this solution. Another possibility might be to run PHP inside FastCGI and use suexec. If the PHP script is being executed this way, I would think that any sendmail processe launched would have the username in the envelope-from. You also might get a performance gain by doing things through FastCGI, though you'd lose some of the module-specific features like persistent database connections. Worth testing, anyway. Let us know how it goes. :) -- Paul Chvostek [EMAIL PROTECTED] it.canadahttp://www.it.ca/ Free PHP web hosting!http://www.it.ca/web/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] running SSH through a PHP script
I am using SSH inside one of my PHP pages to run some commands on a remote server and return the output web page. In detail, I'm using SSHing 3 different times and it is taking a long time for the resulting page to load with the output from the remote command. When running top on my webserver, I see the ssh process come up, do its thing, and quit. The weird thing is that there is a 15-20 second wait in between the SSH sessions. My code is not doing anything that should cause it to take this long--it's just running these SSH commands back to back. I've tried using system(), passthru(), and backticks, and all yield the same result. If I try to run something other than SSH, there is no delay. I don't know why PHP is taking so long between the processes if clearly the process has finished. I'm running Red Hat Advanced Server 2.1, php-4.1.2, and Apache 1.3.27. There is no delay in the SSH commands when run from a shell, only through the web page. Any ideas? Thanks, James James S. Martin, RHCE Contractor Administrative Office of the United States Courts Washington, DC (202) 502-2394 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
I take it you've also tried setting Reply-To: ?? Same format as From: Mark -Original Message- From: Brian S. Drexler [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 16:25 To: 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini No, I tried this too. Here is what I've tried $hdrs = array( 'From'= ''.$FullName.' '.$Email.'', 'Return-Path' = $Email, //'From'= $Email, //'Disposition-Notification-To' = ''.$FullName.' '.$Email.'', 'Disposition-Notification-To' = $Email, 'Return-Receipt-To' = '' .$FullName.' '.$Email.'', //'Return-Path' = $Email, 'Subject' = 'Your Quote # '.$Theresult ); The commented out ones were also tried -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini ... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- 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
RE: [PHP] Mail From option in PHP.ini
Yes, sorry...forgot to include that one...:-) -Original Message- From: M.A.Bond [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:31 AM To: 'sysadmin'; 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini I take it you've also tried setting Reply-To: ?? Same format as From: Mark -Original Message- From: Brian S. Drexler [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 16:25 To: 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini No, I tried this too. Here is what I've tried $hdrs = array( 'From'= ''.$FullName.' '.$Email.'', 'Return-Path' = $Email, //'From'= $Email, //'Disposition-Notification-To' = ''.$FullName.' '.$Email.'', 'Disposition-Notification-To' = $Email, 'Return-Receipt-To' = '' .$FullName.' '.$Email.'', //'Return-Path' = $Email, 'Subject' = 'Your Quote # '.$Theresult ); The commented out ones were also tried -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini ... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- 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
Re: [PHP] Netscape 6, What a piece of s$#@ ,anyone else had problems
I received this email, with the PHP subject, at an address I haven't used in a long time on the PHP list. It contained a attached file called: Marzia_MaterialeDaInternet.lnk.exe A fairly large BASE 64 encoded attachment. I DID not open it. This is a warning to others. Lucas Persona wrote: Jason, I've Replyed also to the lsit, because someone could help us on this... Jason Lotito wrote: Lucas Persona wrote: I was used to think on that way... Some time ago I have problems with Netscape 6 and PHP. It was not a -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
From the php website, it appears that the [EMAIL PROTECTED] can be put in the fifth parameter of the mail() function: Example 3. Sending mail with extra headers and setting an additional command line parameter. mail([EMAIL PROTECTED], the subject, $message, From: [EMAIL PROTECTED], [EMAIL PROTECTED]); Note: This fifth parameter was added in PHP 4.0.5. Since PHP 4.2.3 this parameter is disabled in safe_mode and the mail() function will expose a warning message and return FALSE if you're trying to use it. --- Brian S. Drexler [EMAIL PROTECTED] wrote: Yes, sorry...forgot to include that one...:-) -Original Message- From: M.A.Bond [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:31 AM To: 'sysadmin'; 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini I take it you've also tried setting Reply-To: ?? Same format as From: Mark -Original Message- From: Brian S. Drexler [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 16:25 To: 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini No, I tried this too. Here is what I've tried $hdrs = array( 'From'= ''.$FullName.' '.$Email.'', 'Return-Path' = $Email, //'From'= $Email, //'Disposition-Notification-To' = ''.$FullName.' '.$Email.'', 'Disposition-Notification-To' = $Email, 'Return-Receipt-To' = '' .$FullName.' '.$Email.'', //'Return-Path' = $Email, 'Subject' = 'Your Quote # '.$Theresult ); The commented out ones were also tried -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini ... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- 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 = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: running SSH through a PHP script
On Fri, Jul 18, 2003 at 11:29:50AM -0400, [EMAIL PROTECTED] wrote: There is no delay in the SSH commands when run from a shell, only through the web page. Any ideas? What user is running the ssh commands? Does that user have a home directory to which it has write permissions in order to create a ~/.ssh/ directory in which to store host keys? The ssh key negotiation will always take a certain amount of time. If all three ssh commands are to the same remote host, you should consider stringing them together on a single command line, so that you only have to run ssh once. $result = `/usr/bin/ssh [EMAIL PROTECTED] cd /some/path/ ./do_something ./do_something_else` Note: this is one of those cases where you should be ULTRA careful about user input. If your ssh command includes any variables that have been posted in a form, do extensive format checks on them. Usernames should always match ^[a-z0-9]+$ . Nothing being used in the ssh command should be allowed to have [;|] in it. Be so anal and paranoid that you risk compromising functionality, and you're less likely to screw yourself. -- Paul Chvostek [EMAIL PROTECTED] it.canadahttp://www.it.ca/ Free PHP web hosting!http://www.it.ca/web/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
GREAT!!! I guess I need to RTFM...:-) Thanks again for all your help everyone! -Original Message- From: Mark [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:38 AM To: [EMAIL PROTECTED]; 'M.A.Bond'; 'sven'; 'php-general' Subject: RE: [PHP] Mail From option in PHP.ini From the php website, it appears that the [EMAIL PROTECTED] can be put in the fifth parameter of the mail() function: Example 3. Sending mail with extra headers and setting an additional command line parameter. mail([EMAIL PROTECTED], the subject, $message, From: [EMAIL PROTECTED], [EMAIL PROTECTED]); Note: This fifth parameter was added in PHP 4.0.5. Since PHP 4.2.3 this parameter is disabled in safe_mode and the mail() function will expose a warning message and return FALSE if you're trying to use it. --- Brian S. Drexler [EMAIL PROTECTED] wrote: Yes, sorry...forgot to include that one...:-) -Original Message- From: M.A.Bond [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:31 AM To: 'sysadmin'; 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini I take it you've also tried setting Reply-To: ?? Same format as From: Mark -Original Message- From: Brian S. Drexler [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 16:25 To: 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini No, I tried this too. Here is what I've tried $hdrs = array( 'From'= ''.$FullName.' '.$Email.'', 'Return-Path' = $Email, //'From'= $Email, //'Disposition-Notification-To' = ''.$FullName.' '.$Email.'', 'Disposition-Notification-To' = $Email, 'Return-Receipt-To' = '' .$FullName.' '.$Email.'', //'Return-Path' = $Email, 'Subject' = 'Your Quote # '.$Theresult ); The commented out ones were also tried -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini ... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- 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 = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirecting to a url..
--- Louie Miranda [EMAIL PROTECTED] wrote: echo meta http-equiv=\REFRESH\ CONTENT=\0; URL=us/index.php\; Or you may have other more advance alternatives? You can use a protocol redirect rather than relying on HTML: header('Location: http://yoursite.org/us/index.php'); Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] locking to domain
Hi, I want to make sure my scripts can be executed on only one domain (or localhost/ 127.0.0.1)...it should not matter if its http://somesite.com/myscript.php or http://somesite.com/~blah/myscript.php or http://blah.somesite.commyscript.php or http://somesite.com/1/2/asdf/234/myscript.php It should only work on somsite.com Any ideas on how i can do this? I've seen this done on some old perl scripts but how in php? Kindly help. Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multidimensional arrays
Hi Many thanks for your time Matt. I tried that method amongst a few others, and couldn't seem to get it right. What I have eventually come across is the function 'array-push' (bizarre!) to add a new array line for each record (after it's been initially defined). It seems to work for me, and hopefully it is the correct, standard way to do such a task. $strCusts = array(array('id','name')); /* setting up empty array for cust id and name */ if (mysql_num_rows($resCusts) 0) { $intCusts = mysql_num_rows($resCusts); /* store the number of records retrieved */ while ($oRsCusts = mysql_fetch_array($resCusts)) { array_push($strCusts,array($oRsCusts[id],$oRsCusts[name])); /* add new array row */ } } Many thanks once again. Gary Matt Matijevich [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... snip select id, name from customer redim custarray(recordcount,2) i = 0 while not eof custarray(i,0) = id; custarray(i,1) = name; i = i+1; movenext wend /snip Not sure what kind of db you are using but I put this together using postgresql using the manual. So this is untested. $conn = pg_connect(host=localhost dbname=whatever); $result = pg_exec($conn, select id, name from customer); $i = 0; while ($row = pg_fetch_array($result)) { $custarray[$i][0] = $row[id]; $custarray[$i][1] = $row[name]; $i++; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: A new FREE web server can do PHP faster than Apache'smod_php
You should leave an identification tag in your url. This way when people click the link you supplied, you can track where they are coming from LiteSpeed wrote: Hi there! Do you feel the need for speed? Lite Speed Technologies proudly introduces you LiteSpeed Web Server 1.0 LiteSpeed Web Server is a full featured, high performance, secure, and easy-to-use Web server that runs on Unix and Linux. It supports HTTP/1.1, SSL, CGI, FastCGI, PHP, JSP, Servlets, GZIP compression, IP level throttling, connection accounting, DoS attack prevention, and instant recovery mechanisms. Installation is very easy with pre-built binary. Administration and configuration is very easy through a Web interface (written in PHP). Our benchmark shows that LiteSpeed web server can serve static content up-to 5 times faster than Apache And our PHP implementation through Fast CGI interface outperforms Apache's mod_php up-to 50%! We are dedicated to bring the best web server products with combination of speed, security and easiness for you need, any comments, suggestions or criticisms are welcome. The Standard Edition is free for commercial use, and we doubt you can get any web server this good without shelling out thousands of dollars. For more information please visit our web site: http://www.litespeedtech.com Did any one try our product? We'd like to hear from you. :-) BTW: PHP Accelerator should work just fine. Thank you, LiteSpeed Team http://www.litespeedtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] omitting the #!
First of all, I apologize if I'm asking a question with an obvious answer. I do my php development on a Windows 2000 machine. Whenever I move php apps to the production server I have to add the path to php (#!/usr/bin/php) to the top of every php file. Is there some way I can configure the Apache or PHP so that I don't need to do this anymore? The server is Red Hat Linux 9.0 with Apache 2.0.40 and PHP 4.2.2. Thanks. -Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] omitting the #!
yeah, your currently running php through cgi on your live server, just install php as a proper module, and you should be good to go. you may also be able to stick a header on every page that includes the #!. not 100% with this tho, you'll have to have a look into it... - Original Message - From: Rob Day [EMAIL PROTECTED] To: 'PHP Users' [EMAIL PROTECTED] Sent: Friday, July 18, 2003 4:49 PM Subject: [PHP] omitting the #! First of all, I apologize if I'm asking a question with an obvious answer. I do my php development on a Windows 2000 machine. Whenever I move php apps to the production server I have to add the path to php (#!/usr/bin/php) to the top of every php file. Is there some way I can configure the Apache or PHP so that I don't need to do this anymore? The server is Red Hat Linux 9.0 with Apache 2.0.40 and PHP 4.2.2. Thanks. -Rob -- 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] omitting the #!
Rob Day wrote: First of all, I apologize if I'm asking a question with an obvious answer. I do my php development on a Windows 2000 machine. Whenever I move php apps to the production server I have to add the path to php (#!/usr/bin/php) to the top of every php file. Is there some way I can configure the Apache or PHP so that I don't need to do this anymore? The server is Red Hat Linux 9.0 with Apache 2.0.40 and PHP 4.2.2. Thanks. -Rob I take it you haven't configured Apache on your *nix box to parse php? In your httpd.conf. LoadModule php4_module modules/libphp4.so AddType application/x-httpd-php .php Then restart your server (of course, I'm assuming that you compiled php for Apache2) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: running SSH through a PHP script
it's running as the apache user.. I negated the need for a ~/.ssh/ directory by specifying the path to a private key and by putting entries for the hosts in /etc/ssh/ssh_authorized_keys. It stopped complaining after I did that. Chaining commands together doesn't work for me because I'm going to different hosts, unfortunately. Also, the key exchange isn't taken a long time at all, I watch the process in TOP appear, do it's thing, and dissappear. It's something with PHP waiting extraordinary amounts of time between the SSH process. Why would it be waiting if it is clear the process has been executed? Thanks for the tip on the user input, I'll definately do that once this get's into production. James James S. Martin, RHCE Contractor Administrative Office of the United States Courts Washington, DC (202) 502-2394 Paul Chvostek [EMAIL PROTECTED] 07/18/2003 11:45 AM Please respond to php-general To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject:[PHP] Re: running SSH through a PHP script On Fri, Jul 18, 2003 at 11:29:50AM -0400, [EMAIL PROTECTED] wrote: There is no delay in the SSH commands when run from a shell, only through the web page. Any ideas? What user is running the ssh commands? Does that user have a home directory to which it has write permissions in order to create a ~/.ssh/ directory in which to store host keys? The ssh key negotiation will always take a certain amount of time. If all three ssh commands are to the same remote host, you should consider stringing them together on a single command line, so that you only have to run ssh once. $result = `/usr/bin/ssh [EMAIL PROTECTED] cd /some/path/ ./do_something ./do_something_else` Note: this is one of those cases where you should be ULTRA careful about user input. If your ssh command includes any variables that have been posted in a form, do extensive format checks on them. Usernames should always match ^[a-z0-9]+$ . Nothing being used in the ssh command should be allowed to have [;|] in it. Be so anal and paranoid that you risk compromising functionality, and you're less likely to screw yourself. -- Paul Chvostek [EMAIL PROTECTED] it.canadahttp://www.it.ca/ Free PHP web hosting!http://www.it.ca/web/ -- 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] Mac Address Lookup
I am trying to do a lookup of a Mac Address via PHP. Is there any way to do so like gethostbyaddr that gets me the name of a machine? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: A new FREE web server can do PHP faster than Apache'smod_php
Thanks John, that's a good idea. Please visit our website at http://www.litespeedtech.com/index.html?php-general Thanks, LiteSpeed John Manko wrote: You should leave an identification tag in your url. This way when people click the link you supplied, you can track where they are coming from LiteSpeed wrote: Hi there! Do you feel the need for speed? Lite Speed Technologies proudly introduces you LiteSpeed Web Server 1.0 LiteSpeed Web Server is a full featured, high performance, secure, and easy-to-use Web server that runs on Unix and Linux. It supports HTTP/1.1, SSL, CGI, FastCGI, PHP, JSP, Servlets, GZIP compression, IP level throttling, connection accounting, DoS attack prevention, and instant recovery mechanisms. Installation is very easy with pre-built binary. Administration and configuration is very easy through a Web interface (written in PHP). Our benchmark shows that LiteSpeed web server can serve static content up-to 5 times faster than Apache And our PHP implementation through Fast CGI interface outperforms Apache's mod_php up-to 50%! We are dedicated to bring the best web server products with combination of speed, security and easiness for you need, any comments, suggestions or criticisms are welcome. The Standard Edition is free for commercial use, and we doubt you can get any web server this good without shelling out thousands of dollars. For more information please visit our web site: http://www.litespeedtech.com Did any one try our product? We'd like to hear from you. :-) BTW: PHP Accelerator should work just fine. Thank you, LiteSpeed Team http://www.litespeedtech.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] headers already sent and cookie problem
-Original Message- From: frederik feys To: 'Ford, Mike [LSS]'; [EMAIL PROTECTED] Here's the URL: http://www.aurelis.org/store/cart.txt and the get_cartID: http://www.aurelis.org/store/includes/functions/get_cartID.txt -- I've only had time for a quick look, but I think I have an inkling of where your problem might be. It all seems to lie with the way you've implemented GetCartId() -- and the problem will only show up any time the cartId cookie is not already set. Basically, if the cookie is not set, GetCartId() generates a new ID and sets the cookie -- but this requires sending a header, and you can't do this once you've started output of the real page. So you must make you first call to GetCartId() *before* you send any output. Now, if we look at this fragment of code from /store/cart.txt: function ShowCart($lang) { global $connection,$lang_dir,$DOCUMENT_ROOT,$page_theme,$country_iso_code,$srch_ter m; /* ob_start(); //start buffering output */ $page_title=get_label(194,$lang,$connection); $page_tab=3; include_once($DOCUMENT_ROOT . /header_aurelis.php); $country_iso_code = $_GET[country_iso_code]; if($lang==EN){ $currency_symbol = $ ; } else{ $currency_symbol = euro; ; } $totalCost = 0; $show_cart = @mysql_query((select * from cart inner join items on cart.itemId = items.itemId where cart.cookieId = ' . GetCartId() . ' order by items.itemName asc),$connection); ... we can see that you include header_aurelis.php, which presumably outputs the initial part of your HTML, before you do $show_cart = @mysql_query ... ; which includes a call to GetCartId() -- which will attempt to set the cartId cookie if it's not already set, and will fail with the headers already sent error. So, overall, I'd say you've got to get/set your cartId earlier in the game -- and certainly before you call or include anything that outputs actual page content. This analysis also explains why the error is intermittent -- someone who has set the cartId cookie once will probably not see the error again until after the cookie expires 30 days later! Hope this helps (and you followed my somewhat rambling explanation!) Cheers! Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: A new FREE web server can do PHP faster than Apache'smod_php
Thanks Mark, that's good idea. Please visit our website at http://www.litespeedtech.com/index.html?php-general Thanks, LiteSpeed Mark wrote: Yes I am. Apache 2 is not considered safe with PHP, and Apache 1.3x is missing some features I'd like... And IIS... well don't get me started with IIS. I guess I'll have to accelerate my linux/FreeBSD cwitchover plans. --- LiteSpeed Information [EMAIL PROTECTED] wrote: - Are you talking about Windows? We have plan to support more Unix likesystems but no Windows. Thank you for your feedback, LiteSpeed Team Mark wrote: I'd have been happy to. You don't support my OS.--- LiteSpeed [EMAIL PROTECTED] wrote: Hi there!Do you feel the need for speed?Lite Speed Technologies proudly introduces you LiteSpeed Web Server 1.0 LiteSpeed Web Server is a full featured, high performance, secure, and easy-to-use Web server that runs on Unix and Linux. It supports HTTP/1.1, SSL, CGI, FastCGI, PHP, JSP, Servlets, GZIP compression, IP level throttling, connection accounting, DoS attack prevention, and instant recovery mechanisms. Installation is very easy with pre-built binary. Administration and configuration is very easy through a Web interface (written in PHP).Our benchmark shows that LiteSpeed web server can serve static content up-to 5 times faster than Apache And our PHP implementation through Fast CGI interface outperforms Apache's mod_php up-to 50%!We are dedicated to bring the best web server products with combination of speed, security and easiness for you need, any comments, suggestions or criticisms are welcome.The Standard Edition is free for commercial use, and we doubt you can get any web server this good without shelling out thousands of dollars. For more information please visit our web site: http://www.litespeedtech.com/index.html?php-general Did any one try our product? We'd like to hear from you. :-)BTW: PHP Accelerator should work just fine.Thank you,LiteSpeed Teamhttp://www.litespeedtech.com-- PHP General Mailing List (http://www.php.net/)To unsubscribe, visit: http://www.php.net/unsub.php =Mark [EMAIL PROTECTED] can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing.***__Do you Yahoo!?SBC Yahoo! DSL - Now only $29.95 per month!http://sbc.yahoo.com = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: A new FREE web server can do PHP faster than Apache'smod_php
Mark, When you say Apache 1.3x is missing some features, do you mean on Windows or on all systems? I wonder what it is? Thanks, LiteSpeed Mark wrote: Yes I am. Apache 2 is not considered safe with PHP, and Apache 1.3x is missing some features I'd like... And IIS... well don't get me started with IIS. I guess I'll have to accelerate my linux/FreeBSD cwitchover plans. --- LiteSpeed Information [EMAIL PROTECTED] wrote: - Are you talking about Windows? We have plan to support more Unix likesystems but no Windows. Thank you for your feedback, LiteSpeed Team Mark wrote: I'd have been happy to. You don't support my OS.--- LiteSpeed [EMAIL PROTECTED] wrote: Hi there!Do you feel the need for speed?Lite Speed Technologies proudly introduces you LiteSpeed Web Server 1.0 LiteSpeed Web Server is a full featured, high performance, secure, and easy-to-use Web server that runs on Unix and Linux. It supports HTTP/1.1, SSL, CGI, FastCGI, PHP, JSP, Servlets, GZIP compression, IP level throttling, connection accounting, DoS attack prevention, and instant recovery mechanisms. Installation is very easy with pre-built binary. Administration and configuration is very easy through a Web interface (written in PHP).Our benchmark shows that LiteSpeed web server can serve static content up-to 5 times faster than Apache And our PHP implementation through Fast CGI interface outperforms Apache's mod_php up-to 50%!We are dedicated to bring the best web server products with combination of speed, security and easiness for you need, any comments, suggestions or criticisms are welcome.The Standard Edition is free for commercial use, and we doubt you can get any web server this good without shelling out thousands of dollars. For more information please visit our web site: http://www.litespeedtech.com/index.html?php-general Did any one try our product? We'd like to hear from you. :-)BTW: PHP Accelerator should work just fine.Thank you,LiteSpeed Teamhttp://www.litespeedtech.com-- PHP General Mailing List (http://www.php.net/)To unsubscribe, visit: http://www.php.net/unsub.php =Mark [EMAIL PROTECTED] can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing.***__Do you Yahoo!?SBC Yahoo! DSL - Now only $29.95 per month!http://sbc.yahoo.com = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mac Address Lookup
very little chance, a machine won't transmit it's MAC address, that the main point of the TCP/IP stack is to convert IP address' into MAC address' at routers and such. - Original Message - From: Ashwin Kutty [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 18, 2003 5:19 PM Subject: [PHP] Mac Address Lookup I am trying to do a lookup of a Mac Address via PHP. Is there any way to do so like gethostbyaddr that gets me the name of a machine? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: A new FREE web server can do PHP faster than Apache's
LiteSpeed Information wrote: Mark, When you say Apache 1.3x is missing some features, do you mean on Windows or on all systems? I wonder what it is? And be sure to CC [EMAIL PROTECTED] :) -- === Jim Jagielski [|] [EMAIL PROTECTED] [|] http://www.jaguNET.com/ A society that will trade a little liberty for a little order will lose both and deserve neither - T.Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mac Address Lookup
If you have the IP address, then 'nslookup' or I guess now 'dig' and 'host' would be the newere versions. They are Linux system calls, use system() or exec() to use them within your script, and play around with the options and/or read the man pages for how to use them. HTH -Brad - Original Message - From: skate [EMAIL PROTECTED] Date: Friday, July 18, 2003 12:28 pm Subject: Re: [PHP] Mac Address Lookup very little chance, a machine won't transmit it's MAC address, that the main point of the TCP/IP stack is to convert IP address' into MAC address' at routers and such. - Original Message - From: Ashwin Kutty [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 18, 2003 5:19 PM Subject: [PHP] Mac Address Lookup I am trying to do a lookup of a Mac Address via PHP. Is there any way to do so like gethostbyaddr that gets me the name of a machine? Thanks. -- 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
Re: [PHP] Mac Address Lookup
I guess I should have put this in one post Your subject says something different then your question, one asking for the computer name, the other the MAC. To get the MAC the computer will need to be on your LAN, otherwise this is not possible. You can then use the 'arp' command to get the MAC address. HTH -Brad - Original Message - From: skate [EMAIL PROTECTED] Date: Friday, July 18, 2003 12:28 pm Subject: Re: [PHP] Mac Address Lookup very little chance, a machine won't transmit it's MAC address, that the main point of the TCP/IP stack is to convert IP address' into MAC address' at routers and such. - Original Message - From: Ashwin Kutty [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 18, 2003 5:19 PM Subject: [PHP] Mac Address Lookup I am trying to do a lookup of a Mac Address via PHP. Is there any way to do so like gethostbyaddr that gets me the name of a machine? Thanks. -- 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
Re: [PHP] locking to domain
On Saturday 19 July 2003 00:00, Ryan A wrote: I want to make sure my scripts can be executed on only one domain (or localhost/ 127.0.0.1)...it should not matter if its http://somesite.com/myscript.php or http://somesite.com/~blah/myscript.php or http://blah.somesite.commyscript.php or http://somesite.com/1/2/asdf/234/myscript.php It should only work on somsite.com Any ideas on how i can do this? I've seen this done on some old perl scripts but how in php? echo $_SERVER['HTTP_HOST'] -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* ... an experienced, industrious, ambitious, and often quite often picturesque liar. -- Mark Twain */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem matching multiple times
On Fri, 18 Jul 2003, Curt Zirzow wrote: } Do you mean: } } $patterns[3] = /###Image($count+1)###/; } $replacements[3] = html stuff; } } Actually I did mean to use the $patterns[] and $replacements[], php } will automatically increase the index for you kinda makes adding } different pattern/replacement arrays easier in any order. } } The array will by default be FIFO. Ok, gotcha. } $sel_image = SELECT * from ppd_photos where ppd_id = '$_GET[ppdid]' AND place_holder = '$thephoto[0]'; } What does this return? } } I'm a bit confused right now.. The query simply returns one row with all the htmlstuff [width, height, caption, image_holder, etc] for one image. In otherwords, $message might contain: - Hello world, look at my [b]cat[/b]: ###Image1### Nice, huh? And now look at my [b]dog[/b]: ###Image2### Not so nice, eh? - I'm using a big preg_replace call to replace any of that custom formatting tag [eg: [b][/b]] as well as the ###ImageX### tags. Instead of replacing ###Image1### with some formatting code, I need to look up ###Image1### in the database, which stores the formatting codes. So the in the above query, $thephoto[0] contains '###Image1###', since it is the first photo on the page. However, when preg_replace finds a 2nd photo, with a image_holder of ###Image2###, the select statement is still run against the first image place holder, ###Image1###. So I need to advance the counter before running the SQL statement If I leave out the sql stuff and do something like this: $patterns[3] = /###Image(\d+)###/si; $replacements[3] = My Photograph\$1; Then the page sucessfully substitutes My Photograph1 for every place that $message contained ###Image1### and My Photograph2 for every place that $message contained ###Image2###. So I need to somehow run preg_match on that part of $message in order to extract ###Image1###, ###Image2###, ###Image3###, etc from the message and look them up in the database. I think. :-\ } after the user enters in his stuff, he wants, in your CMS and before you } save it, parse it for all the special tags you have and keep track of it } somewhere. That way when you output it (in this script) you only need } to apply the necessary pattern/replacements before outputing it to the } browser. Good idea! Thanks very much! Thanks again for your help, and time, with this. I do appreciate it. /vjl/ -- Vince LaMonica UC Irvine, School of Social Ecology W3 Developer * 116 Social Ecology I, Irvine, CA 92697 [EMAIL PROTECTED] http://www.seweb.uci.edu/techsupport Linux price to performance ratio: Error: Divide by zero. Continue?(Y/N) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Javascript multi text box form validation?
Hi all, I'm having an issue with quotes, slashes, and apostrophes being submitted into text boxes and they are breaking my sql statements. So, I am trying to do two things. 1. javascript form validation to prevent the double quotes and slashes 2. a sql_scrubber function to handle the apostrophes I am not strong in JS. I have found examples on the net for the form validation but my problem is that I want to use the same function on each text box for the testing of slashes and double quotes. Does anyone have or know of a location out there? Is their a better solution for what I am trying to do? Thanks in advance. Johnny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript multi text box form validation?
Johnny Martinez wrote: Hi all, I'm having an issue with quotes, slashes, and apostrophes being submitted into text boxes and they are breaking my sql statements. So, I am trying to do two things. 1. javascript form validation to prevent the double quotes and slashes 2. a sql_scrubber function to handle the apostrophes I am not strong in JS. I have found examples on the net for the form validation but my problem is that I want to use the same function on each text box for the testing of slashes and double quotes. Does anyone have or know of a location out there? Is their a better solution for what I am trying to do? Thanks in advance. You might want to check out stripslashes(). http://us2.php.net/manual/en/function.addslashes.php - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Javascript multi text box form validation?
2. a sql_scrubber function to handle the apostrophes addslashes() http://www.php.net/manual/en/function.addslashes.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Javascript multi text box form validation?
doh...RTFM Johnny! Thanks guys! -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:07 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Javascript multi text box form validation? Johnny Martinez wrote: Hi all, I'm having an issue with quotes, slashes, and apostrophes being submitted into text boxes and they are breaking my sql statements. So, I am trying to do two things. 1. javascript form validation to prevent the double quotes and slashes 2. a sql_scrubber function to handle the apostrophes I am not strong in JS. I have found examples on the net for the form validation but my problem is that I want to use the same function on each text box for the testing of slashes and double quotes. Does anyone have or know of a location out there? Is their a better solution for what I am trying to do? Thanks in advance. You might want to check out stripslashes(). http://us2.php.net/manual/en/function.addslashes.php - Brad -- 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] explode and escape character for string separator
Hi all, Suppose I have a long string like $myStr = $string1:$string2:$string3; I can obviously explode them using : as the separator. But what if $string1 contains the character : by itself? I was thinking, first I am gonna put an escaping character, so I can do something like: $string1 = str_replace(:, \:, $string1); But that still won't work with explode. So, what can I use instead of explode? Anything simple, and fast? This is a hypothetical situation. The real situation is that I am trying to have a protocol for data sent by client using Flash. But the basic question remains. Thanks for any help. RDB -- - /\ ASCII Ribbon Campaign against HTML \ / email and proprietary format X attachments. / \ - Have you been used by Microsoft today? Choose your life. Choose freedom. Choose LINUX. - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode and escape character for string separator
--- Reuben D. Budiardja [EMAIL PROTECTED] wrote: Suppose I have a long string like $myStr = $string1:$string2:$string3; I can obviously explode them using : as the separator. But what if $string1 contains the character : by itself? You should strive to make your delimiter unique. A delimiter that might possibly appear within the items it is meant to delimit is no longer a delimiter. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode and escape character for string separator
On Friday 18 July 2003 02:42 pm, Chris Shiflett wrote: --- Reuben D. Budiardja [EMAIL PROTECTED] wrote: Suppose I have a long string like $myStr = $string1:$string2:$string3; I can obviously explode them using : as the separator. But what if $string1 contains the character : by itself? You should strive to make your delimiter unique. A delimiter that might possibly appear within the items it is meant to delimit is no longer a delimiter. I did strive for that. But whatever character I choose, the problem remains that we can't guarantee that it's going ot be only used as deliminater, since the deliminated string is an input from user. So the problem remains. RDB -- - /\ ASCII Ribbon Campaign against HTML \ / email and proprietary format X attachments. / \ - Have you been used by Microsoft today? Choose your life. Choose freedom. Choose LINUX. - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] paypal and ecommerce
Looking for opinions as to the best way to handle this. I am using a php ecommerce product(osCommerce) to create an 'online yardsale'. This will not be an auction site but items for sale at a straight price. Currently the site is set up so the user can place several things in their basket, check out and the website owner is credited (via paypal accounts). The problem is, when we allow anyone to post items, you may go to the site, chose five items to buy but they are all from different people. How do you handle the check out? We don't want them to have to check out five times so all of the five sellers can have their accounts credited. Any help would be greatly appreciated. Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] paypal and ecommerce
Maybe it's just me, but I don't quite understand what you mean by this: The problem is, when we allow anyone to post items, you may go to the site, chose five items to buy but they are all from different people. How do you handle the check out? Can you rephrase? Are you talking about having an affiliate program? -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 12:01 PM To: [EMAIL PROTECTED] Php. Net Subject: [PHP] paypal and ecommerce Looking for opinions as to the best way to handle this. I am using a php ecommerce product(osCommerce) to create an 'online yardsale'. This will not be an auction site but items for sale at a straight price. Currently the site is set up so the user can place several things in their basket, check out and the website owner is credited (via paypal accounts). The problem is, when we allow anyone to post items, you may go to the site, chose five items to buy but they are all from different people. How do you handle the check out? We don't want them to have to check out five times so all of the five sellers can have their accounts credited. Any help would be greatly appreciated. Thanks, Eddie -- 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] explode and escape character for string separator
On Friday 18 July 2003 02:42 pm, Chris Shiflett wrote: --- Reuben D. Budiardja [EMAIL PROTECTED] wrote: Suppose I have a long string like $myStr = $string1:$string2:$string3; I can obviously explode them using : as the separator. But what if $string1 contains the character : by itself? You should strive to make your delimiter unique. A delimiter that might possibly appear within the items it is meant to delimit is no longer a delimiter. I did strive for that. But whatever character I choose, the problem remains that we can't guarantee that it's going ot be only used as deliminater, since the deliminated string is an input from user. So the problem remains. So choose another method. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode and escape character for string separator
Reuben D. Budiardja wrote: I did strive for that. But whatever character I choose, the problem remains that we can't guarantee that it's going ot be only used as deliminater, since the deliminated string is an input from user. So the problem remains. Are you adding the delimiter? If so, maybe you could escape that character in the users input when you add it. - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] paypal and ecommerce
I assume you're going to try to make money at this. if so, maybe YOU should get paid by the customer, then either weekly or monthly, send out a check (or transfer via paypal) to the sellers - minus your fee, of course. You can easily automate this if you interface with Paypal. --- Edward Peloke [EMAIL PROTECTED] wrote: Looking for opinions as to the best way to handle this. I am using a php ecommerce product(osCommerce) to create an 'online yardsale'. This will not be an auction site but items for sale at a straight price. Currently the site is set up so the user can place several things in their basket, check out and the website owner is credited (via paypal accounts). The problem is, when we allow anyone to post items, you may go to the site, chose five items to buy but they are all from different people. How do you handle the check out? We don't want them to have to check out five times so all of the five sellers can have their accounts credited. Any help would be greatly appreciated. Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] paypal and ecommerce
Hi, It kind of looks to me that each seller will be paid directly, with no money being processed by his web site. Like eBay does.. However, you'll be able to buy 2+ items at one time. Do you want suggestions on how to set it up for one checkout process, and several payment destinations? -Dan Joseph -Original Message- From: Ralph Guzman [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:57 PM To: 'Edward Peloke'; '[EMAIL PROTECTED] Php. Net' Subject: RE: [PHP] paypal and ecommerce Maybe it's just me, but I don't quite understand what you mean by this: The problem is, when we allow anyone to post items, you may go to the site, chose five items to buy but they are all from different people. How do you handle the check out? Can you rephrase? Are you talking about having an affiliate program? -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 12:01 PM To: [EMAIL PROTECTED] Php. Net Subject: [PHP] paypal and ecommerce Looking for opinions as to the best way to handle this. I am using a php ecommerce product(osCommerce) to create an 'online yardsale'. This will not be an auction site but items for sale at a straight price. Currently the site is set up so the user can place several things in their basket, check out and the website owner is credited (via paypal accounts). The problem is, when we allow anyone to post items, you may go to the site, chose five items to buy but they are all from different people. How do you handle the check out? We don't want them to have to check out five times so all of the five sellers can have their accounts credited. Any help would be greatly appreciated. Thanks, Eddie -- 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
Re: [PHP] explode and escape character for string separator
One set of delimiters I often use for text files is ~~ or ^^. They are fairly unique. If they do appear in a file then there is probably garbage in the file and I want to know about. For my templates delimiter I use {::TagName::}. You could use }::{ as your delimiter. Don't limit yourself to just a single character. Although the upside down ! or ? are nice if you are not using Spanish. On Friday, July 18, 2003, at 03:04 PM, Reuben D. Budiardja wrote: I did strive for that. But whatever character I choose, the problem remains that we can't guarantee that it's going ot be only used as deliminater, since the deliminated string is an input from user. So the problem remains. -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode and escape character for string separator
On Friday 18 July 2003 03:01 pm, you wrote: On Friday 18 July 2003 02:42 pm, Chris Shiflett wrote: --- Reuben D. Budiardja [EMAIL PROTECTED] wrote: Suppose I have a long string like $myStr = $string1:$string2:$string3; I can obviously explode them using : as the separator. But what if $string1 contains the character : by itself? You should strive to make your delimiter unique. A delimiter that might possibly appear within the items it is meant to delimit is no longer a delimiter. I did strive for that. But whatever character I choose, the problem remains that we can't guarantee that it's going ot be only used as deliminater, since the deliminated string is an input from user. So the problem remains. So choose another method. I would if I can think of better method. That answer does not help. RDB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode and escape character for string separator
On Saturday 19 July 2003 03:04, Reuben D. Budiardja wrote: You should strive to make your delimiter unique. A delimiter that might possibly appear within the items it is meant to delimit is no longer a delimiter. I did strive for that. But whatever character I choose, the problem remains that we can't guarantee that it's going ot be only used as deliminater, since the deliminated string is an input from user. So the problem remains. Do note that your delimiter is not limited to a single character, it can be a sequence of characters. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Horner's Five Thumb Postulate: Experience varies directly with equipment ruined. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode and escape character for string separator
load a bunch of characters into an array. Do a loop through that array and check all of your $strings for the current character in your loop. If the current array character does not exist in any of them, you have your delimiter. I could put together an example if you want me to. __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Multidimensional arrays
$sql = select id, name from customer; $rs = mysql_query($sql) or die(sql=$sql = .mysql_error()); while ($row = mysql_fetch_assoc($rs)) { $custarray[] = $row; } /* $row is an array with the elements 'id' and 'name' $custarray becomes a multi-array indexed starting a 0 e.g. $custarray[0]['id'] = 5126 $custarray[0]['name'] = 'jo' $custarray[1]['id'] = 5127 $custarray[1]['name'] = 'mark' */ On 7/18/2003 8:33 AM, Gary Broughton wrote: Hi Can anybody help me grasp multidimensional arrays please? Basically, I am retrieving all records from one table (two fields), and want to return them in an array. I am converting code from ASP to PHP, and in the former I did something like this: select id, name from customer redim custarray(recordcount,2) i = 0 while not eof custarray(i,0) = id; custarray(i,1) = name; i = i+1; movenext wend ... but all my efforts to store them in the same kind of way in PHP have proved fruitless. Any advice would be much appreciated. Many thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] paypal and ecommerce
Sorry I didn't do a better job of describing the situation.. It kind of looks to me that each seller will be paid directly, with no money being processed by his web site. Like eBay does.. However, you'll be able to buy 2+ items at one time. Yes, the theory would be that we would sit back and let the people get paid directly but not sure how to handle this. We did suggest, as Mark did, of having our company get the money and then nightly or so transferring the money from our account to the sellers' accounts but we would rather have it work where money goes directly from the buyer to the seller through paypal. Do you want suggestions on how to set it up for one checkout process, and several payment destinations? Yes! Utilizing what osCommerce already has, we would like to tweak it to make this possible. Thanks, Eddie -Original Message- From: Dan Joseph [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:59 PM To: '[EMAIL PROTECTED] Php. Net' Subject: RE: [PHP] paypal and ecommerce Hi, It kind of looks to me that each seller will be paid directly, with no money being processed by his web site. Like eBay does.. However, you'll be able to buy 2+ items at one time. Do you want suggestions on how to set it up for one checkout process, and several payment destinations? -Dan Joseph -Original Message- From: Ralph Guzman [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:57 PM To: 'Edward Peloke'; '[EMAIL PROTECTED] Php. Net' Subject: RE: [PHP] paypal and ecommerce Maybe it's just me, but I don't quite understand what you mean by this: The problem is, when we allow anyone to post items, you may go to the site, chose five items to buy but they are all from different people. How do you handle the check out? Can you rephrase? Are you talking about having an affiliate program? -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 12:01 PM To: [EMAIL PROTECTED] Php. Net Subject: [PHP] paypal and ecommerce Looking for opinions as to the best way to handle this. I am using a php ecommerce product(osCommerce) to create an 'online yardsale'. This will not be an auction site but items for sale at a straight price. Currently the site is set up so the user can place several things in their basket, check out and the website owner is credited (via paypal accounts). The problem is, when we allow anyone to post items, you may go to the site, chose five items to buy but they are all from different people. How do you handle the check out? We don't want them to have to check out five times so all of the five sellers can have their accounts credited. Any help would be greatly appreciated. Thanks, Eddie -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode and escape character for string separator
After reading your problem this is what I think you should do is dont let the user enter the string predelimited have them enter each individual string at which point you can safely search for the delimiter and replace it with the character of your choice _ is a favorite of mine. then rebuild the string and delimit it yourself Chris - Original Message - From: Reuben D. Budiardja [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:47 AM Subject: [PHP] explode and escape character for string separator Hi all, Suppose I have a long string like $myStr = $string1:$string2:$string3; I can obviously explode them using : as the separator. But what if $string1 contains the character : by itself? I was thinking, first I am gonna put an escaping character, so I can do something like: $string1 = str_replace(:, \:, $string1); But that still won't work with explode. So, what can I use instead of explode? Anything simple, and fast? This is a hypothetical situation. The real situation is that I am trying to have a protocol for data sent by client using Flash. But the basic question remains. Thanks for any help. RDB -- - /\ ASCII Ribbon Campaign against HTML \ / email and proprietary format X attachments. / \ - Have you been used by Microsoft today? Choose your life. Choose freedom. Choose LINUX. - -- 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