[PHP] Re: [Q] How to setup Dreamweaver so that PHP scripts are executed?

2004-08-06 Thread Michael T. Peterson
Thanks to both of you, but it is still not working. I've configured the site
(both local and testing) correctly, but what gets passed to IExplore is the
URL below:

C:\Program Files\Apache
Group\Apache\htdocs\northwest_steelheader\rivers\northwest_rivers.htm

http://localhost/northwest_steelheader/ does not get passed. I can't help
but think that I'm not configuring the  correctly.

Cheers,

Michael


"Michael T. Peterson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I know this must be really obvious to many of you, but I have been unable
to
> configure DW (using [preferences] or [site->edit]) so that it will execute
a
> php script from a  tag.  When the submit button
is
> clicked the php file is displayed, rather than executed.
>
> Here's the HTML code of the submit button form:
>
>  target="mainFrame">
>  
>   Select interval
>   2 days
>   4 days
>   8 days
>   31 days
>   
>  
> 
>
> When the [Update Database] button is clicked, the file specified by the
> action parameter is displayed, rather than executed.
>
> My dev machine is a Windows XP system with Apache, PHP, and MySQL
installed.
> I have confirmed that my Apache-PHP configuration is correctly configured.
> For example,  PHP correctly executes the script when I pass
> "update_river_measurements.php" to IExplore.exe from the command line.
Also,
> when I upload these local files to my ISP, the PHP also executes
correctly.
>
> Any suggestions as to how to get DW to execute these files would be
> appreciated.
>
> Cheers,
>
> Michael
> P.S. Cross-posted to the DreamWeaver news group
>
> -- 
> 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] [Q] How to setup Dreamweaver so that PHP scripts are executed?

2004-08-06 Thread Michael T. Peterson
Hi,

I know this must be really obvious to many of you, but I have been unable to
configure DW (using [preferences] or [site->edit]) so that it will execute a
php script from a  tag.  When the submit button is
clicked the php file is displayed, rather than executed.

Here's the HTML code of the submit button form:


 
  Select interval
  2 days
  4 days
  8 days
  31 days
  
 


When the [Update Database] button is clicked, the file specified by the
action parameter is displayed, rather than executed.

My dev machine is a Windows XP system with Apache, PHP, and MySQL installed.
I have confirmed that my Apache-PHP configuration is correctly configured.
For example,  PHP correctly executes the script when I pass
"update_river_measurements.php" to IExplore.exe from the command line. Also,
when I upload these local files to my ISP, the PHP also executes correctly.

Any suggestions as to how to get DW to execute these files would be
appreciated.

Cheers,

Michael
P.S. Cross-posted to the DreamWeaver news group

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



[PHP] Re: [Q] Converting SQL Datetimes to timestamps

2004-08-04 Thread Michael T. Peterson
Thanks, everyone.  I appreciate this very much.

Cheers,

Michael

"Michael T. Peterson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Evidently the strtotime() function will not convert an SQL datetime to a
> timestamp. Am I missing something? Here's an example of what I mean:
>
> $sql_datetime = '1948-30-03 01:30:00';
> $ts = strtotime( $sql_datetime );
> print( $ts.'');
>
> When this script is executed, strtotime() returns -1.
>
> If true, that strtotime() is unable to convert SQL datetimes into
> timestamps, how are others accomplishing this?
>
> Cheers,
>
> Michael
>
> -- 
> 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] [Q] Converting SQL Datetimes to timestamps

2004-08-03 Thread Michael T. Peterson
Evidently the strtotime() function will not convert an SQL datetime to a
timestamp. Am I missing something? Here's an example of what I mean:

$sql_datetime = '1948-30-03 01:30:00';
$ts = strtotime( $sql_datetime );
print( $ts.'');

When this script is executed, strtotime() returns -1.

If true, that strtotime() is unable to convert SQL datetimes into
timestamps, how are others accomplishing this?

Cheers,

Michael

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



[PHP] [Q] Regex Woes

2004-07-18 Thread Michael T. Peterson
All,

This should be dirt simple -- So simple, in fact, that I'm somewhat
embarassed to make this post, but, oh well

I need to find all lines that begin with the string 'WAZ' after reading from
a url (http://www.atmos.washington.edu/data/zone_report.KSEW.html). While
I've tried every combination of expressions under the sun (using the
functions preg_match(), ereg()), I can not figure out a correct regexp for
this task.

I trim each line before submitting to preg_match() or ereg(). I also strip
out the tags except for  and .

Would some kind sould show me the correct regexp?

By the way, one of the simplest expressions, to follow the suggestion in the
PHP Manual, is just  '/WAZ/' or '/^WAZ/'. The former doesn't match "WAZ"
anywhere in the string, and the latter doesn't find a match when "WAZ" is at
the beginning of the string.

Cheers,

Michael

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



[PHP] [Q] PHP 101 -- How to check for session existence?

2004-07-14 Thread Michael T. Peterson
To protect certain web pages on my site, I am using the following code
inserted at the very beginning (top) of the page:




... Dreamweaver template code  here...


Is this a recommended way of doing this?

Next, to initialize the session, a login page posts the username - password
information to a PHP script, check_login.php. The login info is checked
against a database and, if all is kosher, a new session is created and the
user is dispatched to the site's home page. Here's the relevant code:



Does this make sense? Am I missing something? Any review, advice, etc.,
would be much appreciated.

Cheers,

Michael

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



[PHP] [Q] Using $_SERVER['DOCUMENT_ROOT'] correctly

2004-07-12 Thread Michael T. Peterson
I'm attempting to define a set of environment variables that will allow me
to edit and test my web pages on my local machine and then upload to my ISP
for verification and publication without having to change any symbols. What
variable should I use for the document root?

Here's how some of the symbols were defined:

$WWWROOT = $_SERVER['DOCUMENT_ROOT'];

// Set up the dev directory's environment variables.
$PROJECT_DIR   = $WWWROOT.'/my_web_site';
$MEMBERS_DIR   = $PROJECT_DIR.'/members';
... etc,

On my machine (a winxp system), the symbols and path get set properly and
everything works great.  However, when I upload the pages to my ISP's
machine (a unix system), I get a 404 page not found error when trying to
dispatch to /home/mtpweb/public_html/my_web_site/members/member_login.htm
(the file exists

On my local machine $_SERVER['DOCUMENT_ROOT'] is c:/program files/apache
group/apache/htdocs

On my ISP's machine the path is /home/mtpweb/public_html.

Should I be using something other that $_SERVER['DOCUMENT_ROOT']?

Cheers,

Michael

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



[PHP] Re: [Q] Why does my php file gets displayed instead of executed

2004-07-11 Thread Michael T. Peterson
Per request, here are the two other source files that get executed prior to
the invocation of validate_member_login.php, index.php and init.php.

But first, here's a simple restatement of the problem:

(1) Direct the browser to open index.php
(2) init.php is included by index.php.
(3) index.php dispatches user to member_login.htm. User fills in username
and password fields and then presses the submit button.
(4)  is invoked.
(5) The source code of validate_member_login.php is displayed in the browser
rather then being executed.

However, when the invocation sequence is:

(1) Direct the browser directly to member_login.htm and fill in the username
and password fields.
(2) Press submit.
(3) validate_member_login.php is executed properly.

Here's index.php.  Its purpose is to check the session variables to
determine whether the user is logged in. If not, the user is dispatched to
member_login.php via redirct using header().

Now, here are the two php files of interest, index.php and init.php. First,
index.php,



Here is init.php, the file that index.php includes (see above). This file
just sets up the exectution environment.





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



[PHP] Re: [Q] Why does my php file gets displayed instead of executed

2004-07-11 Thread Michael T. Peterson
Here is some additional info:

My other PHP scripts execute just fine, including the php script init.php
which uses header(...) to dispatch to the member_login.htm page. Recall that
the problem arises when validate_member_login.php is invoked from
member_login.htm. When validate_member_login.php is invoked directly, it
executes properly.

I'm running the most recent production release of the Apache server on
winxp. My ISP is running the same version. I've configured PHP identically
with my ISP's Apache config. I use Dreamweaver MX for development and
testing. I've not tested for this problem on my ISP's system, yet

Once again, note that the php script, validate_member_login.php is executed
properly in one case, yet is displayed in the browser in the other. Here is
the code for validate_member_login.php:



'init.php' executes session_start(), sets a bunch of constants (e.g.,
MEMBER_HOME_PAGE, etc.), sets an error handler, and includes a bunch of
libraries. All standard stuff.

Again, any help would be appreciated.

Cheers,

Michael

"Michael T. Peterson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> When a user first comes to my site, the user's session id is checked and
> validated. If no session id is present or the validation fails, the user
is
> vectored to a second page containing a login form.  When the user enters
the
> username and password and then clicks the submit button the info is
> forwarded to a third page, a php script, validate_member_login.php, that
> checks the username and password against a database.  Just for
completeness,
> note that the php script, validate_member_login.php, is invoked via login
> form's action parameter, i.e.,
>
> 
>
> The problem is that the php script, validate_member_login.php, is
displayed
> in the browser rather than being executed.
>
> This is my first attempt at designing a dynamic web site so I'm sure I've
> missed something really basic, but I have hardly any hair left to pull
out.
>
> Thanks, in advance,
>
> Michael
>
> -- 
> 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] [Q] Why does my php file gets displayed instead of executed

2004-07-11 Thread Michael T. Peterson
When a user first comes to my site, the user's session id is checked and
validated. If no session id is present or the validation fails, the user is
vectored to a second page containing a login form.  When the user enters the
username and password and then clicks the submit button the info is
forwarded to a third page, a php script, validate_member_login.php, that
checks the username and password against a database.  Just for completeness,
note that the php script, validate_member_login.php, is invoked via login
form's action parameter, i.e.,



The problem is that the php script, validate_member_login.php, is displayed
in the browser rather than being executed.

This is my first attempt at designing a dynamic web site so I'm sure I've
missed something really basic, but I have hardly any hair left to pull out.

Thanks, in advance,

Michael

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



[PHP] [Q] PHP code embedded in html files - What happens?

2004-03-14 Thread Michael T. Peterson
When the following file, tmp.htm, is executed no output is produced.



Test



hello world';
?>



However, when the name of the file is changed to tmp.php the expected
output, 'hello world', is obtained.  Is this the correct behavior?  More
specifically, is the php script not executed?

Cheers,

Michael

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



[PHP] [Q] Session management when WEB site is based on template

2004-03-13 Thread Michael T. Peterson
I'm having difficulty figuring out where/how to integrate PHP session
management into a web site whose pages are based on a template.  Pointers to
docs and/or examples would be very helpful.

Cheers,

Michael

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



[PHP] [Q] About "Method Not Allowed" error message

2004-02-20 Thread Michael T. Peterson
When I click the submit button (after completing a [member registration]
form), I get the following error message:

Method Not Allowed
The requested method POST is not allowed for the URL
/northwest_steelheader/members/register_new_member.html.

This used to work but, during the course of my coding, I've changed
something that now causes this error.

What does this error mean and can someone tell me what sorts of bobos elicit
it?

Cheers,

Michael

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



[PHP] Re: [Q] Howto go directly to a URL?

2004-02-18 Thread Michael T. Peterson
Thanks, everyone.  Just the answer(s) I was looking for.

Michael

"Michael T. Peterson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have written a very straightforward user login script.  Once the user
> successfully logs in, I would like my PHP script to take him directly to
the
> home page.  I know this sounds simple, but the only solution I've found is
a
> function called do_html_url() from Welling and Thompson's book (see
>
http://www.cs.indiana.edu/classes/a348/fall2001/labs/php9/do_html_url.html).
> When this function is invoked the user is dispatched to an intermediate
web
> page on which is presented a link that, when clicked, will take the user
to
> the intended page.
>
> Can I avoid that intermediate step, somehow?  When my script logs in the
> user, how to I write the code that dispatches directly to the home page?
>
> Thanks,
>
> Cheers,
>
> Michael
>
> -- 
> 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] Re: [Q] Howto go directly to a URL?

2004-02-13 Thread Michael T. Peterson
Thanks for the quick response, everyone, but I was hoping for something
other than redirect()/header().  As I understand them, these services
require the complete URL and I'm simply dispatching to another page within
my web site (in fact, within the same directory)  i.e., I'm looking to use a
path-relative URL.

Cheers,

Michael

member_login_page -> member_home_page

rather than
member_login_page -> intermediate_page -> member_home_page.

"Michael T. Peterson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have written a very straightforward user login script.  Once the user
> successfully logs in, I would like my PHP script to take him directly to
the
> home page.  I know this sounds simple, but the only solution I've found is
a
> function called do_html_url() from Welling and Thompson's book (see
>
http://www.cs.indiana.edu/classes/a348/fall2001/labs/php9/do_html_url.html).
> When this function is invoked the user is dispatched to an intermediate
web
> page on which is presented a link that, when clicked, will take the user
to
> the intended page.
>
> Can I avoid that intermediate step, somehow?  When my script logs in the
> user, how to I write the code that dispatches directly to the home page?
>
> Thanks,
>
> Cheers,
>
> Michael
>
> -- 
> 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] [Q] Howto go directly to a URL?

2004-02-13 Thread Michael T. Peterson
I have written a very straightforward user login script.  Once the user
successfully logs in, I would like my PHP script to take him directly to the
home page.  I know this sounds simple, but the only solution I've found is a
function called do_html_url() from Welling and Thompson's book (see
http://www.cs.indiana.edu/classes/a348/fall2001/labs/php9/do_html_url.html).
When this function is invoked the user is dispatched to an intermediate web
page on which is presented a link that, when clicked, will take the user to
the intended page.

Can I avoid that intermediate step, somehow?  When my script logs in the
user, how to I write the code that dispatches directly to the home page?

Thanks,

Cheers,

Michael

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



[PHP] [Q] Problems invoking a PHP script - Have no hair left to pull - Please help [:-)

2004-02-10 Thread Michael T. Peterson
I have a registration form which collects some data then, when the user
clicks the submit button sends the data to a second page (a PHP script).
The problem I'm having is getting my webserver (apache) to invoke the PHP
scrip to process the data. What's so baffling about this is that I've
already written another, similar facility ( a login form which sends user
supplied info to php script for authentication).  The login app works great.
The registration app doesn't even tho' the registration app is semantically
and syntactally identical to the login app.

I think what's happening is I'm missing something really simple.  Does
anyone have any suggestions as to what I need to be looking for?  I've been
at this for about 5 hours now and am going crazy looking at this [very
simple] code.

Finally, in my php.ini file "display_errors" is set to ON (But no errors are
displayed or written to error log).

Here's the form code fragment in the file member_registration_form.html:
...

...

And here's the preamble and the PHP block in the file,
register_new_member.php:



New member registration





Registration Results






Again, no are any errors displayed or logged.  Any help would be greatly
appreciated.

Cheers,

Michael

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



[PHP] [Q] Compatibility issues using Apache and/or IIS

2003-12-24 Thread Michael T. Peterson
First I'm very new to all this, so forgive the naivity of these questions:
Anyway, I am building a WEB Site dev environment that supports PHP-MySQL
development.  I have both IIS and Apache WEB servers available for local
testing which begs the following question:

What are the factors that would influence my choosing IIS over Apache or
vice-versa?  If I develop and test against a local Apache server, will I run
into problems when uploading to a site that uses IIS?  What about using a
local IIS server  and uploading to an Apache site?

Thanks in advance.

Michael

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



[PHP] [Q] Best Practices Question - Directory Structures for WEB site dev using PHP

2003-12-23 Thread Michael T. Peterson
Hi,

I'm new to PHP and WEB site development, but have coded in C/C++, Java, and
multiple shells for over 20 years.  So far I've found this stuff really neat
(and challenging). Anyway, I have a few questions dealing with file
locations, [de facto] directory structures, etc., when designing a WEB Site
whose content will be managed, for the most part, using PHP.  BTW, I've read
Welling and Thompson, a lot of the docs on www.zend.com, and various other
useful PHP web sites.  I've also written some simple functions, played with
templates (inc smarty), etc.  About the only info I've been unable to find
are suggestions as to how to layout the *.php files in a WEB Site.

I develop with Dreamweaver MX on Windows XP Pro using IIS.  When complete, I
upload to my WEB host.  On Linux, I use a text editor (Visual Slick Edit)
and Apache.  Both systems have the latest stable MySQL and PHP releases.
Sources are managed with CVS.

1) How do experienced developers layout their [dev] directory hierarchy?
For example, is there an accepted place to put one's function libraries?  On
IIS (Windows XP), the default directory structure is

c:\inetpub\
AdminScripts
iissamples
mailroot
Scripts
wwwroot\
myproject1
myproject2
...
myprojectN

where the myproject* directories are my current WEB Site designs.

2) When using CVS, I should think that the PHP files would be checked-out
into a directory that IS NOT in a [local] WEB Site directory (i.e., to avoid
littering the structure with CVS directories).  When the files are ready to
be uploaded to WEB site they would then be exported into the WEB Site
directory for uploading.  Is this how you guys do things?

If one can point me to docs/books/webs that cover these (and other similar
questions) I would be very grateful.  Also, if you just want to tell me how
you do it, I would appreciate that very much.

Thanks, in advance.

Michael

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