heey,
Ik heb een script die een sitenaam en wachtwoord moet opslaan in de database.. nu slaat die de domein wel op maar het wachtwoord niet...
Dit is een script voor een gratis hosting site!
PHP
<?php
/************************************************************\
* Om deze pagina te zien moet je minimaal ingelogd zijn
\************************************************************/
if( min_toegang( 10 ) ) {
/************************************************************\
* Hosting aanmaken
\************************************************************/
require( 'inc/class/direct/class.httpsocket.php' );
if ( $_SERVER[ 'REQUEST_METHOD' ] == 'POST' ) {
if ( ! empty( $_POST[ 'password' ] ) && strlen( $_POST[ 'password' ] ) >= 5 ) {
$Socket = new HTTPSocket;
$Socket->connect( $core[ 'conf' ][ 'direct' ][ 'server' ], 2222 );
$Socket->set_login( $core[ 'conf' ][ 'direct' ][ 'user' ], $core[ 'conf' ][ 'direct' ][ 'pass' ] );
$Socket->set_method( 'POST' );
$Socket->query( '/CMD_API_ACCOUNT_USER',
array(
'action' => 'create',
'add' => 'Submit',
'username' => 'account' . $lid[ 'id' ],
'email' => $core[ 'lid' ][ 'email' ],
'passwd' => $_POST[ 'password' ],
'passwd2' => $_POST[ 'password' ],
'domain' => $_POST[ 'sitenaam' ] . '.hostvoorfree.nl',
'package' => $core[ 'conf' ][ 'direct' ][ 'package' ],
'ip' => $core[ 'conf' ][ 'direct' ][ 'ip' ],
'notify' => 'yes'
)
);
$Result = $Socket->fetch_body( );
if ( substr( $Result, 0, 7 ) == 'error=0' ) {
mysql_query( "UPDATE leden SET hostpass = '" . mysql_escape_string( $_POST[ 'password' ] ) . "' WHERE id = '" . $_POST[ 'sitenaam' ] . "'" ) or die( mysql_error( ) );
$core[ 'tpl' ]->assign( 'act_success', 1 );
} else {
$core[ 'tpl' ]->assign( 'act_failure', 1 );
}
} else {
$core[ 'tpl' ]->assign( 'act_failure', 1 );
}
} else {
$core[ 'tpl' ]->assign( 'act_form', 1 );
}
/************************************************************\
* Assign pagina
\************************************************************/
$core[ 'tpl' ]->assign( 'titel', 'Hosting aanmaken' );
$core[ 'tpl' ]->assign( 'pagina', 'pagina/hosting.tpl' );
} else {
/************************************************************\
* Assign pagina
\************************************************************/
$core[ 'tpl' ]->assign( 'titel', 'Geen toegang' );
$core[ 'tpl' ]->assign( 'pagina', 'pagina/geen_toegang.tpl' );
}
/************************************************************\
* Display layout
\************************************************************/
$core[ 'tpl' ]->display( 'layout.tpl' );
?>
Toon Meer
Zou iemand het werkend kunnen maken? en dan weer posten?
Alvast bedankt;)
Mvg, Mentimjojo