好的。我是PHP中的類新手,並嘗試將變量傳遞到類中的受保護函數中。我該怎麼做呢?嘗試從類外調用受保護的功能
CLASSES.PHP
的index.php
<?php
include($_SERVER['DOCUMENT_ROOT']."/includes/con.php");
if(isset($_POST['developerbtn'])){
$fname = $_REQUEST['fname'];
$lname = $_REQUEST['lname'];
$email = $_REQUEST['email'];
$password = $_REQUEST['password'];
$Cgindex = new gindex();
$Cgindex->rdev($fname,$lname,$email,$password);
}
?>
沒有關係,但它忽略的PHP標籤?>關閉(如果PHP沒有嵌入在HTML或VIC-好習慣相反) –
請參閱http://stackoverflow.com/questions/4361553/php-public-private-protected – Stecman