Re: [PHP] session timeout

2003-11-13 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] How do I set the session timeout - eg someone leaves a broweser for say half an hour then have to log in again.. As I'm on an intranet I want to increase ro 3 hours Pete, Change the default configuration of the option session.cookie_lifetime in the php.ini This

Re: [PHP] msession - giving me a hard time

2003-11-13 Thread CPT John W. Holmes
From: Guillaume Dupuis [EMAIL PROTECTED] Now, I am testing the interaction of 2+ servers working together. From SERVERA I create and echo the my SID using echo session_start(); echo session_id();echo $SID;, and then I follow a link (within the same browser session) to SERVERB and then do the

Re: [PHP] Why would this eregi() function not work?

2003-11-13 Thread John W. Holmes
Dave G wrote: PHP Gurus, I have an eregi() function that I'm using to validate emails that users enter into a form. I pretty much took it directly from the book PHP and MySQL Web Development. It looks like this: (!eregi('[EMAIL PROTECTED]', $email) 1. Special characters within brackets do

Re: [PHP] testing a variable

2003-11-12 Thread CPT John W. Holmes
From: Adam Williams [EMAIL PROTECTED] I need to test a variable to see if it contains a value or not, and if not, do something. [snip] if ( !isset($var ) { echo do something;} That's the correct way. What I am doing is checking a field in an sql table, and if the field is null, empty,

Re: [PHP] overriding string concatenation '.'

2003-11-12 Thread CPT John W. Holmes
From: tirumal b [EMAIL PROTECTED] I have an ip addr in a variable. I use 'ssh'.$ipaddr.'command' in a php file The dots in ipaddr variable are considered to be string concatenations. No they are not. Show some examples. ---John Holmes... -- PHP General Mailing List

Re: [PHP] overriding string concatenation '.'

2003-11-12 Thread CPT John W. Holmes
From: Chris W. Parker [EMAIL PROTECTED] CPT John W. Holmes mailto:[EMAIL PROTECTED] The dots in ipaddr variable are considered to be string concatenations. No they are not. Show some examples. What am I missing here? How is the dot operator not considered concatenation

Re: [PHP] Why is this code not working?

2003-11-12 Thread CPT John W. Holmes
From: Dave G [EMAIL PROTECTED] PHP Gurus, If you say so... I'm trying to put the results of a query into an array. My code looks like this: ?php $query = SELECT datecolumn FROM table WHERE MONTH(datecolumn) = . $currentMonth; $result = mysql_query($query); $numRows =

Re: [PHP] Getting an uploaded picture

2003-11-12 Thread CPT John W. Holmes
From: Mike R [EMAIL PROTECTED] I thought about that, but figured I'd ask first - particularly since I wasn't sure which code to send: the code for uploading the pictures or the code that displays the pictures/links to them? Show the code that displays the links to them and some of the

[PHP] Re: Need a nicer way to escape single/double quotes....

2003-11-12 Thread CPT John W. Holmes
Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... I haven't found a more efficient way to better escape the quote characters for the javascript right from PHP because I only get The kid in the javascript alert message, so I'm wondering if anyone of you know of

Re: [PHP] validate names with regex

2003-11-12 Thread CPT John W. Holmes
From: Chris W. Parker [EMAIL PROTECTED] Can someone post a function or regex that can validate names (first and last)? The most important bit is that names like O'Malley and Hope-Jones are not barred. I use this: //allow a possible ', -, or space in name. ' will //be replaced

Re: [PHP] Changing case

2003-11-12 Thread CPT John W. Holmes
From: Robert Sossomon [EMAIL PROTECTED] I have a form that allows for an item to be entered, the other pieces have been fixed so far that were bogging me down, but now I am looking for a way to convert any entry in the form to be UPPER case so that when the quote is listed, they are

Re: [PHP] keyword searching

2003-11-12 Thread CPT John W. Holmes
From: Adam Williams [EMAIL PROTECTED] I'm using Informix SQL. Could have saved some bandwidth by mentioning that in the first place and only posting to either php-general or php-db (which is more appropriate), not both. :) Ignore what my other posts said, as I don't know how Informix works.

Re: [PHP] validate names with regex

2003-11-12 Thread John W. Holmes
Chris W. Parker wrote: CPT John W. Holmes mailto:[EMAIL PROTECTED] on Wednesday, November 12, 2003 2:09 PM said: $match = ^[a-z]+([- ]{1}|(\\\'))?[a-z]+$; along with eregi(), but it can (should) be easily adapted to a syntax compatible with preg_match(). I'm wondering two things: 1

Re: [PHP] help create community newbie guide to security

2003-11-11 Thread John W. Holmes
Lawrence Kennon wrote: For a BBS I would like to let users post links to various resources. They 'post' a message to the BBS via a form and that is stored in a MySQL db, then the content of their 'post' is available to other users on the BBS. Currently I strip out all PHP/HTML with the

Re: [PHP] Unique ID

2003-11-11 Thread John W. Holmes
Marek Kilimajer wrote: Dimitri Marshall wrote: I'm making a message board and I've decided the best way to go about the structure is to have 3 tables, two of them will be Posts and Replys. Now, in order for this ti work, each post has to have a UniqueID - same with the replys. Looking at another

Re: [PHP] Time problem

2003-11-11 Thread John W. Holmes
Erin wrote: Hi All, Sorry if this has been asked a 1000 times and if its easy to find in the php manual but i cant seam to solve this. How do i convert a timestamp in to a normal readable time date ie 2003155023 into 11th November 2003 @ 15:50:23 IFF the timestamp is coming from MySQL

Re: [PHP] Solutions for 1970 epoch date restriction

2003-11-09 Thread John W. Holmes
YC Nyon wrote: I have a table that includes 3 columns for day, month and year. Example: Day, Month, Year 11,Jan, 1974 4,Sep, 1921 ... ... I need to construct a query where users can specify a starting date. Currently, I stuck in mktime function became of the 1970 epoch problem. It gives an error

Re: [PHP] How can i run DOS command from browser

2003-11-07 Thread John W. Holmes
imran wrote: Any one know that how can me run a script from command line after receving the input from FORM thru browser Assuming your talking about running a program on the server, take a look at exec(). If you're wanting to run something on the user's computer, ummm, no. -- ---John

Re: [PHP] Cross Site Scripting (and SQL Injection)

2003-11-07 Thread John W. Holmes
Shaun wrote: Is there a way to filter metacharacters from all $_POST values sent from pages on my site in an effort to eliminate the majority of XSS attacks? There's no magic function that's going to protect you from Cross Site Scripting or SQL Injection. Do you honestly even know what they are

Re: [PHP] Re: High bandwidth application tips

2003-11-07 Thread CPT John W. Holmes
From: Richard Baskett [EMAIL PROTECTED] * use recent mysql 4.x The new versions have ability to cache results of often used queries, and return the results very fast without even touching the disk. Note that this is much better for web apps than usual query cacheing that many databases

Re: [PHP] Adding a log file

2003-11-07 Thread John W. Holmes
Erik Osterman wrote: Consider using this // // STDERR logging function // function warn( $msg, $die = 0 ) { $fp = fopen(php://stderr, 'w') or die(Failed to open STDERR); fwrite($fp, [.strftime(%Y-%m-%d %T).] $msg\n) or die(Failed to write to stderr); fclose($fp);

Re: [PHP] Re: Input Validation of $_SESSION values

2003-11-06 Thread CPT John W. Holmes
From: Boyan Nedkov [EMAIL PROTECTED] [snip] ... Short of any severe bugs in PHP's core, there is no way for a user of your Web application to modify session data ... [/snip] It seems that statement is not completely correct considering the topic discussed in the paper 'Session Fixation

Re: [PHP] File creation date.

2003-11-06 Thread CPT John W. Holmes
From: Carles Xavier Munyoz Baldó [EMAIL PROTECTED] I want to write a PHP function for delete the files in a directory older than 1800 seconds. Is there any function for it ? Start here: http://us2.php.net/manual/en/ref.filesystem.php ---John Holmes... -- PHP General Mailing List

Re: [PHP] File creation date.

2003-11-06 Thread CPT John W. Holmes
From: Carles Xavier Munyoz Baldó [EMAIL PROTECTED] I want to write a PHP function for delete the files in a directory older than 1800 seconds. Is there any function for it ? Read this thread, too: http://www.phparch.com/mailinglists/msg.php?a=701737s=Mike+Migurski+findsp=1 If you can get

Re: [PHP] MySQL Password Function

2003-11-06 Thread CPT John W. Holmes
From: Raditha Dissanayake [EMAIL PROTECTED] From: Shaun I am trying to make my site more secure, can anyone suggest a tutorial on using the mySQL password function with PHP. I can't find anything through google... it's very simple intead of using insert into users set userPassword='123';

Re: [PHP] High bandwidth application tips

2003-11-06 Thread CPT John W. Holmes
From: Luis Lebron [EMAIL PROTECTED] Excellent tips. I think I'm really going to have to polish my sql skills for this task. Any good tools for benchmarking sql queries? If you've been following the Load Stress Tool thead, this program: http://jakarta.apache.org/jmeter/index.html was mentioned.

Re: [PHP] MySQL Password Function

2003-11-06 Thread CPT John W. Holmes
From: Raditha Dissanayake [EMAIL PROTECTED] Oh, and this will do almost NOTHING to make your site more secure. Why do you think it will? You are partly right about this we had a nice flame war about this very issue couple of weeks ago on the jabber lists. Anyone interested in the nitty

Re: [PHP] preg_replace ^M

2003-11-06 Thread CPT John W. Holmes
From: Torsten Rosenberger [EMAIL PROTECTED] i try to replace a string in a file but if i have linefeeds in the string the output file after the replacement has ^M carachters in in Some text editors will display \r as ^M. So, if you're file uses \r\n as the newline, you'll see these ^M at the

Re: [PHP] preg_replace ^M

2003-11-06 Thread CPT John W. Holmes
From: Torsten Rosenberger [EMAIL PROTECTED] Those are \r characters from dos newline (\r\n). Generally they are not harmful and many editors can work with them without problems (vim). You can use some utility commands to convert to or from dos or unix newlines. But i'm working under

Re: [PHP] Send data Header Response

2003-11-06 Thread CPT John W. Holmes
From: Jonathan Villa [EMAIL PROTECTED] I would like submit a form to a page, do some processing on that page, then if need be, return to the referrer but also send the submitted data along with it... and data is coming from a POST form, not a GET. I tried

Re: [PHP] restricting text fill on a text area

2003-11-06 Thread CPT John W. Holmes
From: Ian Truelsen [EMAIL PROTECTED] I want to set up a sized div on my page and be able to fill it with text from a text file. Easy enough, but I want to be able to 'sense' when the text area fills, no matter what size text the browser has set. Client side issue, not PHP. Ask on a Javascript

Re: [PHP] To format a number

2003-11-06 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] I have a number for example 5 and I would it transform in 5,00. I tried with round() but it doesn't add the numbers after comma with an interger number. Does some funtion that make this exist? You mean some function that'll format a number? Hmmm... number_format()

Re: [PHP] Replacing text on page, but not in img tags

2003-11-06 Thread John W. Holmes
Taylor York wrote: Lets say im trying to replace every occurance of 'hello' with 'bhi/b'. Here's something that's probably close to what you want. Something else you need to worry about besides img tags is what if the word hello appears in a a tag? within Javascript? This will match anything

Re: [PHP] Printing from PHP

2003-11-06 Thread John W. Holmes
Peter Goggin wrote: Is it possible to have a php a script that will run on my server but let me print to my client network printer? No. PHP is server side, printing is client side. If php will not support access to a client printer is there any way of embedding a Form Feed in the display so

Re: [PHP] Issues with Mysql 4.0 and PHP in a production environment

2003-11-06 Thread CPT John W. Holmes
From: Luis Lebron [EMAIL PROTECTED] Are there any issues with running PHP 4.3.X and Mysql 4.0 in a production environment? Of course there is. If you write crappy code, your program will suffer. If you don't write crappy code, well, then you're fine. ---John Holmes... -- PHP General Mailing

Re: [PHP] [Stats] PHP Net List: October 2003

2003-11-05 Thread John W. Holmes
John Nichel wrote: Hey, I beat John Holmes You mean you're bigger than 14 inc... err, nevermind, you're talking about something else... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com --

Re: [PHP] Changing the php.ini file

2003-11-05 Thread John W. Holmes
Mike At Spy wrote: I changed a value for max uploads in my php.ini file (linux box); I restarted apache, then the whole server, to get the new value to come up and, generally, take affect. Neither of those things did it. Does anyone know what I need to do to get the ini file re-read by the OS,

Re: [PHP] [Stats] PHP Net List: October 2003

2003-11-05 Thread John W. Holmes
Jay Blanchard wrote: Aren't you dead? And have a movie? Yes and Yes. Val Kilmer asked if he could play me and I gave him the go ahead... and, umm, PHP rocks. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals

Re: [PHP] Sessions within new windows

2003-11-05 Thread John W. Holmes
Donald Tyler wrote: What's happening is that when the new window pops up, the script isn't getting the session info properly. I changed it so that the page opens up in the main window instead of a new one and it works fine. I presume this is because the browser is not sending the session ID to

Re: [PHP] Changing the php.ini file

2003-11-05 Thread John W. Holmes
Marek Kilimajer wrote: post_max_size is another setting that has effect on uploads. It should be higher than upload_max_filesize. Make sure it isn't Apache doing the limiting, also. Some searching will tell you the setting, but Apache has a limit itself on the size of files it'll accept. --

Re: [PHP] replace special chars

2003-11-05 Thread John W. Holmes
Victor Spng Arthursson wrote: Are there any good function to replace special characters, for example double qoutes, with something that are more html-safe? If only the PHP gods would bless us with a function such as htmlspecialchars() or maybe even htmlentities()... what a great world it would

Re: [PHP] Shared SessionIDs?

2003-11-05 Thread CPT John W. Holmes
From: Chris W. Parker [EMAIL PROTECTED] But seriously, why is it such a bad idea? I'd like to finally figure this out so I don't keep coming up with them (not that I've ever used any). ;) I've got to remember back to what the original thread was about... :) The suggestion, iirc, was to pass

Re: [PHP] anyway to return more than one value?

2003-11-05 Thread John W. Holmes
Chris W. Parker wrote: Ok I know it's not possible to return more than one value. But I'm going to explain what I'd like to do so maybe there's an easy way to do it. I've got some functions that query a database and turn the result into an array and return that array. What I'd like to do is not

Re: [PHP] FTP_DELETE!

2003-11-05 Thread John W. Holmes
Dimitri Marshall wrote: Just wondering what to put for the resource ftp_stream in the following: ftp_delete ( resource ftp_stream, string path) the result of ftp_connect(). -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP

Re: [PHP] the function of the @ symbol?

2003-11-05 Thread John W. Holmes
Wouter van Vliet wrote: What would it suppress, the notice: undefined variable $first on line 44 notification? Exactly. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List

Re: [PHP] Re: Input Validation of $_SESSION values

2003-11-05 Thread John W. Holmes
Pablo Gosse wrote: As to your last point, can something else change the session vars other than my php scripts, answers to that question are exactly what I'm looking for. Other PHP scripts on the same server (doesn't have to be same domain) and most anything that can access the filesystem could

Re: [PHP] FTP_DELETE!

2003-11-05 Thread John W. Holmes
Dimitri Marshall wrote: Don't know what that is because I don't connect to FTP. The files upload fine, but I just want to know how to delete them. Is the result of ftp_connect() the $host in mysql_connect? If you're talking about deleting files on the same filesystem as your PHP scripts, then

Re: [PHP] php|cruise - do unto others...

2003-11-05 Thread CPT John W. Holmes
From: Becoming Digital [EMAIL PROTECTED] php|cruise is coming this March. Final word on this, I promise! :) I'll be on the cruise, so I'm looking forward to meeting anyone else that'll be there. Contact me offline if you want. I wanted to say think you to all of those that contributed to the

Re: [PHP] help with EVAL direct

2003-11-04 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] OS RedHat 9 and RedHat 7.2 Apache 1.3.27 and Apache 2 I have problem with direct eval, in version PHP4.2.2 is all OK in version PHP 4.3.3 - direct eval bad here cut code $s = '$ret = ibase_execute($this-query, $arg_list[0], $arg_list[1], $arg_list[2],

Re: [PHP] Stripping Decimals

2003-11-04 Thread CPT John W. Holmes
From: Ed Curtis [EMAIL PROTECTED] I currently use number_format() and str_replace() to remove a , or $ if entered and reformat it as a price for an item. I've asked the user not to use decimals but some still do. How do I remove a decimal and anything after from a number in a varable?

Re: [PHP] split ...

2003-11-04 Thread CPT John W. Holmes
From: Dan Joseph [EMAIL PROTECTED] I'm getting the following error: [Tue Nov 4 10:01:53 2003] [error] PHP Warning: split() [a href='http://www.php.net/function.split'function.split/a]: REG_EMPTY in /usr/local/apache/htdocs-chm/import_data.php on line 26 Here is the code in question:

Re: [PHP] Sweet PHP backup / dump function for MySQL database

2003-11-04 Thread CPT John W. Holmes
From: René Fournier [EMAIL PROTECTED] Right now, I'm using phpMyAdmin to periodically backup/dump a client MySQL database to a textfile (from which one can simply restore the database if it ever got corrupted). I'm also working on a super-simple CMS for the client to use themselves. I would

Re: [PHP] Shared SessionIDs?

2003-11-04 Thread John W. Holmes
Chris W. Parker wrote: Guillaume Dupuis mailto:[EMAIL PROTECTED] We currently have 3 php servers. Can we use the same SessionID to connect across the 3 systems? If not, what would you suggest to minimize the number of login prompts, while keeping secure? Here's an idea (whether or not it's a

Re: [PHP] How do i replace table names?

2003-11-03 Thread John W. Holmes
Bas wrote: I want to replace something like this: $sql = CREATE TABLE bas_table ( ); With this: CREATE TABLE hugo_table ( ); And do the same for INSERT INTO... How do i do this? If you know that bas_ will not appear within your data, then a simple str_replace() will do. $new_data =

Re: [PHP] Dates then 1970

2003-11-03 Thread John W. Holmes
Mark McCulligh wrote: What function(s) would you use if you want to take someone's birth day and format it on display. I have always used strtotime, then strftime but it doesn't work if someone was born in 1939. strtotime returns -1. What function would you use to take the input string 1939/11/23

Re: [PHP] mysql_field_type() ...

2003-11-03 Thread John W. Holmes
Jay Blanchard wrote: [snip] ...will say if a field is of type ENUM, but not its possible values (including default). Does anyone know how I can fetch possible values of a field type of ENUM? [/snip] You would have to use DESCRIBE. So if Even better is DESC table_name column_name; so you only

Re: [PHP] passing an array via GET and a hidden form element

2003-11-02 Thread John W. Holmes
Robb Kerr wrote: I'm trying to pass a variable from a search page to the results page via GET. The $MANUFACTURERS variable contains an array and is obtained from the URL. I've tried the following to no avail... input name=manufacturer[] type=hidden multiple id=manufacturer[] value=?php

Re: [PHP] scalar value as array problem

2003-11-02 Thread John W. Holmes
Steve Turner wrote: I have a frustrating problem. I have a shopping cart class that creates session variable arrays to store the product_id and quantity. My development machine is running windows 2000 with PHP 4.3.3 and my script is working perfectly on my machine. When I upload to the remote

Re: [PHP] stat(), file_exists(), is_file() on Windows2000

2003-10-30 Thread CPT John W. Holmes
From: Chris Hubbard [EMAIL PROTECTED] The problem: all the code I've tried to test whether a temp (from a form post) is there before doing a filesize() on it is failing. I'm doing a filesize check so absurdly large files aren't copied from the temp folder to a permanent folder. (and no I

Re: [PHP] session_regenerate_id()

2003-10-29 Thread CPT John W. Holmes
From: Alexander Mueller [EMAIL PROTECTED] I am not entirely sure what the following paragraph at http://at2.php.net/manual/en/function.session-regenerate-id.php shall mean As of PHP 4.3.3, if session cookies are enabled, use of session_regenerate_id() will also submit a new session cookie

Re: [PHP] Performance of dynamically generated select boxes

2003-10-29 Thread CPT John W. Holmes
From: Luis Lebron [EMAIL PROTECTED] I am rebuilding a php application to handle a higher load. The previous programmer had created a series of dynamically generated select boxes using a mysql table. Would it be faster or less resource intensive to create a series of arrays to generate the

Re: [PHP] session_regenerate_id()

2003-10-29 Thread CPT John W. Holmes
From: Alexander Mueller [EMAIL PROTECTED] Cpt John W. Holmes wrote: PHP 4.3.2 created a new session ID, but it didn't resend the cookie. So the next request would include the old session ID again from the cookie. I wonder what it is then good for. Changing the id internally without

Re: [PHP] Problems with remote include

2003-10-29 Thread CPT John W. Holmes
From: Pablo Zorzoli [EMAIL PROTECTED] ?php include ('http://blabla.com/script.php?var1=a'); ? [snip] script.php should echo some text, but i don't get any output. You know you're going to get the OUTPUT of script.php, right? You'll get the same exact result as if you typed the address into

Re: [PHP] function question

2003-10-29 Thread CPT John W. Holmes
From: Brian V Bonini [EMAIL PROTECTED] function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page') { Am I wrong in assuming that $count_key is being explicitly set to '*' in this instance? Only if no value is passed when the function is called.

Re: [PHP] Undefined Index - is this how you declare get post?

2003-10-29 Thread John W. Holmes
Terence wrote: Since I started using error_reporting(E_ALL), I havent found (in my opinion) a good way to declare GET and POST variables when getting them from a form or querystring. I have searched google and the docs for several hours now without much luck. ?php error_reporting(E_ALL); // This

Re: [PHP] Menu populated based on previous menu

2003-10-28 Thread CPT John W. Holmes
From: Robb Kerr [EMAIL PROTECTED] Searched all the sites I could find for this problem to no avail. I have two dropdown menus in a form. The first menu contains a list of MANUFACTURERS obtained from a database. The second contains a list of MODELS also obtained from the database. I want the

Re: [PHP] php sessions

2003-10-28 Thread CPT John W. Holmes
From: Chris Shiflett [EMAIL PROTECTED] --- Rob Adams [EMAIL PROTECTED] wrote: Test it yourself. With all due respect, it seems you should be doing the testing. Login to a PHP app using a standard browser and session cookies and see for yourself. I understand the philosophy of the web

Re: [PHP] Variables not passing to mail script

2003-10-28 Thread CPT John W. Holmes
From: Bob Rea [EMAIL PROTECTED] At 03:59 PM 10/27/2003 -0800, Jeff - Harbornet wrote: Disregard last email. I figured it out. Thanks. Care to tell the rest of us? I'm a newby and would like to know. Hmmm, that's obvious, since you can't even spell newbie. ;) ---John Holmes... -- PHP

Re: [PHP] php sessions

2003-10-28 Thread CPT John W. Holmes
From: Chris Shiflett [EMAIL PROTECTED] But I was talking about cookies anyway. Which is where different browsers have different behaviors. In IE, by default, it will not pass a cookie from a new browser window. This is very interesting. I might try to research this a bit more and see what

Re: [PHP] Shortening a String

2003-10-28 Thread John W. Holmes
Jason Williard wrote: I would like to display part of the output of a query. In many cases, the string returned by this query exceeds 200 characters. Is there a way to cut it off after 200 characters? Even better, is there a way to cut it off at the next space after 200 characters? Read this

Re: [PHP] php temp table question (for mysql)

2003-10-27 Thread CPT John W. Holmes
From: Larry Brown [EMAIL PROTECTED] Does anyone know whether the use of persistent connections with php will allow a temp table created by a script to linger around No, the table will still be removed at the end of the script whether you use persistant connections or not. and cause a problem

Re: [PHP] php temp table question (for mysql)

2003-10-27 Thread CPT John W. Holmes
From: CPT John W. Holmes [EMAIL PROTECTED] Temporary tables are unique for that specific question. I mean connection, not question... I'm working on a survey system, so I have questions on my mind. :) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

Re: [PHP] problem with intval and !=

2003-10-23 Thread John W. Holmes
Greg Beaver wrote: http://www.php.net/is_numeric is the function you are looking for. No need for fancy regexps. The OP is looking for an integer, but is_numeric() will return true for float values and also for numbers in scientific notation. So 12.3 and 12E3 will be TRUE. The original

Re: [PHP] is_uploaded_file() security

2003-10-22 Thread CPT John W. Holmes
From: Alexander Mueller [EMAIL PROTECTED] AFAIK the browser only sends the content of the chosen file and cannot specify in any way a local filename which should be worked on. Furthermore PHP creates a temporary file containing the uploaded file content and passes this filename as 'tmp_name'

Re: [PHP] Random Quotes...

2003-10-22 Thread CPT John W. Holmes
From: Payne [EMAIL PROTECTED] I am working on a project and I need to see sample quote for doing random quotes. These quotes will be put from a database. Can some please share me some sample code. Thanks. If you're using MySQL, you can use SELECT quote FROM Quote ORDER BY RAND() LIMIT 1 to

Re: [PHP] is_uploaded_file() security

2003-10-22 Thread CPT John W. Holmes
From: Alexander Mueller [EMAIL PROTECTED] Cpt John W. Holmes wrote: The user can pass the name of a file on the server. If you're not doing any checks and moving or displaying the file the user sent you, you may end up moving, deleting, or displaying any file on your server. ---John

Re: [PHP] Session output question

2003-10-22 Thread CPT John W. Holmes
From: Susan Ator [EMAIL PROTECTED] 1) Is there any way to print out active sessions names? I have $_SESSION['SID'], $_SESSION['uid'], $_SESSION['msg'] can I output the literal strings: $_SESSION['SID'] $_SESSION['uid'] $_SESSION['msg'] $keys = array_keys($_SESSION); 2) Is there any way

Re: [PHP] Email Body

2003-10-22 Thread John W. Holmes
micro brew wrote: I am sending an email using mail() and it works fine. But the formatting of the body of the email is wrong. I want to format part of it in columns sort of like this: Name Quantity Price Can this be done neatly without using an html email? \t is a tab. You can

Re: [PHP] there has to be a better way...

2003-10-22 Thread John W. Holmes
jsWalter wrote: I need to read (write comes later) from a config file that we used to handle manually. I'm getting lazy, so I'm writing a web interface for this. Don't know if someone said this or not, but why not just use parse_ini_file() ? -- ---John Holmes... Amazon Wishlist:

Re: [PHP] Age from birthdate?

2003-10-22 Thread John W. Holmes
DvDmanDT wrote: How would I get the age of someone if I store the birthdate in a date field? I just realized FLOOR((UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(birthdate))/60/60/24/365.25) wont work for persons born before 1970... :p I must get the current age in years, and I must be able to select

Re: [PHP] Launch Print Dialog Box with PHP?

2003-10-21 Thread CPT John W. Holmes
From: [-^-!-%- [EMAIL PROTECTED] If you must answer, to satisfy you own urges, then a simple NO would suffice. The answer is No, then. Try not to take things so personally; I'm not here to get you ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] seems like magic_quotes_gpc is turning itsself on!

2003-10-21 Thread CPT John W. Holmes
From: William Bailey [EMAIL PROTECTED] I have a strange problem with one of the sites i work on and provide support for. I the following block of code that checks to see if magic_quotes_gpc is enabled and if it is it dies with an error message: if((integer)ini_get('magic_quotes_gpc')!=0){ ~

Re: [PHP] The page cannot be displayed error

2003-10-21 Thread CPT John W. Holmes
From: Sudheer Palaparambil [EMAIL PROTECTED] I am calling insert_user.php like this form method=post name=form action=insert_user.php onsubmit=return verifyIt(this); This file and the index.php are kept in the same directory. But the browser returns The page cannot be displayed

Re: [PHP] data type conversion in mysql using php

2003-10-21 Thread CPT John W. Holmes
From: Uma Shankari T. [EMAIL PROTECTED] Is it possible to update the float value of mysql to varchar field by using php ?? mysql_query('ALTER TABLE MyTable CHANGE COLUMN old_column_name new_column_name VARCHAR(25)'); ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Destroying session if not being used from past 10 mins.

2003-10-21 Thread CPT John W. Holmes
From: Binay [EMAIL PROTECTED] How can I configure the session to get destroyed, if not being used from past 10 mins. If you're using the default session handler, the session files are cleaned up after not being used for 1440 seconds (by default), and the session is basically destroyed. You can

Re: [PHP] Destroying session if not being used from past 10 mins.

2003-10-21 Thread CPT John W. Holmes
From: Binay [EMAIL PROTECTED] Is it possible to increase the probability which is by default 1% to 99 % and make sure that session are destroyed after 10 mins by setting session.gc_maxlifetime to 600. I wouldn't recommend that, but you could. The setting to 600 is fine, but I wouldn't adjust

Re: [PHP] (ANNOUNCE) New PHP mailing list *searchable* archives

2003-10-21 Thread CPT John W. Holmes
From: Marco Tabini [EMAIL PROTECTED] This is a fully searchable archive of the PHP mailing lists with an attempt to build proper threading, keyword highlight, automatic quoted text indentation and a few other features. Everyone go check it out. The thread view and highlighting really make the

Re: [PHP] Using cookies

2003-10-21 Thread John W. Holmes
Marco Tabini wrote: Joseph Bannon wrote: I think it's the responsibility of whomever is holding the key (ie, the username and password). When a user logs into my site, I put their username and password in a cookie. I then check those cookies to allow them access to membership only parts of the

Re: [PHP] Using cookies

2003-10-21 Thread John W. Holmes
Marek Kilimajer wrote: John W. Holmes wrote: You're not even allowed to use persistant cookies in public government sites unless you get permission from the Secretary of the Defense. Hi, this is interesting. Can you post the guidelines? Quote: This policy will be clarified to make clear

Re: [PHP] Using cookies

2003-10-21 Thread John W. Holmes
John Nichel wrote: Chris W. Parker wrote: John Nichel mailto:[EMAIL PROTECTED] on Tuesday, October 21, 2003 3:50 PM said: 1. Create a random ID and store it with the users record in the db. 2. If the user chooses to be remembered, stick the random ID into a cookie. 3. When a user hits a

Re: [PHP] Session within a session lock?

2003-10-21 Thread John W. Holmes
Steve Wardell wrote: I have a page on my PHP site that needs to access itself. I open a socket connection and pass in the HTTP request header including a cookie string such as: Cookie: PHPSESSID=766bc531e9185be6b54206c944f258d9 With the session name and id of the user's current session (as I

Re: [PHP] Using cookies

2003-10-21 Thread John W. Holmes
Chris W. Parker wrote: John W. Holmes mailto:[EMAIL PROTECTED] on Tuesday, October 21, 2003 5:30 PM said: Not a good method. If I get on your site and see my cookie has the value 241757219 in it, I just need to subtract one from the number and revisit your site. Now I'm the user who

Re: [PHP] Whats more efficient? ( echo ; or ?php echo ? )

2003-10-21 Thread John W. Holmes
Ryan A wrote: I have an option box on a webpage and have around 10 options on it and have run into a doubt, which is more efficient to do: 1. option value=1?php if($th_order==1){echo SELECTED; } ?Something1/option option value=2?php if($th_order==2){echo SELECTED; } ?Something2/option (or) 2.

Re: [PHP] Whats more efficient? ( echo ; or ?php echo ? )

2003-10-21 Thread John W. Holmes
Chris Shiflett wrote: --- John W. Holmes [EMAIL PROTECTED] wrote: Use a template engine to separate your presentation from your logic. :) Isn't PHP a templating engine? :-) Of course it is, but what's that got to do with separating presentation from logic (business logic)? Each one can be PHP

Re: [PHP] Whats more efficient? (Conclusion)

2003-10-21 Thread John W. Holmes
Ryan A wrote: Just one last question, you guys can reply to this off list or on: does using a templating engine slow down pages a lot (as i have heard) or increase speed (as i have heard again) ? :-D Depends upon your application and the templating engine. Many options either way. In my cases,

Re: [PHP] Data modelling software

2003-10-20 Thread CPT John W. Holmes
From: Hardik Doshi [EMAIL PROTECTED] Can anyone tell me which data modelling software is good for the mysql database? I'm sure you're using PHP to access MySQL, but this question has nothing to do with PHP and should be asked on a MySQL website/list or you should research what Google has to

Re: [PHP] Re: $PHP_SELF

2003-10-20 Thread CPT John W. Holmes
From: Boris Sagadin [EMAIL PROTECTED] I believe the issue is where exactly is $PHP_SELF being used. $PHP_SELF isn't available inside a function, without global'ing it but $_SESSION is available all the time. Yes, but the problem in my case is that it works most of, but not all the time,

Re: [PHP] Print mysql errors

2003-10-20 Thread John W. Holmes
Joseph Bannon wrote: How do you print the error message sent back from MySQL? $resultCC = mysql_query($queryCC) or die(???); ??? = mysql_error() -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com --

Re: [PHP] php|cruise - do unto others...

2003-10-20 Thread John W. Holmes
Becoming Digital wrote: php|cruise is coming this March. I'd like to really thank Edward for the kind words. I'm humbled by the comments everyone makes and very grateful for any donation, large or small, that's made. I just consider myself a regular joe here who really likes answering

Re: [PHP] Launch Print Dialog Box with PHP?

2003-10-20 Thread John W. Holmes
[-^-!-%- wrote: Is is possible to launch the windows print dialog box, with PHP? Perhaps with a specific HEADER() code? I know it's possible to force download with HEADER(), but can you do the same for printing? I'm looking for something that does the same as the windows.print() function in

<    3   4   5   6   7   8   9   10   11   12   >