# PHP CODE NEEDED

**URL:** <https://forum.phpvms.net/t/php-code-needed/3033>\
**Category:** General\
**Created:** [July 11, 2010, 12:45am UTC](https://forum.phpvms.net/t/php-code-needed/3033 "2010-07-11T00:45:16Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mynameiskhan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@mynameiskhan](https://forum.phpvms.net/u/mynameiskhan)\
**Post date:** [July 11, 2010, 12:45am UTC](https://forum.phpvms.net/t/php-code-needed/3033/1 "2010-07-11T00:45:16Z")

</div>

Dear all hi i need help please guide me through this.

ok now the question is i have changed my virtual airline side menu last night and have installed some good menu here is the code

```
<?
print "</tr>";
print "<tr>";
print "<td width='190' height='100%' bgcolor='#B7CEC7' valign='top' style='border-right: 1px solid #004800'><br>";

?>
<?php
if ($logged=="yes"){
   print "<a href='logoff.php'><b>Logoff</b></a>";
}
else{
   print "<a href='logon.php'><b>Logon</b></a>";

}
?>
<div class="urbangreymenu">

<h3 class="headerbar">VPIA </h3>
<ul>
<br>
<img src="http://www.aircanadavirtual.com/images/simmiles.png" />
<img src="http://www.vpia.org/images/vatsim.png" />
<br>
<br>
<li><a href="http://www.simmiles.com/asiava/PIA/pilots.php">Simmiles Online Pilots</a></li>
<li><a href="http://www.simmiles.com/asiava/PIA/routes.php">Simmiles Online Routes</a></li>
<li><a href="http://www.simmiles.com/asiava/PIA/fleet.php">Simmiles Online Fleet</a></li>
<li><a href='about.php'>About us</a></li>
<li><a href='faq.php'>FAQ</a></li>
<li><a href='staff.php'>Staff</a></li>
<li><a href='photogallery.php'>Photo Gallery</a></li>
<li><a href='contact.php'>Contact</a></li>
<li><a href='disclaimer.php'>Disclaimer</a></li>
</ul>
</div>

```

now the thing is previously it was coded with some other coding in php and every thing is working properly now when i changed the side menu i dont know how to use php code with this menu basically i wanted to hide my pilot center from visitors and pilot i want pilot can only see pilot center after login with pilot IDS so i can i do that please help me out of this

here is my old menu code

```
<?
print "</tr>";
print "<tr>";
print "<td width='190' height='100%' bgcolor='#B7CEC7' valign='top' style='border-right: 1px solid #004800'><br>";

print "<table width='100' valign='top' border='0' cellpadding='5' cellspacing='0'>";

print "<tr>";
print "<td>";

if ($logged=="yes"){
   print "<a href='logoff.php'><b>Logoff</b></a>";
}
else{
   print "<a href='logon.php'><b>Logon</b></a>";

}

print "</td>";
print "<td></tr>";
print "<table width='100%' valign='top' border='0' cellpadding='5' cellspacing='0'>";
print "<tr>";
print "<td width='7%' height='26' background='../images/menu_bg.gif'>";
print "<center><img src='../images/menu_arrow.gif'></center>";
print "</td>";

print "<td width='93%' height='26' background='../images/menu_bg.gif' class='menu'>";

print "VPIA <a href='main.php'><image src='/images/home.gif' border=0></a>";
print "</td>";
print "</tr>";

print "<tr>";
print "<td height='66' colspan='2'>";
print "<p>";

print "<a href='http://www.facebook.com/group.php?gid=4083514203'><image src='http://www.vpia.org/images/fcbk.jpg' border=0></a><br>";
print "<a href='skype:virtualpia?call'><img src='/images/skype1.jpg' style='border: none;' alt='Skype Me™!'/></a><br>";
print "<a href='http://www.twitter.com/VirtualPIA'><img src='http://twitter-badges.s3.amazonaws.com/follow_us-a.png' alt='Follow VirtualPIA on Twitter' width='150' height='25'</a><br>";
?>  
<br>

<img src="http://www.aircanadavirtual.com/images/simmiles.png" />
<img src="http://www.vpia.org/images/vatsim.png" />
<br><a href="http://www.simmiles.com/asiava/PIA/statistics.php"></a>
<br><a href="http://www.simmiles.com/asiava/PIA/pilots.php">Online Pilots</a>
<br><a href="http://www.simmiles.com/asiava/PIA/routes.php">Online Routes</a>
<br><a href="http://www.simmiles.com/asiava/PIA/fleet.php">Online Fleet</a>
<br>
<?
print "<a href='about.php'>About us</a> / <a href='faq.php'>FAQ</a><br>";
print "<a href='staff.php'>Staff</a><br>";
print "<a href='photogallery.php'>Photo Gallery</a><br>";
print "<a href='contact.php'>Contact</a><br>";

//print "<a href='http://vpia.free-forums.org' target='blanc'>Forum</a><br>";

print "<a href='disclaimer.php'>Disclaimer</a><br>";

//print "<a href='events.php'>Events</a><br>";
//print "<a href='news.php'>News</a><br>";
//print "<a href='links.php'>Links</a><br><br>";

if ($logged<>"yes"){
 print "<a href='registration.php'><b>JOIN VPIA</b></a><br>";
}
print "</td>";
print "</tr>";
print "</table>";
?>

```

hope someone can help me soon.

regards

---

<div class="post-metadata">

**Author:** ![JetAirUK](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/7c8e57/32.png) [@JetAirUK](https://forum.phpvms.net/u/JetAirUK)\
**Post date:** [July 11, 2010, 10:46am UTC](https://forum.phpvms.net/t/php-code-needed/3033/2 "2010-07-11T10:46:00Z")

</div>

You see above each little bit of the old code it has the if ($logged\<\>“yes”){

Try that?

---

<div class="post-metadata">

**Author:** ![Tom](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://forum.phpvms.net/u/Tom)\
**Post date:** [July 11, 2010, 10:57am UTC](https://forum.phpvms.net/t/php-code-needed/3033/3 "2010-07-11T10:57:18Z")

</div>

Looks like you’re using a custom system right? Yup,

```
<? if($logged<>"yes"){
// do things for logged in people
} ?>

```

Also, all those uses of print is messy.

Where you have multiple instances of print “”; to display html, you can just condense them all into a single print “”;, or just remove print altogether and put php tags around the php.

---

<div class="post-metadata">

**Author:** ![mynameiskhan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@mynameiskhan](https://forum.phpvms.net/u/mynameiskhan)\
**Post date:** [July 11, 2010, 4:25pm UTC](https://forum.phpvms.net/t/php-code-needed/3033/4 "2010-07-11T16:25:05Z")

</div>

Guys thank you so much for replying now the thing is Tom i am not using that Print Commands i have changed my menu that was old one what i am trying to ask you guys is this is my new menu

code

```
<div class="urbangreymenu">

<h3 class="headerbar">Pilot Center</h3>
<ul
<li><a href='ATR42.php'><b>ATR42 Schedules</a></li></b>

<li><a href='skedatr.php'><b>ATR42F Schedules</a></li></b>

<li><a href='b737.php'><b>B737 Schedules</a></li></b>

<li><a href='a310.php'><b>A310 Schedules</a></li></b>

<li><a href='b767.php'><b>A300 Schedules</a></li></b>

<li><a href='b777.php'><b>B777 Schedules</a></li></b>

<li><a href='b747.php'><b>B747 Schedules</a></li></b>

<li><a href='logbook.php'><b>My logbook</a></li></b>

<li><a href='download.php'><b>Download Section</a></li></b>

<li><a href='help.php'><b>Pilot's Manual</a></li></b>

<li><a href='rankings.php'><b>Rankings</a></li></b>

<li><a href='pilotroster.php'><b>Pilot hours</a></li></b>

<li><a href='flights.php?map=karachi' target='_blank'><b>Flight Movements</a></li></b>
</ul>
</div>

```

now juts tell me how i can hide only this pilot center menu and pilots can only see this menu after login example would be gr8 for me waiting for your reply asap.

Regards

---

<div class="post-metadata">

**Author:** ![Tom](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://forum.phpvms.net/u/Tom)\
**Post date:** [July 11, 2010, 4:27pm UTC](https://forum.phpvms.net/t/php-code-needed/3033/5 "2010-07-11T16:27:57Z")

</div>

Like this:

```
<? if($logged<>"yes"){
// do things for logged in people
} ?>

```

---

<div class="post-metadata">

**Author:** ![skymx](https://forum.phpvms.net/user_avatar/forum.phpvms.net/skymx/32/63_2.png) [@skymx](https://forum.phpvms.net/u/skymx)\
**Post date:** [July 11, 2010, 4:36pm UTC](https://forum.phpvms.net/t/php-code-needed/3033/6 "2010-07-11T16:36:10Z")

</div>

> Guys thank you so much for replying now the thing is Tom i am not using that Print Commands i have changed my menu that was old one what i am trying to ask you guys is this is my new menu
> 
> code
> 
> ### Pilot Center
> \<ul- **ATR42 Schedules**
> - **ATR42F Schedules**
> - **B737 Schedules**
> - **A310 Schedules**
> - **A300 Schedules**
> - **B777 Schedules**
> - **B747 Schedules**
> - **My logbook**
> - **Download Section**
> - **Pilot's Manual**
> - **Rankings**
> - **Pilot hours**
> - **Flight Movements**
> 
> now juts tell me how i can hide only this pilot center menu and pilots can only see this menu after login example would be gr8 for me waiting for your reply asap.
> 
> Regards

Is this what you need?:

\<?php

/\*

Quick example of how to see if they’re logged in or not

Only show this login form if they’re logged in \*/

if(Auth::LoggedIn() == false)

{ ?\>

SK

---

<div class="post-metadata">

**Author:** ![mynameiskhan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@mynameiskhan](https://forum.phpvms.net/u/mynameiskhan)\
**Post date:** [July 11, 2010, 5:34pm UTC](https://forum.phpvms.net/t/php-code-needed/3033/7 "2010-07-11T17:34:18Z")

</div>

well when iam putting this code \<?php

/\*

Quick example of how to see if they’re logged in or not

Only show this login form if they’re logged in \*/

if(Auth::LoggedIn() == false)

{ ?\>

it gives this error

and like this i am putting the code

```
<?php
/*
Quick example of how to see if they're logged in or not
Only show this login form if they're logged in */
if(Auth::LoggedIn() == false)

<div class="urbangreymenu">

<h3 class="headerbar">Pilot Center</h3>
<ul
<li><a href='ATR42.php'><b>ATR42 Schedules</a></li></b>

<li><a href='skedatr.php'><b>ATR42F Schedules</a></li></b>

<li><a href='b737.php'><b>B737 Schedules</a></li></b>

<li><a href='a310.php'><b>A310 Schedules</a></li></b>

<li><a href='b767.php'><b>A300 Schedules</a></li></b>

<li><a href='b777.php'><b>B777 Schedules</a></li></b>

<li><a href='b747.php'><b>B747 Schedules</a></li></b>

<li><a href='logbook.php'><b>My logbook</a></li></b>

<li><a href='download.php'><b>Download Section</a></li></b>

<li><a href='help.php'><b>Pilot's Manual</a></li></b>

<li><a href='rankings.php'><b>Rankings</a></li></b>

<li><a href='pilotroster.php'><b>Pilot hours</a></li></b>

<li><a href='flights.php?map=karachi' target='_blank'><b>Flight Movements</a></li></b>
</ul>
</div>
{ ?>

```

i really don’t know how to put with in TAGS can you explain me with full code please

and let me explain you how i am using my menu now in my server i have one folder name Menu and inside it i have many PHPS files for different Menu section to show up with main.php and in other pages if i wnt to show my menu with the page i am putting php code on the top of the page like this

```
<? include("menu/m_item_general.php") ?>

```

i hope now you guys understand the process…

Regards

---

<div class="post-metadata">

**Author:** ![Tom](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://forum.phpvms.net/u/Tom)\
**Post date:** [July 11, 2010, 5:58pm UTC](https://forum.phpvms.net/t/php-code-needed/3033/8 "2010-07-11T17:58:21Z")

</div>

You’re not using phpvms so that code won’t work. Use this:

```
<?
if($logged<>"yes"){ ?>

<div class="urbangreymenu">

<h3 class="headerbar">Pilot Center</h3>
<ul>
<li><a href='ATR42.php'><b>ATR42 Schedules</a></li></b>

<li><a href='skedatr.php'><b>ATR42F Schedules</a></li></b>

<li><a href='b737.php'><b>B737 Schedules</a></li></b>

<li><a href='a310.php'><b>A310 Schedules</a></li></b>

<li><a href='b767.php'><b>A300 Schedules</a></li></b>

<li><a href='b777.php'><b>B777 Schedules</a></li></b>

<li><a href='b747.php'><b>B747 Schedules</a></li></b>

<li><a href='logbook.php'><b>My logbook</a></li></b>

<li><a href='download.php'><b>Download Section</a></li></b>

<li><a href='help.php'><b>Pilot's Manual</a></li></b>

<li><a href='rankings.php'><b>Rankings</a></li></b>

<li><a href='pilotroster.php'><b>Pilot hours</a></li></b>

<li><a href='flights.php?map=karachi' target='_blank'><b>Flight Movements</a></li></b>
</ul>
</div>
} ?>

```

---

<div class="post-metadata">

**Author:** ![mynameiskhan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@mynameiskhan](https://forum.phpvms.net/u/mynameiskhan)\
**Post date:** [July 11, 2010, 6:04pm UTC](https://forum.phpvms.net/t/php-code-needed/3033/9 "2010-07-11T18:04:37Z")

</div>

Tom Sorry but this is also not working again Error

```
Parse error: syntax error, unexpected $end in /home/ahmad/public_html/scripts/menu/m_item_pilot.php on line 87

```

yes i am not using PHPVMS its a different site based on direct php coding.

sorry.

Regards

---

<div class="post-metadata">

**Author:** ![Tom](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://forum.phpvms.net/u/Tom)\
**Post date:** [July 11, 2010, 6:06pm UTC](https://forum.phpvms.net/t/php-code-needed/3033/10 "2010-07-11T18:06:45Z")

</div>

What’s on line 87?

---

<div class="post-metadata">

**Author:** ![mynameiskhan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@mynameiskhan](https://forum.phpvms.net/u/mynameiskhan)\
**Post date:** [July 11, 2010, 6:21pm UTC](https://forum.phpvms.net/t/php-code-needed/3033/11 "2010-07-11T18:21:03Z")

</div>

well TOM when i opened File in Code Editor it is showing on Line 87

```
} ?>

```

what to do now…?

---

<div class="post-metadata">

**Author:** ![mynameiskhan](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@mynameiskhan](https://forum.phpvms.net/u/mynameiskhan)\
**Post date:** [July 12, 2010, 4:21pm UTC](https://forum.phpvms.net/t/php-code-needed/3033/12 "2010-07-12T16:21:24Z")

</div>

Nobody knows About this CODE?

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [July 12, 2010, 9:08pm UTC](https://forum.phpvms.net/t/php-code-needed/3033/13 "2010-07-12T21:08:17Z")

</div>

> Nobody knows About this CODE?

The little bit I can see looks like it is missing the opening php tag before line 87, you close the previous one at the top of the page.

```
<?php
   }
?>

```
