Re: [PHP] Double parenthesis crisis

2004-07-07 Thread John W. Holmes
Ryan Schefke wrote: I'm trying to display the value of that variable in an input box Seriously, how many times can this question be asked in a week? You just need to run htmlentities() or htmlspecialchars() on the data before you place it in the element. -- ---John Holmes... Amazon Wishlist: www

Re: [PHP] Client IP

2004-07-07 Thread John W. Holmes
Rosen wrote: Can I get just adress of the IP, with which the server communicates ? If you don't see the IP address somewhere in the $_SERVER variable, then NO. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phpa

Re: [PHP] Client IP

2004-07-07 Thread John W. Holmes
Rosen wrote: IP adress not send ?!? And how server communicate with client ? A variety of ways. What I meant is that it's not sent in the browser's headers that it sends to the site, which is where getenv() and $_SERVER[] would snatch it from. Do not rely on IP addresses. Trust me. -- ---John Ho

Re: [PHP] Client IP

2004-07-07 Thread John W. Holmes
Matthew Sims wrote: Hi, How can I get remote IP adress of client? I use the fillow script:: $ip=getenv('HTTP_X_FORWARDED_FOR'); if (!$ip) { $ip = getenv('REMOTE_ADDR'); } But sometime it return me "unknown" sa IP adress. Can someone help me ? Thanks in advance! $_SERVER["REMOTE_ADDR"] Either metho

Re: [PHP] Storing website templates in sessions

2004-07-07 Thread John W. Holmes
Joe Harman wrote: I was curious if anyone out there has some pros and cons to storing a website template that is extracted from a mysql db and stored in a session... is this an efficient way to do it? also... does anyone know what the size limitations for a session would be? There's no practical li

Re: [PHP] Malicious SQL

2004-07-07 Thread John W. Holmes
Matthew Sims wrote: I think a good programming habit it to treat it as if it were off. With regards to magic_quotes_gpc, you can't just "treat it as if it were off" otherwise you may end up escaping data twice if it's not really off on a server that runs your code. Detect it's value with get_mag

Re: [PHP] Malicious SQL

2004-07-07 Thread John W. Holmes
Justin Patrin wrote: On Wed, 7 Jul 2004 10:31:17 -0700, Brian Dunning <[EMAIL PROTECTED]> wrote: The PHP directive magic_quotes_gpc is on by default, and it essentially runs addslashes() on all GET, POST, and COOKIE data. Why doesn't this automatically prevent injections, since it escapes out an

Re: [PHP] Malicious SQL

2004-07-07 Thread John W. Holmes
Brian Dunning wrote: I have a question about this. Here is from the documentation: The PHP directive magic_quotes_gpc is on by default, and it essentially runs addslashes() on all GET, POST, and COOKIE data. Why doesn't this automatically prevent injections, since it escapes out any single qu

Re: [PHP] using $$foo_name vs. $foo_name for file upload

2004-07-06 Thread John W. Holmes
Tony wrote: Trying to use the following statement to upload a file via a form, when I use a variable "$foo" in the following statement it works correctly: if (copy($foo, "./$foo_name")) {//blah... } The name of the file I am trying to upload $foo is evaluated correctly. Likewise I can obtain the

Re: [PHP] parse_ini_file VS. constructor with many parameters

2004-07-06 Thread John W. Holmes
Jason Barnett wrote: I have a class definition that has a lot of private properties. These properties don't need to change often, in fact a user could probably just change the values once and forget about most of them. So this makes me think that I should use parse_ini_file and a configuration

Re: [PHP] quick newbie q: mysql_insert_id()

2004-07-05 Thread John W. Holmes
Christopher J. Mackie wrote: If I want to use PEAR DB to handle my database connections, how do I retrieve the recordID (primary key) added when I run an INSERT query? mysql_insert_id($db_object) doesn't seem to work if the object is PEAR, and the PEAR docs don't seem to show the same function. You

Re: [PHP] help me with eregi

2004-07-05 Thread John W. Holmes
water_foul wrote: ho do you make a eregi so it looks at the var as a single line use the preg_ functions. -- ---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.ne

Re: [PHP] Session tracking and multiple form updates

2004-07-04 Thread John W. Holmes
Tom Rogers wrote: store it in the session like: $_SESSION[session_id()]['dbkey'] = $dbkey; then get it back with $dbkey = (isset($_SESSION[session_id()]['dbkey']))? $_SESSION[session_id()]['dbkey'] : 0; That doesn't negate the problem of people having more than one window open and editing records

Re: [PHP] Session tracking and multiple form updates

2004-07-04 Thread John W. Holmes
Michael Gale wrote: Now at the moment on each page is a hidden variable containing a db primary key for which the data is getting updated. I know that hidden values are not a good idea since the user can change them ... so I was going to store the hidden value in a "$_SESSION" variable but then the

Re: [PHP] For/Next Help Needed

2004-07-04 Thread John W. Holmes
for($z=0;$zWhat is the difference between this code and using a "foreach" command? Nothing, really. Using a foreach() simply means you don't have to keep up with the $z count variable... foreach($recipient as $email) { mail($email,$subject,$message,$headers); } -- ---John Holmes... Amazon Wishlis

Re: [PHP] For/Next Help Needed

2004-07-04 Thread John W. Holmes
mcp6453 wrote: I'm using Jack's PHP FormMail script, and I need to change it. I know very little abou PHP, but here's what I very much need to do right away. I need the script to send the same hard coded message to each of 10 people. All of the email addresses do not need to be in the "To" field. O

Re: [PHP] Something like strip_tags?

2004-07-04 Thread John W. Holmes
Jason Paschal wrote: i'd like to be able to strip only one type of HTML tag from a web document (), but to do that with strip_tags(), i'd have to predict every possible HTML tag that might be used, except for the one i want to strip, and put those in the allowable tags parameter. That's why I w

Re: [PHP] Re: web page output "as we go"

2004-07-04 Thread John W. Holmes
David T-G wrote: Jason, et al -- ...and then Jason Barnett said... % >Is there any way I can tell the web browser to start trickling the data % >onto the page? % % As Torsten so kindly pointed out to me before, your friend is the % flush() function: % http://www.php.net/flush Aha! It looks like

Re: [PHP] user-defined superglobals

2004-07-03 Thread John W. Holmes
Michael Collins wrote: I am relatively new at PHP and wondering why there is no mechanism to create user-defined superglobals? For example in ASP.Net I can setup a global.asa to define database connections or any named value I want to be available anywhere in an application. It would be great to

Re: [PHP] Re: Obtain NT Logon

2004-07-03 Thread John W. Holmes
Manuel Lemos wrote: I have a web form with a field for username, this is a corporate site so will be the users NT logon. Would it be possible using PHP to obtain this information directly from the client pc? Assuming that you Web server is configured to require Windows NT domain authentication for

Re: [PHP] RE: MySQL Results Not Being Committed To Database

2004-07-03 Thread John W. Holmes
$query = mysql_query($sql); $mysql_result = mysql_query ($sql, $Connection) or die ("Invalid Query - " . mysql_error()); You're running the query twice. Take out that first line. And I second the recommendation to please reply to the list and not individuals unless they request it. -- --

Re: [PHP] MySQL Results Not Being Commited To Database

2004-07-03 Thread John W. Holmes
Harlequin wrote: sql == "INSERT INTO RegisteredMembers (TXT_UserID,TXT_UserPassword,TXT_Comments,TXT_FurtherComments) VALUES('".$NewUserID."','".$NewUserPassword."','".$NewUserComments."','".$NewUserFurtherComments."')"; This should be $sql = " ... " and then you need to run the query w

Re: [PHP] connection parameters to db's

2004-07-03 Thread John W. Holmes
Dennis Gearon wrote: When I connect to a database on the same machine as the apache server us running under, that's server name "localhost", right? Yes. You can also use the IP address or computer name. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: T

Re: [PHP] Handling MySQL errors

2004-07-03 Thread John W. Holmes
Shaun wrote: Is there a way to handle MySQL errors gracefully such as a duplicate entry into a UNIQUE field, the method I've been using seems a little laborious... //see if user exists $query = "SELECT * FROM users WHERE Username = '".$_POST[username]."'"; $result = @mysql_query

Re: [PHP] PHP Bug ?

2004-07-03 Thread John W. Holmes
Siddharth Hegde wrote: While we are on this topic, I have noticed that for only some keys, the following does not work $arr[KEY_NAME] but when I change this to $arr['KEY_NAME'] it works. That's because KEY_NAME is a constant and 'KEY_NAME' is a string. So unless you really have a constant called K

Re: [PHP] Password encyption

2004-07-02 Thread John W. Holmes
Anzak Wolf wrote: Call me paranoid but I think I would rather play the little bit in overhead to decypt the password to give myself a slightly safer feel about my database password. Paranoid. And where do you plan on keeping the key to decrypt the password? In another file? How are you going to

Re: [PHP] php functions avail ?

2004-07-02 Thread John W. Holmes
Brent Clark wrote: I would like to know if these functions (for php 5)are already uploaded, available on the php.net sites, in terms of research and or support. http://zend.com/php5/whats-new.php Yes. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The

Re: [PHP] PHP5 contest

2004-07-01 Thread John W. Holmes
Siddharth Hegde wrote: Does anyone know who to contact if they have any Qs regarding the PHP5 contest. One of the Qs I had - Are we allowed to use Pear library and classes. That's a good question. I bet that's asked frequently. They should make a list of questions like that and call it a QTAFA; Qu

Re: [PHP] Protecting database passwords

2004-07-01 Thread John W. Holmes
From: "Bob Hockney" <[EMAIL PROTECTED]> > > I think he is talking about the password that is written inside the script > > in the mysql_connect statement. I think he is worried that someone could > > access it's code and find out the DB password. > > What I am concerned about is a local user on th

Re: [PHP] Is that a PECL in your pants?

2004-06-30 Thread John W. Holmes
- Edwin - wrote: I guess it's more on the underlying library. (i.e. Sablotron vs libxslt) Yeah, I guess that's what I meant; the "XSLT extension" versus the "XSL extension" which basically comes down to the libraries powering them. Anyone have any recommendations which one would be better to use

Re: [PHP] Is that a PECL in your pants?

2004-06-30 Thread John W. Holmes
Curt Zirzow wrote: Thanks for the explanation Curt. I'll do my best to educate! :) As far as XSLT and XSL, the one is prefered over the other. What do you mean by this? XSLT is preferred over XSL? Any reasons why you can point me to? Thanks again. -- ---John Holmes... Amazon Wishlist: www.amazon.

Re: [PHP] MATCH ... AS relevancy FROM

2004-06-30 Thread John W. Holmes
John Taylor-Johnston wrote: David> http://dev.mysql.com/doc/mysql/en/Fulltext_Boolean.html David> Quote: David> They do not automatically sort rows in order of decreasing relevance. David> You can see this from the preceding query result: The row with the highest relevance is David> the one that c

[PHP] Is that a PECL in your pants?

2004-06-30 Thread John W. Holmes
Can anyone explain the purpose of PECL to me besides what it says on the web page (http://pecl.php.net)? For instance, the XSLT extension has been moved to PECL, but the experimental XSL functions are included by default with PHP5. This would lead me to favor the XSL functions over the XSLT fun

Re: [PHP] Messages to List Being Truncated

2004-06-30 Thread John W. Holmes
Red Wingate wrote: nobody ( and especialy not me ) would have offended you, if you wouldn't have flamed someone for creating a new thread by replying to another. Your E-Mail client breaks the Threads just like he did which makes reading the threads a pita. Replying to an existing thread to create a

Re: [PHP] Re: How to escape apostrophe in HTML textbox exactly???

2004-06-30 Thread John W. Holmes
Joel Kitching wrote: s... when you pull the data *out* of the database the \ will not exist and you therefore do not need to perform stripslashes(). I tried using addslashes() on the string in the query, and then SELECTing it, and the slashes are included. Does mysql_escape_string() not do th

Re: [PHP] Re: How to escape apostrophe in HTML textbox exactly???

2004-06-30 Thread John W. Holmes
Joel Kitching wrote: What's wrong with addslashes() on the way in and stripslashes() on the way out? Why would you want to convert it to it's HTML entity? Please try to load the following HTML and tell me what's wrong with it: And then load this: -- ---John Holmes... Amazon Wishlist: www.amazon.

Re: [PHP] Re: How to escape apostrophe in HTML textbox exactly???

2004-06-30 Thread John W. Holmes
Red Wingate wrote: use " to display the data in the input-text element and undo this before inserting it into the database function quoteToHtml ( $string ) { return str_replace( '"' , '"' , $string ); } function htmlToQuote ( $string ) { return str_replace( '"' , '"' , $string ); } Only way to

Re: [PHP] Re: test if $int is integer

2004-06-30 Thread John W. Holmes
Matthew Sims wrote: I recently purchased George Schlossnagle's Advanced PHP Programming and on page 85 in the Error Handling chapter, he made a reference about the is_int function. In the above function example he had: if (!preg_match('/^\d+$/',$n) || $n < 0) { In which he mentions: It might be

Re: [PHP] New changes

2004-06-28 Thread John W. Holmes
Randy C Boland wrote: Isn't this a moderated list? lol -- ---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 unsubscribe, visit: http://www.php.net/unsu

Re: [PHP] Doubling up...

2004-06-06 Thread John W. Holmes
[EMAIL PROTECTED] wrote: Using the code below, im getting a problem where it is printing out TWO of each field value instead of one... [snip] while($row = mysql_fetch_array($result)){ fetch_array returns an array where the indexes are numeric and where they are the column names. So $row has four

Re: [PHP] Get Column Names for mySQL...

2004-06-06 Thread John W. Holmes
Russell P Jones wrote: How would one cycle through and get all of the column names in a mysql table? say that i have... id | title | name | description 1 | MR. | russ | age XX height XX 2 | MRS. | jan | age XX height XXX and I want to print out the 4 column names... how would one accomplish t

Re: [PHP] Difficult SQL (for me) - please help!

2004-06-05 Thread John W. Holmes
Brian Dunning wrote: Thanks to all who helped with my earlier SQL question. It was exactly what I needed. But now I'm making it more involved. Tom and Dick are competing salesmen. The data looks like this: Tom Pitch Dick Pitch Tom Sale Dick Sale Tom Pitch I want to show a list

Re: [PHP] Multiple URL Redirection

2004-06-05 Thread John W. Holmes
[EMAIL PROTECTED] wrote: I've got a domain that is hosted at a certain host. This host allows me to create subdomains, and also to add several domains to the same account. The thing is if I add a domain like xxx.com to my yyy.com both will be directed to my index.php page. I want to know if there i

Re: [PHP] Error Downloading files using FOpen

2004-06-04 Thread John W. Holmes
Winkler, Gerald wrote: That gives me the same junk data problems. Define "junk data"? How is it corrupting the file? try downloading a simple text file with a basic sentence in it. What does it look like after it's corrupted? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC8

Re: [PHP] script location

2004-06-04 Thread John W. Holmes
From: "Gabe" <[EMAIL PROTECTED]> > Knowing the functions is half the battle. :-) GI JOE!!! ---John Holmes http://www.ebaumsworld.com/gijoe.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Bulk table updates

2004-06-03 Thread John W. Holmes
Robert Sossomon wrote: I am looking for a tutorial or a already created class or file that I can use to learn how to create a form that is populated from a database table that can be edited in every row and column and takes only 1 SAVE button to upload all the changes. Look on phpclasses.org or in

Re: [PHP] php as user apache

2004-06-03 Thread John W. Holmes
From: "Travis Low" <[EMAIL PROTECTED]> > John W. Holmes wrote: > > From: "Nirnimesh" <[EMAIL PROTECTED]> > > > >>I have a problem regarding using my php scripts to write files to my > >>account. > >>We know that php run

Re: [PHP] php as user apache

2004-06-03 Thread John W. Holmes
From: "Nirnimesh" <[EMAIL PROTECTED]> > I have a problem regarding using my php scripts to write files to my > account. > We know that php runs as user apache. Now giving write permissions to > apache for uploading files to my account essentially means that I have to > give write permissions for a

Re: [PHP] imploding a multi-dimensional array

2004-06-03 Thread John W. Holmes
From: "Tom Wuyts" <[EMAIL PROTECTED]> > I want to implode a multi-dimensional array into 1 string. Any reason you need to implode() instead of serialize() the array? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] When did mysql_query quit allowing multiple queries separated by a semicolon

2004-06-03 Thread John W. Holmes
From: "James Harrell" <[EMAIL PROTECTED]> > Mostly a research question. I recall (a long time ago - php3?) that > some php packages could be compromised by injecting a secondary query > though GET/POST variables when they were not properly sanitized. > > ex: > $query="select a from $b"; > mysql_qu

Re: [PHP] weird error

2004-06-03 Thread John W. Holmes
From: "Marek Kilimajer" <[EMAIL PROTECTED]> > > The second error shows you did not turn on register globals. Look at a > > phpinfo() page to confirm you edited the right php.ini. You must restart > > your webserver after the change, also. > > Or he typed the url into the location bar, or selected a

Re: [PHP] weird error

2004-06-03 Thread John W. Holmes
From: "pagongski" <[EMAIL PROTECTED]> > Notice: Use of undefined constant REMOTE_ADDR - assumed > 'REMOTE_ADDR' in c:\win2kapp\easyphp1-7\www\index.php on line 35 > > Notice: Undefined variable: HTTP_REFERER in . > > I have register globals on. (was off so i turned t

Re: [PHP] $_FILES passed by value

2004-06-03 Thread John W. Holmes
From: "Daniel Guerrier" <[EMAIL PROTECTED]> > If I pass a $_FILES to an object by value. Does it > create a copy of the actual posted files as well? > > In other words if I post a 2MB file to save.php and in > turn pass $_FILES to an object $file->fileis($_FILES); > Does that create 4MB of data i

Re: [PHP] Re: Can session.save_path data be saved to a database instead of a file system?

2004-06-02 Thread John W. Holmes
From: "Caleb Walker" <[EMAIL PROTECTED]> > This looks like modifications that need to be made to the application. I > dont really want to touch the application. Instead I just want PHP, > through the php.ini file or whatever to take the session data and put it > in a database instead of the file

Re: [PHP] Refresh and retry when using back button on IE

2004-06-02 Thread John W. Holmes
Pieter from SA wrote: > I need to know if there is any code that can be used to get rid of the > refresh and retry when using the back button in internet explorer. > > Every time i get info from the database and display the result, and i use > the back button it says > > Warning: Page has Expired T

Re: [PHP] SELECT

2004-06-02 Thread John W. Holmes
Phpu wrote: Is there any way to select all entries in the database except one entry or tho entries? Yes. http://www.bigredspark.com/answers.html -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP

Re: [PHP] text search in database

2004-06-02 Thread John W. Holmes
Vincent DUPONT wrote: I need to do a text search on some fileds in a database. It'd help if you said what database you're using and posted this on [EMAIL PROTECTED] -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals –

Re: [PHP] session variables

2004-06-01 Thread John W. Holmes
Bob Lockie wrote: $_SESSION['new_name'] = $_REQUEST['new_name']; Is not global. I printed out the value locally but it is not made into a session variable. Yes, it is. Providing you have sessions configured correctly and use session_start(). -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/

Re: [PHP] Test Email

2004-06-01 Thread John W. Holmes
From: "Tom Chubb" <[EMAIL PROTECTED]> > Sorry if anyone else gets this, but I'm not receiving any emails at the > moment and wanted to check my subscription. You know php-general is working when you get emails from Advance Credit Suisse Bank and the Information Desk. ---John Holmes... (Sorry..

Re: [PHP] update mysql using radio button

2004-06-01 Thread John W. Holmes
From: "Daniel Clark" <[EMAIL PROTECTED]> > club_member > ='N'){echo 'CHECKED';}?>> =='N', you mean. :) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Online Testing Application

2004-06-01 Thread John W. Holmes
From: "Pushpinder Singh" <[EMAIL PROTECTED]> > I am designing a PHP and MySQL based online Testing Application. > The application will consist of about 120 lessons and each lesson will > have a quiz at the end of the lesson. There will also be some core > lessons that all test takers will ha

Re: [PHP] "Date object"

2004-06-01 Thread John W. Holmes
From: "Ryan A" <[EMAIL PROTECTED]> > A bit confused, I downloaded a function and it says it takes a "date > object"what exactly is a "date object"? > > This is exactly what is written " The function takes a date object as its > only parameter." No such thing. If you look at the code, though,

Re: [PHP] PHP Basic's Problem with a simple script.

2004-06-01 Thread John W. Holmes
From: "php-general" <[EMAIL PROTECTED]> > I use PHP Ver. 4.1.2 with apache 1.3.26 on a debian box. > In php.ini, "safe_mode" is off, and "register_globals" is on. > > I can enter names and submit them as often I like, but > the statement from the if-block is never executed, i.e. > the output "You

Re: [PHP] Security/Web tree/db connect and select

2004-06-01 Thread John W. Holmes
From: "Chris W. Parker" <[EMAIL PROTECTED]> > > You're right. Option 2 offers more security in that no one will ever > > be able to reach the file directly with a web browser. You don't need > > to use file() or file_get_contents(), though... A simple > > include('../includes/db.inc'); wil work (wh

Re: [PHP] Remember username and password

2004-06-01 Thread John W. Holmes
From: "Phpu" <[EMAIL PROTECTED]> > How can i make a registration form that will remember > my username and password every time i login from the same computer? > I think i should set a cookie but i don't know how. http://us2.php.net/setcookie Don't put the username and password in the cookie. You

Re: [PHP] extracting quoted text in string

2004-06-01 Thread John W. Holmes
From: "Chris Hayes" <[EMAIL PROTECTED]> > >I would like to extract the quoted text from a string > >for example : the translation for beautiful is "beau" and wonderful is > >"formidable" > >I need to get 'beau' and 'formidable' strings into an array. > > > >Any idea?? > >I can go with strpos and

Re: [PHP] shortcut if

2004-05-31 Thread John W. Holmes
Bob Lockie wrote: No syntax error but this always returns 's'. $add = $delete_count > 0 ? "s" : "x"; Hmm.. that's odd because if(false) { return false; } always returns false for me... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP

Re: [PHP] Text file

2004-05-31 Thread John W. Holmes
alantodd wrote: What would be the easiest way to open a text file, remove a line if the line begins with a word from an array of words (there are 5 words I will be looking for) then write that back to the text file with everything removed $filedata = file('yourfile.txt'); foreach($filedata as $key

Re: [PHP] Referer problem

2004-05-31 Thread John W. Holmes
Merlin wrote: I am trying to prevent hotlinking of images by other servers. Pictures are generated on the fly by a php script, where I have included this code to prevent hot linking: $haystack = $_SERVER['HTTP_REFERER']; $needle = 'globosapiens'; $pos = strpos($haystack, $needle); if ($pos

Re: [PHP] multiple checkbox help

2004-05-31 Thread John W. Holmes
Bob Lockie wrote: I tried this HTML: $_REQUEST['deleteID'] === the last box checked. so I did a google search and changed my HTML to: Now the code: for ($i = 0; $i < count($_REQUEST['deleteID']); $i++){ echo "deleting '" . $value . "'"; } has the right count but how do I get the values out?

Re: [PHP] Submitting a form from tags

2004-05-30 Thread John W. Holmes
GodFoca wrote: Heyp! I wanted to know if there is some way to do the submitting of a form from a normal href link, instead of the big-dumb-gray button. If it can't be done with PHP, how can it be done? Why would you think PHP can do anything client side? submit or something like that... -- ---John

Re: [PHP] Security/Web tree/db connect and select

2004-05-28 Thread John W. Holmes
Dennis Seavers wrote: Option 1: Include the mysql_connect and mysql_select_db commands within the script that manipulates the data from the database. Option 2: Include the mysql_connect and mysql_select_db commands (along with usernames and passwords) outside the Web tree, but have the script

Re: [PHP] Delete Multiple Records From Checkboxes

2004-05-26 Thread John W. Holmes
Albert Padley wrote: I've checked the archives and several other sources, but still can't seem to make this work. I have a form with checkboxes to designate records to be deleted from the mysql database. The pertinent form code is: The processing code is: if (count($del) > 0){ for ($i=0;$i

Re: [PHP] is_object($_SESSION['dagobertduck']);

2004-05-26 Thread John W. Holmes
From: "Justin Palmer" <[EMAIL PROTECTED]> > Make sure you include the Class file in every consecutive page that you > would like to use the object in. and include it before session_start(). Although if var_dump() is showing it's an object, you're question of why is_object() fails is still valid.

Re: [PHP] How to check for a $_GET without throwing a Notice?

2004-05-26 Thread John W. Holmes
From: "Brian Dunning" <[EMAIL PROTECTED]> > How do I check for the presence of an optional $_GET param without > throwing a "Notice: Undefined index" when the param is not present? > > Tried all three of these, they all produce the Notice when the param is > not passed: > > if ($_GET['id']) >

Re: [PHP] interesting

2004-05-25 Thread John W. Holmes
From: "Justin Patrin" <[EMAIL PROTECTED]> > IMHO it's just better to use concatenation and single quotes for your > string. PHP doesn't have to parse your strings for variables that way > and it makes it obvious what parts are variables. To each his own. Shall we discuss the merits of print vs. e

Re: [PHP] interesting

2004-05-25 Thread John W. Holmes
From: Daniel Clark >>echo "\"{$search_for_list[$i][0]}\""; will work, btw. > > What does the {}around the array mean? It delimits your variable so PHP knows what to interpret as a variable and what to interpret as a string. $ar[1] = 'foo'; echo "Value is {$ar[1]}"; // Value is foo $ar = 'foo';

Re: [PHP] interesting

2004-05-25 Thread John W. Holmes
From: "Bob Lockie" <[EMAIL PROTECTED]> > echo "\"" . $search_for_list[$i][0] . "\"" works but > echo "\"$search_for_list[$i][0]\"" prints "Array[0]. $search_for_list[$i] is an 'Array' which is followed by the string '[0]' ... how is PHP supposed to know you mean $search_for_list[$i][0]? echo "\"

Re: [PHP] Problem with number_format

2004-05-25 Thread John W. Holmes
From: <[EMAIL PROTECTED]> > please suppose PHP 4.3.2 and $number=502,3550 > > number_format($number,2,'.',' ') returns 502.36. > > It seems ok, but if $number=253,0650 > > number_format($number,2,'.',' ') returns 253.06 instead of 253.07. > > Why? > I've noticed this non-coherent approximation beh

Re: [PHP] phpmyadmin

2004-05-24 Thread John W. Holmes
From: "Chris W" <[EMAIL PROTECTED]> > I am using phpmyadmin to backup my mysql database. I have it setup to > backup all databases and at the bottom there is this foot note . . . > > "* Use __DB__ for database name, __TABLE__ for table name and any > strftime

Re: [PHP] list explode and undefined references

2004-05-24 Thread John W. Holmes
From: "Scot L. Harris" <[EMAIL PROTECTED]> > I came across an interesting problem today which I have found a work > around but was wondering if anyone on the list had a better way to solve > this problem. > > Been writing some php scripts on a Linux system using PHP 4.2.2. Basic > script works ju

Re: [PHP] Random Record Retrieval

2004-05-22 Thread John W. Holmes
Robb Kerr wrote: These are "inspirational" quotes that I want to appear at the bottom of the pages of my website. I want them to come up randomly with every page load. SELECT * FROM table ORDER BY RAND() LIMIT 1 -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|arc

Re: [PHP] email address Bill%40domain.com, "hello+world"

2004-05-22 Thread John W. Holmes
Bill Freeburg wrote: A previous program is passing an email address to my code via method=post. When I print it, it looks like "bill%40Domain.com" instead of [EMAIL PROTECTED] Also, text comes in as "Hello+World" instead of "Hello World". What's going on? I'm obviously missing something. I can't

Re: [PHP] newbie question about preg_match

2004-05-20 Thread John W. Holmes
From: "Al" <[EMAIL PROTECTED]> > I'm trying to compose a general purpose text snip expression to extract > a text segment from a string. > > Should this work for all reasonable cases? It seems to work for several > test strings. > > $start= "str1"; > > $end= "str2"; > > preg_match ("|$start (.*)

Re: [PHP] Simple MySQL/PHP Query

2004-05-20 Thread John W. Holmes
From: "Nick Wilson" <[EMAIL PROTECTED]> > * and then Nick Wilson declared > > > >pages of course... What I need to do, is add to the very end of each > > > >html page, one short peice of text.. not a footer, just an adition to > > > >every page. > > > > > > UPDATE table SET body = body + "text

Re: [PHP] [newbie] Can PHP be a security risk if it's just connecting to MySQL?

2004-05-18 Thread John W. Holmes
Dave G wrote: If that text is not properly validated and escaped, you could be open to SQL Injection attacks > I'm less clear on what "properly escaped" means. I thought escaping was a matter of putting slashes before special characters, so that their presence doesn't confuse the SQL queri

Re: [PHP] rewind 5 lines

2004-05-17 Thread John W. Holmes
From: "Martin Hjort Eriksen" <[EMAIL PROTECTED]> > I have a file where the pointer is set at EOF. > > Is it possible, in a very easy way, to rewind it 5 lines? Thereby being > able to return the last 5 lines of the file with "fgets". You could use rewind() if you know how many bytes you need to

Re: [PHP] PHP not parsing joined tables well

2004-05-17 Thread John W. Holmes
From: "Steve Douville" <[EMAIL PROTECTED]> > I'm got a query that is joining a few tables. > > select > par.*, pla.*, pro.*, reg.* > from parent par, players pla, registrations reg, programs pro > where blah blah blah > > Now, a result set is the same but I'm having trouble parsing it

Re: [PHP] what do '?' and ':' do?

2004-05-17 Thread John W. Holmes
From: "Radek Zajkowski" <[EMAIL PROTECTED]> > $module_dir = ($module == "") > ? "" > : $module."/"; > > what does the semicolon and the question mark do? Ternary Operator: http://us2.php.net/operators.comparison ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscrib

Re: [PHP] [newbie] Can PHP be a security risk if it's just connecting to MySQL?

2004-05-17 Thread John W. Holmes
From: "Dave G" <[EMAIL PROTECTED]> > I almost exclusively use PHP > to draw from data held within a MySQL database on the same server. I do > not allow users to upload files. I suppose the most that I allow users > to do is input some information like email addresses, user names and > passwords.

Re: [PHP] Forums

2004-05-16 Thread John W. Holmes
Ryan A wrote: Hey, Just spent 2 hours at hot scripts searching for a good forum software, after going through 15 pages I found: "PBLang - International PHP-forum" which seems good. Either get the free version of Invision Power Board or do yourself a favor and buy vBulletin. -- ---John Holmes... A

Re: [PHP] while inside a while or join or...

2004-05-16 Thread John W. Holmes
T. H. Grejc wrote: Hallo, I know of a few ways of doing this but I am not sure that any is right. I want to consult with you what is the best way of doing this: Table 1: ++-+ | *a* | *b* | ++-+ | 2 | 1| ++-+ | 2 | 2| ++-+ Table 2: ++-+ | *b*

Re: [PHP] New Newbie Question

2004-05-15 Thread John W. Holmes
Ronald "The Newbie" Allen wrote: Time: size="50"> it only displays 2004-05-15 Please learn HTML. You need quotes around your value. Time:" -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Gener

Re: [PHP] Session variables not working

2004-05-14 Thread John W. Holmes
From: "Andrew Wood" <[EMAIL PROTECTED]> > Using a cookie which is shown in my browser as PHPSESSID > > Yes they're on the same domain but no there's nothing being passed > accross the URL. Should there be? No, not normally. How are you getting from page 1 to page 2? > page1.php... > > ob_start(

Re: [PHP] Session variables not working

2004-05-14 Thread John W. Holmes
- Original Message - From: "Andrew Wood" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, May 14, 2004 4:48 PM Subject: [PHP] Session variables not working > I'm trying to set the following two vars on one page then read their > values on another like this: [snip] > But on page

Re: [PHP] dynamically building insert/update forms from db

2004-05-14 Thread John W. Holmes
From: "Edward Peloke" <[EMAIL PROTECTED]> > how would it know that I want the numeric in the db to be a menu item or > yes, no on the form? How do you know whether you want it to be a "menu item" or "yes, no"? Now program the same logic into your function/class that handles creating your form...

Re: [PHP] Normalising Names

2004-05-13 Thread John W. Holmes
Justin French wrote: Can someone point me in the direction of a function/library/tutorial on normalising and formatting user-inputted names so that they have the correct capitalisation etc? I remember a discussion about this on the list a while ago (http://www.phparch.com/mailinglists/msg.php?a

Re: [PHP] md5() with rand() || Strange results, need help....

2004-05-13 Thread John W. Holmes
CF High wrote: If anyone has any clues as to what might be happening; i.e. why the md5'd submitted plain text password does not match the stored md5'd password, please, please let me know. md5() results in a 32 character string. What kind of field are you storing it in? -- ---John Holmes... Amaz

Re: [PHP] Load Data infile

2004-05-13 Thread John W. Holmes
Juan Pablo Herrera wrote: [snip] I need do load data infile in mysql: $query_string2 = "LOAD DATA INFILE '/var/www/xls/test' REPLACE INTO TABLE `test` FIELDS TERMINATED BY ',' ENCLOSED BY '\"' ESCAPED BY '\\' LINES TERMINATED BY '\n'";$query_db_string2 = mysql_query($query_string2); But not realiz

Re: [PHP] _$ variable

2004-05-13 Thread John W. Holmes
[EMAIL PROTECTED] wrote: > Please somebody tell me what _$ (start from underscore) variable means. > I'm trying to find it from PHP.NET, but I cannot find that. http://us2.php.net/manual/en/function.gettext.php -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|

<    1   2   3   4   5   6   7   8   9   10   >