Re: [PHP] decimal places

2002-11-26 Thread Kevin Stone
Try.. printf("%.2f", $amount); -Kevin - Original Message - From: "Bryan Koschmann - GKT" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Tuesday, November 26, 2002 12:29 PM Subject: [PHP] decimal places > Hello, > > Does anyone here have a good way to make sure dollar amo

Re: [PHP] IE Problems: disappearing text with 'Back' button

2002-11-26 Thread Kevin Stone
> ''){print "value='{$_SESSION['rfname']}'';}> > > but I just get a ? in the value field, not the name. Yeah there's a good reason for that. You're not ending yoiur PHP tag! :-P Joking aside you're on the right track. This IS the way to do it. You should never rely on the browsers cache to r

Fw: [PHP] formating numbers & date

2002-12-03 Thread Kevin Stone
To change the number of decimal places look into the number_format() function. To change the date/time structure the date() function will do what you need. Search for both on www.php.net -Kevin - Original Message - From: "Jeff Bluemel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tu

Re: [PHP] "x" as a multiplier

2002-12-03 Thread Kevin Stone
Is it possible you're mistaken somehow? x isn't an operator in PHP. Executing $a x $b will give you a parse error. Anything in quotes is automatically casted as a string. -Kevin - Original Message - From: "John Meyer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 03

Re: [PHP] "x" as a multiplier

2002-12-03 Thread Kevin Stone
-- > From: Adam Williams [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 03, 2002 3:48 PM > To: Kevin Stone > Cc: John Meyer; [EMAIL PROTECTED] > Subject: Re: [PHP] "x" as a multiplier > > > I don't think he's trying to multiply, I think he wants

Re: [PHP] Looping Addition

2002-12-05 Thread Kevin Stone
You simply need the absolute value of the difference. So taking Stephen's example below.. $total = 0; foreach( $_POST['nums'] as $number ) { $total -= $number;// if users inputs 5 as first value result equals -5 $total = abs($total); // result now equals 5 } - Original Message -

Re: [PHP] Forms

2002-12-10 Thread Kevin Stone
This HTML is invalid. Is it the same way in your script? Mary Do instead. Mary -Kevin - Original Message - From: "Beauford.2002" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, December 11, 2002 2:36 PM Subject: [PHP] Forms > Hi, > > I'm sending th

Re: [PHP] PHP and MySQL

2002-12-11 Thread Kevin Stone
Numerous syntax errors produce your invalid query... 1) If you use double quotes to enclose the string, "INSERT..., then you do not have to delimit your single quotes. 2) You accidently delimit a variable at VALUES ('\$select 3) The SQL command its self does not need to end with a semi-colon. Fix

Fw: [PHP] problems with jsp & php

2002-12-11 Thread Kevin Stone
I may be wrong about this becuase I don't program JSP but if the values in $_GET are strings then you may need to encase them in quotes. var action = ""; -Kevin - Original Message - From: "Jeff Bluemel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 11, 2002 3:22

[PHP] JSRS/PHP Calendar Script

2002-12-11 Thread Kevin Stone
ide-tracked. So if someone has already developed such a script I'd be very interested. Much thanks, Kevin Stone [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php4 / sessions

2002-12-13 Thread Kevin Stone
The variable must exist before you can register it in the session.. $client_filter = 'filter'; session_register('client_filter'); ..or simply.. $_SESSION['client_filter'] = 'filter'; -Kevin - Original Message - From: "Kevin Porter" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Frid

Re: [PHP] FTP Listings for HTML page

2002-12-13 Thread Kevin Stone
Yes it is doable. see. open_dir(); @ www.php.net You can also find a number of premade scripts on HotScripts.com or one of the class stores. Do a search on Google. -Kevin - Original Message - From: "Randum Ian" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 13, 2002

Fw: [PHP] Question about "if" statement evaluating (0=="string") as TRUE

2002-12-13 Thread Kevin Stone
When you define $no, you define it without quotes, so PHP assumes it is a numeral. What you're asking in your conditional statement is: Does the numeral 0 equal the integer evaluation of "string". The answer is True. But when you put $no into quotes you cast it as a string. Now what you're ask

Fw: [PHP] Difference between 2 Dates

2002-12-13 Thread Kevin Stone
Oh dear. In what format are you storing the date in your database? If you can convert what you have into UNIX EPOCH then you can simply subtract your date against mktime(); then echo the result through getdate() and be done with it in three lines of code. -Kevin - Original Message - From

Re: [PHP] Difference between 2 Dates

2002-12-13 Thread Kevin Stone
Again the solution is to convert the dates into timestamps for easy comparison. In your case you can use the strtotime() function. I believe that -mm-dd is a standard date format that the function will recognize, is it not? $ts1 = strtotime($date1); $ts2 = strtotime($date2); if ($ts1 > $ts2)

[PHP] PHP Auto-Responder

2002-12-16 Thread Kevin Stone
I need a solution to activate a PHP script when somebody sends an email to a specified account. I've looked into procmail and sork and find that I am in way over my head. I know my way around PHP well enough but I'm more than a little dense when it comes to Unix commands. I wouldn't even know ho

Re: [PHP] Variables - Help

2002-12-16 Thread Kevin Stone
Difficult to tell exactly what your problem is but to disassociate a varaible name to its place in memory you use, unset($varname); -Kevin - Original Message - From: "Beauford.2002" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Tuesday, December 17, 2002 1:29 PM Subject:

Re: [PHP] PHP Auto-Responder

2002-12-16 Thread Kevin Stone
- Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 16, 2002 3:16 PM Subject: Re: [PHP] PHP Auto-Responder > On Tuesday 17 December 2002 04:16, Kevin Stone wrote: > > I need a solution to activate a PH

[PHP] Re: PHP Auto-Responder

2002-12-17 Thread Kevin Stone
Good suggestions. Thank you very much. -Kevin - Original Message - From: "Joel Boonstra" <[EMAIL PROTECTED]> To: "Kevin Stone" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, December 17, 2002 6:41 AM Subject: Re: PHP Auto-Responder &g

Re: [PHP] nested if in a for statement

2002-12-17 Thread Kevin Stone
Prepare the rubber glove... Chang this // $i <= count($userVars) To this // $i < count($userVars); Arrays start at index 0, not 1. -Kevin - Original Message - From: "James Brennan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 17, 2002 2:03 PM Subject: [PHP] neste

Re: [PHP] nested if in a for statement

2002-12-17 Thread Kevin Stone
Oops sorry didn't mean to add to the spam. LOL -Kevin - Original Message - From: "Kevin Stone" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 17, 2002 2:24 PM Subject: Re: [PHP] nested if in a for statement > Prepare the rubber

Re: [PHP] old getenv?

2002-12-18 Thread Kevin Stone
The only way to get at HTTP_REFERER is either through getenv(), $HTTP_SERVER_VARS, or $_SERVER. There is no other way around it. But since the methods are universial there shouldn't be any harm in just using the Find/Replace command in your editor. I found one (rather odd) reference that suggest

Re: [PHP] directory list function?

2002-12-27 Thread Kevin Stone
There is no builtin function to do this in one step but it's not in anyway difficult.. http://www.php.net/manual/en/function.opendir.php -Kevin - Original Message - From: "Dade Register" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 27, 2002 1:34 PM Subject: [PHP] dir

Re: [PHP] PHP complied code

2003-01-02 Thread Kevin Stone
Actually all PHP4 code is compiled before it is executed. What the author of that book suggests is pre-compiling a script. The difference between a standard script and a pre-compiled script is the time it takes to parse the code. You might pre-compile scripts that are going to see heavy use on y

Re: [PHP] Session Question

2003-01-03 Thread Kevin Stone
In most cases, Yes. Calling session_start() for the first time sets a cookie on the client's computer containing the session id. At the same time the function creates a matching session file on the server. You register whatever variables you want to this file so that when you call session_start

Re: [PHP] Variables that persist through reload?

2003-01-03 Thread Kevin Stone
That's just the browser's cache, nothing to do with PHP. Not all browsers will cache succesfully. If you want to guarentee that variables will be stored for later retrieval (or for repopulating a form) then you need to use sessions or store the content of the variables in a database. -Kevin --

Re: [PHP] Variables that persist through reload?

2003-01-03 Thread Kevin Stone
Woops.. sorry I missed the crux of your post. I didn't read all the way down. :) -Kevin - Original Message - From: "Kevin Stone" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "David Chamberlin" <[EMAIL PROTECTED]> Sent: Friday, January 03, 200

Re: [PHP] One more form question

2003-01-03 Thread Kevin Stone
- Original Message - From: "David Chamberlin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 03, 2003 1:27 PM Subject: [PHP] One more form question > OK, last one was answered quickly and successfully (thank you!), so > here's another one. > > Is there an easy way to se

Fw: [PHP] Get your *own* IP...?!

2003-01-06 Thread Kevin Stone
In Apache it's $_SERVER['SERVER_ADDR'] But I don't know if this applies to IIS as well. -Kevin - Original Message - From: "Charles likes PHP" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 06, 2003 1:45 PM Subject: [PHP] Get your *own* IP...?! > Does anyone know a wa

Re: [PHP] How can I redirect to another php page

2003-01-08 Thread Kevin Stone
http://groups.google.com/groups?num=30&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&; q=url+redirect+php -Kevin - Original Message - From: "Teo Petralia" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 08, 2003 1:46 PM Subject: [PHP] How can I redirect to another php page >

Fw: [PHP] strange problem (user poll)

2003-01-08 Thread Kevin Stone
[EMAIL PROTECTED] It would help to know where $action is being defined. - Original Message - From: "- [ Paul Ferrie ] -" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 08, 2003 3:43 PM Subject: [PHP] strange problem (user poll) > Can anyone see a problem in this?

Re: [PHP] strange problem (user poll)

2003-01-08 Thread Kevin Stone
I have no idea what I did but this email was not supposed to go to the list.. my apologies. *LOL* -Kevin - Original Message - From: "Kevin Stone" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 08, 2003 4:18 PM Subject: Fw: [PHP] stra

Re: [PHP] building web album - design questions

2003-01-09 Thread Kevin Stone
- Original Message - From: "Anders Thoresson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 09, 2003 1:20 PM Subject: [PHP] building web album - design questions > Hi, > > I'm planning to build a web album for my digital photographs, and have > some questions rega

Fw: [PHP] Security in included PHP files

2003-01-15 Thread Kevin Stone
Most web accounts have at least one or two directory levels behind the public directory. Simply place the files behind the public directory and call them into your main script from there. Absolutely no reason those files need to be publically accessible. -Kevin - Original Message - From

Fw: [PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Kevin Stone
You can never fully rely on any information given to you by the browser. You can't rely it being accurate or even being there at all. What I suggest to you is code a solution around the IP address. The IP address of course, like any information coming from the client, can be tampered with but mor

Re: Fw: [PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Kevin Stone
- From: "Chris Shiflett" <[EMAIL PROTECTED]> To: "Kevin Stone" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 15, 2003 2:37 PM Subject: Re: Fw: [PHP] HTTP_REFERER work without a problem > --- Kevin Stone <[EMAIL PROTECTED]> wrot

Fw: [PHP] Re: Question about using session and "logging out"

2003-01-17 Thread Kevin Stone
Don, The only method that I have discovered to protect the login against the back-button is to validate the session at the top of each and every protected page. Forgive the psuedo code.. When the back button is pressed it goes through this process, sees that there is no active session, goes to

Re: [PHP] Finding out if a table exists

2003-01-21 Thread Kevin Stone
Okay what the hell I'm bored anyway... function mysql_table_exists($table) { global $db; // <- database resource handle $result = @mysql_list_tables($db); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_row($result)) { if (strtolower($row[0

Fw: [PHP] doing auto number myself to a primary key...

2003-01-31 Thread Kevin Stone
In MySQL you use MAX() to retrieve the maximum value from a column. `SELECT MAX(id) as id FROM divxtemp` -Kevin - Original Message - From: "Mr. BuNgL3" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 31, 2003 2:31 PM Subject: [PHP] doing auto number myself to a primary

Fw: [PHP] move a record into a different table

2003-01-31 Thread Kevin Stone
Sorry but as convenient as PHP and MySQL are there are some things you just have to code for yourself. In order to move data from one table to another you will have to: 1) SELECT the desired fields from the first table 2) extract() them from the results pointer 3) INSERT them into the second tabl

Re: [PHP] Help Needed

2003-01-31 Thread Kevin Stone
Pervasive login methods such as the one you've devised are the best way to have a password protected region on your website. However it will only work on pages that are parsed by PHP. In order to protect plain text or HTML files they will have to be stored outside of your public directory and eit

Re: [PHP] tracking bulk email

2003-02-03 Thread Kevin Stone
- Original Message - From: "Lowell Allen" <[EMAIL PROTECTED]> To: "PHP" <[EMAIL PROTECTED]> Sent: Monday, February 03, 2003 10:37 AM Subject: [PHP] tracking bulk email > I've added an email feature to a content management system that will send > plain text email to about 1400 contact addr

Fw: [PHP] authentication

2003-02-03 Thread Kevin Stone
The question is too broad to answer in one post. Suffice to say Yes you can do all of this if you have the know-how. Recommend you continue your research with some basics on PHP.net and a good tutorial-style book such as "PHP and MySQL Web Development". There is tons of information online as we

Re: [PHP] Sessions

2003-02-03 Thread Kevin Stone
It is all here: http://www.php.net/manual/en/ref.session.php -Kevin - Original Message - From: "Mike Tuller" <[EMAIL PROTECTED]> To: "php mailing list list" <[EMAIL PROTECTED]> Sent: Monday, February 03, 2003 11:06 AM Subject: [PHP] Sessions > In an earlier post I wanted to carry an i

Re: [PHP] array of unknown elements and insert query

2003-02-03 Thread Kevin Stone
Something like.. $query = "INSERT INTO tablename (fieldname) VALUES"; foreach ($_POST['listbox'] as $key => $val) { $values[] = "('$val')"; } $query .= implode(',', $values); $result = mysql_query($query); This is assuming all your listbox values go into the same table column. -Kevin -

Fw: [PHP] Can I see when a file was created?

2003-02-04 Thread Kevin Stone
Hmm... I seem to recall reading that Unix does not store the file creation date and this is the reason that PHP does not have such a function. The only option is to store that information in a database when you create the file on the server. -Kevin - Original Message - From: "Øystein Håla

Re: [PHP] testing if a query was successful

2003-02-04 Thread Kevin Stone
As quoted from the manual: "A non-FALSE return value means that the query was legal and could be executed by the server. It does not indicate anything about the number of rows affected or returned. It is perfectly possible for a query to succeed but affect no rows or return no rows." Always test

Re: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Kevin Stone
FYI, I replied to a similar problem just a few threads down. Next time please consider searching before you post. You'll find you can answer your own question 9 out of 10 times. $result = mysql_query("UPDATE or INSERT or DELETE... ") or die("Invalid query: " . mysql_error()); if (mysql_affected_

Re: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Kevin Stone
FYI unlike the other mysql result functions mysql_affected_rows() works on the last query *only* and does not accept a results pointer as input. So this will result in an error... $result = mysql_query("UPDATE.. whatever"); $affected_rows = mysql_affected_rows($result); //<== invalid identifier

Re: [PHP] empty variables from a form

2003-02-05 Thread Kevin Stone
Next time please consider searching on PHP.net or Google before you post. This is an exceedingly basic question and there is an extraordinary amount of information already out there.. if(empty($_POST['ac2'])) { echo "Area Code is a required field."; } -Kevin - Original Message - From

Re: [PHP] empty variables from a form

2003-02-05 Thread Kevin Stone
FYI, isset() will return true for an empty variable. You use isset() only when you expect there to be no variable. But for a hard coded HTML form the variable will *always* be set (except in the case of check boxes) even if thas no value. So your only options are to use empty() or test the strin

Re: Re: [PHP] empty variables from a form

2003-02-05 Thread Kevin Stone
Okay enough of this. Please show us some code. :-) -Kevin - Original Message - From: "Sunfire" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 05, 2003 2:10 PM Subject: Re: Re: [PHP] empty variables from a form > empty doesnt work either... it still comes up as t

Fw: [PHP] Read file and get what i want

2003-02-06 Thread Kevin Stone
You basically have two options. 1) You can use readfile() to open the file into an array then $line = explode(':', $file) in a for loop to split the values from each line. search for 'readfile' and 'explode' on php.net 2) You can fopen() the file and use $data = fgetcsv($fp, 1000, ':') then your

Re: [PHP] Reading input stream of incoming request

2003-02-06 Thread Kevin Stone
All data sent through a POST request is stored in the $_POST array. $_POST['myvar']; -Kevin - Original Message - From: "Reuben D. Budiardja" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 06, 2003 1:27 PM Subject: [PHP] Reading input stream of incoming request >

Re: [PHP] if(!empty()) statement

2003-02-06 Thread Kevin Stone
Before I say a word I'd just like to inform you that these are the types of questions better left to books and tutorials rather than live help. That being said, ELSE does not need to follow IF. Code the condition you want to capture and perform your error message on that. // Enter if member not

Re: [PHP] Dynamic input fields in Form

2003-02-07 Thread Kevin Stone
Based on your description it could litterally be coded one of a hundred different ways. The way I would code a small problem like this is in a monolithic logical construct such as the if/else statement below. This allows you to be a little bit more careless how you construct the page. Another con

Fw: [PHP] Avoiding several windows with the same session

2003-02-07 Thread Kevin Stone
That's interesting.. the session id should be different for each instance of the browser. The only exception I can think of is the MacOS since it runs multiple windows within the same instance of the application. This assumption is untested of course. Maybe it would help for you to explain why y

Re: [PHP] delete query doesnt work

2003-02-07 Thread Kevin Stone
You have a syntax error. Look at your quotes. -Kevin - Original Message - From: "Sunfire" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 07, 2003 3:05 PM Subject: [PHP] delete query doesnt work > i have a delete query: > mysql_query("delete from members where compan

Re: [PHP] delete query doesnt work

2003-02-07 Thread Kevin Stone
Then you just answered your own question. -Kevin - Original Message - From: "Sunfire" <[EMAIL PROTECTED]> To: "Kevin Stone" <[EMAIL PROTECTED]> Sent: Friday, February 07, 2003 3:37 PM Subject: Re: [PHP] delete query doesnt work > ok so i mistyped it th

Re: [PHP] delete query doesnt work

2003-02-07 Thread Kevin Stone
In fact does not require the closing tag. will be ignored. Make sure you have Registered Globals ON. Or change $delete to $_POST['delete']; -Kevin - Original Message - From: "Sunfire" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 07, 2003 4:16 PM Subject: Re: [PHP]

Re: [PHP] numerics

2003-02-10 Thread Kevin Stone
Check out: is_numeric() http://www.php.net/manual/en/function.is-numeric.php -Kevin - Original Message - From: "Edward Peloke" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 10, 2003 11:27 AM Subject: [PHP] numerics > IS there a way to only allow the user to type in

Re: [PHP] numerics

2003-02-10 Thread Kevin Stone
I'm sorry I misunderstood. As previously stated PHP is server-side only, you need a client-side solution. Search for Javascript validate numeric. - Kevin - Original Message - From: "Kevin Stone" <[EMAIL PROTECTED]> To: "Edward Peloke" <[EMAIL PRO

Fw: [PHP] MySQL for storing PHP code

2003-02-10 Thread Kevin Stone
Check out eval(); http://www.php.net/manual/en/function.eval.php - Kevin - Original Message - From: "Daniel Page" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 10, 2003 2:21 PM Subject: [PHP] MySQL for storing PHP code > Hi, > > Would it be possible to store PHP cod

Fw: [PHP] passing a query string to a popup window problems

2003-02-11 Thread Kevin Stone
What does that string look like when it is outputed? You're asking us to assume that $formuser and $formpassword are there in the first place. - Kevin - Original Message - From: "Brad Esclavon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 11, 2003 1:09 PM Subject: [

Fw: [PHP] calculating kilobytes

2003-02-14 Thread Kevin Stone
Joe, you might try something like this instead of a slow PHP function. I based it off of a user example on the PHP site. This is tested and I use it often for various purposes. I think it may be ideal for you becuase it is extremely fast. Requires Linux though I'm certain there's an equivilant

Re: [PHP] function problem

2003-02-14 Thread Kevin Stone
Exactly where does $option_block get put into $string? -Kevin - Original Message - From: "Peter Gumbrell" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Friday, February 14, 2003 4:11 PM Subject: [PHP] function problem > I have a function below which populates a select l

Re: [PHP] Multisorting an array

2003-02-17 Thread Kevin Stone
- Original Message - From: "Joachim Krebs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 17, 2003 8:25 AM Subject: [PHP] Multisorting an array > I have an array with the following structure: > > Array > ( > [0] => Array > ( > [name] => images >

Re: [PHP] Text data truncated after first blank character in form fields

2003-02-17 Thread Kevin Stone
It's your HTML Failing to enclose the value in quotes may lead to truncation. Your output looks like this... You should always quote every parmeter in the tag just to avoid such problems. This should work.. - Kevin - Original Message - From: "Michael Eacott" <[EMAIL PROTECTED]> To:

Re: [PHP] Text data truncated after first blank character in form fields

2003-02-17 Thread Kevin Stone
Hmm. Don't know what to tell ya. It works on my computer. Have you tried pressing CTRL+F5 to flush your browser cache? - Kevin - Original Message - From: "rentAweek support" <[EMAIL PROTECTED]> To: "Kevin Stone" <[EMAIL PROTECTED]> Cc: "Mi

Re: [PHP] invalid path when a page calls itself again

2003-02-19 Thread Kevin Stone
I don't know for sure but I believe commands like (../) may not work in the require() or include() functions. Just code the exact path from the home directory and you should be good to go.. require("/var/www/html/system/index.php"); By the way I'd think twice about the way in which you're authen

Re: [PHP] File Trouble

2003-02-24 Thread Kevin Stone
file() creates the array based on 'new line' characters (\n). If no line breaks are present then it will create an array with one element and that element will be entire file. What exactly does this list.txt file look like? - Kevin - Original Message - From: "Pushpinder Singh Garcha" <

Re: [PHP] Switch Question

2003-02-24 Thread Kevin Stone
To do this you would use multiple nested case statments and break only after the last case statement. You cannot use conditionals within a case statement but this has the effect of an OR condition... switch($color) { case "black": case 1: return ImageColorAllocate($image,0,0,0); b

Re: [PHP] Still having File trouble

2003-02-24 Thread Kevin Stone
My only remaining thought is that if the file looks like it has line breaks when you open it then it must have line breaks of some kind. You could experiment with \r and \n\r by reading the file into a variable and then explode("\n\r",$file) to see if that creates the array for you. Other than th

Re: [PHP] Auto Incrementing a Variable name?

2003-02-25 Thread Kevin Stone
Variable variables allows you to define a variable name from a string. http://www.php.net/manual/en/language.variables.variable.php - Kevin - Original Message - From: "Jeff Pauls" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 25, 2003 2:18 PM Subject: [PHP] Auto Inc

Re: [PHP] restating plea for help with sort

2003-02-27 Thread Kevin Stone
Hmm well upon first glance looks like all you need to do is loop that array and start a new array within the loop. An If/Else construct checks If the value is "n/a" then append to the back of the new array Else prepend to the front of the new array.You append the values manually or use array_p

Re: [PHP] restating plea for help with sort

2003-02-27 Thread Kevin Stone
lues and one for non-"n/a" values. After the values are sorted to their separate arrays do asort($nonnavals); then concatonate the two arrays together using array_merge(), putting the "n/a" array second. - Kevin ----- Original Message - From: "Kevin Stone&quo

Re: [PHP] Distance Calculator

2003-02-28 Thread Kevin Stone
Eh well I've never built a distance calculator but I have used a Census data file for various other things. The text file is comma delimited. The schema is as follows.. Field 1 - State Fips Code Field 2 - 5-digit Zipcode Field 3 - State Abbreviation Field 4 - Zipcode Name Field 5 - Longitude in

Fw: [PHP] Post method

2003-02-28 Thread Kevin Stone
You can use an open socket connection to send/recieve data to and from a remote host however this method is less-than-ideal for the browser interface. So probably the best way would be to use a hidden HTML form and javascript. The onLoad="" command executes a function that submits the form whi

Fw: [PHP] Run db query with db query?

2003-03-03 Thread Kevin Stone
You don't have to use the same variable name to store the second results pointer. $resulta = mysql_query(); whle ($row = mysql_fetch_row($resulta)) { $resultb = mysql_query(); while ($row = mysql_fetch_row($resultb)) { } } - Kevin - Original Message - From: "CF High" <[

Re: [PHP] working with file and mail

2003-03-03 Thread Kevin Stone
Impossible. The list() = split() construct will initialize any variables that do not contain values so it cannot possibly be a security risk. User 100 cannot possibly see user 99's email address unless user 99's email address is on line 100. If you want to be absolutely certain then initialize y

Fw: [PHP] Re: Scroll through values sent from a form

2003-03-04 Thread Kevin Stone
Invalid syntax. Replace '->' with '=>'. Also building arrays and using implode() is an alternative method to building the string.. foreach($_POST as $key => $val) { $fields[] = $key; $values[] = $val; } $fields = implode(', ', $fields); // collapse to string $values = implode(', ', $val

Re: [PHP] syntax error

2003-03-04 Thread Kevin Stone
Where is $line coming from? The function won't output what you don't input. Other than that I don't see anything wrong. - Kevin - Original Message - From: "John Taylor-Johnston" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 04, 2003 4:33 PM Subject: [PHP] syntax error

Re: [PHP] Re: Date Question.

2003-03-05 Thread Kevin Stone
He's recommending something like this.. $tmp = explode(' ', $date); if (date("Y-m-d") == $tmp[0]) // date format -mm-dd { echo "Today"; } Seems like a reasonable solution to me. Read the manual if you need more information.. http://www.php.net/manual/en/function.explode.php http://www.p

Re: [PHP] File Access Rights

2003-03-05 Thread Kevin Stone
chmod($file, 0600); This sets the file to Owner read and write, Group nothing, Public nothing. If you're on a shared server then chances are this function has been disabled so you may have to FTP or SSH into your account and set the permissions for the file manually using the chmod command. Good

Re: [PHP] fopen

2003-03-05 Thread Kevin Stone
Please take another look at the manual page on fopen(). You're not using it correctly. fopen() does not return the contents of the file, it retuns a resource handel. You pass the handel as a parameter to fread() in order to read the file. http://www.php.net/manual/en/function.fread.php If all y

Re: [PHP] adding a comma between a list of file names

2003-03-05 Thread Kevin Stone
The simplest way would be to build an array of filenames then implode the array. $handle = opendir($emaildir); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $emailes[] =substr($file,0,strpos($file,'.')); } } closedir($handle); $emailes = implode(',',

Fw: [PHP] Pages refresh on submission on RedHat Server - POST problem

2003-03-06 Thread Kevin Stone
You wouldn't by chance be using $PHP_SELF as the action field of the form? - Kevin - Original Message - From: "Arijit Chaudhuri" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 06, 2003 10:56 AM Subject: [PHP] Pages refresh on submission on RedHat Server - POST problem

Re: [PHP] reading last -n lines array is emty

2003-03-06 Thread Kevin Stone
You could do it reading back to front the way you propose but I think it will work much better in a proper for loop. // the number of elements in the array. $num_lines = count($file); // the line we want to start the loop at. if ($num_lines > 10) $start_line = $num_lines - 10; else $start

Re: [PHP] reading last -n lines array is emty

2003-03-06 Thread Kevin Stone
Kevin - Original Message - From: "WebDev" <[EMAIL PROTECTED]> To: "Kevin Stone" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, March 06, 2003 4:33 PM Subject: Re: [PHP] reading last -n lines array is emty > still empty > >

Re: [PHP] reading last -n lines array is emty

2003-03-06 Thread Kevin Stone
Sorry that should be $file[$i] not $line[$i]. I failed to see your other mistake. Just trust me on the '|' thing. - Kevin - Original Message - From: "WebDev" <[EMAIL PROTECTED]> To: "Kevin Stone" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Se

Re: [PHP] reading last -n lines array is emty

2003-03-06 Thread Kevin Stone
Holy crap looks like I was wrong! I just tested it and sure enough '|' does return an error.. how do you like that. So use split("\|", $file[$i]). - Kevin - Original Message - From: "Kevin Stone" <[EMAIL PROTECTED]> To: "WebDev" <[EMAI

Re: [PHP] reading last -n lines array is emty

2003-03-06 Thread Kevin Stone
- Original Message - From: "1LT John W. Holmes" <[EMAIL PROTECTED]> To: "Kevin Stone" <[EMAIL PROTECTED]>; "WebDev" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, March 06, 2003 2:06 PM Subject: Re: [PHP] reading last -n line

Re: [PHP] retrieve last n records

2003-03-06 Thread Kevin Stone
- Original Message - From: "drparker" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 06, 2003 2:42 PM Subject: [PHP] retrieve last n records > I need to retrieve the last n records of a table, n will probably be 2 > or 3. I know that I can accomplish this by: select *

Re: [PHP] Displaying few words from record in mySQL

2003-03-07 Thread Kevin Stone
- Original Message - From: "Rahul.Brenda" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 07, 2003 11:22 AM Subject: [PHP] Displaying few words from record in mySQL > Glory & Supreme Power > > What i'm looking to do is.. i want to display only the > first few words of the

Re: [PHP] Min and max of array

2003-03-07 Thread Kevin Stone
- Original Message - From: "Liam Gibbs" <[EMAIL PROTECTED]> To: "php list" <[EMAIL PROTECTED]> Sent: Friday, March 07, 2003 12:07 PM Subject: [PHP] Min and max of array Is there a way to find the minimum and maximum values of an array? min() and max() don't take arrays.

Re: [PHP] Min and max of array

2003-03-07 Thread Kevin Stone
- Original Message - From: "Liam Gibbs" <[EMAIL PROTECTED]> To: "php list" <[EMAIL PROTECTED]> Sent: Friday, March 07, 2003 12:24 PM Subject: Re: [PHP] Min and max of array > >you can sort it and get the values. > > I would, but I need the array in the same order. I can't sort it. > > >

Re: [PHP] HTTP_REFERER security implications?

2003-03-10 Thread Kevin Stone
- Original Message - From: "Tom Woody" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 9:53 AM Subject: [PHP] HTTP_REFERER security implications? > I am working on a simple authentication script, where the user submits a > login and password, the credentials are c

Fw: [PHP] Multi-select inputs and naming

2003-03-10 Thread Kevin Stone
- Original Message - From: "Dan Phiffer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 11:24 AM Subject: [PHP] Multi-select inputs and naming > Hello, > > Am I correct in my understanding that for a multi-select input, PHP requires > that the name attribute end

[PHP] Reg Ex to search for both Integer and Comma-spaced Integer

2003-07-01 Thread Kevin Stone
I'm a little confused by something. I need to build a reg-ex to scrape for both plain integers and comma spaced integers in the same place in the same string at the same time. For example.. $string = "Mark's average score was 544."; preg_match("/average score was ([0-9]+)/", $string, $matches);

Re: [PHP] Reg Ex to search for both Integer and Comma-spaced Integer

2003-07-01 Thread Kevin Stone
- Original Message - From: "Ford, Mike [LSS]" <[EMAIL PROTECTED]> To: "'Kevin Stone'" <[EMAIL PROTECTED]>; "PHP-General" <[EMAIL PROTECTED]> Sent: Tuesday, July 01, 2003 12:19 PM Subject: RE: [PHP] Reg Ex to search for both In

  1   2   3   4   5   6   >