$tajuk = "Parameter Function"; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>PHP | <?php echo $tajuk; ?> </title> </head> <body> <?php function greeting($message) { echo $message; } greeting("Hello how are you?"); ?> <?php function calculate($number1, $number2) { $sum = $number1 * $number2; echo $sum; } calculate(122, 222); ?> </body> </html>
<pre> <?=var_dump($this->hud->history_get())?> </pre> </div> <div id="HUD_Loading"> <div id="progress"> Loading... <img src="<?=assets_url('images/global/progressbar.gif')?>"/> </div> </div> </div> </div> <div id="user"> <?php if ($this->acl->is_auth()) : ?> <ul> <li id="UserName"><?=greeting().', '.$this->profile->current()->name->friendly?></li> <li id="Logout"><a href="<?=site_url("login/destroy")?>"><span>Logout</span></a></li> </ul> <?php endif; ?> </div> <div id="bd" class="fancy_corners"> <div id="bd-inner"> <h2><?=ucwords(method_clean($this->router->fetch_class()))?></h2> <div id="crumbtrail"> <a href="<?=site_url()?>" title="Go to Dashboard" class="tip"> <span>Home</span></a> <a href="<?=controller_url()?>"><?=ucwords(method_clean($this->router->fetch_class()))?></a> <?php if($this->router->fetch_method() != 'index'): ?> <a href="<?=controller_url().'/'.$this->router->fetch_method()?>"><?=ucwords(method_clean($this->router->fetch_method()))?></a> <?php endif; if (isset($content['nav']['title'])) : ?> <a href="<?php if (isset($content['nav']['uri'])) echo site_url($content['nav']['uri']); else echo current_url()?>"><?=$content['nav']['title']?></a> <?php endif ?>
<?php $db = new MySQLDatabase(); $session = new Session(); $applicant_fullname = User::applicant_fullname($session->applicant_id); $result_details = User::find_by_id($session->applicant_id); $display_greeting = greeting(); /**/ $active_sql = "SELECT COUNT(*) FROM `applicant_notifications` WHERE status = 1 AND recipient_id = " . $session->applicant_id; $total_active = $db->query($active_sql); $total_active = $db->fetch_array($total_active); $total_active = array_shift($total_active); $inactive_sql = "SELECT COUNT(*) FROM `applicant_notifications` WHERE status = 2 AND recipient_id = " . $session->applicant_id; $total_inactive = $db->query($inactive_sql); $total_inactive = $db->fetch_array($total_inactive); $total_inactive = array_shift($total_inactive); $admissions = new Admission(); $sql = "select * from admission_status where applicant_id='" . $session->applicant_id . "'"; $admissions = Admission::find_by_sql($sql); foreach ($admissions as $admission) { $time = $admission->time_completed_application; $academic_session = $admission->academic_session; $status = $admission->status; $reason_ = $admission->reason; } ?> <div class="navbar"> <div class="navbar-inner"> <a class="brand" href="#"></a> <ul class="nav nav-tabs"> <li class="active"><a href="home.php"><span><i class="icon-home"></i> </span> Home</a></li>
print strtoupper($pharse); echo "</li></ol>"; //Functions echo "<h1>Functions</h1>"; echo "<p>"; function printPhrase($phrase) { echo "<p>{$phrase}</p>"; } printPhrase("Silly cat!"); echo "</p><p>"; function greeting($name) { print "Hello, {$name}!"; } greeting("Scott"); echo "</p><p>"; function average($num1, $num2) { $avg = ($num1 + $num2) / 2; return $avg; } $a = 5; $b = 3; print "The average of {$a} and {$b} is " . average($a, $b); echo "</p><p>"; function largest($num1, $num2) { if ($num1 > $num2) { return $num1; } else {
<p> ◆greeting.php 파일 생성 <br> function welcome(){ <br> return 'use include'; <br> } </p> <p> ◆greeting.php include <br> include 'greeting.php'; <br> echo welcome(); </p> </td> <td> <?php include 'greeting.php'; echo greeting(); ?> </td> </tr> </table> </article> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="/bootstrap/js/bootstrap.min.js"></script> </body> </html>
<script type="text/javascript" src="./inc/tools.js"></script> <script type="text/javascript" src="./inc/site.js"></script> </head> <body> <ul id="menu"> <li><a class="menu" href="#">resume</a></li> <li><a class="menu" href="#">about</a></li> <li><a href="http://twitter.com/justinhernandez">twitter</a></li> </ul> <a id="github" href="http://github.com/transphorm"> <img style="position: absolute; top: 0; right: 0; border: 0;" src="https://d3nwyuy0nl342s.cloudfront.net/img/4c7dc970b89fd04b81c8e221ba88ff99a06c6b61/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub"> </a> <div class="wrapper"> <div id="theplug"> <?php greeting(); ?> <!-- ABOUT --> <div id="about" class="info"> <h1>About</h1> <p> My name is <span class="me pink">Justin Hernandez</span>. I make the internet fun and exciting. I eat problems for breakfast. Sometimes they make me gassy. </p> <p> I excel at getting things done while keeping it simple. I like to make people laugh. </p>
$total_all = array_shift($total_all); ?> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></a> <div class="nav-collapse collapse"> <ul class="nav"> <li class="active"> <a href="#" class="brand">University of Jos</a> </li> <li> <a href="#" class=""><?php echo greeting() . ', ' . AdminLog::admin_fullname($session->applicant_id) . '.'; ?> </a> </li> </ul> <ul class="nav pull-right"> <li class="dropdown"> <a href="#" id="drop3" role="button" class="dropdown-toggle" data-toggle="dropdown"><span><i class="icon-envelope"></i> </span> Mails<b class="caret"></b></a> <ul class="dropdown-menu" role="menu" aria-labelledby="drop3"> <li> <a tabindex="-1" href="sendmail.php">Send Mail</a> </li> <li class="divider"></li> <li> <a tabindex="-1" target="_blank" href="http://mail.unijos.edu.ng">Go to Unijos Mail<span><i class="icon-chevron-right"></i> </span></a>
<?php require_once '../inc/initialize.php'; $database = new MySQLDatabase(); $session_sql = $database->query("SELECT session FROM application_status WHERE id=1"); $session_sql = $database->fetch_array($session_sql); $greeting = greeting(); $user = new User(); $user_details = $user->find_by_id($session->applicant_id); $progress = $user_details->progress; $student_status = $user_details->student_status; $surname = $user_details->surname; $firstname = $user_details->first_name; $message = 'You have not filled the following tab(s): <br>'; if ($student_status == 'PGA') { if ($progress == "Completed") { sleep(2); echo '<h4 class="alert alert-success"><i class="iconic-o-check" style="color: #51A351"></i> Success </h4>'; echo '<hr>'; echo $greeting . ', <span style=" font-weight: bold; text-shadow: 1px 1px 4px #51A351;"> ' . ucfirst($surname . ' ' . $firstname) . '</span>.<br>'; echo 'You have successfully completed your application form, Please use the button below to view your application details.'; echo '<br><br>'; echo '<a href="confirmation.php" class="btn btn-info">View Your Details</a>'; echo '<hr>'; } else { $tab_filled = str_split($progress); $compulsory_tabs = array('Personal Details' => 'A', 'Academic Qualification' => 'B', 'Referee' => 'F', 'Passport' => 'G'); $size = sizeof($compulsory_tabs); $empty_tab_flag = false; foreach ($compulsory_tabs as $key => $value) { if (!in_array($value, $tab_filled)) {