Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Function being displayed in wrong spot
Old 10-12-2010, 10:57 AM Function being displayed in wrong spot
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
PHP Code:
  <?php if(isset($_GET['link']) && isset($_GET['sub'])) {
            echo 
'</td><td class="heading" valign="top"><div id="page"> <div style="color:white; font-size:10px">'.getlink().' </div>
?>
When it is displayed on the webpage, it is displayed far above this. Move to under
PHP Code:
   <td class="dir" <?php if(isset($_GET['link'])) { echo 'width="20%"'; } echo 'style="'.$style.'"'?> >
 <?php if(isset($_GET['link'])) {
             echo 
'<div id="imgLink">';
        } else {
            echo 
'<div id="imgWrap">';
        }
 
?>
  <ul>
      <div id="page_effect" style="display:none;">
            <li><a href="?link=4"><img src="images/fbo.png" height="<?php echo $height?>" width="<?php echo $width?>" class="" /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">FBO's</div></li>
            <li><a href="?link=6"><img src="images/insurance.png" height="<?php echo $height?>" width="<?php echo $width?>"  class="" /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">Insurance</div></li>
            <li><a href="?link=5"><img src="images/finance.png" height="<?php echo $height?>" width="<?php echo $width?>" class=""  /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">Finance</div></li>
            <li><a href="?link=13"><img src="images/mro.png" height="<?php echo $height?>" width="<?php echo $width?>" class=""  /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">MRO's</div></li>
         </div>
       <div id="page_effect2" style="display:none;">
            <li><a href="?link=1"><img src="images/avionics.png" height="<?php echo $height?>" width="<?php echo $width?>"  class="" /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">Avionics</div></li>
            <li><a href="?link=2"><img src="images/brokers.png" height="<?php echo $height?>" width="<?php echo $width?>"  class="" /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">Brokers</div></li>
            <li><a href="?link=3"><img src="images/charter.png" height="<?php echo $height?>" width="<?php echo $width?>" class=""  /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">Charter</div></li>
            <li><a href="?link=8"><img src="images/manu.png" height="<?php echo $height?>" width="<?php echo $width?>"  class="" /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">Manufacturers</div></li>
       </div>
         <div id="page_effect3" style="display:none;">
            <li><a href="?link=9"><img src="images/msic.png" height="<?php echo $height?>" width="<?php echo $width?>" class=""  /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">Miscellaneous</div></li>
            <li><a href="?link=10"><img src="images/parts.png" height="<?php echo $height?>" width="<?php echo $width?>" class=""  /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">Parts</div></li>
            <li><a href="?link=11"><img src="images/merchandise.png" height="<?php echo $height?>" width="<?php echo $width?>" class=""  /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">Merchandise</div></li>
            <li><a href="?link=12"><img src="images/services.png" height="<?php echo $height?>" width="<?php echo $width?>" class=""  /></a><div class="<?php if(!isset($_GET['link'])) { echo 'sel'; } else { echo 'adjust'; } ?>">Services</div></li>
        </div>
        </ul>
  </div>
  <?php if(isset($_GET['link']) && isset($_GET['sub'])) {
            echo 
'</td><td class="heading" valign="top"><div id="page"> <div style="color:white; font-size:10px">'.getlink().' </div>
            <h3 style="color:#00AEEF;">FBO</h3>
            <h2>Premium Listings</h2>'
;
?>
It pushes the function WAY up tot he top of the script.

PHP Code:
function getlink() {
  include(
'includes/mssql.php');
    
$cat $_GET['link'];
    
$query 'MYQUERY';
    
$insert $conn->execute($query);

    
$num_columns $insert->Fields->Count();

    for (
$i=0$i $num_columns$i++) {
        
$fld[$i] = $insert->Fields($i);
    
    }
    while (!
$insert->EOF)  //carry on looping through while there are records
    
{
        for (
$i=0$i $num_columns$i++) {
            
$link "?link=" $_GET['link'] .  '">'.$fld[$i]->value.'</a>  ';
        }
        
$insert->MoveNext(); //move on to the next record
    
}
    
$cat $_GET['sub'];
    
$query 'MYQUERY';
    
$insert $conn->execute($query);
    
//Counts the Number of Columns of Query
    
$num_columns $insert->Fields->Count();
    
    
//Makes Array $fld for each colum
    
for ($i=0$i $num_columns$i++) {
        
$fld[$i] = $insert->Fields($i);
    
    }
    
    while (!
$insert->EOF)  //carry on looping through while there are records
    
{
        for (
$i=0$i $num_columns$i++) {
            echo 
'<a href="directory.php">Directory</a>  <a href="directory.php'.$link.$fld[$i]->value;
        }
        
$insert->MoveNext(); //move on to the next record
    
}

__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
 
Register now for full access!
Reply     « Reply to Function being displayed in wrong spot
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10180 seconds with 12 queries