[PHP] new to php/mysql - insert not working

2002-03-20 Thread ROBERT MCPEAK
Can somebody help me with this? The following code gets me document contains no data. I have done a successfull select from mysql db, but not an insertion. I don't know how to troubleshoot this. Any help is much appreciated. Thanks! ?php $id = addslashes($id); $visitdate =

[PHP] mysql update help needed

2002-03-20 Thread ROBERT MCPEAK
Can somebody straighten this out for me? I can't get the update to work. I'm sure the variables are being passed to the code. Thanks! if ($postaction==edit) { echo it firedBr; // process form $db = mysql_connect(myhost,

[PHP] html form select list selected

2002-03-20 Thread ROBERT MCPEAK
I'd like to determine the selected option in a select list based on a passed variable. The code below won't work, but I can't figure out why. Any guesses? echo form; echo select name=\display\; echo option value=\true\; if ($display==false){echo

[PHP] Fwd: html form select list selected

2002-03-20 Thread ROBERT MCPEAK
;} echo selectedDon't Display; echo /select; echo /form; ROBERT MCPEAK 03/20/02 04:20PM I'd like to determine the selected option in a select list based on a passed variable. The code below won't work, but I can't figure out why. Any guesses? echo form

RE: [PHP] Fwd: html form select list selected

2002-03-20 Thread ROBERT MCPEAK
option value=1False /select Now the contents of $display is an integer which will can be interpreted as a boolean value (true or false). Then you can compare it like you had. if ($display == false) -Kevin -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Wednesday

[PHP] broken select solution

2002-03-20 Thread ROBERT MCPEAK
; echo /form; ? ROBERT MCPEAK [EMAIL PROTECTED] 03/20/02 04:39PM Still doesn't work. What gives? Kevin

[PHP] testing for blank var

2002-03-21 Thread ROBERT MCPEAK
if $img_url has a value, then I'd like to show the image, if it doesn't, then I'd like to show a message. What's wrong with my code? Am I incorrectly testing for the value? The else works fine, but not the if. Thanks! if (!$img_url) { echo bNo Image URL Entered/bbr;

RE: [PHP] testing for blank var

2002-03-21 Thread ROBERT MCPEAK
Beautiful! Rick Emery [EMAIL PROTECTED] 03/21/02 09:19AM if ( ! ISSET($img_url) ) -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 21, 2002 8:18 AM To: [EMAIL PROTECTED] Subject: [PHP] testing for blank var if $img_url has a value

[PHP] newbyie - date conversion to human readable form

2002-03-25 Thread ROBERT MCPEAK
I've dug around for a while but I can't find a direct answer on how to convert a date in this format: 2002-03-25 to a human readable format such as March 25, 2002, or even better, Monday, March 25, 2002. Can anybody help me with this, or point me to some clear directions on how to do this?

RE: [PHP] newbyie - date conversion to human readableform-CORRECTION

2002-03-25 Thread ROBERT MCPEAK
Rick Emery [EMAIL PROTECTED] 03/25/02 11:04AM CORRECTION: SELECT DATE_FORMAT( mydate, %W, %M %d, %Y) AS thedate FROM mytable; -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 9:58 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] newbyie

[PHP] parse error, mysql select

2002-04-01 Thread ROBERT MCPEAK
When I execute from browser I get a parse error, but when I enter the query directly into a MySQL command prompt I get a successful return. Can anybody see the problem with this code: $query = SELECT DATE_FORMAT( exp_date, %W, %M %d, %Y) AS thedate from tifrequest where

RE: [PHP] parse error, mysql select

2002-04-01 Thread ROBERT MCPEAK
Ack! Thanks. Rick Emery [EMAIL PROTECTED] 04/01/02 02:59PM $query = SELECT DATE_FORMAT( exp_date, \%W, %M %d, %Y\) AS thedate from tifrequest where user='$user' limit 1,1; Missing escape \ in front of quotes -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent

[PHP] date comparison expressions

2002-04-01 Thread ROBERT MCPEAK
I'd like to compare today's date against a stored date, and then fire some code based on the result. Like. if ($today's_date stored_date+5 days) then {blah} Can somebody clue this newbie in on how to do this? -Bob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] date expressions

2002-04-02 Thread ROBERT MCPEAK
How do I compare a date (2002-05-01) against a date plus 5 days? I need help figuring out how to do math operations on dates, etc. Could somebody fill this newbie in? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] syntax for date math expressions

2002-04-03 Thread ROBERT MCPEAK
What is the php syntax for adding or subtracting dates? For example, I'd like to do something like this: 2002-04-03 - 2002-04-02 = 1 or 2002-04-03 - 2002-04-02 = -00-01 or 2002-04-03 + -00-01 = 2002-04-03 etc. Can anybody help this newbie? Thanks! -- PHP General Mailing

[PHP] Re: syntax for date math expressions

2002-04-03 Thread ROBERT MCPEAK
] ROBERT MCPEAK writes: What is the php syntax for adding or subtracting dates? For example, I'd like to do something like this: 2002-04-03 - 2002-04-02 = 1 or 2002-04-03 - 2002-04-02 = -00-01 or 2002-04-03 + -00-01 = 2002-04-03 etc. Can anybody help

[PHP] mySQL join query error

2002-04-04 Thread ROBERT MCPEAK
I get an error with the follow query. There is a field user in both tables, tifrequest tifexpire. Can anybody see what's wrong with it? Thanks. SELECT * FROM tifrequest LEFT JOIN USING(user) WHERE tifexpire.exp_date =2002-04-04 -- PHP General Mailing List (http://www.php.net/) To

[PHP] newbie html forms primer help

2002-04-10 Thread ROBERT MCPEAK
I need some help with html forms. I primer on html forms and variables is much needed. Anybody have some code snipets to share? I'm getting acquainted with $HTTP_POST_VARS but need some help in accomplishing a couple of things. I'd like to collect all checkbox input variables and stick them

Re: [PHP] PHP Training is New York

2002-04-12 Thread ROBERT MCPEAK
Can't make it to this one but would like to know of any other training opps in the Balt-Wash-Phil-NY areas. Anybody know of a good source for this info? Daniel Kushner [EMAIL PROTECTED] 04/12/02 10:48AM LAST DAY TO REGISTER http://websapp.com/training.php --Daniel -- PHP General

[PHP] newbie: unix/php/mySQL permissions

2002-04-15 Thread ROBERT MCPEAK
I'm very new to php mySQL and need some help understanding how I should set up my Unix permissions. I would like to run php code that could delete/create/edit existing files. I've tried to issue the load data infile statement from the command line but mySQL gives me a permissions error. How

[PHP] newbie: unix/php/mySQL permissions

2002-04-15 Thread ROBERT MCPEAK
I'm very new to php mySQL and need some help understanding how I should set up my Unix permissions. I would like to run php code that could delete/create/edit existing files. I've tried to issue the load data infile statement from the command line but mySQL gives me a permissions error. How

[PHP] newbie: unix/php/mySQL permissions

2002-04-15 Thread ROBERT MCPEAK
I'm very new to php mySQL and need some help understanding how I should set up my Unix permissions. I would like to run php code that could delete/create/edit existing files. I've tried to issue the load data infile statement from the command line but mySQL gives me a permissions error. How

[PHP] email attachments

2002-04-16 Thread ROBERT MCPEAK
This nifty code (taken from PHP Cookbook) sends an email with a file attached in-line. The text from the attached file appears within the body of the email. I need to send attached files that are not in-line, but, rather, come as attached files that the user views outside of their email

RE: [PHP] email attachments

2002-04-16 Thread ROBERT MCPEAK
: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 16, 2002 8:46 AM To: [EMAIL PROTECTED] Subject: [PHP] email attachments This nifty code (taken from PHP Cookbook) sends an email with a file attached in-line. The text from the attached file appears within the body of the email. I need

[PHP] formatting form input/sql insert

2002-04-16 Thread ROBERT MCPEAK
I'm collecting data with from textarea inputs. The user may enter a linebreak with the return key, or a tab, etc. I then write this data to a mySQL table, formatting the data with addslashes(). I then output the data to a text file using a select into file statement. When I import the file

[PHP] formatting form input

2002-04-16 Thread ROBERT MCPEAK
How do I use PHP to remove certain characters from form input? Specifically, how to I ensure that form data does not contain any newline/linebreak or tab characters? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] attachment filename

2002-04-16 Thread ROBERT MCPEAK
The code below very nicely sends an email attachment, but, the name of the attachment appears as Part.000, not the original filename of the attached file. How do I set the filename of the attachment? I'd like it to be something nice, like yourfileattachment.txt or something, not Part.000. What

[PHP] php permissions

2002-04-19 Thread ROBERT MCPEAK
php is running on our box as nobody:nogroup. I'm trying to write php code that will edit/delete files uploaded to the server by other users, and, obviously, I get a permissions error. My sysadmin is hesitant to give php more access until I do some research about the security issues involved,

Re: [PHP] php permissions

2002-04-19 Thread ROBERT MCPEAK
Raven [EMAIL PROTECTED] 04/19/02 01:55PM chown them to nobody. - Original Message - From: ROBERT MCPEAK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 19, 2002 7:53 PM Subject: [PHP] php permissions php is running on our box as nobody:nogroup. I'm trying to write php code

RE: [PHP] php permissions

2002-04-19 Thread ROBERT MCPEAK
Craig, you seem very knowledgable and I appreciate your help. I confused matters by mentioning the word upload. I'm actually not using php to upload the files. The user ftps the files to the server, and the ownership permissions prevent php from manipulating the files. I'm looking for a clear

[PHP] newbie: string manipulation

2002-04-24 Thread ROBERT MCPEAK
I need code that grabs the file at the end of a file path. I have this: /usr/blah/doh/yuck/wow/abigfile.html And would like to return this: abigfile.html Could somebody show me how to do this? Thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] basename unix/windows

2002-04-25 Thread ROBERT MCPEAK
I'm running php on linux and wish to use basename() to get the file name from a windows path. basename() on our linux/php box can't seem to cope with the use of backslash (\) in the Windows paths I'm feeding it. In other words: basename(/usr/blah/doh/yuck/wow/abigfile.html) resolves to :

[PHP] date(), strtotime(), Wed, Dec 31, 1969 ??

2002-05-03 Thread ROBERT MCPEAK
Running PHP3 on a Linux box and I've got trouble with date(). Here's the code: $blah=2002-05-02; $thedate = date(D, M d, Y, strtotime($blah)); $echo $thedate; Why is $thedate resolving to Wed, Dec 31, 1969. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] date wierdness

2002-05-03 Thread ROBERT MCPEAK
On PHP3 where $row[art_date] == 2002-05-03, $thedate resolves to Thurs, May 2, 2002 YESTERDAYS DATE! See for yourself, if you wish, here: http://www.endvaw.org/current.php3 What gives. $row = mysql_fetch_array($result); $blah = eregi_replace(-, /, $row[art_date]); $thedate = date(D, M d,

[PHP] newbie: dynamically building associative arrays

2002-05-15 Thread ROBERT MCPEAK
I'm trying to build what I think is an associative array from a set of mySQL results. It looks like this: //First, a mySQL results loop for a select statement return unique occurrences of data in the field term: for ($i=0; $i $num_results; $i++) { $row = mysql_fetch_array($result); echo

[PHP] php/mysql join query help

2002-05-23 Thread ROBERT MCPEAK
I have a table with a field key containing a unique value. I have a second table containing a field called keys containg a pipe-delimited list of values from the key table. I'd like to do a query that took each value from key, and matched it agains the field keys in the second table, and

RE: [PHP] Leading zeroes

2002-05-23 Thread ROBERT MCPEAK
I'm a newbie, but maybe this'll do it: if ($str!='0') { $str = ltrim($str, '0') } Liam Gibbs [EMAIL PROTECTED] 05/23/02 01:49PM From version 4.1.0, $str = ltrim($str, '0') This works excellently. Thanks. One problem that I didn't think of, though: If the number is 0 (only 0), then the

Re: [PHP] php/mysql join query help

2002-05-23 Thread ROBERT MCPEAK
... - Original Message - From: ROBERT MCPEAK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 23, 2002 1:22 PM Subject: [PHP] php/mysql join query help I have a table with a field key containing a unique value. I have a second table containing a field called keys containg

[PHP] variables not behaving as expected

2002-08-19 Thread ROBERT MCPEAK
We've recently upgraded to PHP version 4.2.2 running on SuSE 7.2 with the 2.4.4 kernel and I'm seeing variables behave in a way I didn't expect. With the prior configuration http post variables were freely available on the receiving page, but now, for some reason, they aren't. This code:

[PHP] flaking out on foreach

2002-08-27 Thread ROBERT MCPEAK
Why is this code: ?php $bob=array(1,2,3,5,6); foreach($bob as $foo); { echo $fooBR; } ? Rendering only 6.

[PHP] resizing an image

2002-08-29 Thread ROBERT MCPEAK
Could someone show me some php that proportionally resizes an image? I'm collecting user sumbitted images and need them all to be within certain size constraints. What's the simplest, best way to do this? Sample code would be a huge help, as I'm a newbie and have not done anything with PHP

Re: [PHP] resizing an image

2002-08-29 Thread ROBERT MCPEAK
Sheesh, I will. Thanks. Robert Cummings [EMAIL PROTECTED] 08/29/02 09:47AM ROBERT MCPEAK wrote: Could someone show me some php that proportionally resizes an image? I'm collecting user sumbitted images and need them all to be within certain size constraints. What's the simplest, best

[PHP] php mysql error

2002-09-04 Thread ROBERT MCPEAK
Our box recently went down and after reconfiguring it we're left with a semi-operation mySQL. One error I'm getting is this: mysql select region from clip_art where region is not null and released = 'yes' group by region; ERROR 1: Can't create/write to file '/tmp/#sqld0e_76_1.MYI' (Errcode: 13)

[PHP] random array sort

2002-09-10 Thread ROBERT MCPEAK
Could someone show me a quick and simple way to randomly sort array elements? I can't seem to pinpoint the correct parameters in the docs. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] random array sort -- array() selection quant??

2002-09-10 Thread ROBERT MCPEAK
); $input = $the_exploded_ids; $rand_keys = array_rand ($the_exploded_ids, 2); $this_key=$input[$rand_keys[0]]; $this_key=trim($this_key); ROBERT MCPEAK [EMAIL PROTECTED] 09/10/02 10:22AM Could someone show me a quick and simple way to randomly sort array elements? I can't seem to pinpoint

[PHP] replacing literal in string

2002-09-25 Thread ROBERT MCPEAK
Could somebody help me with the correct syntax for an ereg_replace to replace literal occurences of the quote character in a string. I can't seem to get it right. In other words, I have a form input variable -- that literally may look like this: some_value, and I want it to literally look like

[PHP] replacing literal in string

2002-09-25 Thread ROBERT MCPEAK
Could somebody help me with the correct syntax for an ereg_replace to replace literal occurences of the quote character in a string. I can't seem to get it right. In other words, I have a form input variable -- that literally may look like this: some_value, and I want it to literally look like

[PHP] php mysql fulltext search min word length = 3

2002-09-27 Thread ROBERT MCPEAK
Much to my dismay, I've learned that the mySQL minimum indexable/searchable word length is 3 characters. This is a real problem for me. Anybody know a workaround, or how to tweak mySQL to allow for matches of words 3 chars or less. From the online mysql docs

[PHP] timing out a for loop, fopen

2003-01-15 Thread ROBERT MCPEAK
Dear PHP Gurus: I'm looking for a way to timeout an fopen function. I'm doing some link checking inside of a for loop and some links hang rather than return a definitive can't connect or can connect. (Pardon the highly technical jargon there...) In cases where my link hangs, I'd like to

[PHP] preg_replace: literal / in pattern string

2003-06-03 Thread ROBERT MCPEAK
Search through the docs/archive and can't figure this one out. Surely I'm overlooking something obvious. I can't figure out how to escape a literal / in $q. Adding the line: $q=str_replace(/, \/, $q); yields a literal \/ in $content. $q_upper=strtoupper($q); $q_lower=strtolower($q);

Re: [PHP] Dynamic value lookups

2003-06-03 Thread ROBERT MCPEAK
I agree that you will probably have to build all possible select value arrays on pageload if you want the select list to switch without a page reload. PHP is parsed by the webserver and then sent to the page. Javascript is parsed by the browser. You can use PHP to dynamically generate

[PHP] randomly select file

2002-11-04 Thread ROBERT MCPEAK
Could someone suggest some php for randomly selecting a file from a directory and then displaying the contents of the file? Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] randomly select file

2002-11-05 Thread ROBERT MCPEAK
Thanks guys gals, for clueing me in. rija [EMAIL PROTECTED] 11/04/02 05:31PM Why don't you cope with opendir / readdir () and array_rand () I tried it and I look ok- But, I wonder if there are noble another way to do it? - Original Message - From: ROBERT MCPEAK [EMAIL PROTECTED

[PHP] session cache limiter

2002-11-05 Thread ROBERT MCPEAK
Could somebody shed some light on this error message I'm getting. Could you point me at the appropriate docs or clue me in somehow. PHP Warning: Cannot send session cache limiter - headers already sent (output started at /usr/local/httpd/htdocs/mmc/results.php:79) in

[PHP] publishing php mysql website on cd-rom

2002-11-06 Thread ROBERT MCPEAK
My organization has a need to publish some of our web content on a CD-ROM. I'm in search of suggestions on how to publish our dynamic content (php/mysql templates) in some sort of runtime configuration that would let users browse the site from cd. What's involved with this? Is there such a

Re: [PHP] publishing php mysql website on cd-rom

2002-11-06 Thread ROBERT MCPEAK
[EMAIL PROTECTED] 11/06/02 12:10PM Theoretically it is possible, but fact stays - you won't ever make it work well. So, try to find an alternative for this. Usually, this choice is made by the managers that know nothing about how webcontent works. -- Maxim Maletsky [EMAIL PROTECTED] ROBERT

[PHP] dynamic variable headache

2002-11-08 Thread ROBERT MCPEAK
My newbie brain is maxed out on this, and I'm sure one of you more experience guys can quickly straighten me out. I've got a variable: $_mmdd = a_date_value; Later, I've got four variables; $foo= _; $bar=; $bleh=mm; $doh=dd; I want to stick these variables together on the fly to get

[PHP] newbie: help with date arithmetic

2002-11-12 Thread ROBERT MCPEAK
I'm trying to add/subract two dates. I think I need to use mktime() but I can't quite figure out how. I'd like to do something like this: (2002-11-15)-(2002-11-10)=5 or (2002-12-10)-(2002-11-10)=20 Obviously taking into account number of days in a given month. Does somebody have some code

RE: [PHP] newbie: help with date arithmetic[Scanned]

2002-11-12 Thread ROBERT MCPEAK
Message- From: ROBERT MCPEAK [mailto:RMCPEAK;jhuccp.org] Sent: 12 November 2002 15:31 To: [EMAIL PROTECTED] Subject: [PHP] newbie: help with date arithmetic[Scanned] I'm trying to add/subract two dates. I think I need to use mktime() but I can't quite figure out how. I'd like to do something

[PHP] interpreting variables containing in another variable

2002-11-20 Thread ROBERT MCPEAK
I've got a variable - $email_body, that contain's other variables. For example, echo $email_body, might look like this: $name, $address, $phone, $blah I want those variables to interpreted with corresponding values set earlier in the script. So, in effect, where name=bob, address=101 east

Re: [PHP] interpreting variables containing in anothervariable

2002-11-20 Thread ROBERT MCPEAK
Duh!!! Thanks! Being a newbie hurts sometimes. Chris Shiflett [EMAIL PROTECTED] 11/20/02 01:50PM --- ROBERT MCPEAK [EMAIL PROTECTED] wrote: I've got a variable - $email_body, that contain's other variables. For example, echo $email_body, might look like this: $name, $address, $phone

[PHP] spawing new PHP process

2002-11-26 Thread ROBERT MCPEAK
I'm interested in spawing a new PHP process -- if that's the correct terminology. The situation is that I've got a very slow loading page, where, for example, I'm using PHP to send, say, 1000 emails. The user clicks submit, and, although PHP is firing out the emails, it appears to the user

Re: [PHP] spawing new PHP process

2002-11-26 Thread ROBERT MCPEAK
mail and have your MTA deliver them out of band. man sendmail -Rasmus On Tue, 26 Nov 2002, ROBERT MCPEAK wrote: I'm interested in spawing a new PHP process -- if that's the correct terminology. The situation is that I've got a very slow loading page, where, for example, I'm using PHP to send

[PHP] $_POST var name char conversion . to _

2003-12-10 Thread ROBERT MCPEAK
Has anybody seen the seemingly automatic and unexplained conversion of the character . to _ in $_POST var names? I've tested several ways, with and without PHP, and I've dug around in the HTML specs and can't find a good explanation. Can anybody shed some light on this? Can this be

RE: [PHP] $_POST var name char conversion . to _

2003-12-10 Thread ROBERT MCPEAK
Thanks all. I guessed that it was something built in to PHP, although I was surprised when I couldn't find a good explanation in the usually excellent docs. -Bob Mc Ford, Mike [LSS] [EMAIL PROTECTED] 12/10/03 11:29AM On 10 December 2003 16:19, ROBERT MCPEAK contributed

Re: [PHP] ARRAY

2003-12-10 Thread ROBERT MCPEAK
Because it's and array! print and echo take strings, not arrays, I believe. Anyway, print_r() or a foreach loop will do it for you. ?php print_r($table); //or foreach ($table as $atable){ echo $tableBr; } ? Something like that. Brian Sutton [EMAIL PROTECTED] 12/10/03 01:26PM I am trying

[PHP] php .htaccess autologin

2003-12-11 Thread ROBERT MCPEAK
I've dug around quite a bit and can't figure out how I might use PHP to handle an .htaccess login. For example, if I wanted a script to log in the user, rather than the user logging in with the standard .htaccess dialog. Any ideas? Since the .htaccess vars are stored in the browser, should I