Re: [PHP] update mysql from php web page

2004-04-07 Thread Chip Wiegand
"Daniel Clark" <[EMAIL PROTECTED]> wrote on 04/07/2004 10:17:36 AM:

> For the submit button to work it has to be in a form.
> 
> 
>
> 
> 
> Hope this helps.
> 
> Daniel Clark

Of course, I didn't notice I left that line out of my code, although I did 
remember to put in the closing form tag. But, unfortumately, the update is 
not executed. The form button works, and it appears to do what it should, 
but the data is not changed. 
I changed the form method to get so I could see what is being passed and 
everything there is fine, but at the end of the url I see this-
url...stuff...&submit=Update+Data
Is this correct?

What else can I do to see what was passed to the database (if anything)?
--
Chip

> > 
> > ... more code ...
> > 
> >  > endif;
> > ?>
> > 
> > 
> > -
> >
> > I don't see any reason for the submit button to not work at all. What
> > should I look for now?
> > Thanks for the help,
> > Chip
> 
> 

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



Re: [PHP] update mysql from php web page

2004-04-07 Thread Chip Wiegand
"Daniel Clark" <[EMAIL PROTECTED]> wrote on 04/06/2004 03:27:34 PM:

> I think you need a WHERE clause for the UPDATE, otherwise it will update
> ALL the records.
> 
> e.g.  WHERE OwnerName='$result'
> 
> Then perhaps a redirect to another page.

Thanks for the reminder. I set that, and found the problem that caused the 
page to not load at all - no closing double-quote on the update statement.
Now the page loads properly but when I press the submit button nothing 
happens, it's a dead button.

--
if(isset($submit)):
$query1 = "update warranty set 
VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address',OwnerCity='$city',OwnerState='$state',OwnerZip='$zip',OwnerCountry='$country',DateInstalled='$DateInstalled',DealerName='$Dealer',DealerStreet='$DealerAddress',DealerCity='$DealerCity',DealerState='$DealerState',DealerZip='$DealerZip',DealerCountry='$DealerCountry',Model='$Parts',SN='$PartsSN',VesselType='$vesseltype',VesselLength='$length',InstalledOn='$construction',VesselTypeOther='$vesseltypeother')
 
where OwnerName = $OwnerName";
   $result1 = mysql_query($query1);
   mysql_query($query1); 
else:
   $query = "select * from warranty WHERE OwnerName='$result'"; 
   $results = mysql_query($query);
   $row = mysql_fetch_array($results);
?>
... lots of code ...

... more code ...




-

I don't see any reason for the submit button to not work at all. What 
should I look for now?
Thanks for the help,
Chip

> > I probably need to use if(isset($submit)): and an update statement, 
but my
> > attempt just causes the web page to display completely blank. This is 
what
> > I tried -
> >
> > if(isset($submit)):
> >  $query1 = "update warranty set
> > VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address',
> OwnerCity='$city',OwnerState='$state',OwnerZip='$zip',
> OwnerCountry='$country',DateInstalled='$DateInstalled',
> DealerName='$Dealer',DealerStreet='$DealerAddress',
> DealerCity='$DealerCity',DealerState='$DealerState',
> DealerZip='$DealerZip',DealerCountry='$DealerCountry',
> Model='$Parts',SN='$PartsSN',VesselType='$vesseltype',
> VesselLength='$length',InstalledOn='$construction',
> VesselTypeOther='$vesseltypeother')
> > ;
> >  $result1 = mysql_query($query1);
> >  mysql_query($query1);
> > else:
> >  $query = "select * from warranty WHERE OwnerName='$result'";
> > $results = mysql_query($query);
> >  $row = mysql_fetch_array($results);
> > ?>
> 
> 

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



[PHP] update mysql from php web page

2004-04-06 Thread Chip Wiegand
I have an existing web page that pulls some data and displays it in form 
input fields. I would like to add the ability to edit those fields and 
submit the changes to the server, but have been unsuccessful. What bit of 
code do I need to add to the existing code?
This is the existing code to display the info --

 $query = "select * from warranty WHERE OwnerName='$result'"; 
 $results = mysql_query($query);
 $row = mysql_fetch_array($results);

I probably need to use if(isset($submit)): and an update statement, but my 
attempt just causes the web page to display completely blank. This is what 
I tried -

if(isset($submit)):
 $query1 = "update warranty set 
VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address',OwnerCity='$city',OwnerState='$state',OwnerZip='$zip',OwnerCountry='$country',DateInstalled='$DateInstalled',DealerName='$Dealer',DealerStreet='$DealerAddress',DealerCity='$DealerCity',DealerState='$DealerState',DealerZip='$DealerZip',DealerCountry='$DealerCountry',Model='$Parts',SN='$PartsSN',VesselType='$vesseltype',VesselLength='$length',InstalledOn='$construction',VesselTypeOther='$vesseltypeother')
 
;
 $result1 = mysql_query($query1);
 mysql_query($query1); 
else:
 $query = "select * from warranty WHERE OwnerName='$result'"; 
$results = mysql_query($query);
 $row = mysql_fetch_array($results);
?>

What am I doing wrong?
Thanks,

--
Chip 

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



[PHP] script problem with authorization

2004-03-26 Thread Chip Wiegand
I am trying to get a script to work that will protect individual files, 
not just a directory. The script I am using is this -

<<Back";
// this is the end of the script, next lines added for testing purposes 
only
 echo "File size: $len";
 echo "File name: $file";
 echo "File size using the filesize() function: " . 
filesize("downloads/2004_February_PB_File1.pdf");
 echo "";
 echo "File type using the filetype() function: " . 
filetype("downloads/2004_February_PB_File1.pdf");
 echo "";
 echo "File owner using the fileowner() function: " . 
fileowner("downloads/2004_February_PB_File1.pdf");
}
?>

The test lines above do show the expected results. The two echo statements 
that are supposed to show the variables $len and $file do not result in 
anything. The problem seems to be with the first line auth == 'yes'. If I 
change it to 'no' the script still gives the same results as when it is 
'yes'.

Here's what it's supposed to do - 
I have a directory of files that is protected by a .htaccess file. I have 
a password file outside the web root called passwd. The same passwd file 
is used for other directories for my use only and it works fine. The 
script is supposed to see the .htaccess file and pass the visitor through 
without them having to actually log in, and then the file will download 
automatically.

My purpose -
 is to prevent people from manipulating the url in the location bar and 
download documents directory without loggin into the site. The .htaccess 
works by itself, but I don't want to require the users to 'log in' a 
second time to download a file. They have to log into the site, they 
should be able to download the docs freely. 
I hope this is clear (clear as mud probably). Anyway, I found this script 
on http://www.wazzup.co.nz/tutorials/protect_pdf/index.php. I sent a 
message to the author and haven't heard back yet, so thought I'd try here.
If anyone knows of a better/easier/alternative way to protect individual 
files, give a logged in user free access to it, but protect it from 
downloads from people not logged in, I'm certainly open to any and all 
suggestion. The docs are price lists that we wouldn't want our competitors 
to get ahold of.

Thanks for the help,
--
Chip Wiegand
Computer Services
Simrad, Inc
www.simradusa.com
[EMAIL PROTECTED]

"There is no reason anyone would want a computer in their home."
 --Ken Olson, president, chairman and founder of Digital Equipment 
Corporation, 1977
 (Then why do I have 8? Somebody help me!)

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



Re: [PHP] browser identification problem

2003-02-18 Thread chip . wiegand
Ernest E Vogelsinger <[EMAIL PROTECTED]> wrote on 02/17/2003 11:20:41 
PM:

> At 06:05 18.02.2003, Jason Wong said:
> [snip]
> >On Tuesday 18 February 2003 01:18, [EMAIL PROTECTED] wrote:
> >
> >> > then set 'user_agent' in
> >> > php.ini to match that of one of the compatible browsers.
> >>
> >> I don't see any user_agent entry in my php.ini file. I did a search 
on the
> >> php.net site and didn't find any info on this. What would be the 
proper
> >> way
> >> to set this in php.ini, and in which section of php.ini?
> >
> >Anywhere in php.ini I suppose. Or it can be set at run-time using 
ini_set().
> [snip] 
> 
> http://www.php.net/manual/en/ref.filesystem.php#ini.user-agent

Thanks for the link. I added the following to my php.ini -
user_agent = Mozilla/5.0 (Windows; U; Windows 
NT 5.0; en-US; rv:1.3a) Gecko/20021212  

And it prevents any pages from being displayed. I copied that line
from the http_user_agent line in php_info. The php doc mentioned
above doesn't provide any info on the format of the user_agent line.
Obviously I'm doing it wrong. 
Suggestions?
Thanks
--
Chip 

> -- 
>>O Ernest E. Vogelsinger
>(\)ICQ #13394035
> ^ http://www.vogelsinger.at/
> 
> 
> 
> -- 
> 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] browser identification problem

2003-02-17 Thread chip . wiegand
Here's a bit more info - just for clarity and understanding of what's 
going on...
There are actually 3 server involved -
My current web site is hosted on my isp's server. 
I have another server here in my office which contains about a gigabyte of 
down-
loadable docs. 
And we have our ecommerce site, which is integrated into MAS200, our ERP
system.
On the original web site (on the isp's sever) are  links to the other two 
servers.
This is all fine. This system works, it's not the most efficient, but it 
works.
I am setting up a new server to host my web site, which will include the 
downloadable
docs (thus I will be removing that extra sever from all this), and will 
co-locate it at my
isp's office. (Rather than have them host my site on their server.)
Okay, so the web site on my new server is a mirror of the existing site on 
my isp's server.
That existing site has no problem linking to and logging into the remote 
ecommerce server.
But, my new server is the one with the problem. The isp's server is 
running php-4.2.2. Mine
is running 4.2.3.
So, the same web page can access the remote ecommerce server fine on the 
isp's system,
but not on mine. I have a call in to the isp's tech support, I'll try to 
get a copy of their php.ini
and find out what is differant between theirs and mine.
--
Chip

Jason Wong <[EMAIL PROTECTED]> wrote on 02/14/2003 10:08:45 PM:

> On Saturday 15 February 2003 05:01, [EMAIL PROTECTED] wrote:
> > I have an ecommerce app (MAS200 eBusiness Manager) that works. I am
> > updating my
> > web site to php frames. Now when I want to connect to the eBusiness
> > Manager server
> 
> Presumably you mean connect to that app with some php code?
> 
> > I get this error:
> >
> > Unsupported Browser
> > The browser you are using (PHP/4.2.3) is currently unsupported. Please
> > update your browser to the most current level.
> 
> 
> > This happens regardless of the browser I am using. How can I get this 
to
> > send the actual browser info, not this php info in its place?
> 
> The error comes from some php code accessing that app and has nothing to 
do 
> with whatever browser you're using.
> 
> 
> Find out what browsers that app is satisfied with, then set 'user_agent' 
in 
> php.ini to match that of one of the compatible browsers.
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> The Usenet news is out of date
> */
> 
> 
> -- 
> 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] browser identification problem

2003-02-17 Thread chip . wiegand
Chris Shiflett <[EMAIL PROTECTED]> wrote on 02/14/2003 02:47:43 PM:

> --- [EMAIL PROTECTED] wrote:
> > I have an ecommerce app (MAS200 eBusiness Manager) that works. I am 
> > updating my web site to php frames.
> 
> There is no such thing. Perhaps you mean HTML frames?

Take a look at this web site -
http://www.phpbeginner.com/columns/mark/frames
 
--
Chip

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




Re: [PHP] browser identification problem

2003-02-17 Thread chip . wiegand
Jason Wong <[EMAIL PROTECTED]> wrote on 02/14/2003 10:08:45 PM:

> On Saturday 15 February 2003 05:01, [EMAIL PROTECTED] wrote:
> > I have an ecommerce app (MAS200 eBusiness Manager) that works. I am
> > updating my
> > web site to php frames. Now when I want to connect to the eBusiness
> > Manager server
> 
> Presumably you mean connect to that app with some php code?

On my web page is a link to another server, just a simple url link.
The existing pages are .php pages.

> > I get this error:
> >
> > Unsupported Browser
> > The browser you are using (PHP/4.2.3) is currently unsupported. Please
> > update your browser to the most current level.
> 
> 
> > This happens regardless of the browser I am using. How can I get this 
to
> > send the actual browser info, not this php info in its place?
> 
> The error comes from some php code accessing that app and has nothing to 
do 
> with whatever browser you're using.
 
I have had the existing .php pages accessing the other server for a couple
years now with no problems. Only differance is the new page that has the 
link
is frames. I don't know why that would make a differance though.

> Find out what browsers that app is satisfied with,

5.0 and higher browsers.

> then set 'user_agent' in 
> php.ini to match that of one of the compatible browsers.

I don't see any user_agent entry in my php.ini file. I did a search on the
php.net site and didn't find any info on this. What would be the proper 
way
to set this in php.ini, and in which section of php.ini?
Thanks,
--
Chip
 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> The Usenet news is out of date
> */
> 
> 
> -- 
> 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] browser identification problem

2003-02-14 Thread chip . wiegand
I have an ecommerce app (MAS200 eBusiness Manager) that works. I am 
updating my
web site to php frames. Now when I want to connect to the eBusiness 
Manager server
I get this error:

Unsupported Browser
The browser you are using (PHP/4.2.3) is currently unsupported. Please 
update your browser to the most current level.
This happens regardless of the browser I am using. How can I get this to 
send the actual browser info, not this php info in its place?
--
Chip Wiegand
Computer Services
Simrad, Inc
www.simradusa.com
[EMAIL PROTECTED]

"There is no reason anyone would want a computer in their home."
 --Ken Olson, president, chairman and founder of Digital Equipment 
Corporation, 1977
 (Then why do I have 8? Somebody help me!)

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




Re: [PHP] php pages broken after moving to a newer version

2003-02-06 Thread chip . wiegand
Goetz Lohmann <[EMAIL PROTECTED]> wrote on 02/06/2003 08:09:19 AM:

> Chip Wiegand schrieb:

> > Okay, so I have turned on all the error handling options in 
> > /usr/local/etc/php.ini-dist. I have purposely put an error in my 
> > phpinfo.php
> > page, it errors out in the browser, but no error log is created. My
> > index.php page does not load and does not provide any errors. I set 
the
> > error log to go into the /tmp directory, after trying /var/log and 
also
> > my own home directory, it just will not be created in any of them.
> 
> change php.ini NOT php.ini-dist which not will be loaded !!!

Thanks so much. I copied that file to php.ini and now all is well.
--
Chip

> and be sure you change the php.ini which is used (maybe there might be
> more than one php.ini in your system but only one is use ... find this
> out with phpinfo !)
> 
> [phpinfo.php]
> phpinfo();
> ?>
> 
> 
> -- 
>  @  Goetz Lohmann, Germany   |   Web-Developer & Sys-Admin
> \/  --
> ()  He's the fellow that people wonder what he does and
> ||  why the company needs him, until he goes on vacation.
> 
> 
> -- 
> 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 pages broken after moving to a newer version

2003-02-06 Thread chip . wiegand
Jason Wong <[EMAIL PROTECTED]> wrote on 02/05/2003 09:38:48 PM:

> On Thursday 06 February 2003 07:13, [EMAIL PROTECTED] wrote:
> 
> > > 1) Read the changelog/history/release notes of all versions of php
> > > between the
> > > 4.0.3 and up to 4.2.3
> > >
> > > 2) Check the php log (turn on full error reporting).
> 
> > The log is 23 pages long and doesn't to all the way back to
> > 4.0.3. Could you perhaps give me a hint as to something else to look 
for
> > in
> > the log?
> 
> OK, first you need to see what PHP is choking on. Only way to do 
> that is to do 
> (2) above. So once you know what errors PHP is giving out you do (1) to 
see 
> whether anything has changed to cause this behaviour.

Okay, so I have turned on all the error handling options in 
/usr/local/etc/php.ini-dist. I have purposely put an error in my 
phpinfo.php
page, it errors out in the browser, but no error log is created. My
index.php page does not load and does not provide any errors. I set the
error log to go into the /tmp directory, after trying /var/log and also
my own home directory, it just will not be created in any of them.

> NB if PHP doesn't give any errors, then it would suggest to me that your 
code 
> logic is broken.

If the page works fine in php-4.0.3 then I don't see how it can be broken.
This is frustrating. You can see the page at the link below.
I have pasted my /usr/local/etc/php.ini-dist below. If it would help I can
also add my index.php that is having problems...
Regards,
--
Chip W
www.simradusa.com

[PHP]

;;;
; WARNING ;
;;;
; This is the default settings file for new PHP installations.
; By default, PHP installs itself with a configuration suitable for
; development purposes, and *NOT* for production purposes.
; For several security-oriented considerations that should be taken
; before going online with your site, please consult php.ini-recommended
; and http://php.net/manual/en/security.php.


;;;
; About this file ;
;;;
; This file controls many aspects of PHP's behavior.  In order for PHP to
; read it, it must be named 'php.ini'.  PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory.  The
; path in which the php.ini file is looked for can be overridden using
; the -c argument in command line mode.
;
; The syntax of the file is extremely simple.  Whitespace and Lines
; beginning with a semicolon are silently ignored (as you probably 
guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.
;
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from 
FOO=bar.
;
; The value can be a string, a number, a PHP constant (e.g. E_ALL or 
M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an 
expression
; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo").
;
; Expressions in the INI file are limited to bitwise operators and 
parentheses:
; |bitwise OR
; &bitwise AND
; ~bitwise NOT
; !boolean NOT
;
; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.
;
; An empty string can be denoted by simply not writing anything after the 
equal
; sign, or by using the None keyword:
;
;  foo = ; sets foo to an empty string
;  foo = none; sets foo to an empty string
;  foo = "none"  ; sets foo to the string 'none'
;
; If you use constants in your value, and these constants belong to a
; dynamically loaded extension (either a PHP extension or a Zend 
extension),
; you may only use these constants *after* the line that loads the 
extension.
;
; All the values in the php.ini-dist file correspond to the builtin
; defaults (that is, if no php.ini is used, or if you delete these lines,
; the builtin defaults will be identical).



; Language Options ;


; Enable the PHP scripting language engine under Apache.
engine = On

; Allow the  tags are 
recognized.
short_open_tag = On

; Allow ASP-style <% %> tags.
asp_tags = Off

; The number of significant digits displayed in floating point numbers.
precision=  12

; Enforce year 2000 compliance (will cause problems with non-compliant 
browsers)
y2k_compliance = Off

; Output buffering allows you to send header lines (including cookies) 
even
; after you send body content, at the price of slowing PHP's output layer 
a
; bit.  You can enable output buffering during runtime by calling the 
output
; buffering functions.  You can also ena

Re: [PHP] php pages broken after moving to a newer version

2003-02-05 Thread chip . wiegand
Jason Wong <[EMAIL PROTECTED]> wrote on 02/05/2003 12:49:16 PM:

> On Thursday 06 February 2003 04:41, [EMAIL PROTECTED] wrote:
> > After copying the web site to the new server some pages no longer 
include
> > the
> > 'include' pages. I am using php frames. I load the index page, it's 
just
> > blank, white.
> > I can load the included pages manually through the url and they load 
okay.
> > I am
> > wondering if there is something in the php config file I need to set 
for
> > the include path,
> > but when I was in that file I didn't see any such setting, like in the
> > earlie versions of
> > php.
> 
> 1) Read the changelog/history/release notes of all versions of php 
> between the 
> 4.0.3 and up to 4.2.3
> 
> 2) Check the php log (turn on full error reporting).

I checked the change log for all instances of 'include' but found nothing
relevant. The log is 23 pages long and doesn't to all the way back to 
4.0.3. Could you perhaps give me a hint as to something else to look for 
in
the log?

--
Chip

> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Woodward's Law:
>A theory is better than its explanation.
> */
> 
> 
> -- 
> 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] php pages broken after moving to a newer version

2003-02-05 Thread chip . wiegand
I have a web site on a server running 
freebsd-4.2/mysql-3.23.10/php-4.0.3pl1.
I am replacing that machine with a new box running 
freebsd-4.7/mysql-3.23.52/php-4.2.3.
After copying the web site to the new server some pages no longer include 
the
'include' pages. I am using php frames. I load the index page, it's just 
blank, white.
I can load the included pages manually through the url and they load okay. 
I am 
wondering if there is something in the php config file I need to set for 
the include path,
but when I was in that file I didn't see any such setting, like in the 
earlie versions of
php. Any suggestions?
Regards,
--
Chip Wiegand
Computer Services
Simrad, Inc
www.simradusa.com
[EMAIL PROTECTED]

"There is no reason anyone would want a computer in their home."
 --Ken Olson, president, chairman and founder of Digital Equipment 
Corporation, 1977
 (Then why do I have 8? Somebody help me!)

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




Re: [PHP] What's the PHP-equivalent of Perl's AUTOLOAD feature?

2003-01-17 Thread Chip Castle
Hi Chris,

Thanks for the info.  I probably need to make myself more clear, as I'm 
not referring to a database abstraction layer in terms of drivers (e.g., 
"dbx" in PHP, DBI in Perl).

I think the best example of what I'm talking about is in Tim Kientzle's 
"Perl and Rapid Database Prototyping" article of December's TPJ:
http://www.chipcastle.com/tpj/TPJDecember2002.pdf

The first few paragraphs should give you the basic idea, so let me know 
if you have any suggestions.

Thanks!

Chip Castle / Open Source Web Developer
http://www.chipcastle.com


Chris Hayes wrote:
At 02:06 17-1-2003, you wrote:


I just read an interesting article in The Perl Journal (TPJ) about using
AUTOLOAD as a layer of abstraction for accessing database columns and I
would like to write something similar in PHP.  Is this possible?



If you mean some sort of database abstraction so one script would work 
on MySQL as well as Oracle; there is not such a thing within PHP itself. 
The google search term would 'database abstraction layer' and a popular 
one is ADODB (not to be confused with the other adoDB), at 
http://php.weblogs.com/ADODB.

If that's not what you mean please try to explain it again

Chris Hayes









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




[PHP] What's the PHP-equivalent of Perl's AUTOLOAD feature?

2003-01-16 Thread Chip Castle
Hello -

I just read an interesting article in The Perl Journal (TPJ) about using
AUTOLOAD as a layer of abstraction for accessing database columns and I
would like to write something similar in PHP.  Is this possible?

I have written a number of PHP/MySQL applications, but do not consider
myself an expert.  I cannot find anything on various PHP-related
websites and was hoping someone with more in depth knowledge would be
able to make a few suggestions.

Thanks!

Chip Castle
chip (at) chipcastle (dot) com


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




Re: [PHP] form box question

2003-01-13 Thread chip . wiegand
Just a suggestion - you might want to disable the ability to input html 
code in the messages, as 
a precautionary messure. I tested the script and was able to make a mess 
of the page after 
submitting.
--
Chip




"Anthony Ritter" <[EMAIL PROTECTED]>
01/13/2003 09:07 AM

To
[EMAIL PROTECTED]
cc

bcc

Subject
[PHP] form box question



Hi,
I'm testing the following form on:

MS Win98 / IE 5.5 / PHP 4.0 / Apache and it works fine.

However...when I publish the

..php file

and the

data.txt file

on the ISP's MS IIS server, I get undeclared variables and indexes when 
the
form page loads.

The script follows.

Any help would be greatly appreciated.
Thank you.
Tony Ritter
..

// form.php




body {background-color:beige;
body
{
scrollbar-base-color: #FCF6DC;
scrollbar-face-color: #E3DBB5;
scrollbar-track-color: #FCF6DC;
scrollbar-arrow-color: #000;
scrollbar-highlight-color: #fff;
scrollbar-3dlight-color: #7B6D29;
scrollbar-shadow-color: #7B6D29;
scrollbar-darkshadow-color: #E3DBB5;
}
border:5px solid black;
}
textarea {border:1pt solid red;
  background-color:white;
  color:black;

  }

textarea p{font-size:12px;

  }

table {border:1pt solid black;
   width:700px;
   font-size:10px;
   background-color:#E3DBB5;
   color:#7B6D29;
   }


input {border:1pt solid solid red;
   background-color:white;
   color:black;}

..submit {
   background-color:#80;
   color:white;}

p {font-family:arial;
   font-size:12px;
  }

hr { color:#80;

}

A:link:{text-decoration:none; color:#7B6D29;}
A:visited:{text-decoration:none; color:#7B6D29;}
A:hover:{text-decoration:underline; color:green}




");

 print("Some of the messages have been:\n");

 $Data=file($TheFile);
  for($n=0; $n");

print("");
print("$getline[0]\n");
print("");
print("");
print("$getline[1]\n");
print("");
print("");
print("mailto:$getline[2]>$getline[2]\n");
print("");
print("");
print("");

  } //end for loop
 fclose($Open);

   } //end if
else
 {
  print("Unable to read data.txt");
 }
} //end function

function createform()
{

print("\n");
print("So...How did you like EagleFest 2003?: 
 \n");
print("Your name: \n");
print("Your e-mail: \n");
print("\n");
print("\n");
print("\n");

}

function handleform()
{
 global $comments;
 global $yourname;
 global $youremail;
 $comments=stripslashes($comments);
 $yourname=stripslashes($yourname);
 $youremail=stripslashes($youremail);
 $callfunction=WriteToFile($comments,$yourname,$youremail);
  if($callfunction)
   {

print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print("Thank you
for your comments about EagleFest 2003.");

   }//end if
  else
  {
   print("Your submission was not processed.");
  } //end else
}

if($beensubmitted)
 {
  handleform();
 }
else
{
createform();
ReadTheFile();
}
?>








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






Fw: Re: [PHP] Simple HTML-Form Question

2002-10-13 Thread Chip Wiegand

Yep, I've been going over this with John off-list, I learned something
new tonite. One thing about his script - it doesn't print the text
entered in the box, it only prints the work Hallo. To fix that would
require adding
. "$name";
to the end of the echo statement.
Regards,
--
Chip

@ Edwin wrote this stuff back on Mon, 14 Oct 2002 11:55:28 +0900:

> Hello,
> 
> Just for the sake of the argument...
> 
> On Monday, October 14, 2002 10:44 AM
> Chip Wiegand wrote:
> 
> > Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 01:13:53
> > +0200:
> >
> > > This beautifies it (even makes it a bit more secure), but one
> > > doesn't need it really; should have worked without these changes,
> > > too. (Of course, it's better to include these changes)
> > >
> > > Sascha
> >
> > No it shouldn't have worked the way you had it originally. The isset
> > statement HAS to have the same value as the submit buttom name or it
> > won't work at all.
> 
> Yes it will. Try it. ;)
> 
> Of course, I didn't mean to say that it will work the way you want it.
> I just wanted to say that it would still work even though the isset
> statement doen't have the same value with the submit button. Remember,
> isset() is basically a function to check if something is set or not...
> 
> So, changing this
> 
> > > > if (isset($_GET['submit']))
> 
> to this
> 
> > > > if (isset($_GET['name']))
> 
> will have a similar result (for the short code discussed here).
> 
> - E
> 
> PS
> Typo: (should be $_GET['name'])
> > > >  echo "Hallo ".$GET['name'];
> 
> > As for the beautify part, that's just the way I write
> > my code, that doesn't matter at all to whether or not the script
> > will work.
> >
> > --
> > Chip
> >
> > > > The value of name for the submit button is wrong - it should be
> > > > the same as the value you gave the isset statement, in this case
> > > > it should be
> > > > Better yet is to use isset($submit) and the value for the submit
> > > > statement is also name="submit" -
> > > > 
> > > > of course value is optional. So you end up with this -
> > > >
> > > >  > > > if (isset($_GET['submit']))
> > > > {
> > > >  echo "Hallo ".$GET['name'];
> > > > }
> > > > else
> > > > {
> > > > echo "
> > > > 
> > > >  ";
> > > > }
> > > > ?>
> > >
> > >
> > > --
> > > 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] Simple HTML-Form Question

2002-10-13 Thread Chip Wiegand

Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 01:13:53 +0200:

> This beautifies it (even makes it a bit more secure), but one doesn't
> need it really; should have worked without these changes, too. (Of
> course, it's better to include these changes)
> 
> Sascha

No it shouldn't have worked the way you had it originally. The isset
statement HAS to have the same value as the submit buttom name or it
won't work at all. As for the beautify part, that's just the way I write
my code, that doesn't matter at all to whether or not the script will
work.

--
Chip

> > The value of name for the submit button is wrong - it should be the
> > same as the value you gave the isset statement, in this case it
> > should be
> > Better yet is to use isset($submit) and the value for the submit
> > statement is also name="submit" -
> > 
> > of course value is optional. So you end up with this -
> >
> >  > if (isset($_GET['submit']))
> > {
> > echo "Hallo ".$GET['name'];
> > }
> > else
> > {
> > echo "
> > 
> > ";
> > }
> > ?>
> 
> 
> -- 
> 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] Simple HTML-Form Question

2002-10-13 Thread Chip Wiegand

Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 00:09:58 +0200:

> register_globals defaults now to off. Use the superglobals instead.
>  if (isset($_GET['name'])) {
> echo "Hallo ".$GET['name'];
> }
> else {
> echo "
> 
> ";
> }
> ?> 
> Sascha

The value of name for the submit button is wrong - it should be the same
as the value you gave the isset statement, in this case it should be

Better yet is to use isset($submit) and the value for the submit
statement is also name="submit" -

of course value is optional. So you end up with this -



";
}
?> 
--
Chip

> Am Sonntag, 13. Oktober 2002 23:40 schrieb Lars H. Korte:
> > Hi,
> > I've updated to PHP 4.2.3 and wrote this simple Script:
> >
> >  > if (isset($name)) {
> > echo "Hallo $name";
> > }
> > else {
> > echo "
> > 
> > ";
> > }
> > ?>
> >
> > I would expect the following:
> > The site starts with the form, then I enter my name (Lars) and click
> > the send-button. Then the script says Hello Lars.
> >
> > The actual output is:
> > The site starts with the form, I enter my name and click the button,
> > then the form keeps being there, no "Hello"-message.
> >
> > Has there changed something in PHP-Coding since I've learned it a
> > few years before?
> >
> > There seems to be a diffrence between clicking the send button and
> > pressing Enter. Has this always been so?
> >
> > regards
> > Lars
> 
> 
> -- 
> 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] Looking for a forum

2002-09-26 Thread Chip Wiegand

On Wed, 2002-09-25 at 22:26, John Taylor-Johnston wrote:
> Hi,
> I'm looking for some forum script, a bit like this:
> http://www.chevelles.com/cgi-bin/forum/Ultimate.cgi
> Can anyone post a link to something useful?
> John

I set up phpBB on my company web site. It was easy to set up and has all
the features you could want.

--
Chip

> -- 
> 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] Editor

2002-09-21 Thread Chip Wiegand

On Sat, 2002-09-21 at 06:15, Bryan McLemore wrote:
> Hi guys, just wondering if anyone could recomend a good editor that is based on 
>windows.  Thanks, Bryan

HTML-Kit by Chami software (www.chami.com) - saves in unix format or
windoze format, extremely configurable, direct uploads/downloads/editing
of files on the remote server, built in Tidy, etc etc.

--
Chip


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




[PHP] HELP - fwrite(...PHP code...)

2002-09-12 Thread Hankley, Chip

I have an application where I need to write PHP code to a file that will be
used later...but it's not working the way I'd expect.

When I issue the following:

fwrite($fp, "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 variables are valid?

2002-08-28 Thread Hankley, Chip

Jay -

How 'bout this?

$init = 1;
$query = "SELECT foo ";
$query .= "FROM bar WHERE";
if ($init AND isset($var1)) {
  $query .= "WHERE thus = '" . $var1 . "' ";
  $init = 0;}

if ($init AND isset($var2)) {
  $query .= "WHERE thus = '" . $var2 . "' ";
  $init = 0;}
elseif (isset($var2)) {
  $query .= "AND WHERE thus = '" . $var2 . "' ";
  $init = 0;}  

if ($init AND isset($var3)) {
  $query .= "WHERE thus = '" . $var3 . "' ";
  $init = 0;}
elseif (isset($var3)) {
  $query .= "AND WHERE thus = '" . $var3 . "' ";
  $init = 0;}

if ($init AND isset($var4)) {
  $query .= "WHERE thus = '" . $var4 . "' ";
  $init = 0;}
elseif (isset($var4)) {
  $query .= "AND WHERE thus = '" . $var4 . "' ";
  $init = 0;}

... you could even make all of those if...elseif's into a function.

Chip

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 28, 2002 1:51 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Building a query on multiple variables, how to test for
which variables are valid?


So these 4 variables walk into a bar :^]

I have a form with 4 drop downs. Each of these drop downs might have a value
and there is no order in which they might have a value. A query needs to
built (the WHERE and AND portions) that takes into account which ever
variables have been set. A user may choose a variable that would not be in
the first location.

$var1 = is not set
$var2 = is set
$var3 = is set
$var4 = is not set

(or any other combination) The query, of course, needs to be in order taking
into account the above example;

$query = "SELECT foo ";
$query .= "FROM bar ";
$query .= "WHERE thus = '" . $var2 . "' ";
$query .= "AND thus = '" . $var3 . "' ";

If three of the variables are set then there would need to be an additional
AND statement, etc. It would be foolhardy to construct an if or case
statement that would take into account each possible combination. I have
been thinking this through for an hour or so, but I am not seeing a clear,
elegant, and efficient piece of code. Has anyone done anything like this, or
does anyone have an idea of how this might be done?

TIA!

Jay

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort & Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*



-- 
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] whats wrong with this?

2002-08-28 Thread Hankley, Chip

you need to use "==" instead of "="

"==" is used when comparing values (i.e. is this "==" to that)
"=" is used to set something's value (i.e. this "=" that)

-chip

-Original Message-
From: Chris Barnes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 28, 2002 11:12 AM
To: Php-General (E-mail)
Subject: [PHP] whats wrong with this?


I just cant seem to work out why this doesn't work. My PHP book doesn't
explain "if" statements very well so i have no idea if i am breaking a rule.

$system_day = date("j");

for($day = 1; $day < 32; $day++){
if($day = $system_day){
echo "match!";
}

else{
echo "no match";
}
}

the problem i am experiencing is that it seems the "if" statement is setting
the $day value to equal $system_day instead of comparing their values
if i add

echo "Day: " . $day . " System_day: " . $system_day;

before and after the if statement then the first result is something like

Day: 1 System_day: 29

after the "if" statement has executed the result is

Day: 29 System_day: 29

so you see, instead of "if" comparing $day to $system_day it is making $day
equal to $system_day.

any ideas why and how to fix this?

help is most appreciated :)


-- 
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: Automatic Download using URL, HELP!

2002-08-26 Thread Hankley, Chip

Bogdan - 

Sorry for the delay to your follow-up.

The total script is below... first let me explain a little more of what I'm
doing for clarity's sake.

I'm downloading a lot of data files from a site. The way the site works, you
supply some information in a form regarding the data set you want. This goes
to a PERL script which creates a packaged (zipped) data set and puts it in
an FTP directory.

What I wanted to do was write a script that would automatically do the form
submission, retrieve the name and location of the zip file, and save it to
my local hard disk. I happened to have a list of over 1000 data set names
that I wanted to get... so I just needed to loop through them.

FWIW, the "faking a form post" part of this, which is really the core of
what I'm doing, is based on the following in the pgp_general archives:

  http://marc.theaimsgroup.com/?l=php-general&m=101899239727991&w=2

You can search for this by searching the archives for the term "asphttp".
ASPHTTP is a tool for ASP that does the same thing... only it costs money,
and this little function is free! How cool is that?

Here's the script (got it working, BTW).

Chip

http://www.someserver.com/cgi-bin/some_script.pl
  $host="www.someserver.com;
  $path="/cgi-bin/some_script.pl";

  //The next line makes up the 'data to send' in the form. Apparently
  // if you start the string with a "&", this will use the POST method,
  // while if you start with a "?" it will use the GET method (or at
  // least it's acting like it's doing one or the other).
  $data_to_send = "&myDataSetName=" . $a .
"&FormVar1=Value1&FormVar2=Value2";
  PostToHost($host, $path, $data_to_send);
}

function PostToHost($host, $path, $data_to_send)
{
  //This part of the function creates a file that essentially POSTs the
  // $data_to_send information to the $host . $path location, and retrieves
  // the information into a variable called $returnData
  $returnData="";
  $fp = fsockopen($host,80);
  fputs($fp, "POST $path HTTP/1.1\n");
  fputs($fp, "Host: $host\n");
  fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
  fputs($fp, "Content-length: ".strlen($data_to_send)."\n");
  fputs($fp, "Connection: close\n\n");
  fputs($fp, $data_to_send);

  //Loop through the variable $returnData line-by-line. In this case,
  // I'm searching for a keyword. The name of the resulting file is always
  // on a line like this:
  //  YOURFTPFILENAME = some_file_name_.
  //Once I hit this line, I want to save the entire line into a variable
  // called $filename, and break out of the loop.
  while(!feof($fp)) {
$returnData=fgets($fp, 128);
$filename = strstr($returnData, 'YOURFTPFILENAME');
if ($filename)
  break;
  }

  //Use some simple string parsing functions to strip out the
"YOURFTPFILENAME = "
  // part of the filename.
  $filename = substr($filename, 18);
  $filename = trim($filename);

  //Now, I'm going to connect to and read the file that was created. In this
case
  // it is always saved to the same location, so all I need to do is specify
the
  // file name. The file will be read into a variable called $contents.
  $host = "http://www.someserver.com/ftp_downloads/images/";;
  $fp2 = fopen($host . $filename, "rb+");
  $contents = fread ($fp2, 2500); //use some rediculously large number
in fread
  // to ensure that you get the whole
thing.

  //make a file to write to on the local system, and dump $contents into the
new
  // file.
  $fp3 = fopen("D:\\myFiles\\SomeDirectory\\" . $filename, "w");
  fputs($fp3, $contents);

  //close all of the documents
  fclose($fp);
  fclose($fp2);
  fclose($fp3);
}
/* End of Script ---*/
?>

> -Original Message-
> From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 22, 2002 10:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Automatic Download using URL, HELP!
> 
> 
> Just out of curiousity, how did you ever get PHP to prompt you where to 
> save a file? Could you post a more complete code sample?
> 
> Bogdan

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




[PHP] installing php-4.2.1 fails in make

2002-07-05 Thread Chip Wiegand

I am installing from source php-4.2.1 and have apache-2.0.39 installed
and working. When I ran make on php I ended with this message:

-
include/mysql -I/usr/local/php-4.2.1/ext/xml/expat  -D_REENTRANT
-D_THREAD_SAFE 
-I/usr/local/php-4.2.1/TSRM -g -O2 -pthread -DZTS -prefer-pic  
-c php_functions.c
php_functions.c:93: syntax error
*** Error code 1

Stop in /usr/local/php-4.2.1/sapi/apache2filter.
*** Error code 1

Stop in /usr/local/php-4.2.1/sapi/apache2filter.
*** Error code 1

Stop in /usr/local/php-4.2.1/sapi.
*** Error code 1

Stop in /usr/local/php-4.2.1.

---
Is there some issue here between the latest versions of apache and php? 

--
Chip
[EMAIL PROTECTED]
www.wiegand.org


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




Re: [PHP] Can php Read contents from MS Word in Exactly same format

2002-02-04 Thread Chip Wiegand

On Mon, 04 Feb 2002 01:29:11 -0500
"Jason G." <[EMAIL PROTECTED]> wrote:

> MS Word is a proprietary, binary (i think), format...  Have fun.
> 
> There may be a solution out there.
> 
> If you could convince her to save it in Rich Text Format (rtf) and
> then upload it, your life would be much easier...
> 
> -Jason Garber
 
Another option - have her save it as html in word. sure the code it creates is ugly 
and basically unedible rubbish, but it will display correctly. I have a similar 
situation where the marketing people post a once a month dealer newsletter, just a 
simple single-column 1 to 2 page affair. I just got in the habbit of having them email 
me the .doc and then I convert it to html myself. Takes all of 5 minutes or so and it 
clean code.

--
Chip
 
> At 01:51 PM 2/4/2002 +0800, Jack wrote:
> >Dear all
> >I had made  a news input page for one of the HR Manger to input the
> >news for the whole company to read, she is quick comfort with using
> >MS word as a editor, so is there anyway that the php can read the
> >contents from the MS Word and display as exactly same format to html?
> >
> >If there is so, could any one suggest a book to me?
> >
> >Thx a lot
> >Jack
> >[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] Is there a GUI for MySQL?

2001-12-06 Thread chip

On Thursday 06 December 2001 09:31 pm, Hai Nguyen wrote:
> Hi,
>
> I am a newbie at this.  I was just wondering if there is a Graphical
> User Interface for MySQL?
>
> Cheers,
>
> Hai Nguyen

Did you check the mysql.com web site? They list a few, and do a 
search on google, you'll find lots more.

--
Chip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] New Page Escape Sequence

2001-12-04 Thread chip

On Tuesday 04 December 2001 02:35 pm, Martin Towell wrote:
> if it's just a plain text file then, in theory, you can insert a FF
> character (0x0C) but as mentioned, this might not work on all printers.
>
> if you're using html, try using:
> 
> or put the style in some other tag if it doesn't work for 
> there's also "page-break-after: always;" that you could use...

Unfortanately this does not work all the time, in all browsers, on all 
printers, etc etc.
I've tried it, it just wasn't reliable enough to make the appropriate changes 
to many pages, so I've just left them to be printed the way the individuals 
printer wants to print them, after all, you also can't control how the 
margins will appear, etc.

--
chip

> -Original Message-
> From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 05, 2001 7:20 AM
> To: [EMAIL PROTECTED]; Chip; Robert Samuel White
> Subject: Re: [PHP] New Page Escape Sequence
>
>
> Hello,
>
> Chip wrote:
> > On Monday 03 December 2001 11:02 pm, Robert Samuel White wrote:
> > > I wish to take some information out of a database and create a text
> > > file with the information, nicely formatted.  Does any one know of an
> > > escape sequence that works as a "new page" indicator for printing???
> >
> > I did some checking into this also, some time back. All the responses I
>
> got
>
> > then were it's not possible to cover all types of printers and OS's
>
> available
>
> > with just a certain escape sequence or other code.
> >
> > If you get a better answer, would you please copy me on it?
>
> In theory, the right way to achieve that is to put style attribute in
> the first paragraph the page that tells to break the page before the
> paragraph. I know that the attribute exists, but I don't know how many
> browsers obey it when they print the page. Maybe it is safe to resort to
> PDF.
>
> Regards,
> Manuel Lemos

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] New Page Escape Sequence

2001-12-04 Thread chip

On Tuesday 04 December 2001 12:30 am, Manuel Lemos wrote:
> Hello,
>
> Chip wrote:
> > On Monday 03 December 2001 11:02 pm, Robert Samuel White wrote:
> > > I wish to take some information out of a database and create a text
> > > file with the information, nicely formatted.  Does any one know of an
> > > escape sequence that works as a "new page" indicator for printing???
> >
> > I did some checking into this also, some time back. All the responses I
> > got then were it's not possible to cover all types of printers and OS's
> > available with just a certain escape sequence or other code.
> >
> > If you get a better answer, would you please copy me on it?
>
> In theory, the right way to achieve that is to put style attribute in
> the first paragraph the page that tells to break the page before the
> paragraph. I know that the attribute exists, but I don't know how many
> browsers obey it when they print the page. Maybe it is safe to resort to
> PDF.
>
> Regards,
> Manuel Lemos

I know it exists also, it is supposedly supported by the two 'main' browsers, 
but it doesn't work as expected. I tried the style sheet method, inline and 
external, and found it works with IE more often then Netscape, and then only 
sometimes on some printers, but not always, so YMMV.

--
Chip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] New Page Escape Sequence

2001-12-03 Thread chip

On Monday 03 December 2001 11:02 pm, Robert Samuel White wrote:
> I wish to take some information out of a database and create a text
> file with the information, nicely formatted.  Does any one know of an
> escape sequence that works as a "new page" indicator for printing???

I did some checking into this also, some time back. All the responses I got 
then were it's not possible to cover all types of printers and OS's available 
with just a certain escape sequence or other code.

If you get a better answer, would you please copy me on it?

--
Chip
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: I'm getting frustrated with this.

2001-11-30 Thread chip

Got it! Turns out to be one of those obvious left-it-out errors that happens 
when staring at the monitor too long. One other guy helped point this out 
off-list. I'm at home now and don't recall his name, the emails being at work.

Thanks to all,
Chip

On Friday 30 November 2001 12:09 pm, Fred wrote:
> If you want to know exactly why mysql functions fail you should always, and
> I do mean always, use this form:
> $Result = mysql_query($Query, $Connection)
> or die (mysql_error());
> You will always get a fairly descriptive error from mysql.  If you still do
> not understand the error, at least you have more specific information for
> this list.
>
> Fred
>
> Chip Wiegand <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Hi,
> > I just want a simple page that pulls the data from a database (got that
> > working fine, no problem),
> > and on that page I want to be able to have an option to delete entries. I
> > have tried what seems
> > to be the simplest method - using a form text field, enter the
> > appropriate info, and hit the submit
> > button. It should then be deleted from the database. I can delete from
> > the database on the
> > command line, but getting it to work in php is another story. I keep
> > getting 'not a valid mysql
> > result resource' errors. I have 3 php/mysql books and cannot get this to
> > work. I know it can't be
> > as difficult as it appears.
> > My goal is simple enough - I have a database that is populated from
> > online web forms. It contains
> > enduser names, addresses & email addresses. I made a form that the
> > marketing people can use
> > to view the database, search it and display it in various ways. I also
>
> gave
>
> > them a form that will
> > allow them to manually add enduser info into the database. That all works
> > fine. It's just the doggone
> > delete stuff that I just haven't got a handle on yet.
> > Is there a tutorial somewhere that shows the simplest method of setting
> > this up? That's all I need,
> > a reference to a location for a tutorial or info on this particular
> > subject.
> >
> > Thanks,
> > Chip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] I'm getting frustrated with this.

2001-11-30 Thread chip . wiegand

Hi,
I just want a simple page that pulls the data from a database (got that
working fine, no problem),
and on that page I want to be able to have an option to delete entries. I
have tried what seems
to be the simplest method - using a form text field, enter the appropriate
info, and hit the submit
button. It should then be deleted from the database. I can delete from the
database on the
command line, but getting it to work in php is another story. I keep
getting 'not a valid mysql
result resource' errors. I have 3 php/mysql books and cannot get this to
work. I know it can't be
as difficult as it appears.
My goal is simple enough - I have a database that is populated from online
web forms. It contains
enduser names, addresses & email addresses. I made a form that the
marketing people can use
to view the database, search it and display it in various ways. I also gave
them a form that will
allow them to manually add enduser info into the database. That all works
fine. It's just the doggone
delete stuff that I just haven't got a handle on yet.
Is there a tutorial somewhere that shows the simplest method of setting
this up? That's all I need,
a reference to a location for a tutorial or info on this particular
subject.

Thanks,
Chip


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Why doesn't this work? HTTP_USER_AGENT

2001-11-27 Thread chip

This is interesting. I did my testing in Opera 5.05 and it fails to display 
the page correctly. I then opened Netscape 6.2 and it works fine. Must be a 
problem with Opera. I also set Opera to identify itself as Netscape and it 
still failed to load the page.
Thanks for the assistance.
Chip

On Monday 26 November 2001 11:11 pm, David Robley wrote:
> On Tue, 27 Nov 2001 17:43, Craig Vincent wrote:
> > 
> > What have I done wrong in such a simple bit of code?
> > -
> > 
> > 
> >  > $browser = $HTTP_USER_AGENT;
> > $ip = $REMOTE_ADDR ;
> > $db = mysql_connect ( "localhost" , "username" , "password" );
> > mysql_select_db ( "database" , $db );
> > $sql = "INSERT INTO table_name(ip,browser,received)
> > VALUES('$ip','$browser',now())" ;
> > $results = mysql_query ( $sql);
> > ?>
> > Howdy
> > 
> > 
> > 
> >
> > I copy & pasted your code onto a test HTML page and modified the mysql
> > commands to appropriately connect to my MySQL server.  There was
> > absolutely no problem with this code at all.  What version of PHP are
> > you using?
>
> Just about to do that but he saved me the effort.
>
> Any chance you created the script with DOS end of line characters??

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Why doesn't this work? HTTP_USER_AGENT

2001-11-26 Thread chip

I have this small test page, below, which returns an error -

Parse error:  parse error in /usr/local/apache/htdocs/test.php on line 4

on the $browser line, if I comment it out, it returns an error on the $ip 
line, etc. I can leave all the php lines out, add an echo statement 



in the body to get the http_user_agent and it displays the user agent just 
fine. What have I done wrong in such a simple bit of code?
-



Howdy
  

TIA,
Chip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] configure problem

2001-11-19 Thread Chip

On Monday 19 November 2001 15:54, David Robley wrote:
> On Tue, 20 Nov 2001 01:11, Chip wrote:
> > I am setting up a new system for a friend and am getting the following
> > error when running ./configure -
> >
> > /usr/libexec/elf/ld: cannot find -lgd.
> > error code 1
> >
> > This machine is a default install of FreeBSD4.4, Apache-1.3.22,
> > MySQL-3.23.44 and PHP-4.0.6. I have set this same system up on several
> > other machines and have never come across this error.
> > What am I missing that is causing this problem?
> > --
> > Chip W.
>
> It would appear that you don't have gd on that machine, or it is not
> where the config is expecting to find it.

Well it's working now, and not because I didn't have gd installed, I did, do. 
I downloaded php-4.0.5 and ran the exact same ./configure line as in 4.0.6 
and it installed just fine, had no problem finding everything. Could there be 
a problem in 4.0.6 I wonder?
--
Chip W.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] configure problem

2001-11-19 Thread Chip

I am setting up a new system for a friend and am getting the following error 
when running ./configure -

/usr/libexec/elf/ld: cannot find -lgd.
error code 1

This machine is a default install of FreeBSD4.4, Apache-1.3.22, MySQL-3.23.44 
and PHP-4.0.6. I have set this same system up on several other machines and 
have never come across this error.
What am I missing that is causing this problem?
--
Chip W.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] site last updated

2001-11-03 Thread Chip

On Saturday 03 November 2001 21:12, Steve Werby wrote:
> "Ryan Christensen" <[EMAIL PROTECTED]> wrote:
> > You can do this in a per-page basis w/:
> >
> > $modified = stat("yourfile.html");
> > echo date("l, F dS",$modified[9]);
>
> Also see getlastmod() and filemtime().

I am interested in this also. I understand the way it is working here, but 
what about using a common footer.inc which contains the last modified script, 
to show the last modified date of another inc file, body.inc, inside page.php?
This would have to know the body.inc file name loaded into page.php I guess. 
That'd sure be easier than adding the script to several hundred seperate 
pages.
 
--
Chip W.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] phpmyadmin is installed, now how to access it?

2001-10-28 Thread Chip

On Sunday 28 October 2001 15:52, Moody wrote:
> > I see all the files are name php3 rather than php. When I access the
> > index.php3 of course it my browser doesn't know what to do so it asks if
> > I want to download it.
>
> Sounds like you need to add ".php3" to your AddType directive in the
> httpd.conf file
> i.e.the line in httpd.conf that says:
>
> AddType application/x-httpd-php .php
>
> Should be changed to:
>
> AddType application/x-httpd-php .php .php3
>
> This should solve the problem with .php3 scripts not executing on your
> server :-)
>  Otherwise, if you want/have to change all the extensions to .php, you'll
> have to change all the requires and includes in the phpMyAdmin scripts to
> reflect these changes.

Interesting that it only worked after adding .php3 to the existing .php line. 
Earlier I had uncommented the lines just above that one which is almost 
identical except it is for .php3, but that didn't do the trick.

Thanks for the help,
--
Chip W.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] phpmyadmin is installed, now how to access it?

2001-10-28 Thread Chip

On Saturday 27 October 2001 23:47, Peter wrote:
> Very easy.
>
> After I expanded the PhpMyAdmin files in the appropriate directory, 

which is...?
I installed it into /usr/local/apache/htdocs/phpMyAdmin/
is that okay? It doesn't want to work correctly.

> I just
> set the appropriate server name, username and password for SQL server in
> the config.php.inc file

Done.

> Then I accessed the directory with my web browser and I was successfully
> in using PHPMyAdmin.
>
> Peter

I see all the files are name php3 rather than php. When I access the 
index.php3 of course it my browser doesn't know what to do so it asks if I 
want to download it. So I copied it as index.php and then I get all the code 
and not the actual rendered page.  Then I copied all the php3 files to php 
and still get just the code only. The docs are not clear on this stuff. 
Supposedly just install it to the appropriate directory (which is...?), then 
set the user name and password, and away you go. Hmm, not for me. Do I need 
to do something to my httpd.conf so it will know how to handle php3 files? I 
uncommented the appropriate lines so it will handle php3 as well as php, but 
that did no good. I added AddModule lines for php3, still no good. I don't 
know what to try next.
I'm sure it's easier than I make it out to be, but I don't know how to make a 
php3 program work on a php4 system, and the docs don't cover this.
--
Chip

> On Sat, 27 Oct 2001, Chip wrote:
> > I just installed the FreeBSD port for PHPMyAdmin and was reading the docs
> > on the php wizard site but cannot figure out how to actually access the
> > interface. Is it through a particular port like webmin? Can some clue me
> > in please?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] phpmyadmin is installed, now how to access it?

2001-10-27 Thread Chip

I just installed the FreeBSD port for PHPMyAdmin and was reading the docs on 
the php wizard site but cannot figure out how to actually access the 
interface. Is it through a particular port like webmin? Can some clue me in 
please?
-- 
Chip W.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Calendar

2001-10-26 Thread Chip

Does anyone know of a php script that will display a monthly calendar in 
a graphical format? I have a client that would prefer that over the typical
list of dates which is much easier to do. I need to be able to put various
bits of info on differant days of the month of course, and have links to all
the months, in seperate calendar pages.

--
Chip W.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Can PHP do what this javascript does...

2001-10-24 Thread chip . wiegand

Thanks for all the reponses. I know that php is server-side only, and that
certain things
like mouse-overs, are client-side, wasn't sure about the printer function
though. I could
have assumed it was, but I try not to assume anything, but always ask to
make sure.

Regards,
Chip





Mike Eheler <[EMAIL PROTECTED]> on 10/24/2001 10:31:30 PM
Internet mail from:
To:   [EMAIL PROTECTED]
cc:   [EMAIL PROTECTED]

Subject:  Re: [PHP] Can PHP do what this javascript does...


There's a really long method of doing it that would work, but would
involve server-side browser detection, and a database containing a list
of browsers that support print shortcuts.

Stick with the JS.

Mike

[EMAIL PROTECTED] wrote:

>To print: 
>Click here or Select File
>and then Print from your browser's menu.
>
>Is there an equivelant bit of code to do this printer shortcut with php?
>
>--
>Chip Wiegand
>Computer Services
>www.simradusa.com
>[EMAIL PROTECTED]
>Simrad, Inc
>Lynnwood, WA
>425-712-1138
>
>"There is no reason anyone would want a computer in their home."
> --Ken Olson, president, chairman and founder of Digital Equipment Corp.,
>1977
>  (-- Then why do I have nine? Somebody help me!)
>
>









-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Can PHP do what this javascript does...

2001-10-24 Thread chip . wiegand

To print: 
Click here or Select File
and then Print from your browser's menu.

Is there an equivelant bit of code to do this printer shortcut with php?

--
Chip Wiegand
Computer Services
www.simradusa.com
[EMAIL PROTECTED]
Simrad, Inc
Lynnwood, WA
425-712-1138

"There is no reason anyone would want a computer in their home."
 --Ken Olson, president, chairman and founder of Digital Equipment Corp.,
1977
  (-- Then why do I have nine? Somebody help me!)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Submit

2001-10-21 Thread Chip Landwehr

lol NP--actually I am using sessions-Will I have to declare each form
variable as a session variable to do this?


"Jack Dempsey" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> sorry chip, i'm so used to using sessions, i just kind of assumed you
would
> :-)
> sessions will carry the data around.if you can't/won't use them, you
> could use curl to post the values along, but sessions are much more
elegant
> for this kind of thing
>
> my $.02
> jack
>
> -Original Message-
> From: Chip Landwehr [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 21, 2001 8:39 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Submit
>
>
> But won't using a header kill all the form data?  Thought you had to use
> post for that?
>
>
>
> "Jack Dempsey" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > sure, have to states for your script, one is the normal blank form, the
> > second is the check.
> > in your check, validate the data. if its not good, print the form out
> again
> > with those values already filled in if they apply.
> > if it is good, redirect to a new page using header();
> http://php.net/header
> > be careful not to output any before you make this header call.
> >
> > jack
> >
> > -Original Message-
> > From: Chip Landwehr [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, October 21, 2001 8:29 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Submit
> >
> >
> > I got a form (form.php) that recalls itself when you hit submit to
verify
> > all the fields.  If all the fields are good, I need it to automatically
> post
> > to a new page.  Anyway to do this?
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Submit

2001-10-21 Thread Chip Landwehr

But won't using a header kill all the form data?  Thought you had to use
post for that?



"Jack Dempsey" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> sure, have to states for your script, one is the normal blank form, the
> second is the check.
> in your check, validate the data. if its not good, print the form out
again
> with those values already filled in if they apply.
> if it is good, redirect to a new page using header();
http://php.net/header
> be careful not to output any before you make this header call.
>
> jack
>
> -Original Message-
> From: Chip Landwehr [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 21, 2001 8:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Submit
>
>
> I got a form (form.php) that recalls itself when you hit submit to verify
> all the fields.  If all the fields are good, I need it to automatically
post
> to a new page.  Anyway to do this?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Submit

2001-10-21 Thread Chip Landwehr

I got a form (form.php) that recalls itself when you hit submit to verify
all the fields.  If all the fields are good, I need it to automatically post
to a new page.  Anyway to do this?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Form Question

2001-10-21 Thread Chip Landwehr

I can't do that because  the form is to big and there is a limit to how much
data you can send via the URL bar.  Any other ideas?


"Seb Frost" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> if ($T3==""){header ("Location:
> new_narrative.php?FilledName=No&variable1=hello&variable2=goodbye");}
>
> etc etc
>
> - seb
>
> -Original Message-
> From: Chip Landwehr [mailto:[EMAIL PROTECTED]]
> Sent: 21 October 2001 21:03
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Form Question
>
>
> I got that but the passing back I'm having a problem with.  This is waht I
> got:
>
> if ($T3==""){header ("Location: new_narrative.php?FilledName=No");}
>
> How do I change this to include a Post?
>
>
> "Seb Frost" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > well all of the entries are passed via post or get to your form handler
> > (obviously).  So just pass them back when you re-call the form.
> >
> > then put in
> >
> >  in the form
> >
> > or something like that anyway.
> >
> > - seb
> >
> > -Original Message-
> > From: Chip Landwehr [mailto:[EMAIL PROTECTED]]
> > Sent: 21 October 2001 20:49
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Form Question
> >
> >
> > I got a form that a user fills out.  When they hit submit they are
> > transfered to a PHP page that verifies their data.  If a problem is
found
> > (They forgot to enter an e-mail address) the PHP sends them back to the
> > original form with the field they forgot to fill out highlighted in red.
> > Unfortunately all there entries are wiped out and they have to re-enter
> > everything.  Any easy way to keep there original entries?
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> > ---
> > Incoming mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/2001
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/2001
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/2001
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/2001
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Form Question

2001-10-21 Thread Chip Landwehr

I got that but the passing back I'm having a problem with.  This is waht I
got:

if ($T3==""){header ("Location: new_narrative.php?FilledName=No");}

How do I change this to include a Post?


"Seb Frost" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> well all of the entries are passed via post or get to your form handler
> (obviously).  So just pass them back when you re-call the form.
>
> then put in
>
>  in the form
>
> or something like that anyway.
>
> - seb
>
> -Original Message-
> From: Chip Landwehr [mailto:[EMAIL PROTECTED]]
> Sent: 21 October 2001 20:49
> To: [EMAIL PROTECTED]
> Subject: [PHP] Form Question
>
>
> I got a form that a user fills out.  When they hit submit they are
> transfered to a PHP page that verifies their data.  If a problem is found
> (They forgot to enter an e-mail address) the PHP sends them back to the
> original form with the field they forgot to fill out highlighted in red.
> Unfortunately all there entries are wiped out and they have to re-enter
> everything.  Any easy way to keep there original entries?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/2001
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/2001
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Form Question

2001-10-21 Thread Chip Landwehr

I got a form that a user fills out.  When they hit submit they are
transfered to a PHP page that verifies their data.  If a problem is found
(They forgot to enter an e-mail address) the PHP sends them back to the
original form with the field they forgot to fill out highlighted in red.
Unfortunately all there entries are wiped out and they have to re-enter
everything.  Any easy way to keep there original entries?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] IRC Channel

2001-10-19 Thread Chip Landwehr

Is there a PHP IRC channel?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Disable Back Button

2001-10-19 Thread Chip Landwehr

lol!

True, so true...

"Richard S. Crawford" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Can you imagine the trouble you'd get into if you could?

At 09:47 PM 10/19/2001, Chip Landwehr wrote:
>Is there any way to do this in PHP4?


Sliante,
Richard S. Crawford

http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is
invisible to the eye."  --Antoine de Saint Exupéry

"Push the button, Max!"




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Disable Back Button

2001-10-19 Thread Chip Landwehr

Is there any way to do this in PHP4?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mail function and lots of form fields

2001-10-17 Thread Chip

Great help dude, it works fine now. Much appreciated.
I created mainfile.php which is a form that is submited to thanks.php, which
contains just the small mail function stuff and a call to include 
mailbody.inc, which has all the fields layed out nicely on screen for the 
user to see as well as it being sent to a person in a well formatted message. 
This is all done with test pages, which I can now move over to my production 
site, then after all that is working (there are 5 online forms), I will work 
on getting the data from the forms into a mysql database.

Regards,
--
Chip

On Wednesday 17 October 2001 16:54, Richard Baskett wrote:
> Actually what I meant was that the $body variable would be inside an
> include file just to decrease the amount of coding inside your main file.
> So...
>
> "mainfile.php"
> You would have your form and either you can have the form submit to self or
> to another file.. for explanation purposes I will say another file called
> "thanks.php"
>
> "thanks.php"
> this has your form processing information, plus the mail function, and
> tells the user thanks for submitting the form.  This file would include
> "mailbody.inc" which is the template for the body of your mail message.
> include('mailbody.inc');
>
> "mailbody.inc"
>  $body ="
> This is the header of the email message
>
> Greetings $name,
>
> How are you today, you've spent $amount of dollars in the last $days.
>
> Thank You!
>
> Management";
> ?>
>
> Did this make more sense?
>
> Rick
>
> > On Wednesday 17 October 2001 15:38, Richard Baskett wrote:
> >> For the body what I usually do, if you're planning on just a regular
> >> text email, is to make an include file with this type of formatting:
> >
> > I guess you mean I can use an include file in my variable? Like this:
> > $body = newbody.inc
> >
> > Does the variable need to be quoted? I think most likely, but am not
> > sure. I'll check into this more tomorrow at work.
> > --
> > Chip Wiegand
> >
> >> $body ="
> >> This is the header of the email message
> >>
> >> Greetings $name,
> >>
> >> How are you today, you've spent $amount of dollars in the last $days.
> >>
> >> Thank You!
> >>
> >> Management";
> >>
> >> In other words when you do something like this you can actually see the
> >> formatting and all the \n's or \r's will be there.  I have found this to
> >> bed the easiest way of doing email formatting.  I hope it makes sense to
> >> you, if not you can always write me back and Ill have another go at
> >> explaining it :)
> >>
> >> Rick
> >>
> >>> I have a form with around 50 text fields. I have used the mail function
> >>> to send
> >>> forms with simple textarea's, names, and email addresses, but what
> >>> about when
> >>> I have around 50 fields to send?
> >>> I am using the following format for my mails:
> >>>>>>   if(isset($submit)):
> >>> $date = date("M d, Y");
> >>> $to = "[EMAIL PROTECTED]";
> >>> $subject = "Web Site Comments";
> >>> $body = "On $date\n $name\n ($email) wrote" .
> >>> $feedback; mail($to, $subject, $body, "From:$email\nContent-Type:
> >>> text/html; charset=iso-8859-1\nMime-Version: 1.0\nX-Mailer: PHP/" .
> >>> phpversion()); print("Thanks for the comments!\nWe appreciate
> >>> you taking the time to share your thoughts with us.");
> >>>   else:
> >>>   ?>
> >>> The fields $feedback, $name, $email are from the form, but I have
> >>> another form with around 50
> >>> fields. Is there an alternative to listing all 50or so fields on that
> >>> one $body line? I'd like
> >>> the final message to have a reasonable amount of formatting to keep the
> >>> many fields sorted out and easy to read.
> >>> --
> >>> Chip Wiegand
> >>> Computer Services
> >>> www.simradusa.com
> >>> [EMAIL PROTECTED]
> >>> Simrad, Inc
> >>> Lynnwood, WA
> >>> 425-712-1138
> >>>
> >>> "There is no reason anyone would want a computer in their home."
> >>> --Ken Olson, president, chairman and founder of Digital Equipment
> >>> Corp., 1977
> >>> (-- Then why do I have nine? Somebody help me!)
> >>>
> >>>
> >>> --
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>> To contact the list administrators, e-mail:
> >>> [EMAIL PROTECTED]
> >
> > --
> > --
> > Chip W.

-- 
--
Chip W.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Easy Question

2001-10-05 Thread Chip

When you write a php script to access a database,edit records, etc., is the
entire thing 1 giant PHP page or a bunch of different ones?  If it can be
written both ways, which is the better way to do it?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MySQL Locking Question

2001-10-05 Thread Chip

So once a user logs into a MySQL Server via PHP, if they don't logout, they
stay logged in forever???


Rasmus Lerdorf <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > A.  Browser Closed Before Finishing Edit:
> >  From what I have read Get_Lock locks are automatically
released
> > when connections terminate.  I'm new to this so am unsure if MySQL will
> > terminate the connection when the browser is closed.  If not does MySQL
> > disconnect users after a certain time?  And is this a configurable
option?
>
> No, a mysql connection is server side and has absolutely nothing to do
> with what the user does with their browser client-side.  You can't make a
> mysql connection close when someone closes their browser.  And no, MySQL
> does not disconnect users after a certain time.
>
> > B.  User goes to lunch before hitting Submit
> > I was thinking of putting a timout feature in the browser so
that
> > after say  5 minutes a prompt asking the user that has the record locked
if
> > he is still working or wants to cancel.  This popup would have 20
seconds or
> > so before cancel was automatically selected and the lock is released.
> >
> > C.  User types in www.something.com and leaves the editing page in
limbo:
> > I have no idea what to do in this situation.  If MySQL can be
> > configured to boot a user after so may minutes of activity then that is
the
> > solution.  As with possibility A I am unsure.
> >
> > Sound Feasable?
>
> No, I see all sorts of problems with this.  Personally I would put the
> check at the commit stage.  Maintain a record modification counter.  Right
> before committing the changes check to see if that counter has changed, if
> it has warn the user that the record was changed out from underneath
> him/her and put the edit form back up with the changes.
>
> -Rasmus
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MySQL Locking Question

2001-10-05 Thread Chip

Hmmm...that is true
It would still prevent Jill from editing.  I'll probably add a locked_by
field to convey the user info.

For Dead Locks:

A.  Browser Closed Before Finishing Edit:
 From what I have read Get_Lock locks are automatically released
when connections terminate.  I'm new to this so am unsure if MySQL will
terminate the connection when the browser is closed.  If not does MySQL
disconnect users after a certain time?  And is this a configurable option?

B.  User goes to lunch before hitting Submit
I was thinking of putting a timout feature in the browser so that
after say  5 minutes a prompt asking the user that has the record locked if
he is still working or wants to cancel.  This popup would have 20 seconds or
so before cancel was automatically selected and the lock is released.

C.  User types in www.something.com and leaves the editing page in limbo:
I have no idea what to do in this situation.  If MySQL can be
configured to boot a user after so may minutes of activity then that is the
solution.  As with possibility A I am unsure.

Sound Feasable?


Rasmus Lerdorf <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > OK that example is poor I admit...but do you see the reasoning behind
> > locking?  If a lock was in place Jill would't be able to edit her post
> > because she would get a message stating that Admin Jack was allready
editing
> > it.
>
> GET_LOCK has no way of conveying that information.  You would need to use
> a completely different mechanism to identify who is holding a lock.
>
> How are you going to avoid deadlock?
>
> -Rasmus
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MySQL Locking Question

2001-10-05 Thread Chip

> Well, if you only update the fields that changed then who cares?  The
> fields that Jill changes are going to overwrites Jack's changes anyway.
> Locking the record and having Jack finish before Jill can start isn't
> going to change the end result which would be that Jill's changes are
> going to overwrite Jack's.

The reason for this is because the data that Jack enters could potentialy
affect the data that Jill enters.

Example:  Jack is an administrator at a forum somewhere.  Jack is editing a
post that Jill entered to remove inapropriate content.  Meanwhile Jill is
editing the same post to revise what she said seeing that it could be
mistaken for being inappropriate.  Jack saves, Jill Saves...Jacks stuff is
lost.

OK that example is poor I admit...but do you see the reasoning behind
locking?  If a lock was in place Jill would't be able to edit her post
because she would get a message stating that Admin Jack was allready editing
it.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MySQL Locking Question

2001-10-05 Thread Chip

Well here is the situation.

1. Jack opens record A to change an entry.
2. Jill opens record A to change an entry.
3. Jack finishes his changes and saves the data.
4. Jill finishes her changes and saves the data.

Jill just over wrote whatever Jack did.  The only method I could think of to
prevent this was to have the client check to see if the record was allready
being edited by someone.  If it is then they have to wait.   Is there
another way to do this?   What are atomic updates??



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] MySQL Locking Question

2001-10-05 Thread Chip

I'm preparing to write a DB app using PHP as the programming interface.  I
need to be able to lock records at certain points.  I was wondering if the
following is possible using PHP.

1.  I want to use the GET_LOCK(str, timeout) function to lock records based
on the record ID.  Can GET_LOCK be called through PHP??

2.  If the GET_LOCK fails (Someone else allready has the lock for that
record), I want to make the PHP code to continue attempting to GET_LOCK
until it is available.  Can you do events every 5 seconds until success in
PHP?

THANKS!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php graphics generation

2001-09-30 Thread Chip

I have been using php for simple things so far, and am just starting to look 
into the image generation functions of php. I am wondering just what people 
use these for in real-life applications, some real references. I know what 
the books say can be done, I am interested in what is being done with it.
Just out of curiosity,

--
Chip W.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Posts about the WTC Trajedy

2001-09-11 Thread Chip


I find the 'tone' of this thread to be very shameful! At a time like this we 
should be supporting one another in any way we can, not making off-handed 
remarks, finger-pointing or making facetious comments. I am on about a dozen 
differant lists and they all have threads going on this subject, and this 
list is the only one with any negative remarks. What a shame! I am 
disappointed in what I am reading here. I am glad to see the discussion even 
it is off-topic, but lets try to be supportive, and not make things harder 
than they already are. The world is full of hatred and love, but some of you 
are just perpetuating the hatred. This is not the time for that, but rather 
it is the time to reach out to those who have been hurt by this trajedy. And 
there are many ways we can do that, even if we are on the opposite side of 
the world, whether we are 'believers' or not.

I hope and pray the people responsible are found and brought to justice. 
God bless you, and if you don't happen to believe in God, or any god - 
Regards

--
Chip Wiegand

On Tuesday 11 September 2001 09:26, Alexander Skwar wrote:
> So sprach »[EMAIL PROTECTED]« am 2001-09-11 um 08:55:49 -0600 :
> > We need the receive the help from Got, I believe He is the only one who
> > can help us on this situation 
>
> Well, you know: *EXACTLY* this is the problem!  Your so called "god".
> If it weren't for this superstition, the world would be a *MUCH* safer
> place.  I'm sure of that.
>
> But if it makes you feel better: Go on, believe in that.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
--
Chip W.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] date/time of current page

2001-09-11 Thread chip . wiegand

Thankyou, that works fine.

--
Chip





"Jack Dempsey" <[EMAIL PROTECTED]> on 09/12/2001 12:03:20 AM
Internet mail from:
To:   <[EMAIL PROTECTED]>
cc:   <[EMAIL PROTECTED]>

Subject:  RE: [PHP] date/time of current page


> I'm not sure what you mean, but here is what I have tried -

try this:


jack








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] date/time of current page

2001-09-11 Thread chip . wiegand





"Michael Geier, CDM Systems Admin" <[EMAIL PROTECTED]> on 09/11/2001
11:46:50 PM
Internet mail from:
To:   "Jack Dempsey" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>,
  <[EMAIL PROTECTED]>
cc:

Subject:  RE: [PHP] date/time of current page



document.write('some text ' + document.lastmodified + ' some other text.');


Surely it can be done in PHP, which doesn't, of course, depend on whether
or not the visitor has some options disabled or enabled in their browser.

--
Chip

-Original Message-
From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 11, 2001 4:42 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] date/time of current page


have you tried parsing out the name from $PHP_SELF?
I would think that php wouldn't care if it gets 'index.php' or (some
processing) "index.php", know what i mean?

jack

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 11, 2001 1:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] date/time of current page


I want to put, into a footer include file, the last modified date of the
current
file being viewed. I have the following code that works when I hard code
the
file name -



But of course that won't work as a footer for a site with over two hundred
pages.
What is the parameter for the current page? I tried php_self but that
didn't
work
properly (it returned Dec 31 1969).

--
Chip Wiegand
Simrad, Inc
[EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] date/time of current page

2001-09-11 Thread chip . wiegand





"Jack Dempsey" <[EMAIL PROTECTED]> on 09/11/2001 11:42:07 PM
Internet mail from:
To:   <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
cc:

Subject:  RE: [PHP] date/time of current page


have you tried parsing out the name from $PHP_SELF?
I would think that php wouldn't care if it gets 'index.php' or (some
processing) "index.php", know what i mean?

jack

I'm not sure what you mean, but here is what I have tried -



I also quoted the string $PHP_SELF with the same results, which look
like this -

12/31/69 4:00:00 PM

So, just what am I doing wrong?
--
Chip


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 11, 2001 1:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] date/time of current page


I want to put, into a footer include file, the last modified date of the
current
file being viewed. I have the following code that works when I hard code
the
file name -



But of course that won't work as a footer for a site with over two hundred
pages.
What is the parameter for the current page? I tried php_self but that
didn't
work
properly (it returned Dec 31 1969).

--
Chip Wiegand
Simrad, Inc
[EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]









-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] date/time of current page

2001-09-11 Thread chip . wiegand

I want to put, into a footer include file, the last modified date of the
current
file being viewed. I have the following code that works when I hard code
the
file name -



But of course that won't work as a footer for a site with over two hundred pages.
What is the parameter for the current page? I tried php_self but that didn't work
properly (it returned Dec 31 1969).

--
Chip Wiegand
Simrad, Inc
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] nav buttons not working correctly

2001-08-14 Thread chip . wiegand

I have some existing code that I want to modify to limit the display
results to 5 rows and
add nav buttons to display the next set of 5, etc. You all know what I am
looking for.
I have a book- MySQL/PHP Database Applications by Greenspan & Bulger -
which has
an example that should work, but isn't. I have inserted the function from
the book and can
get 5 rows on the first page, and the next button, but the second page
doesn't display any
rows. Pasted below is the code for my page, the function in question is
down aways. I am
just learning this stuff, so don't be too hard on me about the existin
code, it works fine with-
out the nav function. I am sure there are probably more efficient ways to
write this, but for
now I just want to get the nav function to work properly.
(some lines will undoubtedly wrap and make it all look real ugly)
-


  

Dealer Bulletins, Simrad, Inc

 body {
  background-color: #b5e4f9;
 }

  

  
Simrad Dealer Bulletins


You can sort the bulletins in the following order:
  (This will display all bulletins in one long page.)
  OR click on the bulletin subject line below (much quicker)



  
Bulletin Date (oldest to newest)
  

  
Bulletin Date (newest to 
oldest)
  

  
Select bulletins from Brian Vlad - Plotter and
Radar Products
  

  
Select bulletins from Tom Burke - Autopilots and
Instrumentation
  

  
Select bulletins from Mike Hillers -
Fisheries
  


OR

  
  Enter a word to search for: 
  
  (You must press the search button to complete the 
search)
  
  
  
  



  \n\n\n\n");
 print("\n\n\n");
 printf("%s\n\n\n\n", 
$row["bulletin_number"]);
 print("\n\n\nDealer 
Bulletin");
 printf("Date: %s\n", $row["bulletin_date"]);
 printf("\nNumber: %s\n", $row["bulletin_number"]);
 printf("\nSubject: %s\n", 
$row["bulletin_subject"]);
 printf("\nFrom: %s%s\n", 
$row["bulletin_from1"], $row["bulletin_from2"]);
 print("\n\n");
   print("SIMRAD\n");
 print("\n   A 
KONGSBERG Company\n\n");
 print("Simrad Inc.\n");
 print("19210-33rd Avenue West, Suite A\n");
 print("Lynnwood, WA 98036\n");
 print("U.S.A.\n");
 print("Telephone: 1-425-778-8821\n");
 print("Telefax: 1-425-771-7211\n");
 print("\n\n\n");
 printf("\n%s\n", $row["body"]);
 print("\n\n");
 }
else:
printf("* %s   %s   %s", $row
["bulletin_subject"], $row["bulletin_date"], $row["bulletin_from1"]);
endif;
   }
function nav($offset=0,$this_script="bulletin_sorter.php")
  {
  global $php_self;
  $page_limit = 5;
  if (empty($this_script)) { $this_script = $php_self; }
  if (empty($offset)) { $offset = 0; }
  $result3 = mysql_query("select count(*) from dbulletins");
  list($total_rows) = mysql_fetch_array($result3);
  print "\n";
 if ($offset > 0 )
 {
 print "<<Previous   ";
 }
 if ($offset+page_limit < $total_rows)
 {
 print "Next>> 
  ";
 }
  print "\n";
  }

  ?>

  
  

--
Thanks for any help you all can provide,

Chip Wiegand
Computer Services
www.simradusa.com
[EMAIL PROTECTED]
Simrad, Inc
Lynnwood, WA
425-712-1138

"There is no reason anyone would want a computer in their home."
 --Ken Olson, president, chairman and founder of Digital Equipment Corp.,
1977
  (-- Then why do I have nine? Somebody help me!)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Get USERNAME (Windows...)

2001-08-01 Thread Chip Hankley

I'm building a PHP app for use on our intranet - all MS (Clients will be 95,
NT, or 2000).

Is there a way to retrieve the clients username when they access app (i.e.
the username they used to access the network)?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] best php editor

2001-07-27 Thread Chip

Martin Marconcini wrote:

> LOL :) I didn't ... perhaps I used an old version...

Must've been an old version, I've been using it for close to a year and
haven't
had it crash nearly as much as expected for a winblows app (at work on
winnt4).
Wish there was a *nix port of it.
--
Chip


>
>
> Regards,
>
> Martin Marconcini
> www.marconcini.com.ar
>
> "Life must be lived looking forward and can be understood only looking
> backward." Soren Kierkegaard
>
> > -Original Message-
> > From: elias [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, July 27, 2001 6:51 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] best php editor
> >
> > Then you must be one of the 3% who voted "Bad" at cnet.com ;)
> >
> > "Martin Marconcini" <[EMAIL PROTECTED]> wrote in message
> > 001401c11673$9b2926a0$[EMAIL PROTECTED]">news:001401c11673$9b2926a0$[EMAIL PROTECTED]...
> > > > languages. It is called HTML-kit! I absolutely love it and felt I
> had
> > > to
> > > > share that love with you all.
> > > >
> > > > It is free. A little like Homesite, except better in my view.
> > > Certainly
> > > > far
> > > > more feature-rich for PHP scripting.
> > > >
> > > > Unless I'm missing some serious drawback, it's the best editor for
> web
> > > > work
> > > > I've found!! Works on Windows. Wish they had a Linux version.
> > >
> > > TO be honest, I've used it but it was 2 unstable...
> > >
> > > Regards,
> > >
> > > Martin.
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Regards,

--
Chip Wiegand
CRW Computer Services
www.wiegand.org
[EMAIL PROTECTED]
<-->
  Web page design
Consulting
 PC Repair
<-->




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] WSIWYG Editor using PHP?

2001-07-24 Thread Chip

Joseph Blythe wrote:

> What OS you running Linux? maybe look at http://php.weblogs.com/editors

I use FreeBSD. Thanks for the link, looks like Bluefish has made some big
improvements since I tried it over a year ago, same with Glimmer . Maybe
I'll take another look at those. I usually just use a text editor with
syntax
highlighting, can't get a fancy gui editor to work nearly as fast as that.

--
Chip

>
>
> -Original Message-
> From: chip [mailto:chip]On Behalf Of Chip
> Sent: Wednesday, 25 July 2001 12:57 PM
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] WSIWYG Editor using PHP?
>
> Joseph Blythe wrote:
>
> > Try PHP Coder Pro! http://www.phpide.de
>
> Too bad it's a winblows-only app.  :-(

--
Regards,

--
Chip Wiegand
CRW Computer Services
www.wiegand.org
[EMAIL PROTECTED]
<-->
  Web page design
Consulting
 PC Repair
<-->




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] WSIWYG Editor using PHP?

2001-07-24 Thread Chip

Joseph Blythe wrote:

> Try PHP Coder Pro! http://www.phpide.de

Too bad it's a winblows-only app.  :-(

Chip

>
> Regards,
>
> Joseph.
>
> -Original Message-
> From: Bob Clingan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 25 July 2001 9:18 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] WSIWYG Editor using PHP?
>
> Does anyone know of any WSIWYG editors that you can plug into a site using
> PHP.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Regards,

--
Chip Wiegand
CRW Computer Services
www.wiegand.org
[EMAIL PROTECTED]
<-->
  Web page design
Consulting
 PC Repair
<-->




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] convert vbcrlf to br problem

2001-07-14 Thread Chip

  I have a form with a textarea and it is being used by a marketing dept
to
  paste a ms word doc into. It then is saved into a mysql database and
viewable online. the
  problem is that the word doc used vbCrLf which is not recognized by
the browser, so the
  lines are extmely long.
  I have tried this:
  "];
  ?>
  It just results in an error:
  parse error: expecting "," or ";" on line 8
  (which is the echo line above)
  I would like to be able to add the necessary code to the existing page
so it will automatically
  do the conversions, or put the code into the display page so it will
convert the text at the
  time it is loaded into the page to be read.
  Any suggestions on how to convert the vbCrLf to  on the ms word
doc that is
  pasted into a textarea?
  Surely somebody has come up against this problem, I have yet to find
the answer that will
  work in any of my 3 php books or online.

--
Regards,

Chip




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ODBC to MS-Access View?

2001-07-13 Thread Hankley, Chip

I'm trying to connect up w/ an Access database one of our db administrators
set up.

The Access file has an "adp" extension...the data is housed in a view,
(essentially a read-only dump of some MS SQL Server tables).

I've set up the file as a System DSN in ODBC (WinNT)

When I issue the following command:

  $conn_id = odbc_connect($db, $username, $password) or die();

I get the following error:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The Microsoft
Jet database engine cannot open the file '(unknown)'. It is already opened
exclusively by another user, or you need permission to view its data., SQL
state S1000 in SQLConnect in C:\Inetpub\wwwroot/seating/sharondb.php on line
36

Any ideas? I am supplying the correct username and password...

Thanks

Chip Hankley

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Security of PHP code

2001-07-04 Thread Hankley, Chip

OK,

I'm pretty new to PHP, and have been reading this thread, and am just a
little freaked.

If I understand this right, the only way reason we can view the source code
of those pages is that the web server on which the page resides essentially
has a PHP page somewhere on their site that has some variation of:



as it's content, right?

While I can see the utility of that for some situations
(teaching...examples, etc.), it seems like a huge potential for security
breaches.

Is it possible to have such a function on your site w/o giving access to ALL
of your documents...

Chip

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Why doesn't this work? Please trouble-shoot my script.

2001-02-05 Thread chip

I tried your suggestion, as you can see from the script below, but it
still does not work, I get the
word 'array' where I should get the selected options.
--




Simrad USA Brochures Request Page



\n";
  }
?>
 Please choose the brochures you are interested in receiving.
 
 Select ...
 AP11
 AP12/AP14
 AP20 Series
 AP35
 AP45
 AP9MK3
 Tiller/Wheel Pilots
 WP5000
 
 
 
 AP11
 AP12/14
 AP20 Series
 AP35
  AP45
  AP9MK3
  Tiller/Wheelpilots
  WP5000
 
 
 




Chip Wiegand
Computer Services
[EMAIL PROTECTED]
Simrad, Inc
Lynnwood, WA
425-712-1138

"There is no reason anyone would want a computer in their home."
 --Ken Olson, president, chairman and founder of Digital Equipment
Corp., 1977
  (-- Then why do I have nine? Somebody help me!)


Please respond to [EMAIL PROTECTED]
To: Chip Wiegand
cc:

Subject: Re: [PHP] Why doesn't this work? Please trouble-shoot my
script.




On Monday, February 5, 2001, at 10:59 AM, [EMAIL PROTECTED] wrote:

> Maybe someone can take a look at the script below and tell how to make
the
> bottom part work
> the same way the top part works.

put square brackets immediately after the name element of your select
and checkbox tags. i.e.:






:: Andrew Rush :: Lead Systems Developer :: MaineToday.com ::
**

"Crippled but free, blind all the time, i was learning to see"

- J. Garcia / R. Hunter
**


The  views expressed herein are not necessarily those of my employer,
but
they let me have them anyway.






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Why doesn't this work? Please trouble-shoot my script.

2001-02-05 Thread chip . wiegand



Hi,
Maybe someone can take a look at the script below and tell how to make the
bottom part work
the same way the top part works. The top part (select box) works where the one
item chosen is
written to a hidden file and passed on  to the next page, then on and on through
several more
pages and to the last page that emails the chosen items to our marketing dept.
Problem is,
it only allows one choice at a time. I tried it with the multiple option set but
the final form shows
only the last item chosen from the list of multiple items. So I tried with the
checkboxes, but that
doesn't work at  all.




Simrad USA Brochures Request Page



\n";
  }
?>
 Please choose the brochures you are interested in receiving.
 
 Select ...
 AP11
 AP12/AP14
 AP20 Series
 AP35
 AP45
 AP9MK3
 Tiller/Wheel Pilots
 WP5000
 
 
 
 AP11
 AP12/14
 AP20 Series
 AP35
  AP45
  AP9MK3
 Tiller/Wheelpilots
WP5000


 
 


---
On the checkboxes I had at first specified the name and value fields, but that
didn't work either.
My goal is to have the above list allow multiple choices that are passed to the
next page,
and so on through about 6 pages to the final page. Even better yet would be a
text box where
the end-user could specify a quantity of brochures, for multiple choices, that
would be my
preferred form.

Thankyou for your help,

Chip Wiegand
Computer Services
[EMAIL PROTECTED]
Simrad, Inc
Lynnwood, WA
425-712-1138

"There is no reason anyone would want a computer in their home."
 --Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977
  (-- Then why do I have nine? Somebody help me!)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php and forms question

2001-01-30 Thread Chip

Michael Hall wrote:
> , you
> have session variables or writing information a database or 
> file.

Hi Michael,
I have set up a couple test pages using session variable like
this:
---





Your products have been registered";
}
?>

 


RA772
RA40 Series
RA720
RA723
RA725
RA713
Radars General






Next page


--
then the second page like this -
--





Your products have been registered";
}
?>

 


ap11
ap12/ap14
ap20 series
ap35
ap45
ap9mk3
tiller/wheel pilots
wp5000






Next page


---
and the last one like this 
---





";
foreach ( $autopilots_form as $p )
print "$p";
}

if ( isset($radars_form))
{
print "Your choices:";
foreach ( $radars_form as $p )
print "$p";
}
?>
back


-
The last won't work right because of the if statements.
How do I get it to print all the results? I tried adding
and between the if statements, but that doesn't work, as
I expected, I don't see anything in my php books that will
help with this bit. I want to be able to pick items from 
all pages, and at the end print them to the screen and 
email them to a person.

I welcome any help I can get,

Thanks

Chip Wiegand



> Mick
> 
> On Tue, 30 Jan 2001, Chip wrote:
> 
> > I am trying to build a multi-part form and am
> > using the example from the book Beginning PHP4
> > by Choi, Kent, Lea, et al. in chapter 8.
> > Here's what I want to do -
> > form_page1 - 10 input fields size=3
> > then onwards to
> > form_page2 - 5 input fields size=3
> > then onwards to
> > form_page3 - 5 input fields size=3
> > (and about 5 or 6 pages more)
> > form_page10 has submit button
> > then the thankyou page with a list of the
> > items chosen on the previous pages.
> >
> > These items will be brochures, the text-boxes
> > are for a quantity. Most people will only want
> > one but our authorized dealers can order as
> > many as they need, whence the need for the
> > size being 3 characters.
> >
> > In the example in the book they use a drop-
> > down list, so only one item on the list can be
> > chosen, this won't work for me.
> >
> > How do I store all the choices from each subsequent
> > page and bring them all together on the final page?
> >
> > Thankyou,
> >
> > --
> > Chip Wiegand
> > Alternative Operating Systems
> > www.wiegand.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php and forms question

2001-01-30 Thread Chip

I am trying to build a multi-part form and am
using the example from the book Beginning PHP4
by Choi, Kent, Lea, et al. in chapter 8.
Here's what I want to do -
form_page1 - 10 input fields size=3
then onwards to
form_page2 - 5 input fields size=3
then onwards to 
form_page3 - 5 input fields size=3
(and about 5 or 6 pages more)
form_page10 has submit button
then the thankyou page with a list of the
items chosen on the previous pages.

These items will be brochures, the text-boxes
are for a quantity. Most people will only want
one but our authorized dealers can order as 
many as they need, whence the need for the 
size being 3 characters.

In the example in the book they use a drop-
down list, so only one item on the list can be
chosen, this won't work for me. 

How do I store all the choices from each subsequent
page and bring them all together on the final page?

Thankyou,

-- 
Chip Wiegand
Alternative Operating Systems
www.wiegand.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]