Re: Class/functions question

From: Date: Wed, 15 Feb 2006 09:48:10 +0000
Subject: Re: Class/functions question
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-230419@lists.php.net to get a copy of this message
Paul Goepfert wrote:
Does anyone know where I can find the error log? I am using php on a
http://www.google.com/search?q=where+is+apache+error+log
webserver and the only log I found was a connection log in the logs dir on my webserver.
something like: /var/log/apache/error_log /var/log/httpd/error.log assuming you use a linux server; on windows the apache error log lives in the apache 'Program Files' directory. (asuming you use apache as a webserver) - but basically it _could_ be anywhere on the filesystem. I think you should read the following section of the manual to get an understanding of whats available in terms of error handling, reporting (with a mind to fixing whatever problem you have at this moment): http://php.net/manual/en/ref.errorfunc.php
Paul On 2/14/06, Jochem Maas <jochem@iamjochem.com> wrote:
Paul Goepfert wrote:
I was able to get part of my page to load when I created the Validation class and put a call to the validation class within my table. When I did that the page loaded up until the php code to call
the method and then it does not load the rest of the page.    Can
anyone help me with this? By the way I am calling $_POST["name"] as
it sounds like your class does not exist (or some function or class it relies on).
the parameter to be passed into the function so my php code looks like: <?php $a = new Validation; $a->checkEmpty($_POST["name"]); ?>
1. check your error log for an error messge. 2. determine if the class exists at the time that the above code is run e.g. with class_exists('Validation'). 3. determine if $a is actually a Validation object (i.e. the creation of a new object succeeded)
Paul On 2/12/06, Chris Shiflett <shiflett@php.net> wrote:
Paul Goepfert wrote:
I know how to call functlions, I just just don't know how to do it in PHP.
Based on the rest of your question, I think you mean methods, not functlions. :-) If you're struggling with syntax, you should take one step at a time. Try this: <?php class myClass { function myMethod() {
       echo '<p>myMethod()</p>';
} } $myObject = new myClass; $myObject->myMethod(); ?> That should help you with any syntax problems, but I suspect your problem has more to do with logic than with syntax.
if (isset($submit)) { class Validation {
/* ... */
} } else {
/* ... */
$v = new Validation; $v->checkEmpty($_POST["name"]);
If the form is submitted, define the class, else use the class. That doesn't sound right... Hope that helps. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/


« previous php.general (#230419) next »