Jump to content

Recommended Posts

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

 

ok now the question is i have changed my website side menu last night and have installed some good menu here is the code of new menu

 

<?
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>";
?>

 

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 want 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 have also used this code

 

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

// do things for logged in people

} ?>

 

but no luck yet can anyone explain me with example which code can i use here to hide my menu and here is the menu code which i wanted to hide

 

<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 hope now you guys understand and can help me out of this

 

Regards

 

 

Link to comment
https://forums.phpfreaks.com/topic/207469-help-needed-in-php-code/
Share on other sites

thank you for your reply sir but can you please tell me with full code of my menu how exactly like this

<? if($logged == "yes"){
// do things for logged in people
<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>
} ?>

 

<?php if($logged == "yes"){ // number 3, notice how i closed the php tag, to the right-> ?>

<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>
<?php  // <- here also }?>

 

There were a couple problems-

1. You forgot to close <ul>

2. Dont use php short tags, they are the bad.

3. When echo'ing outside of php tags, you have to close them

Dear Sir sorry but i am big noob in php coding i used the same code you have given me

 

<?php if($logged == "yes"){ // number 3, notice how i closed the php tag, to the right-> ?>

<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>
<?php } // here also -> ?>

 

it was hided but after login in it was not visible to others and to me also for that what to do..........? Pilot center wont showing up after login?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.