Jump to content

Undefined Index on shopping cart


khubba

Recommended Posts

<?phpsession_start();ob_start();include("ayarlar.php"); if ($Ayar["Sepet"]=="Uyeler") {if($SESSION['kullanici']!=true){header ("Location:../uyari.html");die("");}}function perma($deger) {$turkce=array("ş","Ş","ı","(",")","'","ü","Ü","ö","Ö","ç","Ç"," ","/","*","?","ş","Ş","ı","ğ","Ğ","İ","ö","Ö","Ç","ç","ü","Ü");$duzgun=array("s","S","i","","","","u","U","o","O","c","C","-","-","-","","s","S","i","g","G","I","o","O","C","c","u","U");$deger=strtolower(str_replace($turkce,$duzgun,$deger));$deger = preg_replace("@[^A-Za-z0-9\]+@i","",$deger);return $deger;}  ?><!DOCTYPE html PUBLIC "//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en"><head><!-- header information --><title>SEPET VE SİPARİŞ | <?=$SiteBaslik;?></title>    <base href="<?=$SiteAdi;?>"/><meta http-equiv="content-type" content="text/html; charset=utf-8" /><meta name="robots" content="index, follow" /><meta name="keywords" content="<?=$SiteMeta;?>" /><meta name="description" content="<?=$SiteDesc;?>" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />    <link rel="canonical" href="<?=$SiteAdi;?>/" />     <meta name="copyright" content= "<?=$FirmaAdi;?>"/>    <link rel="stylesheet" type="text/css" href="css/<?=$Tema;?>.css" media="all" />    <link rel="stylesheet" type="text/css" href="css/main/<?=$Tip;?>/typography.css" media="all" /> <link rel="stylesheet" type="text/css" href="css/main/<?=$Tip;?>/style.css" media="all" /> <link rel="stylesheet" type="text/css" href="css/main/<?=$Tip;?>/menu.css" media="all" />  <link rel="stylesheet" type="text/css" href="css/skins/<?=$Tema;?>.css" media="all" /> <link rel="stylesheet" type="text/css" href="css/general.css" media="all" /> <link rel="stylesheet" type="text/css" href="css/ltr.css" media="all" />  <!ie css overides> <!--[if IE 6]><link rel="stylesheet" href="css/template.ie6.css" type="text/css" media="screen" /><![endif]--> <!--[if IE 7]><link rel="stylesheet" href="css/template.ie7.css" type="text/css" media="screen" /><![endif]--> <!end of css>  <!js>  <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script><script type="text/javascript">if(typeof jQuery == 'undefined') {document.write(unescape('%3Cscript type="text/javascript" src="js/jquery-1.5.2.min.js" %3E%3C/script%3E'));}</script>        <script type="text/javascript" src="js/ajax.js"></script> <script type="text/javascript" src="js/function.js"></script> <script type="text/javascript" src="js/custom.js"></script>      <script type="text/javascript" src="js/fly-to-basket.js"></script> <!google map ->       <?=$FirmaGoogleAnalytics;?></head> <!- begin body --><body><div id="page-background-simple-gradient">        <div id="page-background-gradient"></div>    </div>    <div id="page-background-glare">        <div id="page-background-glare-image"></div>    </div> <!-- logo and contact number --><div class="top-logo"><!-- logo --><div class="logo-img"><a href="index.html"><img src="<?=$SiteAdi;?><?=$SiteLogo;?>" alt="<?=$SiteBaslik;?>"/></a></div> <? include "$path/include/block-arama.php";?></div> <div class="main"><div class="sheet"><div class="sheet-tl"></div><div class="sheet-tr"></div><div class="sheet-bl"></div><div class="sheet-br"></div><div class="sheet-tc"></div><div class="sheet-bc"></div><div class="sheet-cl"></div><div class="sheet-cr"></div><div class="sheet-cc"></div><div class="sheet-body"> <? include "$path/include/menu.php";?> <div class="showcase"><div class="showcase-jpeg"><div class="showcase-overlay-top"><div class="showcase-overlay-bottom"></div></div></div><div class="showcase-msg"><img src="demo/cart.png" style="float: left; margin: 5px 15px" alt="blog" /><p><span class="showcase-title">Alışveriş Sepeti ve Sipariş<br/></span></p> </div></div> <div id="breadcrumbs"><a title="Home" href="index.html" id="breadcrumbs-home"></a><span class="breadcrumbs home"><a class="pathway" href="index.html">Ana Sayfa</a> <span class="no-link">Alışveriş Sepeti ve Sipariş</span></span></div>  <!-- main content --><div class="content-layout"><div class="content-layout-row"><div class="layout-cell content-sidebar1"><div class="post"><div class="componentheading"><strong>Ödeme</strong> Yöntemleri</div><div class="post-body">                <table width="200" border="0">        <caption>Lütfen ödeme yapmak için aşağıdaki seçeneklerden birini seçiniz.</caption>  <tr>    <td><a class="tour_now csbutton" href="odeme/havale/" >   <span class="tour_now_title">Havale ile Ödeme</span><span class="tour_now_mini">Banka Havalesi ile Ödeme</span></a></td>    <td><a class="join_now csbutton" href="odeme/kapida-kredi-karti/"><span class="join_now_title">Kapıda Kredi Kartı</span><span class="join_now_mini">Kapıda Kredi Kartı</span></a></td>  </tr>  <tr>    <td> <a class="join_now csbutton" href="odeme/kapida-nakit/">      <span class="join_now_title">Kapıda Nakit Ödeme</span>      <span class="join_now_mini">Kapıda Nakit Ödeme</span>    </a></td>    <td> </td>    </tr></table>             <br /><br /><br /></div></div></div> <!-- Right Sidebar --><div class="layout-cell right4" ><div style="padding: 10px 0"></div> <div class="block"><div class="block-tl"></div><div class="block-tr"></div><div class="block-bl"></div><div class="block-br"></div><div class="block-tc"></div><div class="block-bc"></div><div class="block-cl"></div><div class="block-cr"></div><div class="block-cc"></div><div class="block-body"> <div class="blockheaders"><div class="t"><strong>Alışveriş</strong> Sepetiniz</div></div><br /> <div class="blockcontent"><div class="blockcontent-body"><!-- block-content --> <div id="shopping_cart">            <table id="shopping_cart_items" style="border-spacing:0;padding:0;width:100%" >                <tr>                    <th align="left">Adet</th>                    <th align="left">Ürün</th>                    <th align="left">Fiyat</th>                    <th align="left">KDV</th>                    <th align="left">Sil</th>                </tr>                <?php                    if(is_array($_SESSION['firmasistemisepet'])){        $fastx=1;        foreach($_SESSION['firmasistemisepet'] as $icerikp){            $icx=explode('|||',$icerikp);            echo '<tr id="shopping_cart_items_product'.$icx[0].'">                <td>'.$icx[4].'</td>                <td>'.$icx[1].'</td>                <td>'.$icx[2].' </td><td>'.$icx[3].' </td>                <td><a href="javascript:void(0);" onclick="removeProductFromBasket('.$icx[0].');"><img src="remove.gif" alt="" border="0" /></a></td>';        }        $fastx=1;    }?> </table>            <br /><br /> <div id="shopping_cart_totalprice"></div><div id="shopping_cart_totalpricek"></div><div id="shopping_cart_totalpricet"></div>            </div>                  <?php            if($fastx==1){            echo '<script type="text/javascript">updateTotalPrice();</script>';echo '<script type="text/javascript">updateTotalPricek();</script>';echo '<script type="text/javascript">updateTotalPricet();</script>';}?>                                     <br /><br /><!-- /block-content --> <div class="cleared"></div></div></div> <div class="cleared"></div></div></div>  </div>  </div></div><div class="cleared"></div>    <? include "$path/include/footer.php";?> </div><div class="cleared"></div></div> </div><div class="cleared"></div> </div></body> </html><?phpob_end_flush();?>

post-168551-0-30346400-1397808488_thumb.png

Link to comment
Share on other sites

Hard to tell because do not see your form.

 

It would help if showed the actual error, turn on error reporting if do not see it.

 

My best guess is that the form is sending a blank value or was never set and you try to use it.

 

Add this before trying to use the post values as a starter, you should also be filter/sanitizing/escape these values associated to the type of data you expect.

 

 

//check for if it's set and not blank
if(isset($Ayar["Sepet"]) && trim($Ayar["Sepet"]) != '') {
//your code in this area now
echo trim($Ayar["Sepet"]);
} else {
echo "can show a message or die("the message"); here";
}

 

I also noticed some of your code uses the short <?  tags, use the full <?php tags

Link to comment
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.