Ben bu yüzden bu bir newb soru genel olarak PHP ve web scripting yeniyim.
Currently i'm a creating an instance to an object, yet when I call the constructor the script slienty shuts down... it doesn't call the next function and I don't know why. Any help would be welcome.
İşte kodudur.
<?php
class product {
var $ssProductName;
var $ssVendorName;
var $ssDescr;
var $ssURI;
// Clean constructor, strings must be cleaned before use
function __construct($ssProd, $ssVendor, $ssD, $ssU) {
$this->$ssProductName = $ssProd;
$this->$ssVendorName = $ssVendor;
$this->$ssDescr = $ssD;
$this->$ssURI = $ssU;
}
// print a table of the values
function DisplayOneEntry() {
echo '<table border="1">
<tr>
<td>'.$this->$ssProductName.'</td>
<td>'.$this->$ssVendorName.'</td>
<td>'.$this->$ssDescr.'</td>
<td>'.$this->$ssURI.'</td>
</tr>
</table>';
}
}
echo "<HTML>";
echo "A";
$newP = new product("Redhat", "Redhat corp", "Leader in", "www.redhat.com");
echo "B";
$newP->DisplayOneEntry();
echo "</HTML>";
?>
Ama çıkış adildir:
<HTML>
A
Sonra başka bir şey.
Bu php 5.2.9 ve Apache 2.2 kullanan bir hosting sağlayıcısı üzerinde çalışıyor.