Undefined ltrim issue

Hello, sir

i got some problem ltrim issue when i install my script. i cannot proceed the installation because below issue

[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: username in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 8
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: password in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 9
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: nama in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 10
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: email in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 11
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: alamat in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 12
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: telpon in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 13
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: website in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 14
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: headline in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 15
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: harga_produk in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 16
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: persentase in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 17
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: yahoo_id in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 18
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: bank in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 19
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: rekening in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 20
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: id_responder in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 21
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: pass_responder in /home5/mylist/public_html/lifetime-reseller/install/simpan_data_admin.php on line 22
[04-Jul-2015 21:03:18 America/Denver] PHP Notice: Undefined variable: error in /home5/mylist/public_html/lifetime-reseller/system/sistem.php on line 77
[04-Jul-

BELOW THE RELATED SCRIPT

 <?


require( "../system/sistem.php" );
dbConnect();

		   		   
$username = ltrim($username);
$password = ltrim($password);
$nama = ltrim($nama);
$email = ltrim($email);
$alamat = ltrim($alamat);
$telpon = ltrim($telpon);
$website = ltrim($website);
$headline = ltrim($headline);
$harga_produk = ltrim($harga_produk);
$persentase = ltrim($persentase);
$yahoo_id = ltrim($yahoo_id);
$bank = ltrim($bank);
$rekening = ltrim($rekening);
$id_responder = ltrim($id_responder);
$pass_responder = ltrim($pass_responder);
$launch_date = date("d / m / Y - H : i : s ");

$tgl_d = date("d");
$bln_d = date("m");
$thn_d = date("Y");

$tgl_t = date("j");
$bln_t = date("n");
$thn_t = date("Y");

if( $username == "" ) install( "Ooops . . . Username anda harus diisi!!!" );
if( $password == "" ) install( "Ooops . . . Password anda harus diisi!!!" );
if( $nama == "" ) install( "Ooops . . . Nama anda harus diisi!!!" );
if( $email == "" ) install( "Ooops . . . Email anda harus diisi!!!" );
if( $alamat == "" ) install( "Ooops . . . Alamat anda harus diisi!!!" );
if( $telpon == "" ) install( "Ooops . . . Telpon anda harus diisi!!!" );
if( $website == "" ) install( "Ooops . . . Website anda harus diisi!!!" );
if( $headline == "" ) install( "Ooops . . . Headline Bisnis anda harus diisi!!!" );
if( $harga_produk == "" ) install( "Ooops . . . Harga Produk anda harus diisi!!!" );
if( $persentase == "" ) install( "Ooops . . . Persentase pembagian komisi  harus diisi!!!" );
if( $yahoo_id == "" ) install( "Ooops . . . Yahoo ID untuk Online Suport harus diisi!!!" );
if( $bank == "" ) install( "Ooops . . . Nama Bank anda harus diisi!!!" );
if( $rekening == "" ) install( "Ooops . . . No Rekening anda harus diisi!!!" );
if( $id_responder == "" ) install( "Ooops . . . ID Responder harus diisi!!!" );
if( $pass_responder == "" ) install( "Ooops . . . Password Responder harus diisi!!!" );

if ( !eregi( "^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $email ) ) install( "Oops .. data Email anda Invalid alias tidak sah !!!" );

// input data admin ke tabel admin di database


dbConnect();
session_register( "username_admin_ses" );
session_register( "nama_admin_ses" );
session_register( "email_admin_ses" );
session_register( "website_ses" );

$username_admin_ses=$username;
$nama_admin_ses=$nama;
$email_admin_ses=$email;
$website_ses=$website;


$sql="insert into admin(kode,user_admin,password_admin,nama_admin,email_admin,alamat_admin,telpon_admin,website,harga_produk,prosen_reseller,bank_admin,rekening_admin,nama_bisnis,yahoo_id,launch_date,last_login,system,auto_respon,auto_respon2,auto_respon3,warning_code,del_option,filter_email,del_option_sub, status_log, status_marquee, up_or_down, tgl_d, bln_d, thn_d, tgl_t, bln_t, thn_t, title, title2, title3, title4, description, keywords, publisher, copyright, robots1, robots2, language, revisit)
 values('$kode','$username','$password','$nama','$email','$alamat','$telpon','$website','$harga_produk','$persentase','$bank','$rekening','$headline','$yahoo_id','$launch_date','','RANDOM SELECT','Aktif','Aktif','Aktif','Java Script','OTOMATIS','Aktif','OTOMATIS','Aktif','Aktif','Up','$tgl_d','$bln_d','$thn_d','$tgl_t','$bln_t','$thn_t','$headline','.:: M E M B E R -- A R E A ::.','.:: A D M I N -- A R E A ::.','.:: AUTO RESPONDER AREA ::.','Segera di Update Sesuai Bisnis Anda','Segera di Update Sesuai Bisnis Anda','$website','Copyright © $headline - 2006 - All Rights Reserved','index','follow','English','30 days')";



$query=mysql_query ($sql);





$isi_1="insert into mail_aktif(id,status_1,status_2,status_3)
values('1','Aktif','Aktif','Aktif')";
$save_1=mysql_query ($isi_1);

$isi_2="insert into mail_blokir(id,status_1,status_2,status_3)
values('1','Aktif','Aktif','Aktif')";
$save_2=mysql_query ($isi_2);

$isi_3="insert into mail_konfirmasi(id,status_1,status_2,status_3)
values('1','Aktif','Aktif','Aktif')";
$save_3=mysql_query ($isi_3);

$isi_4="insert into mail_thanks_confirm(id,status_1,status_2,status_3)
values('1','Aktif','Aktif','Aktif')";
$save_4=mysql_query ($isi_4);

$isi_5="insert into mail_subscribe(id,status_1,status_2,status_3)
values('1','Aktif','Aktif','Aktif')";
$save_5=mysql_query ($isi_5);

$isi_6="insert into login_responder(username,password,level,nama)
values('$id_responder','$pass_responder','master','$nama')";
$save_6=mysql_query ($isi_6);

$isi_7="insert into mail_hapus(id,status_1,status_2,status_3)
values('1','Aktif','Aktif','Aktif')";
$save_7=mysql_query ($isi_7);


$getsys_1="insert into system_config(select_system)
values('SAS')";
$save_getsys_1=mysql_query ($getsys_1);

$getsys_2="insert into system_config(select_system)
values('Randomizer')";
$save_getsys_2=mysql_query ($getsys_2);

$getsys_3="insert into system_config(select_system)
values('Top Hits')";
$save_getsys_3=mysql_query ($getsys_3);

$getsys_4="insert into system_config(select_system)
values('Down Hits')";
$save_getsys_4=mysql_query ($getsys_4);

$getsys_5="insert into system_config(select_system)
values('Under 1 Priority')";
$save_getsys_5=mysql_query ($getsys_5);

$getsys_6="insert into system_config(select_system)
values('Under 10 Priority')";
$save_getsys_6=mysql_query ($getsys_6);

$getsys_7="insert into system_config(select_system)
values('Default Member')";
$save_getsys_7=mysql_query ($getsys_7);



 if ($query)
  { 

header("Location:input_data_member.php") ;
 }

 
 else 
 { echo " WARNING...!!! : Data Anda GAGAL disimpan, Silahkan CEK Kesalahannya...!! <br> "; 
 
 echo "<title>$nama, Data Anda GAGAL Tersimpan Di Database</title>";
 
 } 





?>

HOW TO FIX THE LTRIM ISSUE?

TQ.

Hi Riz_man, welcome to the forum.

IMHO don’t even bother wasting your time with it, It is using DEPRECATED mysql_ functions so it’s either outlived it’s usefulness or was written by someone that isn’t up-to-date with PHP.

Find an equivalent replacement.

1 Like

Many thanks Mittineague, 4 d reply and advice…

i’m very interesting with this script. Where to find the script look like this.

There is no way how to make this script more secure??

Well for starters, the problem isnt ltrim so much as it is the variables arnt defined. But without knowing what “this script” actually DOES, there’s no way for us to point you at something that does similar.

This script uses both deprecated mysql_ functions and eregi that’s been deprecated since PHP 5.3, so… this code is fairly old. It’s also… rather poorly coded for inserting multiple things into a database.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.