|
Posted by Jeff on June 13, 2008, 1:09 pm
Please log in for more thread options Michael Fesser wrote:
> .oO(Jeff)
Thanks again for your kind assistance. I feel like I'm getting somewhere.
>
>> As I'm learning PHP, I'm making a fair number of mistakes in syntax.
>>
>> In perl, you can turn on reading these errors from the browser by
>> adding this:
>>
>> use CGI::Carp 'fatalsToBrowser';
>>
>> Is there something like this in PHP?
>
> In PHP error messages are printed to the browser by default (or to the
> console if you use the CLI version). With the error_reporting directive
> you can control which types of errors should be shown. On a development
> machine this directive should be set to E_ALL|E_STRICT in the php.ini.
> Also make sure that display_errors is turned on.
OK, I'll find a check the PHP.ini file as I'm finding that the scripts
silently fail.
>
>> Or do I need to find the php.ini file and look to see where the error
>> log is?
>
> By default there is no error log, but you can enable it.
>
>> I spent some time trying to figure out why my class constructor
>> crashed until I found that I was writing php5 on a php4 setup. What is
>> most of the established base, is it 4 or 5?
>
> PHP 4 is dead, the last support for it will finally end in a few weeks.
> After that there will be no more security fixes released. So there's
> absolutely no point in writing PHP 4 scripts anymore. Use a recent 5.2
> instead.
OK. The box I'm working on was initialized in this year. I expected 5
something. This must just be a preference with my web host (RackSpace).
>
>> I see in the php docs that
>> some examples use 5.3, considering that the latest stable release is 5.2
>> I can see how there might be a lot of hair lost!
>
> 5.3 will introduce two major features that were "backported" from PHP 6,
> but it's not released yet. It's not unusual that the manual already
> contains short notes or even full documentation about coming features,
> because many people already use 5.3 or even 6 for testing.
Thanks. I like the direction PHP seems to be going, but there are so
many "functions"! I'm a bit overwhelmed!
>
>> Any recommendations on creating form elements? I've always used
>> CGI.pm which handles all the gotchas. Is there anything that comes with
>> the standard php install? All I really need is radio, select, checkbox
>> and text... I'm used to writing what I need, but I'm also used to not
>> reinventing a wheel that was written by someone far smarter!
>
> There are various classes and libraries out there for creating and
> maintaining forms with PHP. I can't recommend one, since I use my own
> code. You could try a Google search.
I'm striking out, but am thinking to roll my own also.
>
>> Is there a standard include_path being used? Are there any standard
>> extensions for included libararies, generally I'd like them to be seen
>> *only* by the parent script.
>
> Not sure what you mean.
If I name the included file 'my_functions.php' and put it in the web
path, wouldn't some of this be visible from the web. I just want nothing
to happen if someone hits http://my_domain.com/my_includes.php. Perhaps
I'm worrying about nothing...
How does PHP handle placeholders in MySQL?
I'm used to doing this:
$sql='SELECT some_field FROM some_table WHERE another_field = ? AND
other_field = ?';
When you do this (at least in perl), you don't have to worry about
SQL insertion.
I can't seem to find this, and had stumbled across an example
earlier. Perhaps I should break this question out in a new post...
Jeff
>
> Micha
|