php-windows Digest 1 Mar 2003 15:50:12 -0000 Issue 1612
Topics (messages 18788 through 18794):
Re: =at wit's end with GD Libraries=
18788 by: Uttam
18789 by: Anthony Ritter
18790 by: Uttam
18793 by: Anthony Ritter
Re: Send mail
18791 by: Chris Morris
.htaccess and crypt
18792 by: Chris Morris
Learning about OOP
18794 by: Marlene Burckhalter
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
*additional extensions are usually included in complete package i.e.
php-4.3.1-Win32.zip, though i have not personally verified this for this
version of php
*i have earlier downloaded php-4.1.1 and the gd library was included in the
zip package (not in .exe installer, which does not contains additional
extensions).
regds,
-----Original Message-----
From: Anthony Ritter [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 20:29
To: Uttam; [EMAIL PROTECTED]
Subject: Re: =at wit's end with GD Libraries=
Would that be:
php-4.3.1-Win32.zip
and
php-4.2.3-installer.exe
Please advise.
Thank you.
TR
---
[This E-mail scanned for viruses by gonefishingguideservice.com]
--- End Message ---
--- Begin Message ---
Say I wanted to use:
php_gd.dll
after uncommenting the line in the php.ini file - where exactly would that
file - php_gd.dll - reside?
Many thanks.
TR
---
[This E-mail scanned for viruses by gonefishingguideservice.com]
--- End Message ---
--- Begin Message ---
default is <php directory>/extensions
but location can be specified/ in php.ini.
In my system it is in c:\php directory and in php.ini file :
extension_dir=c:/php
/*** by the way, extension_dir=c:\php also works for me
regds,
-----Original Message-----
From: Anthony Ritter [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 10:37
To: Uttam; [EMAIL PROTECTED]
Subject: Re: =at wit's end with GD Libraries=
Say I wanted to use:
php_gd.dll
after uncommenting the line in the php.ini file - where exactly would that
file - php_gd.dll - reside?
Many thanks.
TR
---
[This E-mail scanned for viruses by gonefishingguideservice.com]
--- End Message ---
--- Begin Message ---
I did.
The php.ini file is below:
Everytime I take out the semi-colon in the php.ini file, the page won't
load, the server hangs up and I have to shut down the Apache monitor
manually.
When I insert the semicolon back in to the .ini file , the page then loads -
but that doesn't help if I want to use the GD Libraries since the semi-colon
has to be taken out.
Any ideas will be greatly appreciated.
TR
.......................
; Directory in which the loadable extensions (modules) reside.
extension_dir = C:\PHP\extensions
;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for
it.
;
[snipped]
extension=php_gd2.dll
---
[This E-mail scanned for viruses by gonefishingguideservice.com]
--- End Message ---
--- Begin Message ---
Have you set up your SMTP server in the PHP configuration?
"Orlando castaņeda" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I am trying to send an e-mail like this:
<?php
$to = "[EMAIL PROTECTED]";
$subject = "xsubject";
$message = "x data";
mail ($to, $subject, $message);
?>
There are no errors, but the e-mail is never sent !
I apreciate any help !
Tito
[EMAIL PROTECTED]
[EMAIL PROTECTED]
ICQ # 32019090
--- End Message ---
--- Begin Message ---
I have seen several PHP scripts that act as an interface to .htaccess files.
They are able to add, change, and delete users from a nice, web-based
interface. The only problem is that they don't work on Windows.
I read a post somewhere where someone said that this is because the scripts
use "crypt" to write the encrypted password to the .htpasswd file and
"crypt" is not the same on Windows and Linux/Unix. Something about Windows
and Linux not using the same encryption functions.
Anyway, has anyone gotten this to work on Windows? I am doing research as
to which technology would be best to implement an automated user creation
and removal system and PHP and Apache seems to be the best solution, IF I
can get this to work.
--- End Message ---
--- Begin Message ---
Hi
OOP is new to me, and the manual has not helped me on this one:
What am I doing wrong? I am getting an error message about calling an undefined
function. I defined the method (function) in the class definitions, but when I create
an instance, I get the error message mention above.
By the way, I tested the function by embedding it inside some html coding, and it
worked.
Evidently, I still don't understand the OOP process. Can someone point me in the
right direction? Below, please find my coding listed as CLASS DEFINITIONS(1 and 2),
INSTANCE, AND HTML : ( I did not include the .css file)
CLASS DEFINITIONS (1):
<?php
//This class reads in a template, sets the different values, and sends it to the
browser.
class HtmlTemplate {
//Set the attributes.
var $template;
var $html;
var $parameters = array();
function IdentifyTemplate ($template) {
//This function sets which template will be used.
$this->template = $template;
}
function SetParameter($variable,$value) {
//This function sets the particular values.
$this->parameters[$variable] = $value;
}
function CreatePage() {
//This function does the bulk of the work.
$this->html = implode ("",(file($this->template))); //Read the template into an
array, then
//create a string.
foreach ($this->parameters as $key => $value) {
//Loop through all the parameters and set the variables to values.
$template_name = '{' . $key . '}';
$this->html = str_replace($template_name, $value, $this->html);
}
echo $this->html;
}
}
?>
CLASS DEFINITION (2): //***THE PrintImage FUNCTION GIVES ME THE ERROR MESSAGE***
<?php
//This class is an extension of the HtmlTemplate class.
//It adds the print_image funcion which calls the make_image function.
//These two functions combined print an IMG tag for a given file.
class HtmlTemplateImages extends HtmlTemplate {
//No attributes are necessary because of existing ones in parent class.
function MakeImage($file, $alt=false, $align=false, $extras=false, $dir=false,
$border=0) {
global $size, $image;
global $HTTP_SERVER_VARS;
if (!$dir) {
$dir = 'images';
}
if ($size = @getimagesize($HTTP_SERVER_VARS['DOCUMENT_ROOT'].$dir.'/'.$file)) {
$image = sprintf('<img src="%s/%s" border="%d" %s ALT="%s" %s%s >',
$dir,
$file,
$border,
$size[3],
($alt ? $alt : ''),
($align ? ' align="'.$align.'"' :''),
($extras ? ' '.$extras :'')
);
} else {
$image = sprintf('<img src="%s/%s" border="%d" ALT="%s" %s%s >',
$dir,
$file,
$border,
($alt ? $alt : ''),
($align ? ' ALIGN="'.$align.'"' : ''),
($extras ? ' '.$extras : '')
);
}
return $image;
}
function PrintImage($file, $alt=false, $align=false, $extras=false, $dir=false,
$border=0) {
print MakeImage($file, $alt, $align, $extras, $dir);
}
}
?>
INSTANCE:
<?php
//This is a sample page that uses the HtmlTemplate class and the child class
HtmlTemplateImages.
require_once "HtmlTemplate.inc"; //Include the parent class.
require_once "HtmlTemplateImages.inc"; //Include the child class.
$page = new HtmlTemplate(); //Create an instance.
$page->IdentifyTemplate ("EjebTemplate.inc"); //Identify the template to use for this
//application.
$page->SetParameter ("CSS_LINK", "ejebstyle.css");
$page->SetParameter ("EJEB_LOGO", $page->PrintImage('topgrey.jpg', 'EJEB'));
$page->SetParameter ("EJEB_SOLUTIONS", "eJeb Solutions");
$page->CreatePage(); //Send the page to the browser.
?>
HTML:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel=stylesheet href="{CSS_LINK}" type="text/css">
</head>
<body>
<table width="720" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="50" colspan="3" valign="top">{EJEB_LOGO}</td>
<td colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
<td colspan="4" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td width="120" height="25" valign="top"><p>{EJEB_SOLUTIONS}</p></td>
<td colspan="3" valign="top"><!--DWLayoutEmptyCell--> </td>
<td colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
<td colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="180" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="25" colspan="3" valign="top"><!--DWLayoutEmptyCell--> </td>
<td colspan="4" valign="top"><!--DWLayoutEmptyCell--> </td>
<td colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td colspan="2" rowspan="4" valign="top"><!--DWLayoutEmptyCell--> </td>
<td colspan="5" rowspan="3" valign="top"><!--DWLayoutEmptyCell--> </td>
<td height="50" colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="50" colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="50" colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td colspan="5" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="60" height="450"></td>
<td></td>
</tr>
<tr>
<td height="0"></td>
<td width="80"></td>
<td width="40"></td>
<td width="60"></td>
<td width="60"></td>
<td width="60"></td>
<td width="60"></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
--- End Message ---