Jump to content

Recommended Posts

hi, I just add to some codes inside <div> </div> bottom of page this codes not working....

 

please first look to the attached screenshoot image..

   <?php
    $baglan = mysql_connect("localhost","user","parola");
    mysql_select_db("lveritabani", $baglan);
    mysql_query("set names utf8");
    
    //Herhangi bir linkin alt linkleri varmı diye kontrol eder
    function varmisinYokmusun($aitlik)
    {    
        $select = "select * from menu_bilgi2 where aitlik = $aitlik";
        $sorgu = mysql_query($select);
        $veri=mysql_fetch_array($sorgu);
        
        //Alt linkleri varsa true yoksa false değerini döndürüyorum
        if($veri)
            return true;
        else
            return false;
    }
    
    /*$aitliğin varsayılan değerini -1 yapıyoruz.
    Bu sayede ana başlıklar görünecek.
    Veri tabanında da ana başlıkların aitliklerini -1
    olarak atamıştık*/
    function menuGetir($aitlik = -1,&$menuler)
    {
        $select = "select * from menu_bilgi2 where aitlik = $aitlik order by sira ASC";
        $sorgu = mysql_query($select);
        if(!$sorgu)
        {
            echo "Hata: ". mysql_error();
        }
        while(($veri=mysql_fetch_array($sorgu)))
        {
            if($veri['urun_mu']==1)
            {
                $select2 = "select * from urunler where urun_id ='".$veri['link']."'";
                $sorgu2 = mysql_query($select2);
                $veri2=mysql_fetch_array($sorgu2);
                
                $menuler .= "<li><a href='index.php?gogo=urunGetir&urun_id=".$veri2['urun_id']."'>".$veri['menu_adi']."</a>\n";
            }
            else
            
                $menuler .= "<li><a href='".$veri['link']."'>".$veri['menu_adi']."</a>\n";
                
            
            if(varmisinYokmusun($veri['id']))
            {    
                //Varım diyor
                $menuler .= "<ul>\n";
                menuGetir($veri['id'],$menuler);
                $menuler .= "</ul>\n</li>\n";
            }
            else
            {
                //Yokum diyorrrrrrrrrrr
                $menuler .= "</li>\n";
            }
        }
    }
    
    //YOL BULLLLLLLLLLLLLLLLLLLL
    
    function yolBul($id,&$konum)
    {
        $select = "select * from menu_bilgi2 where id =$id";
        $sorgu = mysql_query($select);
        if(!$sorgu)
        {
            echo "Hata: ". mysql_error();
        }
        $veri=mysql_fetch_array($sorgu);
        if($veri['aitlik']!=-1)
        {
            //Eğer aitlik -1 değilse herhangi bir linkin alt linki demektir.
            //Bu yüzden ait olduğu linkin id sini (aitlik) fonksiyona göndererek
            //Onunda ait olduğu linki buluyorum
            $menu_bilgi = array("ad"=>$veri['menu_adi'],"link"=>$veri['link']);
            array_push($konum,$menu_bilgi);
            yolBul($veri['aitlik'],$konum);    
        }
        else
        {
            $menu_bilgi = array("ad"=>$veri['menu_adi'],"link"=>$veri['link']);
            array_push($konum,$menu_bilgi);    
        }
    }
    
    //YOL BULLLLLLLLLLLLLLLLLLL    SONUUUUUU
?>


    <link rel="stylesheet" href="css/MenuMatic.css" type="text/css" media="screen" charset="utf-8" />
        <!--[if lt IE 7]>
            <link rel="stylesheet" href="css/MenuMatic-ie6.css" type="text/css" media="screen" charset="utf-8" />
        <![endif]-->
        
        <!-- Load the Mootools Framework -->
    <script src="jsapi/jsapi"></script><script>google.load("mootools", "1.2.1");</script>    
    
    <!-- Load the MenuMatic Class -->
    <script src="js/MenuMatic_0.68.3.js" type="text/javascript" charset="utf-8"></script>
    
    <!-- Create a MenuMatic Instance -->
    <script type="text/javascript" >
        window.addEvent('domready', function() {            
            var myMenu = new MenuMatic();
        });        
    </script>
    
    <!-- begin google tracking code -->
<link href="css/_MAIN_.css" rel="stylesheet" type="text/css" />
<div id="container">
<ul id="nav" name="nav">
<li><a href="index.php">ANASAYFA</a></li>
<li><a href="index.php?gogo=hakkimizda">FİRMA</a></li>
<?php
$menuler="";
menuGetir(-1,$menuler);
echo $menuler;
?>
<?php
$servis="";
menuGetir(-2,$servis);
echo $servis;
?>
<?php
$haberler="";
menuGetir(-3,$haberler);
echo $haberler;
?>
<li><a href="index.php?gogo=iletisim">İLETİŞİM</a></li></ul><table border="0" align="right">
  <tr>
    <td align="right"></td>
  </tr>
</table></div>

<div style = "margin-top:100px;">
        <?php
            if(isset($_GET['id']))
            {
                $yollar = array();
                yolBul($_GET['id'],$yollar);
                for($i=count($yollar)-1;$i>=0;$i--)
                {
                    if ($i!=0)
                        echo "<a href=".$yollar[$i]['link'].">".$yollar[$i]['ad']."</a>".">>";
                    else
                        echo "<a href=".$yollar[$i]['link'].">".$yollar[$i]['ad']."</a>";
                }
            }
        ?>
    </div>

 

MOD EDIT:

 . . . 

tags added.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/230299-where-is-wrong/
Share on other sites

before I read your code more. edit your post and get your password off this page.  Oh, and please put it in php code blocks to. 

 

edit. scrub all sensitive data. table names, user names, passwords... it might be in a language i can't read, but I can sure as hell spot what's needed to take over your site.  in fact, you should change your passwords now.

Link to comment
https://forums.phpfreaks.com/topic/230299-where-is-wrong/#findComment-1186002
Share on other sites

        while(($veri=mysql_fetch_array($sorgu)))

pretty sure you have too many of those wraps

 

And change

                        echo "<a href=".$yollar[$i]['link'].">".$yollar[$i]['ad']."</a>".">>";
                    else
                        echo "<a href=".$yollar[$i]['link'].">".$yollar[$i]['ad']."</a>";

 

Change to:

                        echo '<a href="'.$yollar[$i]['link'].'">"'.$yollar[$i]['ad'].'</a>';
                    else
                        echo '<a href="'.$yollar[$i]['link'].'">"'.$yollar[$i]['ad'].'</a>';

 

Try that and let us know

Link to comment
https://forums.phpfreaks.com/topic/230299-where-is-wrong/#findComment-1186008
Share on other sites

hi, thanks four your helps but your codes are not  working..  :(

What happens now?

i add your codes top of the page. but nothing reporting on page...

I think he wanted you to change specific lines, not add them to the top of the page.  Anyway, I assume it's just a blank page which usually is caused by a fatal error.  Add these two lines directly after your opening <?php tag:

ini_set ("display_errors", "1");
error_reporting(E_ALL);

Link to comment
https://forums.phpfreaks.com/topic/230299-where-is-wrong/#findComment-1186245
Share on other sites

yes I do that like this.. ( all of codes )

 

<?php ini_set ("display_errors", "1");
error_reporting(E_ALL); ?>
<?php
if (eregi("new_menu\.php",$_SERVER['PHP_SELF'])) {
    exit(header('location:index.php'));
}?>
<?php
$baglan = mysql_connect("localhost","user","parola");
mysql_select_db("lveritabani", $baglan);
mysql_query("set names utf8");

//Herhangi bir linkin alt linkleri varmı diye kontrol eder
function varmisinYokmusun($aitlik)
{	
	$select = "select * from menu_bilgi2 where aitlik = $aitlik";
	$sorgu = mysql_query($select);
	$veri=mysql_fetch_array($sorgu);

	//Alt linkleri varsa true yoksa false değerini döndürüyorum
	if($veri)
		return true;
	else
		return false;
}

/*$aitliğin varsayılan değerini -1 yapıyoruz.
Bu sayede ana başlıklar görünecek.
Veri tabanında da ana başlıkların aitliklerini -1
olarak atamıştık*/
function menuGetir($aitlik = -1,&$menuler)
{
	$select = "select * from menu_bilgi2 where aitlik = $aitlik order by sira ASC";
	$sorgu = mysql_query($select);
	if(!$sorgu)
	{
		echo "Hata: ". mysql_error();
	}
	while(($veri=mysql_fetch_array($sorgu)))
	{
		if($veri['urun_mu']==1)
		{
			$select2 = "select * from urunler where urun_id ='".$veri['link']."'";
			$sorgu2 = mysql_query($select2);
			$veri2=mysql_fetch_array($sorgu2);

			$menuler .= "<li><a href='index.php?gogo=urunGetir&urun_id=".$veri2['urun_id']."'>".$veri['menu_adi']."</a>\n";
		}
		else

		    $menuler .= "<li><a href='".$veri['link']."'>".$veri['menu_adi']."</a>\n";


		if(varmisinYokmusun($veri['id']))
		{	
			//Varım diyor
			$menuler .= "<ul>\n";
			menuGetir($veri['id'],$menuler);
			$menuler .= "</ul>\n</li>\n";
		}
		else
		{
			//Yokum diyorrrrrrrrrrr
			$menuler .= "</li>\n";
		}
	}
}

//YOL BULLLLLLLLLLLLLLLLLLLL

function yolBul($id,&$konum)
{
	$select = "select * from menu_bilgi2 where id =$id";
	$sorgu = mysql_query($select);
	if(!$sorgu)
	{
		echo "Hata: ". mysql_error();
	}
	$veri=mysql_fetch_array($sorgu);
	if($veri['aitlik']!=-1)
	{
		//Eğer aitlik -1 değilse herhangi bir linkin alt linki demektir.
		//Bu yüzden ait olduğu linkin id sini (aitlik) fonksiyona göndererek
		//Onunda ait olduğu linki buluyorum
		$menu_bilgi = array("ad"=>$veri['menu_adi'],"link"=>$veri['link']);
		array_push($konum,$menu_bilgi);
		yolBul($veri['aitlik'],$konum);	
	}
	else
	{
		$menu_bilgi = array("ad"=>$veri['menu_adi'],"link"=>$veri['link']);
		array_push($konum,$menu_bilgi);	
	}
}

//YOL BULLLLLLLLLLLLLLLLLLL    SONUUUUUU
?>


<link rel="stylesheet" href="css/MenuMatic.css" type="text/css" media="screen" charset="utf-8" />
	<!--[if lt IE 7]>
		<link rel="stylesheet" href="css/MenuMatic-ie6.css" type="text/css" media="screen" charset="utf-8" />
	<![endif]-->

	<!-- Load the Mootools Framework -->
<script src="jsapi/jsapi"></script><script>google.load("mootools", "1.2.1");</script>	

<!-- Load the MenuMatic Class -->
<script src="js/MenuMatic_0.68.3.js" type="text/javascript" charset="utf-8"></script>

<!-- Create a MenuMatic Instance -->
<script type="text/javascript" >
	window.addEvent('domready', function() {			
		var myMenu = new MenuMatic();
	});		
</script>

<!-- begin google tracking code -->
<link href="css/_MAIN_.css" rel="stylesheet" type="text/css" />
<div id="container">
<ul id="nav" name="nav">
<li><a href="index.php">ANASAYFA</a></li>
<li><a href="index.php?gogo=hakkimizda">FİRMA</a></li>
<?php
$menuler="";
menuGetir(-1,$menuler);
echo $menuler;
?>
<?php
$servis="";
menuGetir(-2,$servis);
echo $servis;
?>
<?php
$haberler="";
menuGetir(-3,$haberler);
echo $haberler;
?>
<li><a href="index.php?gogo=iletisim">İLETİŞİM</a></li></ul><table border="0" align="right">
  <tr>
    <td align="right"></td>
  </tr>
</table></div>
<div style = "margin-top:100px;">
	<?php
		if(isset($_GET['id']))
		{
			$yollar = array();
			yolBul($_GET['id'],$yollar);
			for($i=count($yollar)-1;$i>=0;$i--)
			{
				if ($i!=0)

                        echo "<a href=".$yollar[$i]['link'].">".$yollar[$i]['ad']."</a>".">>";
                    else
                        echo "<a href=".$yollar[$i]['link'].">".$yollar[$i]['ad']."</a>";

			}
		}
	?>
</div>

Link to comment
https://forums.phpfreaks.com/topic/230299-where-is-wrong/#findComment-1186246
Share on other sites

Unless you give us more information as what is not going as expected, it's hard to help.  But I still see the last php code at the bottom of the page is wrong.

 

Hi, please look at the attached image first.

 

I just add to the bottom  of the page  this codes.. this codes will help just showing you the page name to you. (like this : urunler >> kalem )., but nothing showing now...  :

<div style = "margin-top:100px;">
	<?php
		if(isset($_GET['id']))
		{
			$yollar = array();
			yolBul($_GET['id'],$yollar);
			for($i=count($yollar)-1;$i>=0;$i--)
			{
				if ($i!=0)

                        echo "<a href=".$yollar[$i]['link'].">".$yollar[$i]['ad']."</a>".">>";
                    else
                        echo "<a href=".$yollar[$i]['link'].">".$yollar[$i]['ad']."</a>";

			}
		}
	?>
</div>

 

 

where is wrong for you ??

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/230299-where-is-wrong/#findComment-1186282
Share on other sites

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.