Re: [PHP] XML Question

2003-03-03 Thread Joseph W. Goff
Sorry, but I am unaware of this function.  It is not a native function to
php, maybe it is a custom function that is part of a library that you are
using.  You would have to contact them for documentation on thier functions.

- Original Message -
From: Diana Castillo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 03, 2003 10:06 AM
Subject: [PHP] XML Question



 what does harvest mean? what would the function harvest do?



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Post method

2003-02-28 Thread Joseph W. Goff
Why not use sessions?
- Original Message -
From: Alex Shi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 28, 2003 3:09 PM
Subject: [PHP] Post method


 Hi,

 Any one know in a php script, if it is possible to simulate a post method?
 I mean I want to header() to an url but don't like to embed the parameters
 into that url.

 Thanks in advance!

 Alex Shi


 --
 ==
 Cell Phone Batteries at 30-50%+ off retail prices!
 http://www.pocellular.com
 ==
 TrafficBuilder Network:
 http://www.bestadv.net/index.cfm?ref=7029
 ==

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Why PHP doesn't work with Apache2?

2003-01-23 Thread Joseph W. Goff
Well, I don't know about trying to uninstall it, but RH8.0 does come with
Apache 2
It works fine and I have not ran into a reason why I should use the older
version for this.
Granted I only use it for testing, my live server is RH7.2 which uses Apache
1
- Original Message -
From: Richard Baskett [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 2:28 PM
Subject: Re: [PHP] Why PHP doesn't work with Apache2?


 Ok I am hearing a bad rumor that Red Hat 8.0 and the Mac xserve both come
 with Apache 2.. now is this a rumor or is this true?

 If it's true.. why?  And does anybody have any experience in uninstalling
 Apache 2 on the xserve and does it break anything?

 Cheers!

 Rick

 Don't walk in front of me, I may not follow, Don't walk behind me, I may
not
 lead, Just walk beside me, and be my friend. - Unknown

  From: Tim Thorburn [EMAIL PROTECTED]
  Date: Thu, 23 Jan 2003 05:03:00 -0500
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] Why PHP doesn't work with Apache2?
 
  Just to add a little fuel to the fire, the only way I've seen or been
able
  to get PHP and Apache 2 working together is by installing each from my
Red
  Hat 8.0 CD's.  When I tried to compile each together, I got many an
error.
 
  When I start doing some actually web work on my testing server, I
imagine
  I'll uninstall Apache 2, and go with some version of 1.3
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Form Validating Class (OOP misunderstandings...)

2003-01-21 Thread Joseph W. Goff
For the most part I found two errors
The first was a scope problem.  $HTTP_*_VARS hashes are not accessible
inside functions unless you source them in.  i.e. global
The other was an extra line in an if statement that did not contain braces.
I did a little formating while I checked the code.  Try this to see if it
works as you expected it to.
?php
class FormV {
var $errorList;

function FormV() {
$this-reset_errorList();
}

function getValue($field) {
global $HTTP_POST_VARS;
return $HTTP_POST_VARS[$field];
}

function isEmpty($field, $msg) {
$value = $this-getValue($field);
if(!trim($value)) {
$this-errorList[] = array('field'=$field,
'value'=$value, 'msg'=$msg);
return true;
} else
return false;
}

function isString($field, $msg) {
$value = $this-getValue($field);
if(is_string($value))
return true;
else {
$this-errorList[] = array('field'=$field,
'value'=$value,'msg'=$msg);
return false;
}
}

function isEmail($field, $msg) {
$value = $this-getValue($field);
$pattern = '/^([a-zA-Z0-9])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/';
if(preg_match($pattern, $value))
return true;
else {
$this-errorList[] = array('field'=$field,
'value'=$value, 'msg'=$msg);
return false;
}
}

function isError() {
if(sizeof($this-errorList)  0)
return true;
else
return false;
}

function get_errorList() {
return $this-errorList;
}

function reset_errorList() {
$this-errorList = array();
}

function stringConvert($field) {
$value = $this-getValue($field);
$value = html_special_chars($value);
$value = stripslashes($value);
$value = strtolower($value);

return $value;
}
}
?


- Original Message -
From: Nicholas Wieland [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 8:12 AM
Subject: [PHP] Form Validating Class (OOP misunderstandings...)


 Hello everybody,
 I'm working on a class but having a lot of problems... probably my
 understanding of PhP-OOP is not so good ...
 Here's the class: I found it on the web and I've tried to personalize
 it to fit my needs...

 ?php

 class FormV
 {
 var $errorList;

 function FormV()
 {
 $this-reset_errorList();
 }

 function getValue( $field )
 {
 $value = $HTTP_POST_VARS[ $field ];
 return $value;
 }

 function isEmpty( $field, $msg )
 {
 $value = $this-getValue( $field );

 if( trim( $value ) ==  )
 {
 $this-errorList[] = array( field = $field,
 value = $value, msg = $msg );
 return true;
 }
 else
 return false;

 }

 function isString( $field, $msg )
 {
 $value = $this-getValue( $field );

 if( is_string( $value ) )
 return true;

 else
 {
 $this-errorList[] = array( field = $field,
 value = $value, msg = $msg );
 return false;
 }
 }

 function isEmail( $field, $msg )
 {
 $value = $this-getValue( $field );
 $pattern =
 /^([a-zA-Z0-9])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/;

 if( preg_match( $pattern, $value ) )
 return true;

 else
 {
 $this-errorList[] = array( field = $field,
 value = $value, msg = $msg );
 return false;
 }
 }

 function isError()
 {
 if( sizeof( $this-errorList )  0 )
 return true;

 else
 return false;
 }

 function get_errorList()
 {
 return $this-errorList;
 }

 function reset_errorList()
 {
 $this-errorList = array();
 }

 function stringConvert( $field )
 {
 $value = $this-getValue( $field );

 $value = html_special_chars( $value );

 $value = stripslashes( $value );

 $value = strtolower( $value );

 return $value;
 }

 };

 ?

 Ok.
 I think that the getter is *totally* wrong but I'm not able to debug
 it, because it's private (I think...). Also the stringConvert() method
 sucks, maybe I'll split it in some others accessor methods, for a
 better design.
 Now I'm totally lost, I don't have a clue how to continue, I've tried
 for hours and hours to make it work, but didn't succeed :(
 Any suggestion on improving and other enhancment for a good form
 validating class is really really appreciated.

 TIA,
 Nicholas

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Parse error

2003-01-14 Thread Joseph W. Goff
Try this...

$sql = INSERT INTO personnel (firstname, lastname, nick, email, salary)
VALUES ('$first','$last','$nickname',);

- Original Message -
From: Brent Lee [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 10:02 AM
Subject: [PHP] Parse error


 I'm new to PHP and am slowly learning it. I have the following code that
is
 giving me errors could someone take a look and suggest a fix?

 Parse error: parse error in /home//public_html/Info/datain.php on
 line 7

 HTML
 ?php
 $db = mysql_connect(localhost, ,xx);
 mysql_select_db(learndb,$db);
 $sql = INSERT INTO personnel (firstname, lastname, nick, email, salary)
 VALUES ('$first','$last','$nickname',)
 $result = mysql_query'($sql);
 echo Thank you! Information entered.\n;
 ?
 /HTML




 --

 Thanks
 __
 Brent Lee



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] MySQL problem with RedHat 8

2003-01-14 Thread Joseph W. Goff
Make sure that the shared module is in the correct directory.
Check your php.ini file to make sure but it is most likely at /usr/lib/php4
make sure that you have mysql.so
- Original Message -
From: Daniel Elenius [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 3:58 PM
Subject: [PHP] MySQL problem with RedHat 8


 Hi!

 I'm trying to connect to my mysql database using something like

  mysql_connect( 'localhost', 'root', 'thepassword' )
 or die ( 'Unable to connect to server.' );

 But I get the error message:
 Fatal error: Call to undefined function: mysql_connect() in
 /home/daniel/public_html/index.php on line 21

 I have:

 [root@p85 /]# rpm -qa |grep sql
 php-mysql-4.2.2-8.0.5
 mysql-3.23.52-3
 mysql-server-3.23.52-3
 mysql-devel-3.23.52-3

 and:

 [root@p85 /]# rpm -q php
 php-4.2.2-8.0.5

 Someone mentioned these two settings in php.ini, which I tried with no
 success:

 register_globals = On
 short_open_tag = On

 phpinfo() says that php was compiled with '--with-mysql=shared,/usr'

 Can someone help me please?

 regards,
 --
 Daniel Elenius [EMAIL PROTECTED]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] question on Header(location

2003-01-13 Thread Joseph W. Goff
No, I am afraid not.  It will only send a redirection header to the same
page that you are on.
- Original Message -
From: Don [EMAIL PROTECTED]
To: php list [EMAIL PROTECTED]
Sent: Monday, January 13, 2003 1:33 PM
Subject: [PHP] question on Header(location


 When I use --- header(Location: http://www.somepage.com), it redirects
to
 my page no problem.  My question is, is there a PHP trick I can use to
make
 it open in a new browser window?

 I'm adverse to using JavaScript as some users may not have it turned on
(odd
 I know but a reality still).

 Thanks,
 Don


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] undefined variable notice - how to furn of

2003-01-09 Thread Joseph W. Goff
In the php.ini file set error reporting to E_ALL  ~E_NOTICE

- Original Message -
From: Borut Kovacec [EMAIL PROTECTED]
To: PHP Mailing List [EMAIL PROTECTED]
Sent: Thursday, January 09, 2003 9:57 AM
Subject: [PHP] undefined variable notice - how to furn of


Hi

I just installed new php 4.2.3 on Win XP, Apache 1.3.24..
Everything works fine, just now I'm getting Notice messages for every
undefined variable or undefined index in arrays..

So now I have to use issset() everytime to avoid this messages...

..is there any way to turn this messages off, because if prior versions I
never got them..??

Borut



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] newbee

2003-01-09 Thread Joseph W. Goff
This is because of the default error reporting setting in the newer version
of php.  This was not the case when your book was written.
In your php.ini file set error reporting = E_ALL  ~E_NOTICE and you will
quit getting the 'Undefined Variable' notices.
- Original Message -
From: Hendrik van Niekerk [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 09, 2003 10:50 AM
Subject: [PHP] newbee


 Hi

 I'm very new to PHP. (have just bought the book PHP and MySQL Web
 Deelopment) SAMS authors Luke Welling and Laura Thompson

 I working with the examples in the book.

 I have loaded MySQL, Apache and PHP onto a NT server. All the test passed
as
 per the examples in the book.

 Working with the the first example in chapter one.

 I have the HTML document that when the quantities are entered the
 processorder.php should be called to show the results and do some calcs.

 what happens is that the php file is called but I get an error message:

 Warning: Undefined variable typeqty in C:\apache
 group\apache\htdocs\processorder.php on line 23

 this varialbe is defined in the html document exactly as in the php
 document.

 now this warning is repeated for all the variables that should have been
 passed to the php for processing.

 What am I missing ?


 thank you in advance


 Hendrik van Niekerk



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] newbee

2003-01-09 Thread Joseph W. Goff
Without seeing some code I would guess that it is register globals issue.
It falls into the same explanation as the previous problem.  You can fix
this in one of two ways.
1) use the super globals
instead of $typeqty use $_POST['typeqty'] or $_GET['typeqty'] depending on
how it is passed.
2) turn register globals on in the php.ini file.

- Original Message -
From: Hendrik van Niekerk [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 09, 2003 11:58 AM
Subject: Re: [PHP] newbee


 Joseph

 I can get the errors to go away but then my example just shows a blank
page!
 The variable are not being passed through to the .php doc

 hendrik

 Joseph W. Goff [EMAIL PROTECTED] wrote in message
 003201c2b803$ada54f60$bdcaa8c0@jg42000">news:003201c2b803$ada54f60$bdcaa8c0@jg42000...
  This is because of the default error reporting setting in the newer
 version
  of php.  This was not the case when your book was written.
  In your php.ini file set error reporting = E_ALL  ~E_NOTICE and you
will
  quit getting the 'Undefined Variable' notices.
  - Original Message -
  From: Hendrik van Niekerk [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Thursday, January 09, 2003 10:50 AM
  Subject: [PHP] newbee
 
 
   Hi
  
   I'm very new to PHP. (have just bought the book PHP and MySQL Web
   Deelopment) SAMS authors Luke Welling and Laura Thompson
  
   I working with the examples in the book.
  
   I have loaded MySQL, Apache and PHP onto a NT server. All the test
 passed
  as
   per the examples in the book.
  
   Working with the the first example in chapter one.
  
   I have the HTML document that when the quantities are entered the
   processorder.php should be called to show the results and do some
 calcs.
  
   what happens is that the php file is called but I get an error
message:
  
   Warning: Undefined variable typeqty in C:\apache
   group\apache\htdocs\processorder.php on line 23
  
   this varialbe is defined in the html document exactly as in the php
   document.
  
   now this warning is repeated for all the variables that should have
been
   passed to the php for processing.
  
   What am I missing ?
  
  
   thank you in advance
  
  
   Hendrik van Niekerk
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Variables that persist through reload?

2003-01-03 Thread Joseph W. Goff
Your local version does not have register_globals turned on in php.ini.
You can either set the value = on or access posted values by using $_POST or
$HTTP_POST_VARS depending on your version of php.
- Original Message -
From: David Chamberlin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 1:58 PM
Subject: [PHP] Variables that persist through reload?


 Hey,

 I'm somewhat new to PHP and I'm doing a lot of forms stuff.  Looking at
 some of the examples at:

 http://www.linuxguruz.org/z.php?id=33

 The variables seem to persist through a reload.  For example, the first
 demo has:

 
 ?
 if (!isset($pick)) {
 echo Fill out and submit the form below.; }
 else {
 $j = count($pick);
 for($i=0; $i$j; $i++) {
 echo Pick b$pick[$i]/b is Checkedbr /; }
 }
 ?

 form action=? echo $PHP_SELF; ?
 ol
 liPaintinginput name=pick[] type=checkbox value=Painting //li
 liPlumbinginput name=pick[] type=checkbox value=Plumbing //li
 liElectricinput name=pick[] type=checkbox value=Electric //li
 /ol

 input type=submit value=Submit! /
 input type=reset value=Reset /
 /form
 

 So the $pick variable is maitained through the submit.  When I demo the
 script on that site, it works as advertised.  When I use the same code
 on my web server, it doesn't work ($pick is never set after submitting).
Is there some configuration option that dictates whether variables
 persist in this manner?

 Thanks,
 Dave


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Hello and help

2003-01-03 Thread Joseph W. Goff
You are on the right track, but missed one major thing.
Anytime you want to retrieve information from a database result set you have
to follow 3 basic steps.
1) Connect to the database *you got that one
2) Execute a query *you got that one
3) Retrieve the resultset ***missed this one

See http://www.php.net/mysql_fetch_assoc for the appropriate syntax.


- Original Message -
From: Todd Barr [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 6:32 PM
Subject: [PHP] Hello and help


I am a PHP newbie, and I am having difficulty in getting my records to
display

here is my code

?php
$Host=localhost;
$User=us34992a;
$Password=*;
$DBname=db34992a;
$Tablename=calendar;
$Link=mysql_pconnect($Host, $User, $Password)
or die (YOu suck1);
$db=mysql_select_db($DBname, $Link)
or die (ISUCKEGGS);
$result=mysql_query(SELECT * from calendar, $Link)
or die (YOu suck3);
print(table width=53% border=0 cellpadding=0 cellspacing=0\n);
print (tr\n);
print (td background=topbig.gif\n);
print (div align=centerfont face=Arial, Helvetica,
sans-serifbfont color=#FFCalender/font/b/font/div
  /td
/tr\n);
print (tr bgcolor=#009ACE\n);
print(td$result[meeting_name]/td\n)or die (you suck);
mysql_close ($Link);
?

any help?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Baffling output

2003-01-02 Thread Joseph W. Goff
Try viewing the source that is generated in html and I bet you will find
that it is broken html code.
- Original Message -
From: Lightfirst [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 02, 2003 4:25 PM
Subject: [PHP] Baffling output


 Can someone explain to me why the loop that counts to 99 appears before
the
 5 by 5 grid in the following php code?

 Thanks!

 ?php

 echo table border=\1\ align=\center\ width=\100%\
 bgcolor=\#FF\ bordercolor=\#FF\tr;

   for ($r=0; $r5; $r++){

 for ($c=0; $c7; $c++){

   if ($c==0 || $c%7==0)

  echo td align=\center\ valign=\middle\ width=\15%\
 height=\77\ bordercolor=\#00\/td; else if ($c%6==0)

 echo td align=\center\ valign=\middle\ width=\14%\
 height=\77\ bordercolor=\#00\/td/trtr;

else {

  echo td align=\center\ valign=\middle\ width=\15%\
 height=\77\ border=\1\ bordercolor=\#00\;

  echo div align=\center\font size=\1\/font/div;

  echo Hello ; $i++;

   } //for else

}// for loop c

  } //for loop r

 for ($i=1; $i100; $i++)

 echo $ibr\n;

 ?




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $_SERVER['DOCUMENT_ROOT'] on localhost

2002-12-18 Thread Joseph W. Goff
Is there a difference between PHP versions on your machine and your site?
Have you looked at phpinfo() to see what variables have been set on your
system?

- Original Message -
From: rolf vreijdenberger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 3:38 PM
Subject: [PHP] $_SERVER['DOCUMENT_ROOT'] on localhost



 hey there,

 I include files outside the document root in my site.
 include $_SERVER['DOCUMENT_ROOT'].../inc.php ;

 when I use this on the localhost it doesn't find this variable:
 $_SERVER['DOCUMENT_ROOT']

 which makes testing more annoying since I have to upload to my site all
the
 time.

 any ideas on the how and why???
 thanks a lot



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $_SERVER['DOCUMENT_ROOT'] on localhost

2002-12-18 Thread Joseph W. Goff
Both sites are running winXP and IIS?  Both same version of IIS?
If the variable is on one and not on the other it could be either a version
conflict, or a configuration problem.
- Original Message -
From: Rolf Vreijdenberger [EMAIL PROTECTED]
To: Joseph W. Goff [EMAIL PROTECTED]; php-general
[EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 3:50 PM
Subject: Re: [PHP] $_SERVER['DOCUMENT_ROOT'] on localhost


 yes, the server var doesn't exist in phpifno();

 no difference
 winxp pro with iss

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $_SERVER['DOCUMENT_ROOT'] on localhost

2002-12-18 Thread Joseph W. Goff
IIS may not have that variable.
You might want to install apache on your local machine so that you are using
the same tools.

- Original Message -
From: rolf vreijdenberger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 4:00 PM
Subject: Re: [PHP] $_SERVER['DOCUMENT_ROOT'] on localhost



 the document_root just doesn't show up in my phpinfo();

 do windows machines have one anyway?
 I have used this var before, just not testing it locally.

 It normally shows up when I use phpifno on the server.



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Submitting a Form

2002-12-17 Thread Joseph W. Goff
Your error reporting is set to E_ALL.  If you change it to E_ALL  ~E_NOTICE
you will not get the notice messages anymore.
Also, if you are not getting the value, try $_POST['Test'] instead.
- Original Message -
From: Jay Thayer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 11:38 AM
Subject: [PHP] Submitting a Form


 I have a php page, with a form I am attempting to submit.
 form method=Post action=submitTest.php
 input type=hidden name=Test value=Test Value
 input type=submit value=Submit name=SubmitTest
 form

 In submitTest.php, I simply put
 ?php
 print $Test;
 ?

 Yet, I continually get the browser message:
 Notice: Undefined variable: Test in ...\submittest.php on Line 2

 1. Any reason that I can not pass the variable to the submit page?  I am
 using an Apache Web Server on Windows XP.  I am simplying attempting to
pass
 a variable from one page to another, so I can update my database.  This is
 just a simple test that is failing.

 2. If I have a select name=testmultiple multiple HTML tag, how can I
 reference the x# of variables that are selected in that form value in the
 submittest page?  I would want to get every option that is selected in the
 page.

 3. Is there a variable so that I can see everything that is passed from
the
 form, some debug variable I could print() to see everything that was
 passed from the form?

 Anyone have an idea?



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP question

2002-12-17 Thread Joseph W. Goff
You can set this up in the php.ini file in the /etc directory.
You can set php to run an any user and any group that you have set up on
your system.  Just make sure that you set permissions properly so that it
can function in the directories that it is accessed.
- Original Message -
From: Tom Ray [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 1:11 PM
Subject: [PHP] PHP question


 Are PHP script supposed to run as the user or as the web server?
 Currently I'm running Red Hat 7.3 with apache 1.3.x and all my PHP
 scripts run as apache, not as the user. I'm wonder if I can run the
 scripts as the user and how do I fix this?

 Any help would be great!


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP question

2002-12-17 Thread Joseph W. Goff
Actually, I was mistaken.  It isn't php.ini that has to be changed.  I
believe it is httpd.conf.
php runs as what ever the webserver is set up to run as.
- Original Message -
From: Joseph W. Goff [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]; Tom Ray
[EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 1:18 PM
Subject: Re: [PHP] PHP question


 You can set this up in the php.ini file in the /etc directory.
 You can set php to run an any user and any group that you have set up on
 your system.  Just make sure that you set permissions properly so that it
 can function in the directories that it is accessed.
 - Original Message -
 From: Tom Ray [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 Sent: Tuesday, December 17, 2002 1:11 PM
 Subject: [PHP] PHP question


  Are PHP script supposed to run as the user or as the web server?
  Currently I'm running Red Hat 7.3 with apache 1.3.x and all my PHP
  scripts run as apache, not as the user. I'm wonder if I can run the
  scripts as the user and how do I fix this?
 
  Any help would be great!
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $HTTP_POST_VARS problem

2002-12-16 Thread Joseph W. Goff
It looks to me like you are trying to get an uploaded file?
If so, it isn't $HTTP_POST_VARS, it is $HTTP_POST_FILES or $_FILES if you
are using a version of PHP that has super globals.
See the PHP manual for more info:
http://www.php.net/manual/en/language.variables.predefined.php

- Original Message -
From: Chris Shiflett [EMAIL PROTECTED]
To: Lee P. Reilly [EMAIL PROTECTED]; PHP [EMAIL PROTECTED]
Sent: Monday, December 16, 2002 10:04 AM
Subject: Re: [PHP] $HTTP_POST_VARS problem


 --- Lee P. Reilly [EMAIL PROTECTED] wrote:
  The following statements have the following return
  values:
 
  echo $HTTP_POST_VARS['userfile'];
  = C:\\Documents and Settings\\Administrator\\Desktop\\IR
  Files\\gmp1.ir
 
  echo $userfile;
  = C:\\Documents and Settings\\Administrator\\Desktop\\IR
  Files\\gmp1.ir
 
  echo $HTTP_POST_VARS['userfile']['name'];
  = NOTHING RETURNED
 
  echo $HTTP_POST_VARS['userfile']['size'];
  = NOTHING RETURNED
 
  echo $userfile_size;
  = NOTHING RETURNED
 
  echo $userfile_name;
  = NOTHING RETURNED
 
  Does anyone know what the problem is?

 What do you think the problem is? I don't see anything
 unexpected, unless I'm missing something.

 Chris

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] FTP Can't create temp file?

2002-12-16 Thread Joseph W. Goff
What happens when you remove the suppresion operator (@) from the
move_upload_file and why not just use ftp_put()?
That has always worked fine for me.
- Original Message -
From: Marios Adamantopoulos [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 16, 2002 11:06 AM
Subject: [PHP] FTP Can't create temp file?



 Hi all again

 I'm trying to upload to a unix server. The program I use works fine on my
 2000 IIS machine but it has a problem on the online one. Permittions have
 been checked and I've been looking all day to find something, but natha...

 I would appreciate it if someone can have a look and suggest something.
Here
 is the script:


 $conn_id = ftp_connect($ftpServer);
 $login_result = ftp_login($conn_id, $ftpUser, $ftpPass);
 if ((!$conn_id) || (!$login_result)) {
 echo FTP connection has failed!;
 echo Attempted to connect to $ftpServer for user $ftpUser;
 exit;
 } else {
 //echo Connected to $ftpServer, for user $ftpUser;
 }


 $phpftp_dir = ;

 echo br-- . ftp_pwd($conn_id) . br;


 $phpftp_tmpdir=/tmp;


 srand((double)microtime()*100);
 $randval = rand();
 $tmpfile=$phpftp_tmpdir . / . $thefile_name . . . $randv;

 echo Temp file:  . $tmpfile . br;


 if (!@move_uploaded_file($thefile,$tmpfile)) {
 echo Upload failed!  Can't create temp file;
 } else {
 ftp_chdir($conn_id,$phpftp_dir);
 ftp_put($conn_id,$thefile_name,$tmpfile,FTP_BINARY);
 //ftp_quit($conn_id);
 unlink($tmpfile);
 }

 ---
 I always get: Upload failed!  Can't create temp file

 Thank you guys in advance

 Mario



 _
 Marios Adamantopoulos
 Senior Developer

 Tonic
 +44 (0)20 7691 2227
 +44 (0)7970 428 372
 www.tonic.co.uk

 Recent projects
 www.polydor.co.uk
 www.adcecreative.org
 www.sony-europe.com/pocketlife


 
 Opinions, conclusions and other information in this message that do not
 relate to the official business of Tonic Design Limited shall be
 understood as neither given nor endorsed by them.


 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] URL field receiving Array for others

2002-12-16 Thread Joseph W. Goff
Whatever variable that is suppose to contain the URL is an array.  If you
try to print a variable that is an array the value you get is 'Array'.  You
will either have to step through it, or implode it, or something of that
nature to get what the array contains.
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 16, 2002 11:50 AM
Subject: [PHP] URL field receiving Array for others



 Hello All!

 I have a script which inserts a users info into mysql via PHP.

 Here is the code which does so:

 $sql = (INSERT INTO `business` (`id`, `bt_id`, `bus_name`, `bcity`,
`phone`,
 `cell`, `email`, `url`, `details`, `duration`, `s_id`, `license`,
`datime`,
 `comments`,`ip`,`user_id`,`user_pass`)
 VALUES
 ('', '$bus_type_id', '$bus_name', '$city_id', '$phone', '$cell',
 '$email', '$url', '$details', '$duration', '$state_id', '$license',
 '$date','$comments', '$REMOTE_ADDR', '$user_id',
password('$userpass2')));

 and it sends a mail to me, however crude:


 100% ASAP Plumbing and Rooter Specialist, City ID: 2647
  1-866-FIX- GUARD,
   l

  Array  (this is supposed to be a url)

 PlumberASAP.com Specializing in Drains, Faucets, Filters, Repairs,
Sprinkers,
 Installations, Water Heaters, Disposals, Copper Plumbing, Leak Detection.
Fast,
 Clean and Courteous Service Danny McGowan Owner/Operator
 ,
 12 months,


 I can't duplicate the problem.

 Any idea what is happening here?

 Thanks


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] URL field receiving Array for others

2002-12-16 Thread Joseph W. Goff
I don't know.  You need to show your code.
- Original Message -
From: [EMAIL PROTECTED]
To: Joseph W. Goff [EMAIL PROTECTED]
Cc: php-general [EMAIL PROTECTED]
Sent: Monday, December 16, 2002 12:01 PM
Subject: Re: [PHP] URL field receiving Array for others



 But what could the user be typing into the field to return an array?

 I'm completely at a loss.

 Quoting Joseph W. Goff [EMAIL PROTECTED]:

 ### Whatever variable that is suppose to contain the URL is an array.  If
you
 ### try to print a variable that is an array the value you get is 'Array'.
 ### You
 ### will either have to step through it, or implode it, or something of
that
 ### nature to get what the array contains.
 ### - Original Message -
 ### From: [EMAIL PROTECTED]
 ### To: [EMAIL PROTECTED]
 ### Sent: Monday, December 16, 2002 11:50 AM
 ### Subject: [PHP] URL field receiving Array for others
 ###
 ###
 ### 
 ###  Hello All!
 ### 
 ###  I have a script which inserts a users info into mysql via PHP.
 ### 
 ###  Here is the code which does so:
 ### 
 ###  $sql = (INSERT INTO `business` (`id`, `bt_id`, `bus_name`, `bcity`,
 ### `phone`,
 ###  `cell`, `email`, `url`, `details`, `duration`, `s_id`, `license`,
 ### `datime`,
 ###  `comments`,`ip`,`user_id`,`user_pass`)
 ###  VALUES
 ###  ('', '$bus_type_id', '$bus_name', '$city_id', '$phone',
 ### '$cell',
 ###  '$email', '$url', '$details', '$duration', '$state_id', '$license',
 ###  '$date','$comments', '$REMOTE_ADDR', '$user_id',
 ### password('$userpass2')));
 ### 
 ###  and it sends a mail to me, however crude:
 ### 
 ### 
 ###  100% ASAP Plumbing and Rooter Specialist, City ID: 2647
 ###   1-866-FIX- GUARD,
 ###l
 ### 
 ###   Array  (this is supposed to be a url)
 ### 
 ###  PlumberASAP.com Specializing in Drains, Faucets, Filters, Repairs,
 ### Sprinkers,
 ###  Installations, Water Heaters, Disposals, Copper Plumbing, Leak
 ### Detection.
 ### Fast,
 ###  Clean and Courteous Service Danny McGowan Owner/Operator
 ###  ,
 ###  12 months,
 ### 
 ### 
 ###  I can't duplicate the problem.
 ### 
 ###  Any idea what is happening here?
 ### 
 ###  Thanks
 ### 
 ### 
 ###  --
 ###  PHP General Mailing List (http://www.php.net/)
 ###  To unsubscribe, visit: http://www.php.net/unsub.php
 ### 
 ###
 ###
 ### --
 ### PHP General Mailing List (http://www.php.net/)
 ### To unsubscribe, visit: http://www.php.net/unsub.php
 ###
 ###




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Stumped!

2002-12-16 Thread Joseph W. Goff
You don't have a closing french brace for your while loop.
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, December 16, 2002 12:57 PM
Subject: Re: [PHP] Re: Stumped!


Hmm, I am still getting a parse error on the last line of code...


In a message dated 12/16/2002 1:49:26 PM Eastern Standard Time,
[EMAIL PROTECTED] writes:

 $sql = SELECT .;
 $sql_e = mysql_query($sql);

 while ($result = mysql_fetch_array($query_e)) {
 .
 }

 You were missing the mysql_query


 [EMAIL PROTECTED] escribió en el mensaje
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am trying to display a column from my database as a list.  Each listing
 needs to be a URL that links to another script that brings up all of the
 data
 in the row to edit.  I keep getting a parser error and I can't figure it
 out.
  Here is the code and any help is greatly appreciated.
 
 ?php
 $db = mysql_connect(localhost, Uname, PW);
 
 $select_db = mysql_select_db(machmedi_meetingRequest,$db);
 $sql = SELECT * FROM requests;
 
 while ($result = mysql_fetch_array($query)) {
 $id= $result[id];
 $meetingName= $result[meetingName];
 
 echo (A HREF=/edit.php?id='$id'\$meetingName/A );
 ?
 




Christopher Parker
Senior Corporate Technical Specialist, Corporate Events
America Online Inc.
Phone: 703.265.5553
Fax: 703.265.2007
Cell: 703.593.3199





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php setup

2002-12-16 Thread Joseph W. Goff
You have the error_reporting set at E_ALL in the ini file.  Set it to E_ALL
 ~E_NOTICE
- Original Message -
From: Edward Peloke [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Monday, December 16, 2002 1:29 PM
Subject: [PHP] php setup


 I recently got a laptop and was in the process this weekend of installing,
 php, apache, mysql etc.  One thing I noticed is when I ran the code (that
 works fine everywhere else) on the laptop, I got errors of 'Variable not
 defined' and I have pictures that just won't show.  I am not sure if this
is
 the problem but most of the scripts giving the 'Variable not defined
problem
 and the images where in other folders and referenced in the php page like
 /images/picture.gif and /includes/template1.inc.  Is there something I
need
 to look at in my config file?

 Thanks,
 Eddie


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Date Formatting

2002-12-13 Thread Joseph W. Goff
Just a small question, but why not just do this through the SQL statement
instead of using php?
http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1295
[from the mysql manual]
mysql SELECT DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y');
- 'Saturday October 1997'
mysql SELECT DATE_FORMAT('1997-10-04 22:23:00', '%H:%i:%s');
- '22:23:00'
mysql SELECT DATE_FORMAT('1997-10-04 22:23:00',
  '%D %y %a %d %m %b %j');
- '4th 97 Sat 04 10 Oct 277'

- Original Message -
From: Clint Tredway [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 11:55 AM
Subject: [PHP] Date Formatting


How can I format a date coming out of a MySQL? I know how to format today's
date but not a date coming out of MySQL. I have looked through the manual,
but I must be blind because I cannot figure it out.

Thanks,
Clint


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] newbie - decimal places in arthimetic functions

2002-12-13 Thread Joseph W. Goff
You can use the format() function for this.
http://www.php.net/format

- Original Message - 
From: Max Clark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 1:10 PM
Subject: [PHP] newbie - decimal places in arthimetic functions


 Hi-
 
 How can I control the decimal places returned by an arthimetic function?
 
 I would like this divsion function to only return two decimal places
 (rounded up).
 
 $calcsize = $value / $oneGig;
 
 Thanks in advance,
 Max
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] FTP Listings for HTML page

2002-12-13 Thread Joseph W. Goff
As long as the script has reading capabilities for the directory then yes.
- Original Message - 
From: Randum Ian [EMAIL PROTECTED]
To: 'Kevin Stone' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 1:25 PM
Subject: RE: [PHP] FTP Listings for HTML page


 Would I be able to do this for an ftp server where I have to log in?
 
 -Original Message-
 From: Kevin Stone [mailto:[EMAIL PROTECTED]] 
 Sent: 13 December 2002 19:07
 To: Randum Ian; [EMAIL PROTECTED]
 Subject: Re: [PHP] FTP Listings for HTML page
 
 Yes it is doable.
 see. open_dir(); @ www.php.net
 
 You can also find a number of premade scripts on HotScripts.com or one
 of
 the class stores.  Do a search on Google.
 
 -Kevin
 
 
 - Original Message -
 From: Randum Ian [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, December 13, 2002 11:38 AM
 Subject: [PHP] FTP Listings for HTML page
 
 
  Hi guys, I am maintaining a list of files on an FTP server and it
 would
  be great if I could get a very simple list of all the files and their
  directory names so I can generate a HTML page with the information.
 
  Is this doable?
 
  Randum Ian
  [EMAIL PROTECTED]
  DJ / Reviewer / Webmaster, DancePortal (UK) Limited
  DancePortal.co.uk - Global dance music media
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] newbie - decimal places in arthimetic functions

2002-12-13 Thread Joseph W. Goff
I'm sorry, posted the wrong link.
It is the number_format() function.
http://www.php.net/number_format

- Original Message -
From: Joseph W. Goff [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]; Max Clark
[EMAIL PROTECTED]
Sent: Friday, December 13, 2002 1:31 PM
Subject: Re: [PHP] newbie - decimal places in arthimetic functions


 You can use the format() function for this.
 http://www.php.net/format

 - Original Message -
 From: Max Clark [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, December 13, 2002 1:10 PM
 Subject: [PHP] newbie - decimal places in arthimetic functions


  Hi-
 
  How can I control the decimal places returned by an arthimetic function?
 
  I would like this divsion function to only return two decimal places
  (rounded up).
 
  $calcsize = $value / $oneGig;
 
  Thanks in advance,
  Max
 
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Progress bar for uploading files

2002-10-16 Thread Joseph W. Goff

Actually, I don't think you can make a progress bar function correctly for a
file upload.  The file is uploaded before control is ever given to the
script.
- Original Message -
From: Oscar F [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 16, 2002 1:17 PM
Subject: [PHP] Progress bar for uploading files


 Hello,

 I'm working on a file uploading script, but I need to know if there is a
 way to know what's the progress of the file, so I can make la a progress
 bar?.. Any ideas? Please?.

 Thanks in advance.

   Oscar F.-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Variables and Forms

2002-09-24 Thread Joseph W. Goff

This should open up a new window for the new page
form action=your_new_page.php method=post target=_new

As far as passing variables from page to page, have you ever considered
sessions?

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 24, 2002 2:46 PM
Subject: [PHP] Variables and Forms



  I'm trying to pass variables from one page to the next but don't want to
 use a hidden input type=text box. I need to break from frames and I don't
 know a way to pass that to the action tag in the form. If there's a way to
 do that then great but I haven't found it. I've also tried the meta
 http-equiv=window-target content tag on the action page from the form
 and it didn't work either.

 TIA

 Ed Curtis



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP source code

2002-09-19 Thread Joseph W. Goff

PHP is open source so anyone can get the source code to it.  You can find it
at http://www.php.net/downloads.php

- Original Message -
From: Oliver Witt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 19, 2002 9:50 AM
Subject: [PHP] PHP source code


 Hi,
 Is there any way to read php source code? I didn't think so until I
 heard about people you have done that...
 Kind regards,
 Oliver


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Building a query on multiple variables, how to test for which variable A SOLUTION

2002-08-28 Thread Joseph W. Goff
I have done this two different ways.
The first involves a function that creates a dropdown from the database.
What is special about this function is that I assign it's own condition as
part of the value for that option.  Take this sql statement: select distinct
column_name from the_table
and it would generate this for a select statement:
select name="column_name"
option value=" "All/option
option value=" and column_name='some_value'"some_value/option
option value=" and column_name='another_value'"another_value/option
option value=" and
column_name='a_different_value'"a_different_value/option
/select

Then, when the form is processed, the sql statement would be as follows:
$sql="select whatever_columns from the_table where 1=1$column_name";

The second method is somewhat similar in that the sql statement would remain
the same, but you would have to check each select value to see if you needed
to add a "and column_name ='$column_value'" to it.  i.e.
select statement would be like:
select name="column_name"
option value=" "All/option
option value="some_value"some_value/option
option value="another_value"another_value/option
option value="a_different_value"a_different_value/option
/select

processing would be like:
if (trim($column_name))
$column_name=" and column_name='$column_name'";
$sql="select whatever_columns from the_table where 1=1$column_name";

The important part on this is that you don't have to be concerned with
whether or not to use and or where on the statement, always use and, and in
your sql statement put a where clause that is always true.  i.e. where 1=1.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] command line argument vs. urlencode ?

2002-08-28 Thread Joseph W. Goff

php is treating command line arguments as GET argument.  So that means a +
is a space.  Try rawurlencode.
- Original Message -
From: Renato Lins [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 28, 2002 1:37 PM
Subject: [PHP] command line argument vs. urlencode ?


 Hi,
   Any one know why the + (plus sign) is not passed as argument to
 $argv  when calling a php script from linux shell ?

   if this is not a bug, how do I pass a + as argument ?
   should I use urlencode/urldecode ?
   is that any php.ini variable to turn off this behavior ?

 try this and you will see :


  teste.php--
 ?php
 foreach( $argv as $x )
 printf(p: %s\n,$x);
 ?
 ---
 call with :

 php test.php 123 xxx+


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Exiting from an include or required file

2002-08-21 Thread Joseph W. Goff

You will have to enclose the code is some form of a container.
i.e. a function, while loop...
I would probably use the function, then you could exit with return
The other types of container would use break.
- Original Message - 
From: Henry [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 21, 2002 9:59 AM
Subject: Re: [PHP] Exiting from an include or required file


 Thanks, but my situation is slight more convoluted than I describe.
 
 I want to cascade down through a include chain and want to just stop
 processing the current include and return to the one which called it.
 Similar to exit() but only for the local scope.
 
 TIA
 
 Henry
 
 Mark Roedel [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
 Seems like the easy way, at least in this case, would be to make the
 second part of your File A an else to your if.
 
 ?php
 if (empty($_POST['search_criteria'])) {
 echo You must provide search criteria;
 } else {
 echo You provided search criteria;
 }
 
 
 ---
 Mark Roedel   | Blessed is he who has learned to laugh
 Systems Programmer|  at himself, for he shall never cease
 LeTourneau University |  to be entertained.
 Longview, Texas, USA  |  -- John Powell
 
 
  -Original Message-
  From: Henry [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, August 21, 2002 9:40 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Exiting from an include or required file
 
 
  Hi All,
 
  I would like to exit from an include file and continue in the calling
  script!
 
  As an example
 
  FILE A:
 
  ?php
  if (empty($_POST['search_criteria'))
  {
echo You must provide search criteria;
 
// exit the include file here But how?
   }
 
  echo You have provided serach criteria;
  ?
 
 
  FILE B
 
  #include A;
 
  form method=post
  input name=search_criteria type=text
  /form
 
  TIA
 
  Henry
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Exiting from an include or required file

2002-08-21 Thread Joseph W. Goff

Actually, M.A.Bond is right, you don't even have to enclose it, just use the
return construct.
- Original Message -
From: Joseph W. Goff [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]; Henry
[EMAIL PROTECTED]
Sent: Wednesday, August 21, 2002 10:03 AM
Subject: Re: [PHP] Exiting from an include or required file


 You will have to enclose the code is some form of a container.
 i.e. a function, while loop...
 I would probably use the function, then you could exit with return
 The other types of container would use break.
 - Original Message -
 From: Henry [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, August 21, 2002 9:59 AM
 Subject: Re: [PHP] Exiting from an include or required file


  Thanks, but my situation is slight more convoluted than I describe.
 
  I want to cascade down through a include chain and want to just stop
  processing the current include and return to the one which called it.
  Similar to exit() but only for the local scope.
 
  TIA
 
  Henry
 
  Mark Roedel [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  Seems like the easy way, at least in this case, would be to make the
  second part of your File A an else to your if.
 
  ?php
  if (empty($_POST['search_criteria'])) {
  echo You must provide search criteria;
  } else {
  echo You provided search criteria;
  }
 
 
  ---
  Mark Roedel   | Blessed is he who has learned to laugh
  Systems Programmer|  at himself, for he shall never cease
  LeTourneau University |  to be entertained.
  Longview, Texas, USA  |  -- John Powell
 
 
   -Original Message-
   From: Henry [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, August 21, 2002 9:40 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP] Exiting from an include or required file
  
  
   Hi All,
  
   I would like to exit from an include file and continue in the calling
   script!
  
   As an example
  
   FILE A:
  
   ?php
   if (empty($_POST['search_criteria'))
   {
 echo You must provide search criteria;
  
 // exit the include file here But how?
}
  
   echo You have provided serach criteria;
   ?
  
  
   FILE B
  
   #include A;
  
   form method=post
   input name=search_criteria type=text
   /form
  
   TIA
  
   Henry
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] variables not behaving as expected

2002-08-19 Thread Joseph W. Goff

You don't actually have a variable named $do at this point.
You can either have php set this variable automatically by turning on
register globals in the php.ini file or you can extract the variable or do
something like this:
foreach ($_POST as $key = $post)
{
echo $key = $postBr;
$$key = $post;
 }

- Original Message -
From: ROBERT MCPEAK [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 19, 2002 12:58 PM
Subject: [PHP] variables not behaving as expected


 We've recently upgraded to PHP version 4.2.2 running on SuSE 7.2 with
 the 2.4.4 kernel and I'm seeing variables behave in a way I didn't
 expect.  With the prior configuration http post variables were freely
 available on the receiving page, but now, for some reason, they aren't.

 This code:

 foreach ($_POST as $key = $post)
 {
 echo $key = $postBr;
 $key = $post;
 }
 echo hr;
 echo do = $do;

 renders this result:

 do = addart
 display_date = date
 art_time = time
 art_url = url
 art_link = link
 src_link = link
 src_url = url
 --
--
 do =


 Why is the $do variable null outside of the for loop?  Shouldn't it
 equal addart? Shouldn't it be available anywhere on the page?  With
 the previous configuration the http post variables were available
 anywhere on the page.  Is this a php configuration issue?

 Thanks!





 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] OO code and private functions

2002-08-16 Thread Joseph W. Goff

Not currently, but this will be added in the Zend2 engine.  You can find out
about this on the Zend website.
- Original Message -
From: Richard Black [EMAIL PROTECTED]
To: Php-General [EMAIL PROTECTED]
Sent: Friday, August 16, 2002 9:24 AM
Subject: [PHP] OO code and private functions


 Can I make a function private in PHP, so that it can only be called from
 within an object of that class???

 Just discovering the wonders of OO PHP... :-)

 ==
 Richard Black
 Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
 Tel: 0141 435 3504
 Email: [EMAIL PROTECTED]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] so nobody knows how do get rid of everything outside or certain tags?

2002-08-15 Thread Joseph W. Goff

preg_match('!div[^]+(.*)/div!Uis',$info,$regs);
$everything_between_divs=$regs[1];

- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 15, 2002 11:44 AM
Subject: RE: [PHP] so nobody knows how do get rid of everything outside or
certain tags?


 [snip]
 I asked this question a while ago, and I am still seeking clarification,
 I fooled with ereg_replace and they only do a piece of what I want, I
 would like to know how to keep only a chunk of text defined between 2
 tags let's say, div and /div and ignore everything else, I also have
 to search and replace certain tags between, but I know how to do that
 with ereg_replace. So can anyone help me echo only what is between the
 div tags? Please?
 [/snip]

 Why not take the the beginning div, everything in the middle, and the
end
 /div tag and explode() them into an array and then get what you want and
 write it out? I didn't see your originl post and don't know if there was
 more detail available, but I hope this helps.

 Jay

 I'm not tense.just terribly, terribly alert

 ***
 * Texas PHP Developers Conf  Spring 2003  *
 * T Bar M Resort  Conference Center  *
 * New Braunfels, Texas*
 * San Antonio Area PHP Developers Group   *
 * Interested? Contact [EMAIL PROTECTED] *
 ***



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php