Re: [PHP] sessions not working when page redirects

2004-08-10 Thread John W. Holmes
From: Angelo Zanetti [EMAIL PROTECTED] Im having a slightly weird problem with my session variables. when on a certain page call it A, I register a session variable and assign it a value. I then test if it is registered successfully and has the correct value on the same page, that works no

Re: [PHP] SQL Functions

2004-08-10 Thread John W. Holmes
From: Dan Joseph [EMAIL PROTECTED] In order to get all of the data back you are going to have to loop through it and return the array so that it will be available for manipulation. Hmm.. I suspected this might be the case. I have modified my functiona bit: function

Re: [PHP] PHP/MySQL based webmail?

2004-08-10 Thread John W. Holmes
From: raditha dissanayake [EMAIL PROTECTED] What has squirrelmail/horde scalability got to do with PHP? Is this the mantra of the PHP list, now? Come on... those are both programs written in PHP and discussing how better one is over the other is perfectly good traffic for this list. I'd be very

Re: [PHP] SQL Functions

2004-08-10 Thread John W. Holmes
From: Dan Joseph [EMAIL PROTECTED] Of course, this begs the question of why you're re-implementing what has been done so many times in the past. http://pear.php.net/package/DB http://pear.php.net/package/MDB http://pear.php.net/package/MDB2 http://adodb.sourceforge.net/

Re: [PHP] PHP5 OOP

2004-08-10 Thread John W. Holmes
From: Joel Kitching [EMAIL PROTECTED] Hello, I'm trying to get the hang of OOP here but can't quite figure out how to relate these classes. I've got one for the main project, one for the database, and one for a user. Somehow I need to get the user access to the database, without cumbersome

Re: [PHP] Cannot redeclare function

2004-08-10 Thread John W. Holmes
From: Alex Hogan [EMAIL PROTECTED] I have a registration page that hasn't changed in several weeks. Today it decided to freak-out by throwing an error; 'Cannot redeclare myfunctionname() on line 10 of myfunctions.inc' Nothing has changed in either the calling page, or the function. The

Re: [PHP] Re: php tools

2004-08-10 Thread John W. Holmes
From: Jay Blanchard Open http://www.google.com in the browser of your choice Type PHP IDE in the little box that appears there. Click on the links of returned results. I clicked on all of the links and nothing happened except for some web pages appearing. Now what? ---John Holmes... -- PHP

Re: [PHP] download script

2004-08-10 Thread John W. Holmes
Aaron Todd [EMAIL PROTECTED] wrote in message $file = /home/dlr/test/.$_GET['file'].; Why would this be a security hole if I do not filter the file name before I use it? http://www.yourdomain.com/yourfile.php?file=../../path/to/any/file/on/machine ---John Holmes... -- PHP General

Re: [PHP] complex array and smarty

2004-08-09 Thread John W. Holmes
From: adwinwijaya [EMAIL PROTECTED] Assume I have array that looks like : Array( 'type'-'Fiction', 'notes'-'Fiction books from a-z', 'list'- Array( 'list'- [0]-array( 'title'-'xzy', 'id'-'1')

Re: [PHP] Working with a new design client

2004-08-09 Thread John W. Holmes
From: charles kline [EMAIL PROTECTED] I have never used Smarty, which I understand might be a big help in these situations. One concern of mine is that I have a tight budget on this project and don't want to spend a lot of time learning a new system unless I have to. Smarty is one solution,

Re: [PHP] How PHP handles multiple inclusions of the same file?

2004-08-09 Thread John W. Holmes
From: Justin Patrin [EMAIL PROTECTED] eval($script); use_cached_code(); Ick! eval() is evil! You have benchmarks to back that up or experience? I did a benchmark between using include(), eval(), smarty, pattemplate, and a few others and include() and eval() are always the fastest. Really

Re: [PHP] Browsers on terminal server

2004-08-05 Thread John W. Holmes
From: Lester Caine [EMAIL PROTECTED] I am using $_SERVER[REMOTE_ADDR] to get address of the browser accessing the system and then using gethostbyaddr() to get the machine name. This worked great until I came to a site using M$ Terminal Server to provide the terminals. We still need to know

Re: [PHP] What does \\0 means?

2004-08-05 Thread John W. Holmes
From: John Nichel [EMAIL PROTECTED] On Thursday 05 August 2004 07:39, Jay offered up the following tid-bit of information : Found the following code in the PHP manual: $text = http://www.somelink.com;; echo(ereg_replace([[:alpha:]]+://[^[:space:]]+[[:alnum:]/], a

Re: [PHP] Passing user entered data to DB

2004-08-05 Thread John W. Holmes
From: Jordi Canals [EMAIL PROTECTED] John Holmes wrote: $uservar = htmlspecialchars(strip_tags($uservar)); You don't need to use strip_tags _and_ htmlspecialchars()... unless you want strip_tags to get rid of such malicious and deadly content such as grin and wow. Just use

Re: [PHP] How pass form variable to window.open()

2004-08-05 Thread John W. Holmes
From: CHAN YICK WAI [EMAIL PROTECTED] in the form, for example, i have input type=text.. name=student ... and input type=button onClick=window.open('url?student=$student', ) It seems to me not working. Define not working because that's how you do it. Well, actually, you need to echo

Re: [PHP] dynamic RAM file for real media

2004-08-05 Thread John W. Holmes
From: Daniel Guerrier [EMAIL PROTECTED] I am using PHP to dynamically create real audio links. The question is I was creating one .ram file for each real media file that I wanted to stream. The .ram files need to have absolute urls (which I do not like). I saw a few sites that use one .ram

Re: [PHP] How pass form variable to window.open()

2004-08-05 Thread John W. Holmes
From: CHAN YICK WAI [EMAIL PROTECTED] How about if this $student is actually a text field, when this html generated by php script, it has no value, so the onClick line is ...url?student=$student without value, when I click, it reads nothing, how should I do? Javascript. ---John Holmes...

Re: [PHP] filling out HTML forms

2004-08-05 Thread John W. Holmes
- Original Message - From: Amanda Hemmerich [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 05, 2004 12:39 PM Subject: [PHP] filling out HTML forms So, we are trying to design an account management page that allows users to manage all of their computer accounts in one

Re: [PHP] Why do I keep getting a 501 mail error?

2004-08-05 Thread John W. Holmes
From: Brian Dunning [EMAIL PROTECTED] Developing on a Windows server to be deployed on Linux. I get SMTP server response: 501 Bad address syntax. Here's my code: $mail_from = 'My Name [EMAIL PROTECTED]'; $mail_server = 'mail.servername.com'; // This is hosted externally ini_set(SMTP,

Re: [PHP] Log transaction for audit

2004-08-05 Thread John W. Holmes
From: CHAN YICK WAI [EMAIL PROTECTED] I'm writing an application that requires log every transactions users done, e.g. update which record, delete which record, something like that. I guess one way is whenever I issue a mysql_query(), I also insert this query in whole into another table

Re: [PHP] filling out HTML forms

2004-08-05 Thread John W. Holmes
From: John Nichel [EMAIL PROTECTED]: You can use cURL or one of the PEAR classes to have your PHP script fill out the form on the remote computer... will take some work, but it's possible. Actually, you could just simulate a POST / GET request to the file that handles the form

Re: [PHP] Log transaction for audit

2004-08-05 Thread John W. Holmes
From: Jason Wong [EMAIL PROTECTED] On Friday 06 August 2004 01:47, John W. Holmes wrote: Sounds like you just need to write a wrapper for mysql_query() that logs what's going on. function my_mysql_query($query) { log_query($query); return mysql_query($query

Re: [PHP] periodic file writing error (fputs)

2004-08-05 Thread John W. Holmes
From: Sarah Gray [EMAIL PROTECTED] Once a sale is completed a record is written to a log file on the server. $filename = $dir. /. $logType._.$today..txt; $fp = fopen($filename, a+); fputs($fp, $logEntryStr); fclose($fp); Consider this: 1. User A completes a transaction. 2. Script A reads

Re: [PHP] Re: POST superglobal is empty

2004-08-04 Thread John W. Holmes
From: Dan Phiffer [EMAIL PROTECTED] Jason Davidson wrote: How about print_r($_REQUEST); That also fails to reflect posted data. $_GET is working as expected. There's nothing in PHP that would not let POST values get through. Are you sure this isn't a web server issue only allowing GET

Re: [PHP] multiple checkboxes

2004-08-03 Thread John W. Holmes
From: Robert Sossomon [EMAIL PROTECTED] You need to do: input type=checkbox name=checkBoxGroup1 value=first/ input type=checkbox name=checkBoxGroup2 value=second/ Keeping the name the same makes them a RADIO button and you will only get the last one. This is a valid solution, but it's

Re: [PHP] pconnect...

2004-08-02 Thread John W. Holmes
From: bruce [EMAIL PROTECTED] since pconnect is not supported in php5, i'm wondering if the issue is that mysql no longer supports the underlying functions to implement pconnect, or if the decision to leave it out was based upon other factors. also, is there anybody i can talk to who has

Re: [PHP] Re: php inventory control software

2004-08-02 Thread John W. Holmes
From: John Nichel [EMAIL PROTECTED] Steve Douville wrote: Take a look at www.oscommerce.com Does oscommerce still require register_globals to be on? http://php.resourceindex.com/Complete_Scripts/Shopping_Carts/ Even if it does, you can't instantly equate that as being a Bad Thing. I'm sure

Re: [PHP] COUNT(*) Output Question

2004-08-02 Thread John W. Holmes
From: Tom Ray [Lists] [EMAIL PROTECTED] $count=mysql_query(SELECT sku, COUNT(*) FROM orders GROUP BY sku); But my question is how do I use PHP to output the COUNT(*) results? When I run the command when I'm logged into mySQL I get the following: I assume you're fetching associative arrays

Re: [PHP] multiple checkboxes

2004-08-02 Thread John W. Holmes
From: Josh Close [EMAIL PROTECTED] Very simple question. When making multiple checkboxes, you put the name the same for a few to group them together form action=process.php method=post input type=checkbox name=checkBoxGroup value=first / input type=checkbox name=checkBoxGruop

Re: [PHP] PHP - mySQL query question

2004-07-25 Thread John W. Holmes
Karl-Heinz Schulz wrote: I have a simple question (not for me). Why does this query does not work? $links_query = mysql_query(select id, inserted, title, information, international from links WHERE international = y; order by inserted desc LIMIT 0 , 30); The information for the

Re: [PHP] Re: PHP editor that doesn't require installation

2004-07-24 Thread John W. Holmes
rush wrote: John W. Holmes [EMAIL PROTECTED] wrote in message Does anyone know of a good windows PHP editor that I can run from a USB flash drive without installing it? scite, from the scintilla fame. TemplateTamer would also work fine if you just copy the whole directory Scite is perfect. You

Re: [PHP] Unexpected T_ENCAPSED...

2004-07-24 Thread John W. Holmes
Philip Olson wrote: And quoting integers is not a problem, I even prefer it. IMHO we should tell people to quote all values so if someone forgets to do any sort of input validation (i.e. make sure it's actually an integer) there won't be a major problem otherwise problems (including SQL

Re: [PHP] Fwd: IMPORTANT: Please Verify Your Message

2004-07-24 Thread John W. Holmes
Jason Wong wrote: On Sunday 25 July 2004 09:42, Mark wrote: [EMAIL PROTECTED], [EMAIL PROTECTED] is currently You've got the culprit here. Either lambast him publically (since he doesn't want to receive your private mail). Or do what this says: The thing is, though, none of these people have

Re: [PHP] log.

2004-07-23 Thread John W. Holmes
Ulitin S.S. wrote: I am learning php. I need to log all actions on my page. (like ip, browser, time, pages etc). question is: how can i identify a user and when he is on my page(s) to log all his actions. Your web server already does all of this, why duplicate it? Just get a log analyzer. --

Re: [PHP] Using Post like Get

2004-07-23 Thread John W. Holmes
Dennis Gearon wrote: With get varaibles, it's possible to always have get variables on a page, even without a form, by simply appending the Get variables to the end of the URL. Is there anyway to do the same with Post variables? For instance, a javascript that onUnload submit, or something?

Re: [PHP] Using Post like Get

2004-07-23 Thread John W. Holmes
Dennis Gearon wrote: What I'm trying to achieve is to have the same cookie IDENTIFY a user on different (or same) applications (on the same server), but require them to log in for each application, and get a different session.. Basically, to keep separate 'user trails and in process variables'

Re: [PHP] HTML Escaping

2004-07-23 Thread John W. Holmes
Robb Kerr wrote: I've got a conditional button that needs to appear/hide on my page depending upon the contents of a field in my database. The button is an image and has a long URL and JavaScript for image rotation attached to it. Needless to say, the href is quite long and includes several '

Re: [PHP] Include path

2004-07-23 Thread John W. Holmes
PHP Gen wrote: Hello, I am a bit confused :-(, this is my server path: /home/sites/site80/web/articles/myfile.php from myfile.php I want to include header.php which is located in: /home/sites/site80/web/templates/ include('/home/sites/site80/web/templates/header.php'); Are you looking for a

Re: [PHP] Converting regional decimal numbers

2004-07-23 Thread John W. Holmes
C.F. Scheidecker Antunes wrote: I have a few users that use a different number format, other than the US one, which is 1.526,23 . That is, the comma is used as a separator for the fractional part of the number (.23) and the dot is used to separate thousands. Therefore, I need to convert 1.526,23

[PHP] PHP editor that doesn't require installation

2004-07-23 Thread John W. Holmes
Does anyone know of a good windows PHP editor that I can run from a USB flash drive without installing it? A good stand-alone editor. I know how to use Vi, so I'll even take a copy of that (so long as it's got syntax hightlighting) so long as installation isn't required. For everyone else,

Re: [PHP] run perl script with php

2004-07-22 Thread John W. Holmes
Tassos T wrote: i faced a small problem i have a perl script but i want to execute that in a php script. unfortunately i cannot convert to php. virtual() -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals

Re: [PHP] smpt server requiring authentication

2004-07-22 Thread John W. Holmes
Chris Hunt wrote: anyone know how to configure php's outgoing mail to use a smtp server that requires authentication? Can't. Use an SMTP class from phpclasses.org (Manuel will be on here soon, I'm sure ;) or PEAR. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

Re: [PHP] textarea/display question...

2004-07-21 Thread John W. Holmes
Dennis Gearon wrote: Make sure to remove tags via: $var_that_will_be_displayed = strip_tags( $var_from_user_input_via_POST_or_GET_or_COOKIE ); if you are going to display or mail it as part of a link(email or URL), you might do this instead: $var_that_will_be_part_of_a_link =

Re: [PHP] URL

2004-07-21 Thread John W. Holmes
Bruno Santos wrote: Im developing a couple of pages and i need to do some redirecting to another page depending on the choice of a user. The problem is, to go to another page, i need to send some parameters in the URL that are alredy present, but i need to make the redirecting independent of

Re: [PHP] echo and html_decode

2004-07-21 Thread John W. Holmes
Karl-Heinz Schulz wrote: I'm trying to use html_decode with the echo function but failed so far. ? echo mysql_result($product, 0,1) ? What would be the correct syntax? Huh? I don't see html_decode anywhere and the function is html_entity_decode(), anyhow. If you want to run the above through

Re: [PHP] trim() white space from record set

2004-07-21 Thread John W. Holmes
msa wrote: I created a search form with multiple search parameters. It returns nothing if there is a space after their text entry or if they hit return in the text area. $coltitle_rsResults = 0; if (isset($_GET['Title'])) { $_GET['title'] = trim($_GET['title']); $coltitle_rsResults =

Re: [PHP] Error when using HTTP Location header

2004-07-21 Thread John W. Holmes
Chris Shiflett wrote: There is a difference between works and right Man... where have I heard that before?!? ;) -- ---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] change value of session variable?

2004-07-21 Thread John W. Holmes
Five wrote: Is it possible to assign a value to a session variable on say, page1.php: $_SESSION['favcolor'] = 'blue'; and then on another page, say page2.php reassign the value: $_SESSION['favcolor'] = 'green'; ? So far experimentation says no. PHP says Yes. Crystal ball says to put

Re: [PHP] Line breaks again....

2004-07-21 Thread John W. Holmes
PHP User wrote: I have managed to get the line breaks to show up on my site no problem, but I still get one long line when it is sent to my email. I have looked and looked and have read all the stuff I could find on \r\n, so I'm not sure where to go from here since it's not working... Are you

Re: [PHP] Firefox - IE differences

2004-07-21 Thread John W. Holmes
Karl-Heinz Schulz wrote: The following codes open the links perfect. print($press[1]. a target=_blank href=..\PDF/$press[3] class=\press_links\.strip_tags(html_decode($press[2]))./abr); 1. Use quotes around your attributes. target=_blank href=. 2. Why are you mixing / and \ in your path? Why

Re: [PHP] Re: change value of session variable?

2004-07-21 Thread John W. Holmes
Chris Shiflett wrote: --- Five [EMAIL PROTECTED] wrote: That did it! I wonder if there is a way, then, to have it work even if the variable is initialized after it is echoed. You see, that makes no sense, and that's why no one else was able to answer your question. Code is executed in order.

Re: [PHP] Re: change value of session variable?

2004-07-21 Thread John W. Holmes
Five wrote: page1.php ?php session_start(); echo 'page #1br'; echo $_SESSION['favcolor']; $_SESSION['favcolor'] = 'green'; echo 'bra href=page2.phppage 2/a'; ? page2.php ?php session_start();

Re: [PHP] Re: change value of session variable?

2004-07-21 Thread John W. Holmes
Five wrote: John W. Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If it does not work for you, are you sure you're accepting the session cookie? How are you sure? Do you have a valid session.save_path? How do you know? Are you displaying errors? How do you know? If you see

Re: [PHP] Money format

2004-07-20 Thread John W. Holmes
Luk Moravec - PTV Servis wrote: is there any function wich can format a double or string into money format.for example: 1526789,99 to 1.526.789,99 or something like that.? number_format() -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for

Re: [PHP] textarea/display question...

2004-07-20 Thread John W. Holmes
bruce wrote: textarea value='$foo'/textarea Please review your HTML textbook. There is no value attribute for a textarea. textarea$foo/textarea -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP

Re: [PHP] Problem of a beginner with Array

2004-07-20 Thread John W. Holmes
Henri Marc wrote: I want to make a lottery site (just as an exercise), so I made a page with 6 grids of 50 numbers each (check boxes). Now, I want to know which numbers have been checked by the player. I have a : input name=Grid1 type=checkbox for the first grid. Grid2 for the grid #2... I was

Re: [PHP] textarea/display question...

2004-07-20 Thread John W. Holmes
bruce wrote: ps.. to you guys who said that the textarea doesn't have a value=''.. it does... No, it doesn't. Pleae upgrade your textbooks. http://www.w3.org/TR/html4/interact/forms.html#h-17.7 -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The

Re: [PHP] file_exists() to search for *.xml file with a wild card???

2004-07-20 Thread John W. Holmes
Scott Fletcher wrote: I would like to use the file_exists() or something similar to check for the existance of any of the xml files regardless of what filename it use. Like file_exist(*.xml) for example. Anyone know?? Try glob() -- ---John Holmes... Amazon Wishlist:

Re: [PHP] string filtering

2004-07-20 Thread John W. Holmes
C.F. Scheidecker Antunes wrote: I need to filter some strings. They can only contain characters like a...z or A..Z and 0..9. Some strings have blank spaces, -,./?, characters that must be discarded. I wrote a function to check each and every character but I guess there must be something else

Re: [PHP] get all except 1

2004-07-20 Thread John W. Holmes
Dan McCullough wrote: Haven't done this in a while, but here is my question. I have 4 stories, and you land on the story page where one story is shown and on the side there is a listing of the other 3 stories that are active in that edition. So what I would like to do in one query is get the three

Re: [PHP] get all except 1

2004-07-20 Thread John W. Holmes
Dan McCullough wrote: Anything wrong with SELECT * FROM story WHERE approved = 1 AND newsId != $newsId AND editionId = $eid ORDER BY newsSortOrder ASC Should be fine if I understand your question correctly. You can use != or ; same result. -- ---John Holmes... Amazon Wishlist:

Re: [PHP] Print page without images

2004-07-19 Thread John W. Holmes
francesco[AT]automationsoft[DOT]biz wrote: I know that it is a simple and maybe elementary question, but there is in PHP a function, like print or echo, that print only the text of an HTML page on printer? No. Use CSS. -- ---John Holmes... Amazon Wishlist:

Re: [PHP] old guy newbie needs some help

2004-07-18 Thread John W. Holmes
Bob Imperial wrote: Warning: session_start(): open(/tmp\sess_ff8651f382492ae56f436690d81ff124, O_RDWR) failed: No such file or directory (2) in c:\inetpub\wwwroot\phptest\listing10.1.php on line 15 You just need to set session.save_path in you php.ini file or use session_save_path() before you

Re: [PHP] [Q] Regex Woes

2004-07-18 Thread John W. Holmes
Michael T. Peterson wrote: I need to find all lines that begin with the string 'WAZ' after reading from a url (http://www.atmos.washington.edu/data/zone_report.KSEW.html). While I've tried every combination of expressions under the sun (using the functions preg_match(), ereg()), I can not figure

Re: [PHP] PHP Form Field Validation

2004-07-18 Thread John W. Holmes
Harlequin wrote: Just wondering if there's a quick and easy way to validate form fields using PHP. Not really that concerned with actual content by using REGEX but want to ensure users have at-least bothered to put something in and if not display an error with the form field's name maybe. empty()

Re: [PHP] Error: unexpected T_ELSE on line 14...?

2004-07-18 Thread John W. Holmes
Harlequin wrote: if ($_SESSION[Authorised]=Yes); You know this will _always_ be true, don't you? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Is Function Constants the Correct Term?

2004-07-17 Thread John W. Holmes
Curt Zirzow wrote: * Thus wrote gohaku: Hi everyone, I have been experimenting with defining functions as constants. Below is what I am using to test Function Constants: pre ? define(LOGIN,user); define(PASS,pass); define(DB,mysql); define(DBLOGIN,dblogin(LOGIN,PASS,DB)); This is simply not

Re: [PHP] Need help with line breaks in a textarea form

2004-07-16 Thread John W. Holmes
PHP User wrote: Hi, I have been trying to format the textarea output and have come across some code that almost does what I need, but I still have one small problem. Look at the text below that was input into my textarea: Now is the time for all young men to come to the aid of the party. Now is

Re: [PHP] Getting the primary key from a MySQL insert

2004-07-16 Thread John W. Holmes
Andrew Wood wrote: Thanks. When it says 'the last insert' is that just the last insert my PHP script did, or the last insert on the DB as a whole? Read the links Daniel just sent out. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for

Re: [PHP] Need help with line breaks in a textarea form

2004-07-16 Thread John W. Holmes
PHP User wrote: Something came to mind as soon as I sent my last email, and it seems to work. Not sure it will work in every circumstance but the few tests I tried seemed ok. This is what I did. I added the two following lines to my script. $text=str_replace(\n,br,$text); $text=str_replace(br

Re: [PHP] Echoing Results in a Table

2004-07-16 Thread John W. Holmes
Harlequin wrote: I've managed to develop a query which pulls a finite number of records from a table based on a query. What commends do I now use to present these results in a table...? How would you show a table now with a single record? Start there. Now, what areas would need repeating with a

Re: [PHP] quotes in text.

2004-07-16 Thread John W. Holmes
Ed Curtis wrote: I'm having some difficulty with quotation marks, both single and double, input via a textarea in a form. Here's and example of text. Trying out the Special Character thing. Page 1 is the form. Page 2 is the data shown back to the user. original POST data is not touched. NO

Re: [PHP] Security vulerability, any more detail info than this???

2004-07-16 Thread John W. Holmes
Scott Fletcher wrote: Saw a website about security vulerability and there's no info on php.net that can describe more about it. So, anyone know? http://pcworld.co.nz/news.nsf/0/4D6AE0157B37ACDCCC256ED200693BB3?OpenDocument One more reason to not use strip_tags... like I really needed another,

Re: [PHP] quotes in text.

2004-07-16 Thread John W. Holmes
Ed Curtis wrote: On Fri, 16 Jul 2004, Justin Patrin wrote: This is why he said: Since you seem to have magic_quotes_gpc enabled, you can put the value directly into your query. You shouldn't use htmlentities when putting it into the DB. Use it when displaying the text. I tried it both ways and it

Re: [PHP] Problem with calculate

2004-07-16 Thread John W. Holmes
Rosen wrote: I use some numbers from mysql table and other local vars to calculate one number. But on one calc I receive thath $value=4.5474735088646E-013; This must be zero (0) - I see all vars and calc then with calculator. I use function number_format($value, 2, ., ) and it return me -0.00

Re: [PHP] Uploading a directory of files

2004-07-16 Thread John W. Holmes
Ryan Schefke wrote: Does anyone have a script to upload a directory full of files? .something like a recursive upload. Not going to happen with PHP and an HTML interface. If you have PHP running on two machines and want to do this, then say so. -- ---John Holmes... Amazon Wishlist:

Re: [PHP] finding a substring

2004-07-16 Thread John W. Holmes
C.F. Scheidecker Antunes wrote: Hello all, I need to read lines within a text file that might have a value='somevalue' string the position of value= varies from line to line but there's only one value= in each line. So what I need to do is to parse the file and find the value= and put their

Re: [PHP] Help on copying part of a text file

2004-07-16 Thread John W. Holmes
C.F. Scheidecker Antunes wrote: Hello all, I need some help on the following: I need to extract a paragraph from a text file that is delimited with a --start-paragraph-- and --end-paragraph-- However, after --start-paragraph-- there's a blank line that I need to remove. The delimiter

Re: [PHP] upload an image and store it in mysql

2004-07-16 Thread John W. Holmes
Five wrote: I've been playing with this for two days and am wondering if there's a way to retrieve and display the images in a browser using only php or is it necessary to use a graphics library like GD? You don't need GD unless you want to modify the image (and even then there are other

Re: [PHP] PHP upgrade... issues???

2004-07-15 Thread John W. Holmes
[EMAIL PROTECTED] wrote: I've just got this mail from my host... = Dear customer, This email is sent to inform you that we'll upgrade the PHP version on your server to the latest stable version 4.3.8 within the next hour. = Are there any issues that I need to panic

Re: [PHP] Storing text with carriage returns in MySQL

2004-07-15 Thread John W. Holmes
Vail, Warren wrote: The function addslashes() will resolve many user input problems where the user; Inputs a quoted value in the middle of his string. Uses and and in text. Inputs other ASCII control characters like tab and bell (remember that one). addslashes() does not escapecharacters

Re: [PHP] problem with super global '$_REQUEST'

2004-07-15 Thread John W. Holmes
Dennis Gearon wrote: Why unset the globals? I plan on implementing filters on all User input to ALL scripts in the prepend file. And if someone wants to get a variable that was supplied by a user, they have to specifiy if it's going to be INT, STR(with options to remove run on spaces, validate

Re: [PHP] Offset error

2004-07-15 Thread John W. Holmes
C.F. Scheidecker Antunes wrote: Can anyone tell me how to test the offset 1 or more in the array $att[$k]-parameters[1] so that I can avoid this error? if(isset($att[$k]-parameters[1])) { dosomething(); } -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

Re: [PHP] selecting a database to create a table with MySQL

2004-07-15 Thread John W. Holmes
Rocky Singh wrote: how do i select a database under which to create a table... magic 8-ball says: mysql_select_db() Four second look at the manual probably would have told you the same. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine

Re: [PHP] upload an image and store it in mysql

2004-07-14 Thread John W. Holmes
Five wrote: I have php code that takes text input from a webpage and and stores it in a mysql data base. I tried uploading small images (jpg) using basically the same syntax but they don't make it into the data base. Does anyone know of a simple tutorial that shows how to do this? although I'm

Re: [PHP] Templates Are Driving me Nuts

2004-07-13 Thread John W. Holmes
EE wrote: Please help. This template thing is driving my nuts. I though maybe when I read more articles things will clear up; however, things got even worse. Every article writer has a different idea. Can anyone explain to me what are Templates for? What are the advantages of using them? If I use

Re: [PHP] $_Request from 4.3 to v5.x

2004-07-13 Thread John W. Holmes
Michael Purdy wrote: I have a script which accepts three POSTed variables from a basic form. Under 4.3.7 the script runs fine and the variables are successfully passed to the script. I am testing 5.0 C3 and receive the following error PHP Notice: Undefined index: searchtype in

Re: [PHP] using htmlentities with data in textarea

2004-07-13 Thread John W. Holmes
Hull, Douglas D wrote: But if one enters: w' my word ends up w\' Run stripslashes() on the entire string before you begin processing it. If you eventually insert the data into the database, you'll need to run addslashes() on it though, to prevent errors/sql injection from the unescaped quotes.

Re: [PHP] RE:$_Request from 4.3 to v5.x

2004-07-13 Thread John W. Holmes
Dennis Gearon wrote: Isn't $_REQUEST the same as the old GPC variables in global namespace? A way to get requested variables without paying attention to whether they came in via cookies, post, or get? That's been my understanding so I've been using $_GET, $_POST, $_COOKIE instead, because that

Re: [PHP] Re: Anyone knows when PHP5 is released?

2004-07-13 Thread John W. Holmes
Ben Ramsey wrote: Aidan Lister wrote: When it's ready Hopefully we'll see the stable release in the next 24 hours. There was a post to the internals@ list yesterday. Andi announced a test roll of 5.0.0 saying that he would release PHP 5 within the next 24 hours if all goes well. Keep your

[PHP] HTTP Session Recorder?

2004-07-13 Thread John W. Holmes
Does anyone know of a program that'll record the clicks and requests as I go through a site? Something that'll watch as I click on links, fill in forms, etc and then be able to perform the same requests (duplicating the forms, cookies, etc)?? Maybe a PHP script that can be dropped into an

Re: [PHP] placing values in html teaxtarea

2004-07-12 Thread John W. Holmes
Keith Greene wrote: Here is what I tried: textarea name=zoutput rows=20 cols=70 wrap value=? echo $test; ? / /textarea textareas do not use the value attribute. instead, the value is placed between the textarea/textarea tags: textarea name=zoutput rows=20 cols=70 wrap /? echo $test;

Re: [PHP] Trouble with arrays from within MySQL results where clause

2004-07-12 Thread John W. Holmes
Eric Boerner wrote: Hello all, I am having trouble setting array data from within a MySQL results query. I have modified data from the result and wish to enter it into it's own array ($data). That then is used to generate a graph. The following code basically gives me an empty array... I doubt the

Re: [PHP] File Upload Question

2004-07-12 Thread John W. Holmes
Vail, Warren wrote: Perhaps this is more about HTML than PHP, but the PHP $_FILES var seems to be set up to allow a list of files to be uploaded. How does one get the pop-up window to allow a user to select (ctrl-click or whatever) multiple files in the same pop-up window? Everything I have

Re: [PHP] stripslashes() when reading from the DB

2004-07-12 Thread John W. Holmes
Jordi Canals wrote: I usually stripslashes() when I read the info from the database (MySQL). Because the information was inserted after adding slashes, or the system has magic_quotes_gpc set to ON. I remember being taught this lesson long ago. :) You do not need to strip slashes from the data

Re: [PHP] OO woes

2004-07-12 Thread John W. Holmes
Matthew Sims wrote: Your problem has nothing to do with the Objects (or really even PHP for that matter). You're not supposed to run mysql_escape_string on an entire query. So I ran my $_POST array into array_map before the injection: $_POST = array_map(mysql_escape_string,$_POST); And it all

Re: [PHP] php reserved characters...

2004-07-12 Thread John W. Holmes
bruce wrote: i have the following: html body ? $test = p; echo $test; print $test; ? /body /html it doesn't seem to print... which leads me to believe that is a reserved char/word... i tried to do a \p with no luck... any idea as to what's going on, and can someone point me to a list of the

Re: [PHP] search string / query format

2004-07-09 Thread John W. Holmes
Ed Lazor wrote: I'm going to create a search page that accepts input similar to places like Yahoo and Google. [snip] Also, I've heard that MySQL's indexing can support some of this, but I'm not sure how much. Using a FULLTEXT index and searching in BOOLEAN mode supports the type of search

Re: [PHP] get the month's last day

2004-07-09 Thread John W. Holmes
Sheawh wrote: how can i retrieve the last day of the month? like 31 - Jul, 30 - Jun , 28 - Feb ?php $month = 8; $year = 2003; $lastdayofmonth = mktime(12,0,0,$month+1,0,$year); ? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP

Re: [PHP] Malicious SQL

2004-07-08 Thread John W. Holmes
Philip Olson wrote: on the contrary: sql = mysql_query(select * from users where name='.$name.'); will simply look for a user with a name of Jim; delete from users; and return no results found. But I can also enter: jim'; delete from users You need to catch if there's a quote in the $name too, and

  1   2   3   4   5   6   7   8   9   10   >