Re: [PHP] Image thumbnail creation
You must have the gd library compiled into PHP for this http://www.php.net/manual/en/ref.image.php ? $directory = getcwd(); $directory = $directory./photos; $size = GetImageSize($directory/$image); // feed the name of the original image here. $width = $size[0]; $height = $size[1]; $new_w=100; // set this to what you want the new fixed-width to be $ratio = $new_w/$width; $new_h=$height*$ratio; $dst_img=ImageCreate($new_w,$new_h); $src_img=ImageCreateFromjpeg($directory/$image); ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),I mageSY($src_img)); ImageJpeg($dst_img,$directory/thumbnail.jpg,75); ? - Original Message - From: Steph [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 09, 2001 11:27 AM Subject: [PHP] Image thumbnail creation Hi all! New to the list and new to PHP. Im trying to create Image thumbnail dynamically versus creasting them manually via my graphics program. Thanks, Steph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Objects and sessions
If what you mean is if PHP sessions can register objects, that is true and quite effective. Ethan Schroeder - Original Message - From: Brandon Orther [EMAIL PROTECTED] To: PHP User Group [EMAIL PROTECTED] Sent: Monday, July 02, 2001 4:36 PM Subject: [PHP] Objects and sessions Hello, I was informed by someone that is a blatent liar and regulary makes things up that PHP session can handle Objects. Is this true? Thank you, Brandon Orther -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] reading records alphebetically
You can either select the letter you want through mysql with SELECT * FROM table WHERE name LIKE '$letter%' Or you can select everything: $result = mysql_query(SELECT * FROM table order by name); while ($row = mysql_fetch_array($result)) { extract($row); $first_letter = strtolower($name[0]); } lets say $name = Fred; then $name[0] is set to F; $name[1] is set to r; $name[2] is set toe; and so on... - Original Message - From: Jamie Saunders [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 30, 2001 9:29 AM Subject: [PHP] reading records alphebetically Hi, I have a MySQL database set-up containing a few hundred records. I'm trying to make a script that reads the 'name' field of the records and displays only the records of which the name field begins with a specific letter: if ($letter = A) { display all records of which field 'name' beings with A } else if ($letter = B) { ... I'm just starting out on this, so please excuse my ignorance :) Jamie Saunders [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] image retrival from db?
You need to set the content type. eg: echo Content-type: image/gif; echo $row[image]; Ethan - Original Message - From: Steve [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 3:56 PM Subject: [PHP] image retrival from db? Anyone have a pointer to a script or documentation on how to retrieve an image that is stored in a database? I can insert the image, but unable to display the image once retieved, i apparently am missing something. Thanks Steve
Re: [PHP] image retrival from db?
I meant to say Header(Content-type: image/gif); - Original Message - From: Steve [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 3:56 PM Subject: [PHP] image retrival from db? Anyone have a pointer to a script or documentation on how to retrieve an image that is stored in a database? I can insert the image, but unable to display the image once retieved, i apparently am missing something. Thanks Steve
Re: [PHP] INSERT problem with MySQL/PHP
replace $result = mysql_db_query('item_db', $sql_query, $connection_id); with $result = mysql_db_query('item_db', $sql, $connection_id); or just mysql_query($sql); - Original Message - From: Todd A. Jacobs [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Monday, June 18, 2001 4:11 PM Subject: [PHP] INSERT problem with MySQL/PHP PHP: 4.0.4pl1 MySQL: 3.23.36-1 I have the following code fragment, which uses the same connection parameters elsewhere to *successfully* to retrieve data from a database, so this doesn't appear to be a permissions problem with MySQL. However, nothing happens with inserts; no rows are added at all. All I get is a message form mysql_error() saying Query was empty. Can anyone tell me what might be wrong? $user_idx = 1; $objective = 1; $question = 'Foo'; $question_type = 'singular'; $connection_id = mysql_connect ('192.168.1.1', 'php', 'password') or die (No connection.\n); $sql = INSERT INTO question VALUES (NULL, $user_idx, $objective, '$question', '$question_type', NULL, NULL); $result = mysql_db_query('item_db', $sql_query, $connection_id); echo pre; echo \nDebugging output:\n; echo \tSQL: $sql\n; echo \tError: , mysql_error(), \n; echo \tLast insert ID: , mysql_insert_id(), \n; echo \tResult: $result\n; echo /pre\n; -- Todd A. Jacobs CodeGnome Consulting, LTD
Re: [PHP] Solution to headers already sent error.
(PHP4) In your php.ini file: output_buffering = On Now you can send header calls and session calls whenever you want. Also, take a look at: http://www.php.net/manual/en/ref.outcontrol.php Ethan - Original Message - From: Alexander Wagner [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 3:54 PM Subject: Re: [PHP] Solution to headers already sent error. Hiho, Merio, Quinn wrote: So, during the time the lists were down, i was banging my head over a seemingly impossible error message. Warning: Cannot send session cache limiter - headers already sent What?! I exlaimed.. the first line in my page registered the session variable i was using, so what was the deal. I turned out to be one measly little space in front of my ?php tag. Well, reading the complete message should have helped, which goes like this: Warning: Cannot add header information - headers already sent by (output started at /foo/foo.php3:2) in /foo/bar.php3 on line 399 The message tells you in which file and on which line the output was started. With PHP 4 it does, anyway. Figured i would share that nugget, cus man did it ever drive me nuts, and i saw no reference to it at all in the manuals. Not in the session-section, no. But the description of the header()-function (http://php.net/header) contains this paragraph: Remember that the header() function must be called before any actual output is sent, either by normal HTML tags blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that will output before header() is called. The same problem exists when using a single PHP/HTML file. Of course, this is hard to find when you're browsing through the session-functions. A link might be useful. Something like This function needs to send a HTTP-Header, so you ... as with the header()-function. regards Wagner -- Isn't it strange? The same people who laugh at gypsy fortune tellers take economists seriously. - Cincinnati Enquirer
Re: [PHP] Converting MySQL Date (2001-05-21) to Friendly Date (21 May 2001)
You could shorten it by having mysql convert the date into a timestamp: $result = mysql_query(SELECT UNIX_TIMESTAMP(date) as somedate FROM dates); $row = mysql_fetch_array($result); echo date(jS F Y, $row[somedate]); Ethan - Original Message - From: Pavel Jartsev [EMAIL PROTECTED] To: Matthew Ralston [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, May 23, 2001 6:21 AM Subject: Re: [PHP] Converting MySQL Date (2001-05-21) to Friendly Date (21 May 2001) Matthew Ralston wrote: I've got a date stored in a MySQL database in a DATE field, so it is stored as 2001-05-21. How do I convert that into a more friendly date like 21 May 2001 or even 21st May 2001 for display on a web page? I've tried print date(jS F Y, $dbtable[date]); but I always get 1st January 1970 because I don't know how to convert the MySQL date into a PHP timestamp. Can someone tell me how to do it please? Maybe it's not very nice, but it works: ? list($y,$m,$d) = explode('-', $dbtable['date']); print date(jS F Y, mktime(0, 0, 0, $m, $d, $y)); ? Hope this helps. -- Pavel a.k.a. Papi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Encrypt Password for Session
What I do is md5() encrypt the password and store it in the text file or database. Md5 is a one way algorithm, though, so you can never decrpyt the password. What you do, is when you want to authenticate a user, you md5 encrypt the text they typed in and compare that to the md5 hash in your file or database or wherever. If they match, you let them in. Ethan Schroeder - Original Message - From: Troy Moreland [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 17, 2001 10:41 AM Subject: [PHP] Encrypt Password for Session All, I am currently using sessions to store a user's ID, password and current login status. All works fine. The only issue is that the session file on the server is storing the password in plain text. How do I encrypt that password and how to I decrypt it for comparing? Thanks in advance!! Troy Moreland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] RE: Processing time in PHP. better to use php tags inline or pri nt(html);
The following code is not mine, so I take no credit for it. It seems to work fine for me, though: ? class c_Timer { var $t_start = 0; var $t_stop = 0; var $t_elapsed = 0; function start() { $this-t_start = microtime(); } function stop(){ $this-t_stop= microtime(); } function elapsed() { if ($this-t_elapsed) { return $this-t_elapsed; } else { $start_u = substr($this-t_start,0,10); $start_s = substr($this-t_start,11,10); $stop_u= substr($this-t_stop,0,10); $stop_s= substr($this-t_stop,11,10); $start_total = doubleval($start_u) + $start_s; $stop_total= doubleval($stop_u) + $stop_s$ $this-t_elapsed = $stop_total - $start_total; return $this-t_elapsed; } } }; /* Here's an example usage: $timer = new c_Timer; $timer-start(); echo hr; $timer-stop(); echo $timer-elapsed(); */ ? - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: Merio, Quinn [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 9:47 AM Subject: Re: [PHP] RE: Processing time in PHP. better to use php tags inline or pri nt(html); Why don't you just benchmark both? On Wed, 16 May 2001, Merio, Quinn wrote: Sorry to nag, i hadnt recieved any responses on this post yet.. would like to re-request.. I wanted to know if there is drawbacks or benefits to using the php alternate syntax? 1.) Is it possible (and if so, how do i) get the time it took to process the page (seconds or milliseconds)? 2.) This is where the first q arose from: I am trying to ascertain which is faster, outputting a query using the print function or using the alternate syntax. I know that in ASP, jumping in and out of the asp code slows down the page processing. Here is the two ways i am outputting my recordset: 1.- from within the php code - table cellpadding=4 cellspacing=4 border=2 ?php for ($i = 1; $i = $nr; $i++){ $row = mysql_fetch_assoc ($rs); print(tr); print(td); print($row['projectId']); print(/tdtd); print('a href=mylink.php?linkId='.$row['projectId'].''.$row['projectName'].'/a '); print(/tdtd); print($row['projectStatus']); print(/tr); } // End Loop rows ? /table 2. inline code with the html -- table cellpadding=4 cellspacing=4 border=2 ? for ($i = 1; $i = $nr; $i++): ? ? $row = mysql_fetch_assoc ($rs);? tr td?print($row['projectId']);?/td tda href=myfile?blah=?=$row['projectId']??print($row['projectName']);? /a/td td?print($row['projectStatus']);?/td /tr ? endfor; ? /table Any thoughts from the experts? I love being able to mix html and php tags, but am worried about efficiency. TIA, Quinn Merio Vir2lAlliance Inc. www.vir2lalliance.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] RE: Processing time in PHP. better to use php tags inline or pri nt(html);
Sorry, I think that code got chopped off, try this: ? class c_Timer { var $t_start = 0; var $t_stop = 0; var $t_elapsed = 0; function start() { $this-t_start = microtime(); } function stop(){ $this-t_stop= microtime(); } function elapsed() { if ($this-t_elapsed) { return $this-t_elapsed; } else { $start_u = substr($this-t_start,0,10); $start_s = substr($this-t_start,11,10); $stop_u= substr($this-t_stop,0,10); $stop_s= substr($this-t_stop,11,10); $start_total = doubleval($start_u) + $start_s; $stop_total= doubleval($stop_u) + $stop_s; $this-t_elapsed = $stop_total - $start_total; return $this-t_elapsed; } } }; /* Here's an example usage: $timer = new c_Timer; $timer-start(); echo hr; $timer-stop(); echo $timer-elapsed(); */ ? - Original Message - From: Ethan Schroeder [EMAIL PROTECTED] To: Merio, Quinn [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 12:57 PM Subject: Re: [PHP] RE: Processing time in PHP. better to use php tags inline or pri nt(html); The following code is not mine, so I take no credit for it. It seems to work fine for me, though: ? class c_Timer { var $t_start = 0; var $t_stop = 0; var $t_elapsed = 0; function start() { $this-t_start = microtime(); } function stop(){ $this-t_stop= microtime(); } function elapsed() { if ($this-t_elapsed) { return $this-t_elapsed; } else { $start_u = substr($this-t_start,0,10); $start_s = substr($this-t_start,11,10); $stop_u= substr($this-t_stop,0,10); $stop_s= substr($this-t_stop,11,10); $start_total = doubleval($start_u) + $start_s; $stop_total= doubleval($stop_u) + $stop_s$ $this-t_elapsed = $stop_total - $start_total; return $this-t_elapsed; } } }; /* Here's an example usage: $timer = new c_Timer; $timer-start(); echo hr; $timer-stop(); echo $timer-elapsed(); */ ? - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: Merio, Quinn [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 9:47 AM Subject: Re: [PHP] RE: Processing time in PHP. better to use php tags inline or pri nt(html); Why don't you just benchmark both? On Wed, 16 May 2001, Merio, Quinn wrote: Sorry to nag, i hadnt recieved any responses on this post yet.. would like to re-request.. I wanted to know if there is drawbacks or benefits to using the php alternate syntax? 1.) Is it possible (and if so, how do i) get the time it took to process the page (seconds or milliseconds)? 2.) This is where the first q arose from: I am trying to ascertain which is faster, outputting a query using the print function or using the alternate syntax. I know that in ASP, jumping in and out of the asp code slows down the page processing. Here is the two ways i am outputting my recordset: 1.- from within the php code - table cellpadding=4 cellspacing=4 border=2 ?php for ($i = 1; $i = $nr; $i++){ $row = mysql_fetch_assoc ($rs); print(tr); print(td); print($row['projectId']); print(/tdtd); print('a href=mylink.php?linkId='.$row['projectId'].''.$row['projectName'].'/a '); print(/tdtd); print($row['projectStatus']); print(/tr); } // End Loop rows ? /table 2. inline code with the html -- table cellpadding=4 cellspacing=4 border=2 ? for ($i = 1; $i = $nr; $i++): ? ? $row = mysql_fetch_assoc ($rs);? tr td?print($row['projectId']);?/td tda href=myfile?blah=?=$row['projectId']??print($row['projectName']);? /a/td td?print($row['projectStatus']);?/td /tr ? endfor; ? /table Any thoughts from the experts? I love being able to mix html and php tags, but am worried about efficiency. TIA, Quinn Merio Vir2lAlliance Inc. www.vir2lalliance.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list
Re: [PHP] One database, different forms
I use this code for dynamically creating queries almost every day. $column = mysql_list_fields($db,$table); for($i = 0; $i mysql_num_fields($column); $i++) { $value = mysql_field_name($column,$i); $value = $$value; $values .= '$value'; if($i != mysql_num_fields($column)-1) $values .= ,; } $sql = INSERT INTO $table VALUES ($values); mysql_query($sql); Ethan Schroeder - Original Message - From: midget2000x [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, May 13, 2001 1:31 PM Subject: [PHP] One database, different forms I am writing a PHP application that will operate on a MySQL database. There will be 4 types of forms (like catalog request, info request, etc.) calling the code which writes the data to the database. Since the variable names on the forms will equal the MySQL column names (as they should), I am wondering if there is a way for me to create my SQL statements on the fly so that only data passed is written. Otherwise I'll have to create 8 types of SQL statements...INSERT (if the record, keyed by e-mail address, doesn't exist), and UPDATE (if the record does exist) for all 4 forms. For example, on my add to mailing list form, only the e-mail address is collected. I'd like the PHP to recognize that only the 'email' field is passed and create the SQL statement that only writes the e-mail to the database. Any ideas greatly appreciated! Thanks, Rory -- --- providing the finest in midget technology -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] One database, different forms
Oh, here is the update code, which uses the same concepts: $column = mysql_list_fields($db,$table); for($i = 1; $i mysql_num_fields($column); $i++) { $value = mysql_field_name($column,$i); $name = $value; $value = $$value; $values .= $name='$value'; if($i != mysql_num_fields($column)-1) $values .= ,; } $sql = UPDATE $table SET $values WHERE id='$id'; mysql_query($sql); And the INSERT code again for good measure: $column = mysql_list_fields($db,$table); for($i = 0; $i mysql_num_fields($column); $i++) { $value = mysql_field_name($column,$i); $value = $$value; $values .= '$value'; if($i != mysql_num_fields($column)-1) $values .= ,; } $sql = INSERT INTO $table VALUES ($values); mysql_query($sql); This code relies on 2 variables being correctly set: $db is the name of the database you are working with, and $table is the name of the table. Other than that what this script basically does is goes through every column in the specified table and dynamically creates a query from the names of the columns. Your variable names will need to match the column names exactly or this will insert/update null values. - Original Message - From: midget2000x [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, May 13, 2001 1:31 PM Subject: [PHP] One database, different forms I am writing a PHP application that will operate on a MySQL database. There will be 4 types of forms (like catalog request, info request, etc.) calling the code which writes the data to the database. Since the variable names on the forms will equal the MySQL column names (as they should), I am wondering if there is a way for me to create my SQL statements on the fly so that only data passed is written. Otherwise I'll have to create 8 types of SQL statements...INSERT (if the record, keyed by e-mail address, doesn't exist), and UPDATE (if the record does exist) for all 4 forms. For example, on my add to mailing list form, only the e-mail address is collected. I'd like the PHP to recognize that only the 'email' field is passed and create the SQL statement that only writes the e-mail to the database. Any ideas greatly appreciated! Thanks, Rory -- --- providing the finest in midget technology -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ssh
Simple. Get putty. It is, by far, the best free ssh client out there. http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html It's small, too. Ethan Schroeder - Original Message - From: Dennis Gearon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 14, 2001 5:26 PM Subject: [PHP] ssh anyone got the easy directions to setting up teraterm pro with SSH ***AND*** getting the certificate to work for it? My provider that runs php/mysql/etc only lets people use SSH connections for telnet, which I agree with. Right, now, I don't want to pay the $139 for the non open source windows SSH client. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ssh
I use mindterm sometimes, as well. I love it. Ethan Schroeder - Original Message - From: Dennis Gearon [EMAIL PROTECTED] To: Ethan Schroeder [EMAIL PROTECTED] Sent: Monday, May 14, 2001 7:04 PM Subject: Re: [PHP] ssh WOW! installation beats the HELL out of the teraterm project! Thanks, got it working! I wonder if 'mindterm' would be a good applet to install? For anywhere access that is. My provider only allows access from the IP's I designate. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] need some ideas here...
Find where there sendmail is and put this in an .htaccess file: php_value sendmail_path '/path/to/sendmail -t' Ethan Schroeder - Original Message - From: Christian Dechery [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 14, 2001 7:04 PM Subject: [PHP] need some ideas here... My free-web-hosting (www.f2s.com) does not allow PHP to send emails... I've tried everything... the mail() function, my alternate function which calls popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php' and all that stuff... the mail simply won't go an mail() always returns false... I'm guessing there's no mail sending in this server... so what do I do? is it possible for me to call a script on another host from with a script and return something to it? like ?php code ... code ... code...; code ... code ... code...; here I'd have some code to call a script in another host that can send mails, of course with the necessary parms...; code code code; code code code; ? . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] need some ideas here...
I don't know how you can find sendmail on that system if you don't have telnet access. Try writing a script that does an exec(which sendmail) and see if it tells you. I doubt it will, though. Otherwise try different sendmail locations: /usr/sbin/sendmail, /usr/lib/sendmail, etc. The .htacess file overwrites the value of the php.ini file, so you can specify to php where sendmail is for any script that is under the directory your .htaccess file resides in (unless they don't allow .htaccess). I've had to use this approach a couple times to get php to send mail off properly. Ethan Schroeder - Original Message - From: Christian Dechery [EMAIL PROTECTED] To: Ethan Schroeder [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, May 14, 2001 6:30 PM Subject: Re: [PHP] need some ideas here... what??? I didn't understand... how will I find out where sendmail is in a free-web-host? I don't have telnet access... how can I figure that out? and how a .htaccess file would help me here? At 19:50 14/5/2001 -0500, Ethan Schroeder wrote: Find where there sendmail is and put this in an .htaccess file: php_value sendmail_path '/path/to/sendmail -t' Ethan Schroeder - Original Message - From: Christian Dechery [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 14, 2001 7:04 PM Subject: [PHP] need some ideas here... My free-web-hosting (www.f2s.com) does not allow PHP to send emails... I've tried everything... the mail() function, my alternate function which calls popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php' and all that stuff... the mail simply won't go an mail() always returns false... I'm guessing there's no mail sending in this server... so what do I do? is it possible for me to call a script on another host from with a script and return something to it? like ?php code ... code ... code...; code ... code ... code...; here I'd have some code to call a script in another host that can send mails, of course with the necessary parms...; code code code; code code code; ? . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] need some ideas here...
I should correct myself. The .htaccess file doesn't overwrite the php.ini value, rather it overrides it. Ethan Schroeder - Original Message - From: Ethan Schroeder [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Christian Dechery [EMAIL PROTECTED] Sent: Monday, May 14, 2001 10:40 PM Subject: Re: [PHP] need some ideas here... I don't know how you can find sendmail on that system if you don't have telnet access. Try writing a script that does an exec(which sendmail) and see if it tells you. I doubt it will, though. Otherwise try different sendmail locations: /usr/sbin/sendmail, /usr/lib/sendmail, etc. The .htacess file overwrites the value of the php.ini file, so you can specify to php where sendmail is for any script that is under the directory your .htaccess file resides in (unless they don't allow .htaccess). I've had to use this approach a couple times to get php to send mail off properly. Ethan Schroeder - Original Message - From: Christian Dechery [EMAIL PROTECTED] To: Ethan Schroeder [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, May 14, 2001 6:30 PM Subject: Re: [PHP] need some ideas here... what??? I didn't understand... how will I find out where sendmail is in a free-web-host? I don't have telnet access... how can I figure that out? and how a .htaccess file would help me here? At 19:50 14/5/2001 -0500, Ethan Schroeder wrote: Find where there sendmail is and put this in an .htaccess file: php_value sendmail_path '/path/to/sendmail -t' Ethan Schroeder - Original Message - From: Christian Dechery [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 14, 2001 7:04 PM Subject: [PHP] need some ideas here... My free-web-hosting (www.f2s.com) does not allow PHP to send emails... I've tried everything... the mail() function, my alternate function which calls popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php' and all that stuff... the mail simply won't go an mail() always returns false... I'm guessing there's no mail sending in this server... so what do I do? is it possible for me to call a script on another host from with a script and return something to it? like ?php code ... code ... code...; code ... code ... code...; here I'd have some code to call a script in another host that can send mails, of course with the necessary parms...; code code code; code code code; ? . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] multiline text areas and mysql doesn't work :(
It should be storing them unless you are doing something to the data before inserting it into the database. Have you tried outputting the data through nl2br() ?http://www.php.net/manual/en/function.nl2br.php Ethan Schroeder - Original Message - From: Ciaron Nixon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, May 13, 2001 9:22 AM Subject: [PHP] multiline text areas and mysql doesn't work :( I'm trying to insert the conents of a submitted textarea into a field of a db but it seems to be stripping the control characters or not fomatting them properly. The record updates fine but when I display it all the newlines are gone ie the whole field appears on 1 line. Any ideas how to get it to store the control chars? -Ciaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie Question.
In your apache conf, make sure you have something similar to: AddType application/x-httpd-php .php .phtml .inc If you don't, add it and restart apache. - Original Message - From: Raven [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, May 12, 2001 12:04 PM Subject: [PHP] Newbie Question. Hello to all. This is probably the most basic question of th PHP general list. I just installed PHP 4.0.5 on Apache 1.2.19. Could someone please explain a very basic test. I would like to write a Hello World page as a test. I have tried the following: And named the page: index.php and index.html html head titlePHP Testing Ground/title body ?php echo Hello World; ? /body /html index.php - Displays the html code index.html - displays blank - exept I see the title: PHP Testing Ground in the title header of the browser. So the pages are loading. Help? How do I test this to see that Apache is configured correctly. PS: I followed the PHP Manual instructions for installing PHP on php.net. Apache reported setting up correctly after running make install. Any help would be appreciated. Thanks in advance, Tom Bedell Newbie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Site search engine suggestion.
I use udmsearch and love it. If you want php pages searchable it does actual http requests, so it doesn't give source code. If you don't want php searchable, you can configure it to ignore any file extensions you want. It comes with a php interface built in, also. Ethan Schroeder - Original Message - From: elias [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, May 12, 2001 10:18 AM Subject: [PHP] Site search engine suggestion. Hello guys, I need that badly! I need a suggestion, advise, solution or whatever that might help! I need a Site Search script for a page that mostly have .PHP files some are dynamic and some are not. Basically i was using WebGlimpse but whenever I search using it, It shows the source code of the PHP files! So for example if i search echo , WebGlimpse displays the .PHP file source code! Any suggestion for a better site search program? -elias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] referencing a constant inside an object
global $PHP_SELF; global $REMOTE_USER; - Original Message - From: cw [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Saturday, May 12, 2001 11:28 AM Subject: [PHP] referencing a constant inside an object I'm trying to reference $PHP_SELF and $REMOTE_USER inside a class: var $page; var $user; $this-page=$PHP_SELF; $this-user=$REMOTE_USER; I'm using php4. What am I missing here? TIA, clif -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Site search engine suggestion.
Wow, thanks for the heads up =) Ethan Schroeder - Original Message - From: Ryan W. Zajicek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, May 12, 2001 12:50 PM Subject: RE: [PHP] Site search engine suggestion. Just a side not here... :) udmSearch is now mnoGoSearch (http://search.mnogo.ru/) Thank You Ryan mailto:[EMAIL PROTECTED] -Original Message- From: Ethan Schroeder [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 12, 2001 2:25 PM To: elias Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Site search engine suggestion. I use udmsearch and love it. If you want php pages searchable it does actual http requests, so it doesn't give source code. If you don't want php searchable, you can configure it to ignore any file extensions you want. It comes with a php interface built in, also. Ethan Schroeder - Original Message - From: elias [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, May 12, 2001 10:18 AM Subject: [PHP] Site search engine suggestion. Hello guys, I need that badly! I need a suggestion, advise, solution or whatever that might help! I need a Site Search script for a page that mostly have .PHP files some are dynamic and some are not. Basically i was using WebGlimpse but whenever I search using it, It shows the source code of the PHP files! So for example if i search echo , WebGlimpse displays the .PHP file source code! Any suggestion for a better site search program? -elias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] check if a variable is in a number of states.
How about a case-swtich? http://www.php.net/manual/en/control-structures.switch.php Ethan Schroeder - Original Message - From: DRN [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, May 12, 2001 4:40 PM Subject: [PHP] check if a variable is in a number of states. Hi, I would like to check whether a variable, $type, is equal to a number of different possible states. I know I could use if ( $type == abc || $type == bcd) { $a = b } but this would get a bit clumsy if I had to check whether it is say one of 20 different things. What I was wondering is, is there a better way of doing this? I will occasionally need to add another option as well, although I don't mind a simple code edit. Cheers for your help, Donald __ As well as learning more, I learn that there is even more I don't know http://www.donaldrnoble.f2s.com ¯¯ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]