[PHP] MS Word text pasted into forms

2001-12-20 Thread jimtronic
Occasionally, I have a problem dealing with some of the special characters from text authored in MS Word, and then pasted into a web form. It seems that somewhere something bad happens and what eventually gets put into mysql via php is not correct. In particular, I have trouble with

Re: [PHP] HTML Email

2001-12-18 Thread jimtronic
It looks fine to me. The only difference is that I use Content-Transfer-Encoding: quoted-printable, which shouldn't make much of a difference here. A very small misplacement of a newline character or even a space can cause things not to work correctly. Your best course of debugging is to send

Re: [PHP] Arrays/Hashes

2001-12-18 Thread jimtronic
I've noticed this, too. There are at least two things you can do to make them work... print(Some text {$myhash['mykey']}BR\n) or print(Some text .$myhash['mykey'].BR\n) jim Hey there, sortta simple question... Is it just me or can't you access hashes within strings? This works...

Re: [PHP] Working with designers...

2001-12-18 Thread jimtronic
I try to seperate the php code from the html as much as possible. So, if a page is dynamic, have php figure out the dynamic parts first, put them into variables such as $html, or $pull_down_menu, or whatever. Then all that needs to replaced in the html is that section. HTML coders aren't

Re: [PHP] multicolumn table

2001-12-17 Thread jimtronic
Try something like this... $my_array = array( A=array(1,2,3),B=array(1,2,3),C=array(1,2,3)); $num_columns = 3; echo table; foreach($my_array as $key=$value) { echo trtd$key/td; for($i=1;$i=$num_columns;$i++) { echo td.$value[$i-1]./td; }

Re: [PHP] How deep can I go with embedded if s.

2001-12-17 Thread jimtronic
Well, I just made a test program that nested 1000 if() statements and it worked. Just make sure you close all your curly brackets correctly. IMHO, a large number of nested if else elseif statements indicate poor programming design. Sometimes they are necessary, but usually can be simplified

Re: [PHP] Passing Variables

2001-12-14 Thread jimtronic
Try this in your form ... input type=hidden name=login value=$login/ Can someone tell me how to pass a variable in the url? I am using a form and calling a handler file as its action, as in: FORM NAME=update_list ACTION=handler.php?login=$login METHOD=POST I've also tried single quotes

Re: [PHP] substr trim functions..

2001-12-14 Thread jimtronic
There are no shortage of ways to do this. // Using explode() ... echo array_pop(explode( ,$full_name)); // Using split() ... echo array_pop(split( ,$full_name)); // Using stristr() while($haystack = stristr($haystack, )) { $haystack = substr($haystack,1); $last_word =

[PHP] How to test the load

2001-12-14 Thread jimtronic
Hi, This may be more of webserver question, but what methods are used to test the load on a php script or a family of scripts. I'm guessing that apache (or equiv) would have a problem before PHP under a heavy amount of traffic, right? -- Jim Musil - Multimedia Programmer Nettmedia

Re: [PHP] How to test the load

2001-12-14 Thread jimtronic
Yes, load time, but in general just to see how much traffic a server/script/db can handle and what performance is like. Is this to test load time? To see under what load the script finially craps out, or the server? --- jimtronic [EMAIL PROTECTED] wrote: Hi, This may be more

[PHP] Foreign Language Translation

2001-12-13 Thread jimtronic
I've seen developers use php to translate data into other languages. Has anyone here done this? Ideally, I'd like to be able to write or employ a function like this ... translate($data,english,french); Obviously accuracy will be rough, but are there add on modules that can do this? --

Re: [PHP] Sending out mass mail without having timeout problems ..

2001-12-13 Thread jimtronic
Wouldn't it be easier (better) to create a sendmail alias include file that has all the addresses in it and let sendmail or majordomo or qmail or whatever handle it? I'm not knocking your method as much as I'm looking for the pros and cons of the different methods. jim the way I handle

Re: [PHP] Arrays...

2001-12-12 Thread jimtronic
http://php.net/array Try $data = mysql_fetch_assoc($series) This will produce an associative array with column names attached to values for one row of data from your database. jim Hi, im trying to fill a chart with some data. I am using a mysql query: $query = SELECT serie_tot, COUNT(*)

Re: [PHP] Help creating an image repository/library.

2001-12-11 Thread jimtronic
Presumably, each item in the catalog has a unique id of some sort in the database. When you upload the images, you can rename the image file to image_(unique_id).jpg. Then when you load a page, you can reference the item next to the image. This is only one way to do it, of course. You could

Re: [PHP] Help creating an image repository/library.

2001-12-11 Thread jimtronic
You can also open a socket and put the files up via ftp. I use this method frequently when I cannot move the uploaded files. use the fopen(ftp://user:[EMAIL PROTECTED]/path/to/images,w;) command to place the files. This doesn't work so well if the file already exists, so you have to delete

Re: [PHP] Checking Checkboxes using Arrays

2001-12-06 Thread jimtronic
I'm sorry, your message doesn't make sense... First you say that you want to do what the script is doing, and then you say you don't want it to do that. i want to select the countries (check their checkboxes) if they are equal to a particular country variable I have set or if they appear in an

RE: [PHP] parse error when requiring

2001-12-06 Thread jimtronic
You forgot the semicolon (;) after session_start() This works fine, but now i made the files sessionstart.php and bottom.php sessionstart.php -- ? session_start() if ($SessieEIA-Login == 1) { ? bottom.php -- ? } else {

Re: [PHP] Checking Checkboxes using Arrays

2001-12-06 Thread jimtronic
When you perform the test you want to know if the $id is the user's choice and if the user's choice is in the array. Your code reads differently. You are checking to see if $id is the user's choice OR $id is in the array. which would always check the countries in the array.

Re: [PHP] Equivalent of the Basic function SELECT...CASE

2001-12-06 Thread jimtronic
switch {} will do it. http://www.php.net/manual/en/control-structures.switch.php Could anyone tell me if there is a PHP equivalent to: SELECT x CASE 1 to 5 {...} CASE ELSE {...} END SELECT Muchos gracias. Robin -- PHP General Mailing List (http://www.php.net/)

RE: [PHP] Creating multidimensional array dynamically

2001-12-06 Thread jimtronic
you could also do this ... $data = mysql_fetch_assoc($res); //this is a nice function because it returns an associative array. so // if you change your SQL db, you wouldn't need to change your php code // as much.

[PHP] move_uploaded_file on NT Server

2001-12-06 Thread jimtronic
Hi, I've been having a problem moving uploaded files recently. I have a script in directory /foo/bar and it has no trouble moving a file into /foo/rex but it can't move a file into /foo/zip This is strange because I created all the folders and the scripts, so presumably they would

Re: [PHP] Strange problem with some includes...

2001-12-06 Thread jimtronic
It looks like you put a full URL into your include ... which would be incorrect. The syntax is ... include(path/relative/to/your/script); jim -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List

Re: [PHP] Forms and Results with PHP

2001-12-06 Thread jimtronic
It's good practice to check that needed variables were passed at the top of the page. if($name) { normal display exit } else { error display exit } To take this further, you should verify that not only was the required data sent, but that it was in the