Re: [PHP] MySQL and apostrophes, interesting problem. 42082

2002-03-10 Thread Matt Schroebel
Read the manual about magic_quotes_gpc and addslashes() I prefer to add slashes myself, that way I can verify input lengths but it has the risk that I might miss a field. The trouble with magic_quotes_gpc is that if you have to re-display a variable you have to stripslashes() first. - Origina

Re: [PHP] newbie: the superglobal $_SESSION

2002-03-10 Thread Matt Schroebel
> > if (!isset($_SESSION['count'])) { > $_SESSION['count'] = 0; > } > else { > $_SESSION['count']++; > } > echo $count; > ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Script Debug.

2002-03-07 Thread Matt Schroebel
Could be several things ... > else { > session_register("user_auth_level"); > $auth_select = "select account_admin_level from account_details where > username='$login_username'"; Perhaps echo the sql statement here so you can see what you're trying to do. > $run_auth_select = mysql_query($auth_

RE: [PHP] Mysql

2002-03-05 Thread Matt Schroebel
Change the grant to: grant all on * to clark@localhost identified by 'clark'; Then do a: flush privileges; > I am trying to connect to the database like this: > > $db=mysql_pconnect("localhost", "clark", "clark") > > while in mysql do the following: > > >grant all on * to clark identified b

RE: [PHP] MySQL Query

2002-03-04 Thread Matt Schroebel
> I don't really remember the tutorial very well. I thought it > did a fine job of explaining some of the basics... I spent a few hours > with it and felt pretty good. However, I agree that it's not a good > intro to PHP's basic features. I stumbled on php a few years ago, and that was my

RE: [PHP] MySQL Query

2002-03-04 Thread Matt Schroebel
> This tutorial was my introduction to the concept, but you can > find this > information in a hundred other places: > > http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html I'd recommend that tutorial only as a guideline for using mySQL and php. Don't try to use the

RE: [PHP] good practice

2002-02-14 Thread Matt Schroebel
What I do is use templates to separate the html from the php. So I end up with (at least) 2 files per page, one the template; the other the html. If you have tables, then you need templates for the rows. My model is basically: If ("POST" == $HTTP_SERVER_VARS['REQUEST_METHOD']) { // do data val

RE: [PHP] how a function 'return' statement works

2002-02-14 Thread Matt Schroebel
How about: return $current_page_name[count($current_page_name)-1]; -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Can anyone give my puny mind an explanation as to why the following function only returns the value "Array" ? # ==

RE: [PHP] links manager

2002-02-14 Thread Matt Schroebel
Look here: http://www.zend.com/apps.php?CID=38 -Original Message- From: Administration@myclassguide [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 5:22 AM To: [EMAIL PROTECTED] Subject: [PHP] links manager Hi Anybody know of any good scripts for creating a directory for

RE: [PHP] Filling Forms with $variables

2002-02-13 Thread Matt Schroebel
Always use htmlspecialchars() on form value fields and any data you put into the tags. -Original Message- From: Steven Walker [mailto:[EMAIL PROTECTED]] > In the browser, the name field is only filled with "Steven", and drops off everything after the space. If I echo $na

[PHP] Freebsd, php and mail

2002-02-13 Thread Matt Schroebel
I figured this one out, so I thought I'd put it in the archives ... I just spent a few hours pulling my hair out because the mail sent by mail() was coming from 'unprivileged user' on my freebsd box. It worked fine for another site on the same box. It turned out that I has mistakenly appended

RE: [PHP] Re-Importing .CSV file into Database

2002-02-13 Thread Matt Schroebel
Me thinks you need to have file privileges. See http://www.mysql.com/doc/P/r/Privileges_provided.html -Original Message- From: Thomas Edison Jr. [mailto:[EMAIL PROTECTED]] the current problem at hand of getting the : error:Access denied for user: 'mjimm@localhost' (Using password: YES)

RE: [PHP] Re: One form - Two emails, I need some help please

2002-01-29 Thread Matt Schroebel
And I write those as (true == $PHP_MAIL_FORM) so the parser will catch the missing second equal sign. This won't parse: (true = $PHP_MAIL_FORM) >Edward R. Bailey wrote: >if ($PHP_MAIL_FORM=true){ >should probably be >if ($PHP_MAIL_FORM==true){ -- PHP General Mailing List (http://www.php.net

RE: [PHP] How to echo the "/n", "/r", etc... to the HTML display?

2002-01-28 Thread Matt Schroebel
Read the first user note at the bottom of this manual page: http://www.php.net/manual/en/function.htmlentities.php -Original Message- >Subject: [PHP] How to echo the "/n", "/r", etc... to the HTML display? >So, you see, if I use the PHP function, nl2br(), that took care of the "cr"

RE: [PHP] mixed datatype

2002-01-28 Thread Matt Schroebel
http://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list -Original Message- >From: charlesk [mailto:[EMAIL PROTECTED]] >What does the function look like that it can take unlimited arguments? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-m

RE: [PHP] Sending Form Arrays

2002-01-28 Thread Matt Schroebel
What I do is: Box 1 Box 2 Box 3 Box 4 Box 5 Then in the action script you'll get an array with only the checked values named $checked. So $checked[0] could be 'Box 2' and $checked[1] could be 'Box 5'. Be aware if nothing is checked, then $checked won't be an array, so you'll need to test

RE: [PHP] Using the fsockopen ()-function

2002-01-24 Thread Matt Schroebel
>-Original Message- >From: Björne [mailto:[EMAIL PROTECTED]] >Subject: [PHP] Using the fsockopen ()-function >- >$sp = fsockopen ( "www.php.net", 80, &$errno, &$errstr, 25 ); if ( !$sp ) { > die ( $errno . ": " . $errstr ); >} >else { > fputs ( $sp, "POST /page.php HTT

RE: [PHP] Sending a POST-message

2002-01-24 Thread Matt Schroebel
I think this is what you're looking for. It's a script written by Rasmus. http://www.php-faq.com/faq.php#39 >I wonder how I can send a POST-command to a server, via a PHP-script instead >of a form. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] F

RE: [PHP] Clear form post data

2002-01-24 Thread Matt Schroebel
One would need to check the db to see if the operation had already been performed, so as not to do it again. >um , lets say a form calls its own page , does some db operations and then returns to >its former self , >how do you get it to not perform said db operations on refresh? >i.e the data i

RE: [PHP] Why while doesn't work?

2002-01-24 Thread Matt Schroebel
If you only want the associative array, just use mysql_fetch_array($result). If you're using the constant MYSQL_ASSOC, uppercase it, and don't quote it. >Although the table con_inf in db sbwresearch contains 3 records with >username as the first column, the following short script generates a

RE: [PHP] More Fun With Sessions!

2002-01-23 Thread Matt Schroebel
Your code works fine on my FreeBSD box running php 4.0.4pl1 but not one running php 4.0.6 ... May explain your linux issues? i.e. versions of php ... -Original Message- From: Richard Baskett [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 3:37 PM You only need to register

RE: [PHP] User Authentication

2001-11-13 Thread Matt Schroebel
Caveat: Don't forget to escape user input before sending to SQL. Those samples leave that part to your imagination. Bad guys might take advantage of that :) > http://www.google.com/search?q=php+mysql+user+authentication&b tnG=Google+Search > > First hit's a winner :) > > -- PHP General M

RE: [PHP] .htaccess for PHP

2001-05-22 Thread Matt Schroebel
php_value safe_mode 1 php_value max_execution_time 15 You need to also set the AllowOverride option in apache so that apache looks into the .htaccess file. http://httpd.apache.org/docs/misc/FAQ.html#htaccess-work > I heard that you can modify PHP settings with the .htaccess > file for Apache

RE: [PHP] Array Problem

2001-05-22 Thread Matt Schroebel
> What is the best way to delete an element from an array? > I tried using unset(), and it didn't work. unset works with arrary elements, but it must be a global variable and not passed in. Try the code below to see the results. in deleteGlobal()-Spot\n"; unset ($animals["Spot"]);

RE: [PHP] How do I have a Authentication box pop up?

2001-05-17 Thread Matt Schroebel
There are some user notes under that manual page that might be of use to you. > From: Brandon Orther [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 17, 2001 3:17 PM > > For some reason that doesn't provoke a Pop-up. Maybe this is > because I am on an IIS server. Any Ideas? > http://www.php

RE: [PHP] PHP: Variables in

2001-05-14 Thread Matt Schroebel
I would recommend: is logged in that way you won't get burned by quotes, etc ... > From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 14, 2001 7:59 AM > To: '[EMAIL PROTECTED]' > I want the the secure page to hold the users name > (from variable) in > the header Some

RE: [PHP] About MySQl and Transactions

2001-05-09 Thread Matt Schroebel
You have to have version 3.23 and read this: http://www.mysql.com/doc/C/O/COMMIT.html > From: Hassan Arteaga [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 09, 2001 1:24 PM > How I implements transaccions in MySQL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [E

RE: Re[2]: [PHP] Variables in variable names

2001-05-09 Thread Matt Schroebel
> or even try > > > > This should AFAIK result in an Array, but I'm not sure if > empty fields are put in. You will get the empty fields except for checkboxes. For checkboxes only the checked elements come through so you need values that determine which box was checked. So say you have:

RE: [PHP] download successfull... but in binary... why?

2001-05-09 Thread Matt Schroebel
the man page for header() says look here: http://www.w3.org/Protocols/rfc2616/rfc2616 > From: Christian Dechery [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 09, 2001 9:33 AM > where can I find reference on these header stuff? -- PHP General Mailing List (http://www.php.net/) To unsubscrib

RE: [PHP] mysql_trouble (check fast!)

2001-05-08 Thread Matt Schroebel
You have to check for a db result with either $count = mysql_num_rows($q_updateresult) or if ($row = mysql_fetch_array($q_updateresult)). mysql_query returns a 1 or 0 to indicate if the query was sucessful. One might typically query a db before inserting a record to make sure it's not there f

RE: [PHP] mySQL access denied with correct account/pw?

2001-05-08 Thread Matt Schroebel
If you are now accessing remotely, you'll need remote privileges for the user, not just user@localhost. Could also be the db name is incorrect. > -Original Message- > From: John Vanderbeck [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 08, 2001 2:59 PM He has given me the > account a

RE: [PHP] HTTP authentication : logout!!!

2001-05-07 Thread Matt Schroebel
$PHP_AUTH_USER = ""; $PHP_AUTH_PW = ""; Ought to do it. > From: Thomas Edison Jr. [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 07, 2001 8:39 AM > To: [EMAIL PROTECTED] > Subject: [PHP] HTTP authentication : logout!!! > Now i woul like to create a logout link after clicking > on which, whene

RE: [PHP] add to .htpasswd via php

2001-05-02 Thread Matt Schroebel
You might want to forget the exec and write direct to the file as in this code gallery item: http://www.zend.com/codex.php?id=521&single=1 > From: Joseph Koenig [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 02, 2001 1:40 PM > I'm attempting to streamline my work by writing a script that >

RE: [PHP] Logout Problem auf .htaccess-Login

2001-05-01 Thread Matt Schroebel
$PHP_AUTH_USER="" ought to do it. > From: Jochen Kaechelin [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 01, 2001 4:30 AM > Is it possible to unset $PHP_AUTH_USER and $PHP_AUTH_PW after > a successfull '.htaccess-login'? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-ma

RE: [PHP] template solutions?

2001-04-30 Thread Matt Schroebel
I'm using EasyTemplates from Web Application Development with PHP book by Tobias Ratschiller. It's quite simple, easy to modify, and I loop on a template, appending the html to a variable that I use elsewhere in another template. It really straightens out logic because you're building the pag

RE: [PHP] Get the title from an HTML page

2001-04-30 Thread Matt Schroebel
You can find a function that does that at http://www.zend.com called Get Title Tag in the Code Gallery under the HTML catagory. > -Original Message- > From: Matthew Ralston [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 30, 2001 9:25 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Get the

RE: [PHP] php FTP

2001-04-25 Thread Matt Schroebel
uld check this with > IE 5.1 & 5.5 > I'd like to know if this is just my browser. If it is I'll have to > reinstall NT to fix it. Damn, damn, and double-damn! > > Cheers - Miles > > > At 10:26 AM 4/25/01 -0400, Matt Schroebel wrote: > >I'v

RE: [PHP] php FTP

2001-04-25 Thread Matt Schroebel
I've never done it but here it is: http://conf.php.net/pres/index.php?p=slides%2Fintro&id=ac2 > -Original Message- > From: ryan.barnett1 [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 25, 2001 10:03 AM > To: [EMAIL PROTECTED] > Subject: [PHP] php FTP > > > Hi there, > > I would

RE: [PHP] Easy Form problem

2001-04-19 Thread Matt Schroebel
You need to run the mysql_db_query() twice. Once for each statement, and between the assignments: $query = ...; $mysql_db_query(...); $query = ...; $mysql_db_query(...); > I am trying to update two tables at once from a form using two Insert > statements: > > Should I be using two different va

<    1   2