3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP session_start(); include("../inc/csql.php"); include_once("../js/classes/tc_calendar.php"); $sql=mysql_query("select*from pegawai where idpegawai='".$_SESSION['userid']."'"); $bt="Ubah"; while($rc=mysql_fetch_array($sql)){ $hidpegawai=$idpegawai=$rc['idpegawai']; $nip=$rc['nip']; $nm=$rc['nm']; $tplhr=$rc['tplhr']; $tglhr=$rc['tglhr']; $agama=$rc['agama']; $jk=$rc['jk']; $goldar=$rc['goldar']; $alamat=$rc['alamat']; $pendidikanterakhir=$rc['pendidikanterakhir']; $pendidikanterakhirdi=$rc['pendidikanterakhirdi']; $jurusan=$rc['jurusan']; $statuspegawai=$rc['statuspegawai']; $tgmasukdisini=$rc['tgmasukdisini']; $sebagai=$rc['sebagai']; $sqlJ=mysql_query("select*from jabatanpegawai where idpegawai='".$_SESSION['userid']."'"); $dt=mysql_fetch_array($sqlJ); $idjabatan=$dt['idjabatan']; } $bt="Simpan"; if(@$_REQUEST['submit']=="Simpan"){ $upd=mysql_query("update pegawai set idpegawai='".ins(@$_REQUEST['idpegawai'])."', nip='".ins(@$_REQUEST['nip'])."',nm='".ins(@$_REQUEST['nm'])."', tplhr='".ins(@$_REQUEST['tplhr'])."',tglhr='".ins(@$_REQUEST['tglhr'])."', agama='".ins(@$_REQUEST['agama'])."',jk='".ins(@$_REQUEST['jk'])."', goldar='".ins(@$_REQUEST['goldar'])."',alamat='".ins(@$_REQUEST['alamat'])."', pendidikanterakhir='".ins(@$_REQUEST['pendidikanterakhir'])."', pendidikanterakhirdi='".ins(@$_REQUEST['pendidikanterakhirdi'])."', jurusan='".ins(@$_REQUEST['jurusan'])."',statuspegawai='".ins(@$_REQUEST['statuspegawai'])."', tgmasukdisini='".ins(@$_REQUEST['tgmasukdisini'])."', sebagai='".ins(@$_REQUEST['sebagai'])."' where idpegawai='".@$_REQUEST['idpegawai']."'"); if($upd){ if(!empty($_FILES['file']['name'])){ if(file_exists("ph/".@$_REQUEST['idpegawai'])){ unlink("ph/".@$_REQUEST['idpegawai']); } $fileName = $_FILES['file']['name']; $tmpName = $_FILES['file']['tmp_name']; $fileType = $_FILES['file']['type']; if (($fileName=="") || ($fileType == "text/plain") || ($fileType=="application/octet-stream")){ } if (($fileType=="image/jpeg")||($fileType=="image/bmp")|| ($fileType=="image/png")||($fileType=="image/gif")) { $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); move_uploaded_file($tmpName,"../adm/ph/".@$_REQUEST['idpegawai'].""); fclose($fp); } } //============= echo("<script>window.alert('Pengubahan selesai !'); window.location='epegawai.php';</script>"); } else { echo("<script>window.alert('Pengubahan Gagal!'); window.history.back();</script>"); } }//End Upd ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <head> <title>.: Pegawai</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="../css/images/favicon.ico" /> <link rel="stylesheet" href="../css/style.css" type="text/css" media="all" /> <!--[if IE 6]> <link rel="stylesheet" href="css/ie6.css" type="text/css" media="media" /> <script src="js/png-fix.js" type="text/javascript" charset="utf-8"></script> <![endif]--> <script src="../js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script> <script src="../js/jquery.jcarousel.min.js" type="text/javascript" charset="utf-8"></script> <script src="../js/jquery-func.js" type="text/javascript" charset="utf-8"></script> <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../js/functions.js"></script> <script language="javascript" src="../js/calendar.js"></script> <script> $(document).ready(function(e) { $("#tambah").click(function(){ $("#finput").toggle("slow"); }); }); </script> <script> function cekdulu(){ if(document.getElementById("idpegawai").value.search(/\w/i)==-1){ alert("ID pegawai harap diisi"); return false; } if(document.getElementById("nip").value.search(/\w/i)==-1){ alert("Nama pegawai harap diisi"); return false; } pilihjenis = document.getElementById("jenispegawai").selectedIndex; if(pilihjenis==0){ alert("Jenis pegawai harap dipilih"); return false; } } </script> </head> <body> <!-- Wrapper --> <div id="wrapper"> <!-- Header --> <div id="top" style="position:fixed; z-index:1000; width:100%; margin:0 auto;"> <!-- Shell --> <div class="shell"> <div class="top-nav"> <?PHP include("../inc/menuatas.php"); ?> </div> <div id="search"> <form action="" method="post"> <input type="text" class="field" value="Quick search..." title="Quick search..." /> </form> </div> <div class="cl">&nbsp;</div> </div> <!-- End Shell --> </div> <!-- End Top --> <!-- Main --> <div id="main"> <!-- Shell --> <div class="shell"> <!-- Header --> <div id="header"> <h1 id="logo"></h1> <?PHP //include("../inc/nav.php");?> <div class="cl">&nbsp;</div> </div> <!-- End Header --> <!-- Slider --> <?PHP //ISI ?> <!--ISI --> <h3 ">Profil Pegawai </h3> <br /> <form name="form" action="epegawai.php" method="post" enctype="multipart/form-data" id="finput" onSubmit="return cekdulu()"> <table width="563" border="0" cellpadding="1" cellspacing="2"> <tr > <td width="240">ID Pegawai</td> <td width="4">:</td> <td width="305"><input name="idpegawai" type="text" id="idpegawai" value="<?php echo @$idpegawai;?>" size="20" readonly="readonly" /></td> <td width="305" rowspan="6"><img src="../adm/ph/<?php echo @$idpegawai;?>" alt="" width="105" height="137" style="padding:5px;"/></td> </tr> <tr > <td>NIP</td> <td>:</td> <td><input name="nip" type="text" id="nip" value="<?php echo @$nip;?>" size="20" /></td> </tr> <tr > <td>Nama Lengkap</td> <td>:</td> <td><input name="nm" type="text" id="nm" value="<?php echo @$nm;?>" size="50" /></td> </tr> <tr > <td>Tempat Lahir</td> <td>:</td> <td><input name="tplhr" type="text" id="tplhr" value="<?php echo @$tplhr;?>" size="50" /></td> </tr> <tr > <td>Tanggal Lahir</td> <td>:</td> <td><?php $year = substr(@$tglhr,0,4); $month = substr(@$tglhr,5,2); $day = substr(@$tglhr,8,2); $myCalendar = new tc_calendar("tglhr", true, false); $myCalendar->setIcon("../images/iconCalendar.gif"); if($year!='0000'){ $myCalendar->setDate($day, $month, $year); } $myCalendar->setPath("../js/"); $myCalendar->setYearInterval(1920, 2020); //$myCalendar->dateAllow('2008-05-13', '2012-03-01'); $myCalendar->setDateFormat('j F Y'); //$myCalendar->setHeight(350); //$myCalendar->autoSubmit(true, "form1"); $myCalendar->writeScript(); ?></td> </tr> <tr > <td>Agama</td> <td>:</td> <td><select name="agama" id="agama"> <option value="">-Pilih Salah Satu-</option> <?PHP $getagama=getAgama(); for($i=0;$i<count($getagama);$i++) { ?> <option value="<?PHP echo $getagama[$i]; ?>" <?PHP if($getagama[$i]==@$agama){ echo" selected='selected'";}?> > <?PHP echo $getagama[$i]." </option>";} ?></option> </select></td> </tr> <tr > <td>Jenis Kelamin</td> <td>:</td> <td><select name="jk" id="jk"> <option value="">-Pilih Salah Satu-</option> <?PHP $getjk=getJK(); for($i=0;$i<count($getjk);$i++) { ?> <option value="<?PHP echo $getjk[$i]; ?>" <?PHP if($getjk[$i]==@$jk){ echo" selected='selected'";}?> > <?PHP echo $getjk[$i]." </option>";} ?></option> </select></td> <td>&nbsp;</td> </tr> <tr > <td>Golongan Darah</td> <td>:</td> <td><select name="goldar" id="goldar"> <option value="">-Pilih Salah Satu-</option> <?PHP $getgoldar=getGolDar(); for($i=0;$i<count($getgoldar);$i++) { ?> <option value="<?PHP echo $getgoldar[$i]; ?>" <?PHP if($getgoldar[$i]==@$goldar){ echo" selected='selected'";}?> > <?PHP echo $getgoldar[$i]." </option>";} ?></option> </select></td> <td>&nbsp;</td> </tr> <tr valign="top" > <td>Alamat</td> <td>:</td> <td> <textarea name="alamat" id="alamat" cols="50" rows="4"><?php echo @$alamat;?></textarea></td> <td>&nbsp;</td> </tr> <tr > <td>Pendidikan Terakhir</td> <td>:</td> <td><select name="pendidikanterakhir" id="pendidikanterakhir"> <option value="">-Pilih Salah Satu-</option> <?PHP $getpendidikanterakhir=getPendidikanTerakhir(); for($i=0;$i<count($getpendidikanterakhir);$i++) { ?> <option value="<?PHP echo $getpendidikanterakhir[$i]; ?>" <?PHP if($getpendidikanterakhir[$i]==@$pendidikanterakhir){ echo" selected='selected'";}?> > <?PHP echo $getpendidikanterakhir[$i]." </option>";} ?></option> </select></td> <td>&nbsp;</td> </tr> <tr > <td>Nama Sekolah/Universitas</td> <td>:</td> <td><input name="pendidikanterakhirdi" type="text" id="pendidikanterakhirdi" value="<?php echo @$pendidikanterakhirdi;?>" size="50" /></td> <td>&nbsp;</td> </tr> <tr > <td>Jurusan</td> <td>:</td> <td><input name="jurusan" type="text" id="jurusan" value="<?php echo @$jurusan;?>" size="50" /></td> <td>&nbsp;</td> </tr> <tr > <td>Status Pegawai</td> <td>:</td> <td><select name="statuspegawai" id="statuspegawai"> <option value="">-Pilih Salah Satu-</option> <?PHP $getstatuspegawai=getStatusPegawai(); for($i=0;$i<count($getstatuspegawai);$i++) { ?> <option value="<?PHP echo $getstatuspegawai[$i]; ?>" <?PHP if($getstatuspegawai[$i]==@$statuspegawai){ echo" selected='selected'";}?> > <?PHP echo $getstatuspegawai[$i]." </option>";} ?></option> </select></td> <td>&nbsp;</td> </tr> <tr > <td>Tanggal Masuk di sini</td> <td>:</td> <td><?php $year = substr(@$tgmasukdisini,0,4); $month = substr(@$tgmasukdisini,5,2); $day = substr(@$tgmasukdisini,8,2); $myCalendar = new tc_calendar("tgmasukdisini", true, false); $myCalendar->setIcon("../images/iconCalendar.gif"); if($year!='0000'){ $myCalendar->setDate($day, $month, $year); } $myCalendar->setPath("../js/"); $myCalendar->setYearInterval(1950, 2020); //$myCalendar->dateAllow('2008-05-13', '2012-03-01'); $myCalendar->setDateFormat('j F Y'); //$myCalendar->setHeight(350); //$myCalendar->autoSubmit(true, "form1"); $myCalendar->writeScript(); ?></td> <td>&nbsp;</td> </tr> <tr > <td>Sebagai</td> <td>:</td> <td><select name="sebagai" id="sebagai"> <option value="">-Pilih Salah Satu-</option> <?PHP $getsebagai=getSebagai(); for($i=0;$i<count($getsebagai);$i++) { ?> <option value="<?PHP echo $getsebagai[$i]; ?>" <?PHP if($getsebagai[$i]==@$sebagai){ echo" selected='selected'";}?> > <?PHP echo $getsebagai[$i]." </option>";} ?></option> </select></td> <td>&nbsp;</td> </tr> <tr> <td>Foto</td> <td>&nbsp;</td> <td><input name="file" type="file" id="file" size="31" /></td> <td>&nbsp;</td> </tr> <tr> <td colspan="4"><div align="center"><strong> <input type="submit" name="submit" id="submit" value="<?php echo $bt;?>" onclick="return isnull();"/> <input type="reset" name="batal" id="batal" value="Batal" /> </strong></div></td> </tr> </table> <p>&nbsp;</p> </form> <!-- END ISI --> <!-- Case --> <div class="case"><!-- Row --> <div class="row"> <?PHP //include("../inc/foto.php");?> <!-- End Row --> </div> <!-- End Case --> <!-- Case --> <?PHP //include("../inc/best.php"); ?> <!-- End Case --> </div> <!-- End Content --> </div> <!-- End Shell --> </div> <!-- End Main <div id="footer-push" class="cl">&nbsp;</div> --> </div> <!-- End Wrapper --> <!-- Footer --> <?PHP //include("../inc/footer.php"); ?> <!-- End Footer --> </body> </html>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: include(): open_basedir restriction in effect. File(../inc/csql.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/pt7KC on line 3 Warning: include(../inc/csql.php): Failed to open stream: Operation not permitted in /in/pt7KC on line 3 Warning: include(): Failed opening '../inc/csql.php' for inclusion (include_path='.:') in /in/pt7KC on line 3 Warning: include_once(): open_basedir restriction in effect. File(../js/classes/tc_calendar.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/pt7KC on line 4 Warning: include_once(../js/classes/tc_calendar.php): Failed to open stream: Operation not permitted in /in/pt7KC on line 4 Warning: include_once(): Failed opening '../js/classes/tc_calendar.php' for inclusion (include_path='.:') in /in/pt7KC on line 4 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/pt7KC:6 Stack trace: #0 {main} thrown in /in/pt7KC on line 6
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
60.26 ms | 402 KiB | 8 Q