Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 49
  1. #31
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,389
    Thanks
    13
    Thanked 353 Times in 349 Posts
    as you can see in the code highlighting, you have two " too much in that line.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  2. #32
    New Coder
    Join Date
    Jun 2014
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    new page added

    my dear ,
    new files are added and when to try to reach home page nothing happens.
    myproject.6te.net
    files are here
    this is test.php that i just added and problem arises .
    i can provide you the sql information to access mysql database.
    PHP Code:
    <?php

    session_start
    ();

    DEFINE("FRAMEWORK_PATH"dirname__FILE__ ) ."/" );


    require(
    'registry/registry.class.php');
    $registry = new Registry();
    // setup our core registry objects
    $registry->createAndStoreObject'template''template' );
    $registry->createAndStoreObject'mysqldb''db' );
    $registry->createAndStoreObject'authenticate''authenticate' );
    $registry->createAndStoreObject'urlprocessor''url' );
    $registry->getObject('url')->getURLData();
    // database settings
    include(FRAMEWORK_PATH 'config2.php');
    // create a database connection
    $registry->getObject('db')->newConnection$configs['db_host_sn'], $configs['db_user_sn'], $configs['db_pass_sn'], $configs['db_name_sn']);

    $registry->getObject('authenticate')->checkForAuthentication();

    // store settings in our registry
    $settingsSQL "SELECT `key`, `value` FROM settings";
    $registry->getObject('db')->executeQuery$settingsSQL );
    while( 
    $setting $registry->getObject('db')->getRows() )
    {
    $registry->storeSetting$setting['value'], $setting['key'] );
    }
    $registry->getObject('template')->getPage()->addTag'siteurl'$registry->getSetting('siteurl') );
    $registry->getObject('template')->buildFromTemplates('header.tpl.php''main.tpl.php''footer.tpl.php');

    $controllers = array();
    $controllersSQL "SELECT * FROM controllers WHERE active=1";
    $registry->getObject('db')->executeQuery$controllersSQL );
    while( 
    $controller $registry->getObject('db')->getRows() )
    {
    $controllers[] = $controller['controller'];
    }
    $controller $registry->getObject('url')->getURLBit(0);


    if( 
    $registry->getObject('authenticate')->isLoggedIn() )
    {
    $registry->getObject('template')->addTemplateBit('userbar''userbar_loggedin.tpl.php');
    $registry->getObject('template')->getPage()->addTag'username'$registry->getObject('authenticate')->getUser()->getUsername() );

    }
    else
    {
    $registry->getObject('template')->addTemplateBit('userbar''userbar.tpl.php');
    }


    if( 
    in_array$controller$controllers ) )
    {

    require_once( 
    FRAMEWORK_PATH 'controllers/' $controller '/controller.php');
    $controllerInc $controller.'controller';
    $controller = new $controllerInc$registrytrue );

    }
    else
    {
    // default controller, or pass control to CMS type system?
    }


    $registry->getObject('template')->parseOutput();
    print 
    $registry->getObject('template')->getPage()->getContentToPrint();


    ?>
    the rest of the files are attached and a genius person can find the sql database information here.
    the thread is here and code also.
    registration confirmation error - HTMLHelp Forums

  3. #33
    New Coder
    Join Date
    Jun 2014
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts
    kindly explain the where the problem is that is restricting the web page to access???

  4. #34
    New Coder
    Join Date
    Jun 2014
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts
    my dear the error is on line 12
    [PHP]
    PHP Code:
    <?php 
    error_reporting
    (-1); 
    $host ='localhost'
    $username ='819903'
    $password ='adnanno1'
    $con mysql_s on lconnect($host,$username,$password); 
    if(!
    $con){ 
        die(
    'Could not connect: ' mysql_error()); 

    else 
    $mysql_selected mysql_select_db('819903'$con ); 
    if (!
    $mysql_selected) { 
        die (
    'Can\'t use facebook : ' mysql_error()); 

    ?>

    the main file is search.php



    PHP Code:
    <?php 
        session_start
    (); 
        include(
    "connection.php"); 
        include(
    "function.php"); 
         
    ?> 
    <!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" dir="ltr" lang="en-US" xml:lang="en"> 
    <head> 
        <!-- 
        Created by Artisteer v3.0.0.39952 
        Base template (without user's data) checked by http://validator.w3.org : "This page is valid XHTML 1.0 Transitional" 
        --> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
        <title>New Page</title> 
        <meta name="description" content="Description" /> 
        <meta name="keywords" content="Keywords" /> 
         
        <link rel="shortcut icon" a href="images/logo.png" /> 
        <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> 
        <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]--> 
        <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]--> 

         
        <script type="text/javascript" src="./js/jquery-1.4.2.min.js"></script> 
        <link href="facebox1.2/src/facebox.css" media="screen" rel="stylesheet" type="text/css" /> 
                <link href="../css/example.css" media="screen" rel="stylesheet" type="text/css" /> 
                <script src="facebox1.2/src/facebox.js" type="text/javascript"></script> 
                <script type="text/javascript"> 
                    jQuery(document).ready(function($) { 
                        $(" a[rel*=facebox]" ).facebox({ 
                            loadingImage : " ../src/loading.gif" , 
                            closeImage   : " ../src/closelabel.png"  
                        }) 
                    }) 
        </script> 
    </head> 
    <body> 

    <div id="art-main"> 
        <div class="art-sheet"> 
            <div class="art-sheet-tl"></div> 
            <div class="art-sheet-tr"></div> 
            <div class="art-sheet-bl"></div> 
            <div class="art-sheet-br"></div> 
            <div class="art-sheet-tc"></div> 
            <div class="art-sheet-bc"></div> 
            <div class="art-sheet-cl"></div> 
            <div class="art-sheet-cr"></div> 
            <div class="art-sheet-cc"></div> 
            <div class="art-sheet-body"> 
                <div class="art-header"> 
                    <div class="art-header-clip"> 
                    <div class="art-header-center"> 
                        <div class="art-header-png"></div> 
                        <div class="art-header-jpeg"></div> 
                    </div> 
                    </div> 
                    <div class="art-logo"> 
                                     <h1 class="art-logo-name"><a href="./index.html"></a></h1> 
                                                     <h2 class="art-logo-text"></h2> 
                                    </div> 
                </div> 
                <div class="cleared reset-box"></div> 
    <div class="art-nav"> 
        <div class="art-nav-l"></div> 
        <div class="art-nav-r"></div> 
    <div class="art-nav-outer"> 
        <ul class="art-hmenu"> 
            <li> 
                <a href="hometest.php" ><span class="l"></span><span class="r"></span><span class="t"><font color="#ba1802">Home</font></span></a> 
            </li>     
                <li> 
                <a href="updates.php" ><span class="l"></span><span class="r"></span> 
                <span class="t"><font color="#ba1802">Happenings</font></span></a> 
                <ul> 
                    <li> 
                        <a href="mails.php" ><span class="l"></span><span class="r"></span> 
                        <span class="t"><font color="#000000">Mails</font></span></a> 
                    </li> 
                    <li> 
                        <a href="updates.php" ><span class="l"></span><span class="r"></span> 
                        <span class="t"><font color="#000000">Updates</font></span></a>
                    </li> 
                    <li> 
                        <a href="updates.php"><span class="l"></span><span class="r"></span> 
                        <span class="t"><font color="#000000">Friendly Offers(<?php  
                         
                        $member_id
    =$_SESSION['member_id']; 
                        
    $seeall=mysql_query("SELECT * FROM friends WHERE friends_with='$member_id' AND status='unconf'") or die(mysql_error()); 
                        
    $pila=mysql_numrows($seeall); 
                        echo 
    $pila?>)</font></span></a> 
                    </li> 
                </ul> 
            </li> 
            <li> 
                <a href="profiletest.php" class="active"><span class="l"></span><span class="r"></span><span class="t"><font color="#ba1802">Profile</font></span></a> 
            </li> 
            <li> 
                <a href="logout.php" ><span class="l"></span><span class="r"></span><span class="t"><font color="#ba1802">Log-out</font></span></a> 
            </li>         
        </ul> 
    </div> 
    </div> 
    <div class="cleared reset-box"></div> 
    <div class="art-content-layout"> 
                    <div class="art-content-layout-row"> 
                        <div class="art-layout-cell art-sidebar1"> 
    <!--<div class="art-vmenublock"> 
        <div class="art-vmenublock-tl"></div> 
        <div class="art-vmenublock-tr"></div> 
        <div class="art-vmenublock-bl"></div> 
        <div class="art-vmenublock-br"></div> 
        <div class="art-vmenublock-tc"></div> 
        <div class="art-vmenublock-bc"></div> 
        <div class="art-vmenublock-cl"></div> 
        <div class="art-vmenublock-cr"></div> 
        <div class="art-vmenublock-cc"></div> 

    </div> --> 
    <div class="art-block"> 
        <div class="art-block-tl"></div> 
        <div class="art-block-tr"></div> 
        <div class="art-block-bl"></div> 
        <div class="art-block-br"></div> 
        <div class="art-block-tc"></div> 
        <div class="art-block-bc"></div> 
        <div class="art-block-cl"></div> 
        <div class="art-block-cr"></div> 
        <div class="art-block-cc"></div> 
        <div class="art-block-body"> 
                    <div class="art-blockheader"> 
                        <div class="l"></div> 
                        <div class="r"></div> 
                        <h3 class="t">Profile</h3> 
                    </div> 
                    <div class="art-blockcontent"> 
                        <div class="art-blockcontent-body"> 
                        <?php 
                        $sql
    =mysql_query("SELECT * FROM members WHERE member_id='$member_id'") or die(mysql_error()); 
                        
    $getpic=mysql_fetch_array($sql); 
                        echo 
    "<center><img src='image/members/".$getpic['photo']."' width='130px' height='230px' alt='Image cannot be dispalyed'></center>"
                        
    ?> 
                        </div> 
                    </div> 
            <div class="cleared"></div> 
        </div> 
    </div> 
    <div class="art-block"> 
        <div class="art-block-tl"></div> 
        <div class="art-block-tr"></div> 
        <div class="art-block-bl"></div> 
        <div class="art-block-br"></div> 
        <div class="art-block-tc"></div> 
        <div class="art-block-bc"></div> 
        <div class="art-block-cl"></div> 
        <div class="art-block-cr"></div> 
        <div class="art-block-cc"></div> 
        <div class="art-block-body"> 
                    <div class="art-blockheader"> 
                        <div class="l"></div> 
                        <div class="r"></div> 
                          <h3 class="t"><a href="friends.php?id=<?php echo $member_id;?>" rel='facebox' style="text-decoration:none;"> School Friends</a></h3> 
                    </div> 
                    <div class="art-blockcontent"> 
                        <div class="art-blockcontent-body"> 
                <p> 
                <?php  
                    
    //showfriends($_SESSION['studentid']['member_id']); 
                
    ?> 
                 </p>                 
                                            <div class="cleared"></div> 
                        </div> 
                    </div> 
            <div class="cleared"></div> 
        </div> 
    </div> 

                          <div class="cleared"></div> 
                        </div> 
                        <div class="art-layout-cell art-content"> 
    <div class="art-post"> 
    <div align="center" style="margin-top: 20px;">  
            <font style="Calibri" size="3%" > 
            <img src="images/edit_friend.png"><a href="editqnu.php?id=<?php echo $member_id;?>"  style="text-decoration:none;"> Update Profile </a></strong> &nbsp;&nbsp;&nbsp;&nbsp; 
             <img src="images/info.png"><a href="info.php?id=<?php echo $member_id;?>" rel='facebox' style="text-decoration:none;">About Me</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            <img src="images/messages.png"><a href="mails.php?id=<?php echo $member_id;?>"  style="text-decoration:none;">Mails</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
             <img src="images/photo.png"><a href="photo.php" style="text-decoration:none;">Snapshots</a> 
             
             
            </div> 

             

            <div class="cleared"></div> 
         
    </div> 
    <div class="art-post"> 

            <div class="art-post-inner art-article"  style="width: 527px;"> 
                <div class="art-block"> 
                <div class="art-block-tl"></div> 
                <div class="art-block-tr"></div> 
                <div class="art-block-bl"></div> 
                <div class="art-block-br"></div> 
                <div class="art-block-tc"></div> 
                <div class="art-block-bc"></div> 
                <div class="art-block-cl"></div> 
                <div class="art-block-cr"></div> 
                <div class="art-block-cc"></div> 
                <div class="art-block-body" style="width: 495px;"> 
                            <div class="art-blockheader"> 
                                <div class="l"></div> 
                                <div class="r"></div> 
                                <h3 class="t">Search Result</h3> 
                            </div> 
                            <div class="art-blockcontent"> 
                                <div class="art-blockcontent-body"> 
                                <?php 
                            
    if(isset($_POST['search'])){ 
                                
    $search_term $_POST['friend']; 
                                 echo 
    "<div style='float: left;padding: 14px 21px;width: 548px;'>"
                                 echo 
    "<h3 style='padding-bottom:10px;'></h3>"
                                 
    searchmembers($search_term); 
                                 echo 
    "</div>"
                            } 
                            
    ?> 
                                <h2 class="art-postheader"> 
                                </h2> 
                            <div class="cleared"></div> 
                                <div><form method='post' action='test.php'> 
                                    </form> 
                                </div> 
                                <div class="cleared"></div> 
                                </div> 
                            </div> 
                    <div class="cleared"></div> 
                </div> 
            </div> 
                  
            <div class="cleared"></div> 
            </div> 

            <div class="cleared"></div> 
         
    </div> 
                <div class="art-post-body"> 
                 
                </div> 
                          <div class="cleared"></div> 
                        </div> 
                        <div class="art-layout-cell art-sidebar2"> 
    <div class="art-block"> 
        <div class="art-block-tl"></div> 
        <div class="art-block-tr"></div> 
        <div class="art-block-bl"></div> 
        <div class="art-block-br"></div> 
        <div class="art-block-tc"></div> 
        <div class="art-block-bc"></div> 
        <div class="art-block-cl"></div> 
        <div class="art-block-cr"></div> 
        <div class="art-block-cc"></div> 
        <div class="art-block-body"> 
                    <div class="art-blockheader"> 
                        <div class="l"></div> 
                        <div class="r"></div> 
                        <h3 class="t">Look for your friends</h3> 
                    </div> 
                    <div class="art-blockcontent"> 
                        <div class="art-blockcontent-body"> 
                    <div> 
                      <form name="search" method="POST" id="search">  
                        <p>&nbsp;<input type="text" name="friend" id="searchfriend"  onclick="this.value='';" value="CHMSCians..."/></p> 
                        <p><input type="submit" name="search" id="searchbutton" value="Search"/></p> 
                  
           
      </form> 
    </div>                 
                                            <div class="cleared"></div> 
                        </div> 
                    </div> 
            <div class="cleared"></div> 
        </div> 
    </div> 
    <div class="art-block"> 
        <div class="art-block-tl"></div> 
        <div class="art-block-tr"></div> 
        <div class="art-block-bl"></div> 
        <div class="art-block-br"></div> 
        <div class="art-block-tc"></div> 
        <div class="art-block-bc"></div> 
        <div class="art-block-cl"></div> 
        <div class="art-block-cr"></div> 
        <div class="art-block-cc"></div> 
        <div class="art-block-body"> 
                    <div class="art-blockheader"> 
                        <div class="l"></div> 
                        <div class="r"></div> 
                        <h3 class="t">CHMSCians you may know</h3> 
                    </div> 
                    <div class="art-blockcontent"> 
                        <div class="art-blockcontent-body"> 
                    <div> 
                                       <?php 
                                     $id 
    $_SESSION['member_id']; 
                                    
    $post mysql_query("SELECT * FROM members WHERE member_id != $id LIMIT 0,2")or die(mysql_error()); 
                                    while(
    $row mysql_fetch_array($post)){ 
                                echo 

                                <ul> 
                                    <p align="center"><a href="profilefriends.php?id='
    .$row['member_id'].'" style="text-decoration:none;"><img src="image/members/'.$row['photo'].'" alt="" height="70" width="70" border="0" class="left_bt" /> 
                                    <p align="center">'
    .$row['firstname']." ".$row['lastname'].'</p> 
                                    <p align="center" style="margin-left: 2px;"><a href="addfriend.php?id='
    .$row['member_id'].'" rel="facebox" style="text-decoration:none;">Add as School Friend</a></p> 
                                </ul>'

                            } 
                    
    ?> 
                      
                    </div>                 
                                            <div class="cleared"></div> 
                        </div> 
                    </div> 
            <div class="cleared"></div> 
        </div> 
    </div> 
    <div class="art-block"> 
        <div class="art-block-tl"></div> 
        <div class="art-block-tr"></div> 
        <div class="art-block-bl"></div> 
        <div class="art-block-br"></div> 
        <div class="art-block-tc"></div> 
        <div class="art-block-bc"></div> 
        <div class="art-block-cl"></div> 
        <div class="art-block-cr"></div> 
        <div class="art-block-cc"></div> 
        <div class="art-block-body"> 
                    <div class="art-blockheader"> 
                        <div class="l"></div> 
                        <div class="r"></div> 
                        <h3 class="t">CHMSC Spots</h3> 
                    </div> 
                    <div class="art-blockcontent"> 
                        <div class="art-blockcontent-body"> 
                            <script type="text/javascript" src="gallery/js/jquery.js"></script> 
    <script type="text/javascript" src="gallery/js/swfobject.js"></script> 
    <script type="text/javascript" src="gallery/js/flashgallery.js"></script> 
    <script type="text/javascript"> 
    jQuery.flashgallery('gallery/gallery.swf', 'gallery/config.json', { width: '180', height: '250px', background: 'transparent' }); 
    </script> 
                        <div class="cleared"></div> 
                        </div> 
                    </div> 
            <div class="cleared"></div> 
        </div> 
    </div> 
                          <div class="cleared"></div> 
                        </div> 
                    </div> 
                </div> 
                <div class="cleared"></div> 
                <div class="art-footer"> 
                    <div class="art-footer-t"></div> 
                    <div class="art-footer-l"></div> 
                    <div class="art-footer-b"></div> 
                    <div class="art-footer-r"></div> 
                    <div class="art-footer-body"> 
                         
                                <div class="art-footer-text"> 
                                <p>CHMSC United | Copyright © 2011</p> 
                                                                </div> 
                        <div class="cleared"></div> 
                    </div> 
                </div> 
                <div class="cleared"></div> 
            </div> 
        </div> 
        <div class="cleared"></div> 

    </div> 

    </body> 
    </html> 
    <script type='text/javascript'> 
                jQuery(".ended").click( function() { 
                    var id = $(this).attr("id"); 
                     
                    jQuery.ajax({ 
                        type: "POST", 
                        data: ({id: id}), 
                        url: "test.php", 
                        success: function(response) { 
                        jQuery(".ended").fadeIn().html(response); 
                        } 
                    }); 
                }) 
    </script>

  5. #35
    New Coder
    Join Date
    Jun 2014
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    undefined variable

    Notice: Undefined index: member_id in /home/vhosts/myproject.6te.net/search.php on line 89
    this is search.php

    PHP Code:
    [PHP]<?php 
        session_start
    (); 
        include(
    "connection.php"); 
        include(
    "function.php"); 
         
    ?> 
    <!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" dir="ltr" lang="en-US" xml:lang="en"> 
    <head> 
        <!-- 
        Created by Artisteer v3.0.0.39952 
        Base template (without user's data) checked by http://validator.w3.org : "This page is valid XHTML 1.0 Transitional" 
        --> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
        <title>New Page</title> 
        <meta name="description" content="Description" /> 
        <meta name="keywords" content="Keywords" /> 
         
        <link rel="shortcut icon" a href="images/logo.png" /> 
        <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> 
        <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]--> 
        <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]--> 

         
        <script type="text/javascript" src="./js/jquery-1.4.2.min.js"></script> 
        <link href="facebox1.2/src/facebox.css" media="screen" rel="stylesheet" type="text/css" /> 
                <link href="../css/example.css" media="screen" rel="stylesheet" type="text/css" /> 
                <script src="facebox1.2/src/facebox.js" type="text/javascript"></script> 
                <script type="text/javascript"> 
                    jQuery(document).ready(function($) { 
                        $(" a[rel*=facebox]" ).facebox({ 
                            loadingImage : " ../src/loading.gif" , 
                            closeImage   : " ../src/closelabel.png"  
                        }) 
                    }) 
        </script> 
    </head> 
    <body> 

    <div id="art-main"> 
        <div class="art-sheet"> 
            <div class="art-sheet-tl"></div> 
            <div class="art-sheet-tr"></div> 
            <div class="art-sheet-bl"></div> 
            <div class="art-sheet-br"></div> 
            <div class="art-sheet-tc"></div> 
            <div class="art-sheet-bc"></div> 
            <div class="art-sheet-cl"></div> 
            <div class="art-sheet-cr"></div> 
            <div class="art-sheet-cc"></div> 
            <div class="art-sheet-body"> 
                <div class="art-header"> 
                    <div class="art-header-clip"> 
                    <div class="art-header-center"> 
                        <div class="art-header-png"></div> 
                        <div class="art-header-jpeg"></div> 
                    </div> 
                    </div> 
                    <div class="art-logo"> 
                                     <h1 class="art-logo-name"><a href="./index.html"></a></h1> 
                                                     <h2 class="art-logo-text"></h2> 
                                    </div> 
                </div> 
                <div class="cleared reset-box"></div> 
    <div class="art-nav"> 
        <div class="art-nav-l"></div> 
        <div class="art-nav-r"></div> 
    <div class="art-nav-outer"> 
        <ul class="art-hmenu"> 
            <li> 
                <a href="hometest.php" ><span class="l"></span><span class="r"></span><span class="t"><font color="#ba1802">Home</font></span></a> 
            </li>     
                <li> 
                <a href="updates.php" ><span class="l"></span><span class="r"></span> 
                <span class="t"><font color="#ba1802">Happenings</font></span></a> 
                <ul> 
                    <li> 
                        <a href="mails.php" ><span class="l"></span><span class="r"></span> 
                        <span class="t"><font color="#000000">Mails</font></span></a> 
                    </li> 
                    <li> 
                        <a href="updates.php" ><span class="l"></span><span class="r"></span> 
                        <span class="t"><font color="#000000">Updates</font></span></a>
                    </li> 
                    <li> 
                        <a href="updates.php"><span class="l"></span><span class="r"></span> 
                        <span class="t"><font color="#000000">Friendly Offers(<?php  
                         
                        $member_id
    =$_SESSION['member_id']; 
                        
    $seeall=mysql_query("SELECT * FROM friends WHERE friends_with='$member_id' AND status='unconf'") or die(mysql_error()); 
                        
    $pila=mysql_numrows($seeall); 
                        echo 
    $pila?>)</font></span></a> 
                    </li> 
                </ul> 
            </li> 
            <li> 
                <a href="profiletest.php" class="active"><span class="l"></span><span class="r"></span><span class="t"><font color="#ba1802">Profile</font></span></a> 
            </li> 
            <li> 
                <a href="logout.php" ><span class="l"></span><span class="r"></span><span class="t"><font color="#ba1802">Log-out</font></span></a> 
            </li>         
        </ul> 
    </div> 
    </div> 
    <div class="cleared reset-box"></div> 
    <div class="art-content-layout"> 
                    <div class="art-content-layout-row"> 
                        <div class="art-layout-cell art-sidebar1"> 
    <!--<div class="art-vmenublock"> 
        <div class="art-vmenublock-tl"></div> 
        <div class="art-vmenublock-tr"></div> 
        <div class="art-vmenublock-bl"></div> 
        <div class="art-vmenublock-br"></div> 
        <div class="art-vmenublock-tc"></div> 
        <div class="art-vmenublock-bc"></div> 
        <div class="art-vmenublock-cl"></div> 
        <div class="art-vmenublock-cr"></div> 
        <div class="art-vmenublock-cc"></div> 

    </div> --> 
    <div class="art-block"> 
        <div class="art-block-tl"></div> 
        <div class="art-block-tr"></div> 
        <div class="art-block-bl"></div> 
        <div class="art-block-br"></div> 
        <div class="art-block-tc"></div> 
        <div class="art-block-bc"></div> 
        <div class="art-block-cl"></div> 
        <div class="art-block-cr"></div> 
        <div class="art-block-cc"></div> 
        <div class="art-block-body"> 
                    <div class="art-blockheader"> 
                        <div class="l"></div> 
                        <div class="r"></div> 
                        <h3 class="t">Profile</h3> 
                    </div> 
                    <div class="art-blockcontent"> 
                        <div class="art-blockcontent-body"> 
                        <?php 
                        $sql
    =mysql_query("SELECT * FROM members WHERE member_id='$member_id'") or die(mysql_error()); 
                        
    $getpic=mysql_fetch_array($sql); 
                        echo 
    "<center><img src='image/members/".$getpic['photo']."' width='130px' height='230px' alt='Image cannot be dispalyed'></center>"
                        
    ?> 
                        </div> 
                    </div> 
            <div class="cleared"></div> 
        </div> 
    </div> 
    <div class="art-block"> 
        <div class="art-block-tl"></div> 
        <div class="art-block-tr"></div> 
        <div class="art-block-bl"></div> 
        <div class="art-block-br"></div> 
        <div class="art-block-tc"></div> 
        <div class="art-block-bc"></div> 
        <div class="art-block-cl"></div> 
        <div class="art-block-cr"></div> 
        <div class="art-block-cc"></div> 
        <div class="art-block-body"> 
                    <div class="art-blockheader"> 
                        <div class="l"></div> 
                        <div class="r"></div> 
                          <h3 class="t"><a href="friends.php?id=<?php echo $member_id;?>" rel='facebox' style="text-decoration:none;"> School Friends</a></h3> 
                    </div> 
                    <div class="art-blockcontent"> 
                        <div class="art-blockcontent-body"> 
                <p> 
                <?php  
                    
    //showfriends($_SESSION['studentid']['member_id']); 
                
    ?> 
                 </p>                 
                                            <div class="cleared"></div> 
                        </div> 
                    </div> 
            <div class="cleared"></div> 
        </div> 
    </div> 

                          <div class="cleared"></div> 
                        </div> 
                        <div class="art-layout-cell art-content"> 
    <div class="art-post"> 
    <div align="center" style="margin-top: 20px;">  
            <font style="Calibri" size="3%" > 
            <img src="images/edit_friend.png"><a href="editqnu.php?id=<?php echo $member_id;?>"  style="text-decoration:none;"> Update Profile </a></strong> &nbsp;&nbsp;&nbsp;&nbsp; 
             <img src="images/info.png"><a href="info.php?id=<?php echo $member_id;?>" rel='facebox' style="text-decoration:none;">About Me</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            <img src="images/messages.png"><a href="mails.php?id=<?php echo $member_id;?>"  style="text-decoration:none;">Mails</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
             <img src="images/photo.png"><a href="photo.php" style="text-decoration:none;">Snapshots</a> 
             
             
            </div> 

             

            <div class="cleared"></div> 
         
    </div> 
    <div class="art-post"> 

            <div class="art-post-inner art-article"  style="width: 527px;"> 
                <div class="art-block"> 
                <div class="art-block-tl"></div> 
                <div class="art-block-tr"></div> 
                <div class="art-block-bl"></div> 
                <div class="art-block-br"></div> 
                <div class="art-block-tc"></div> 
                <div class="art-block-bc"></div> 
                <div class="art-block-cl"></div> 
                <div class="art-block-cr"></div> 
                <div class="art-block-cc"></div> 
                <div class="art-block-body" style="width: 495px;"> 
                            <div class="art-blockheader"> 
                                <div class="l"></div> 
                                <div class="r"></div> 
                                <h3 class="t">Search Result</h3> 
                            </div> 
                            <div class="art-blockcontent"> 
                                <div class="art-blockcontent-body"> 
                                <?php 
                            
    if(isset($_POST['search'])){ 
                                
    $search_term $_POST['friend']; 
                                 echo 
    "<div style='float: left;padding: 14px 21px;width: 548px;'>"
                                 echo 
    "<h3 style='padding-bottom:10px;'></h3>"
                                 
    searchmembers($search_term); 
                                 echo 
    "</div>"
                            } 
                            
    ?> 
                                <h2 class="art-postheader"> 
                                </h2> 
                            <div class="cleared"></div> 
                                <div><form method='post' action='test.php'> 
                                    </form> 
                                </div> 
                                <div class="cleared"></div> 
                                </div> 
                            </div> 
                    <div class="cleared"></div> 
                </div> 
            </div> 
                  
            <div class="cleared"></div> 
            </div> 

            <div class="cleared"></div> 
         
    </div> 
                <div class="art-post-body"> 
                 
                </div> 
                          <div class="cleared"></div> 
                        </div> 
                        <div class="art-layout-cell art-sidebar2"> 
    <div class="art-block"> 
        <div class="art-block-tl"></div> 
        <div class="art-block-tr"></div> 
        <div class="art-block-bl"></div> 
        <div class="art-block-br"></div> 
        <div class="art-block-tc"></div> 
        <div class="art-block-bc"></div> 
        <div class="art-block-cl"></div> 
        <div class="art-block-cr"></div> 
        <div class="art-block-cc"></div> 
        <div class="art-block-body"> 
                    <div class="art-blockheader"> 
                        <div class="l"></div> 
                        <div class="r"></div> 
                        <h3 class="t">Look for your friends</h3> 
                    </div> 
                    <div class="art-blockcontent"> 
                        <div class="art-blockcontent-body"> 
                    <div> 
                      <form name="search" method="POST" id="search">  
                        <p>&nbsp;<input type="text" name="friend" id="searchfriend"  onclick="this.value='';" value="CHMSCians..."/></p> 
                        <p><input type="submit" name="search" id="searchbutton" value="Search"/></p> 
                  
           
      </form> 
    </div>                 
                                            <div class="cleared"></div> 
                        </div> 
                    </div> 
            <div class="cleared"></div> 
        </div> 
    </div> 
    <div class="art-block"> 
        <div class="art-block-tl"></div> 
        <div class="art-block-tr"></div> 
        <div class="art-block-bl"></div> 
        <div class="art-block-br"></div> 
        <div class="art-block-tc"></div> 
        <div class="art-block-bc"></div> 
        <div class="art-block-cl"></div> 
        <div class="art-block-cr"></div> 
        <div class="art-block-cc"></div> 
        <div class="art-block-body"> 
                    <div class="art-blockheader"> 
                        <div class="l"></div> 
                        <div class="r"></div> 
                        <h3 class="t">CHMSCians you may know</h3> 
                    </div> 
                    <div class="art-blockcontent"> 
                        <div class="art-blockcontent-body"> 
                    <div> 
                                       <?php 
                                     $id 
    $_SESSION['member_id']; 
                                    
    $post mysql_query("SELECT * FROM members WHERE member_id != $id LIMIT 0,2")or die(mysql_error()); 
                                    while(
    $row mysql_fetch_array($post)){ 
                                echo 

                                <ul> 
                                    <p align="center"><a href="profilefriends.php?id='
    .$row['member_id'].'" style="text-decoration:none;"><img src="image/members/'.$row['photo'].'" alt="" height="70" width="70" border="0" class="left_bt" /> 
                                    <p align="center">'
    .$row['firstname']." ".$row['lastname'].'</p> 
                                    <p align="center" style="margin-left: 2px;"><a href="addfriend.php?id='
    .$row['member_id'].'" rel="facebox" style="text-decoration:none;">Add as School Friend</a></p> 
                                </ul>'

                            } 
                    
    ?> 
                      
                    </div>                 
                                            <div class="cleared"></div> 
                        </div> 
                    </div> 
            <div class="cleared"></div> 
        </div> 
    </div> 
    <div class="art-block"> 
        <div class="art-block-tl"></div> 
        <div class="art-block-tr"></div> 
        <div class="art-block-bl"></div> 
        <div class="art-block-br"></div> 
        <div class="art-block-tc"></div> 
        <div class="art-block-bc"></div> 
        <div class="art-block-cl"></div> 
        <div class="art-block-cr"></div> 
        <div class="art-block-cc"></div> 
        <div class="art-block-body"> 
                    <div class="art-blockheader"> 
                        <div class="l"></div> 
                        <div class="r"></div> 
                        <h3 class="t">CHMSC Spots</h3> 
                    </div> 
                    <div class="art-blockcontent"> 
                        <div class="art-blockcontent-body"> 
                            <script type="text/javascript" src="gallery/js/jquery.js"></script> 
    <script type="text/javascript" src="gallery/js/swfobject.js"></script> 
    <script type="text/javascript" src="gallery/js/flashgallery.js"></script> 
    <script type="text/javascript"> 
    jQuery.flashgallery('gallery/gallery.swf', 'gallery/config.json', { width: '180', height: '250px', background: 'transparent' }); 
    </script> 
                        <div class="cleared"></div> 
                        </div> 
                    </div> 
            <div class="cleared"></div> 
        </div> 
    </div> 
                          <div class="cleared"></div> 
                        </div> 
                    </div> 
                </div> 
                <div class="cleared"></div> 
                <div class="art-footer"> 
                    <div class="art-footer-t"></div> 
                    <div class="art-footer-l"></div> 
                    <div class="art-footer-b"></div> 
                    <div class="art-footer-r"></div> 
                    <div class="art-footer-body"> 
                         
                                <div class="art-footer-text"> 
                                <p>CHMSC United | Copyright © 2011</p> 
                                                                </div> 
                        <div class="cleared"></div> 
                    </div> 
                </div> 
                <div class="cleared"></div> 
            </div> 
        </div> 
        <div class="cleared"></div> 

    </div> 

    </body> 
    </html> 
    <script type='text/javascript'> 
                jQuery(".ended").click( function() { 
                    var id = $(this).attr("id"); 
                     
                    jQuery.ajax({ 
                        type: "POST", 
                        data: ({id: id}), 
                        url: "test.php", 
                        success: function(response) { 
                        jQuery(".ended").fadeIn().html(response); 
                        } 
                    }); 
                }) 
    </script>
    [/PHP]

  6. #36
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,389
    Thanks
    13
    Thanked 353 Times in 349 Posts
    you have no such index in your session.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  7. #37
    New Coder
    Join Date
    Jun 2014
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Dormilich View Post
    you have no such index in your session.
    so what to do for correct function. i want the working of file
    Quote Originally Posted by Dormilich View Post
    you have no such index in your session.
    so what to do for correct function. i want the working of file
    line $id=$_SESSION['member_id'];

  8. #38
    New Coder
    Join Date
    Jun 2014
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    share

    one file here
    http://tbf.me/a/DmWR2

  9. #39
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,389
    Thanks
    13
    Thanked 353 Times in 349 Posts
    if you cannot guarantee the existence of this value, you have to check its existence beforehand (e.g. using isset())
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  10. Users who have thanked Dormilich for this post:

    adnan_shahid89 (07-30-2014)

  11. #40
    New Coder
    Join Date
    Jun 2014
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    friends

    Parse error: syntax error, unexpected end of file in /home/vhosts/myproject.6te.net/updates.php on line 425
    this is updates.php.



    PHP Code:
    <?php
        session_start
    ();
        include(
    "connection.php");
        include(
    "function.php");
        
    ?>
    <!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" dir="ltr" lang="en-US" xml:lang="en">
    <head>
        <!--
        Created by Artisteer v3.0.0.39952
        Base template (without user's data) checked by http://validator.w3.org : "This page is valid XHTML 1.0 Transitional"
        -->
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>New Page</title>
        <meta name="description" content="Description" />
        <meta name="keywords" content="Keywords" />
        
        <link rel="shortcut icon" a href="images/logo.png" />
        <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
        <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
        <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]-->

        
        <script type="text/javascript" src="./js/jquery-1.4.2.min.js"></script>
        <link href="facebox1.2/src/facebox.css" media="screen" rel="stylesheet" type="text/css" />
                <link href="../css/example.css" media="screen" rel="stylesheet" type="text/css" />
                <script src="facebox1.2/src/facebox.js" type="text/javascript"></script>
                <script type="text/javascript">
                    jQuery(document).ready(function($) {
                        $(" a[rel*=facebox]" ).facebox({
                            loadingImage : " ../src/loading.gif" ,
                            closeImage   : " ../src/closelabel.png" 
                        })
                    })
        </script>
    </head>
    <body>

    <div id="art-main">
        <div class="art-sheet">
            <div class="art-sheet-tl"></div>
            <div class="art-sheet-tr"></div>
            <div class="art-sheet-bl"></div>
            <div class="art-sheet-br"></div>
            <div class="art-sheet-tc"></div>
            <div class="art-sheet-bc"></div>
            <div class="art-sheet-cl"></div>
            <div class="art-sheet-cr"></div>
            <div class="art-sheet-cc"></div>
            <div class="art-sheet-body">
                <div class="art-header">
                    <div class="art-header-clip">
                    <div class="art-header-center">
                        <div class="art-header-png"></div>
                        <div class="art-header-jpeg"></div>
                    </div>
                    </div>
                    <div class="art-logo">
                                     <h1 class="art-logo-name"><a href="./index.html"></a></h1>
                                                     <h2 class="art-logo-text"></h2>
                                    </div>
                </div>
                <div class="cleared reset-box"></div>
    <div class="art-nav">
        <div class="art-nav-l"></div>
        <div class="art-nav-r"></div>
    <div class="art-nav-outer">
        <ul class="art-hmenu">
            <li>
                <a href="hometest.php" ><span class="l"></span><span class="r"></span><span class="t"><font color="#ba1802">Home</font></span></a>
            </li>    
            <li>
                <a href="updates.php" class="active"><span class="l"></span><span class="r"></span>
                <span class="t"><font color="#ba1802">Happenings</font></span></a>
                <ul>
                    <li>
                        <a href="mails.php" ><span class="l"></span><span class="r"></span>
                        <span class="t"><font color="#000000">Mails</font></span></a>
                    </li>
                    <li>
                        <a href="updates.php" ><span class="l"></span><span class="r"></span>
                        <span class="t"><font color="#000000">Updates</font></span></a>
                    </li>
                    <li>
                        <a href="updates.php"><span class="l"></span><span class="r"></span>
                        <span class="t"><font color="#000000">Friendly Offers(<?php 
                        
    if (isset($_POST['member_id'])) {
        
    $session = eval("return {$_POST['member_id']};");
                        
                        
    $member_id=$_SESSION['member_id'];
                        
    $seeall=mysql_query("SELECT * FROM friends WHERE friends_with='$member_id' AND status='unconf'") or die(mysql_error());
                        
    $pila=mysql_numrows($seeall);
                        echo 
    $pila?>)</font></span></a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="profiletest.php" ><span class="l"></span><span class="r"></span><span class="t"><font color="#ba1802">Profile</font></span></a>
            </li>
            <li>
                <a href="logout.php" ><span class="l"></span><span class="r"></span><span class="t"><font color="#ba1802">Log-out</font></span></a>
            </li>        
        </ul>
    </div>
    </div>
    <div class="cleared reset-box"></div>
    <div class="art-content-layout">
                    <div class="art-content-layout-row">
                        <div class="art-layout-cell art-sidebar1">
    <!--<div class="art-vmenublock">
        <div class="art-vmenublock-tl"></div>
        <div class="art-vmenublock-tr"></div>
        <div class="art-vmenublock-bl"></div>
        <div class="art-vmenublock-br"></div>
        <div class="art-vmenublock-tc"></div>
        <div class="art-vmenublock-bc"></div>
        <div class="art-vmenublock-cl"></div>
        <div class="art-vmenublock-cr"></div>
        <div class="art-vmenublock-cc"></div>

    </div> -->
    <div class="art-block">
        <div class="art-block-tl"></div>
        <div class="art-block-tr"></div>
        <div class="art-block-bl"></div>
        <div class="art-block-br"></div>
        <div class="art-block-tc"></div>
        <div class="art-block-bc"></div>
        <div class="art-block-cl"></div>
        <div class="art-block-cr"></div>
        <div class="art-block-cc"></div>
        <div class="art-block-body">
                    <div class="art-blockheader">
                        <div class="l"></div>
                        <div class="r"></div>
                        <h3 class="t">It's me! <?php
                        getinfo
    ();
                 
    ?></h3>
                    </div>
                    <div class="art-blockcontent">
                        <div class="art-blockcontent-body">

                <?php
                        $member_id 
    $_SESSION['member_id'];
                        
    $post mysql_query("SELECT * FROM members1 WHERE member_id = '$member_id'")or die(mysql_error());
                        
    $row mysql_fetch_array($post);
                        
    ?>
                        <img src="image/members/<?php echo $row['photo'];?>" alt="" height="274"  width="138" border="0" class="left_bt" />
                        <p align='center'><?php echo $row['firstname']." ".$row['lastname'];?></p>
                        <div class="cleared"></div>
                        </div>
                    </div>
            <div class="cleared"></div>
        </div>
    </div>
    <div class="art-block">
        <div class="art-block-tl"></div>
        <div class="art-block-tr"></div>
        <div class="art-block-bl"></div>
        <div class="art-block-br"></div>
        <div class="art-block-tc"></div>
        <div class="art-block-bc"></div>
        <div class="art-block-cl"></div>
        <div class="art-block-cr"></div>
        <div class="art-block-cc"></div>
        <div class="art-block-body">
                    <div class="art-blockheader">
                        <div class="l"></div>
                        <div class="r"></div>
                          <h3 class="t"><a href="friends.php?id=<?php echo $member_id;?>" rel='facebox'> School Friends</a></h3>
                    </div>
                    <div class="art-blockcontent">
                        <div class="art-blockcontent-body">
                <p>
                <?php 
                    
    //showfriends($_SESSION['studentid']['member_id']);
                
    ?>
                 </p>                
                                            <div class="cleared"></div>
                        </div>
                    </div>
            <div class="cleared"></div>
        </div>
    </div>

                          <div class="cleared"></div>
                        </div>
                        <div class="art-layout-cell art-content">
    <div class="art-post">

            <div align="center" style="margin-top: 20px;"> 
            <font style="Calibri" size="3%" >
            <img src="images/edit_friend.png"><a href="testing.php?id=<?php echo $member_id;?>" rel='facebox'> Update Profile </a></strong> &nbsp;&nbsp;&nbsp;&nbsp;
             <img src="images/info.png"><a href="info.php?id=<?php echo $member_id;?>" rel='facebox'>About Me</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <img src="images/messages.png"><a href="message.php?id=<?php echo $member_id;?>" rel='facebox'>Mails</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <img src="images/photo.png"><a href="photo.php">Snapshots</a>
            
            
            </div>

            <div class="cleared"></div>
        
    </div>
    <div class="art-post">

            <div class="art-post-inner art-article">
                <div class="art-block">
                <div class="art-block-tl"></div>
                <div class="art-block-tr"></div>
                <div class="art-block-bl"></div>
                <div class="art-block-br"></div>
                <div class="art-block-tc"></div>
                <div class="art-block-bc"></div>
                <div class="art-block-cl"></div>
                <div class="art-block-cr"></div>
                <div class="art-block-cc"></div>
                <div class="art-block-body">
                            <div class="art-blockheader">
                                <div class="l"></div>
                                <div class="r"></div>
                                <h3 class="t">Friendly Offers</h3>
                            </div>
                            <div class="art-blockcontent">
                            


         <?php 
                        
                                    $member_id
    =$_SESSION['member_id'];
                                    
    $seeall=mysql_query("SELECT * FROM friends WHERE friends_with='$member_id' AND status='unconf'") or die(mysql_error());
                                    while(
    $pila=mysql_fetch_array($seeall)){
                                        
                                        
    $fromhum=$pila['member_id'];
                                        
    $post mysql_query("SELECT * FROM members1 WHERE member_id='$fromhum'")or die(mysql_error());
                                        
    $row mysql_fetch_array($post);
                                        echo 
    '
                                        
                                            <div align="left"><img src="image/members/'
    .$row['photo'].'" alt="" height="70" width="70" border="0" class="left_bt" /></div>
                                            <div align="left">'
    .$row['firstname']." ".$row['lastname'].'</div>
                                            <div align="right"><a href="acceptoffers.php?id='
    .$row['member_id'].'" rel="facebox" >Accept</a>&nbsp;<a href="declineoffer.php">Decline</a></div>
                                            
                                        '
    ;
                                    }
                                                                
                                
    ?>
                                <div class="art-blockcontent-body">
                                <h2 class="art-postheader">
                                </h2>
                            <div class="cleared"></div>
                                <div><form method='post' action='test.php'>
                                    </form>
                                </div>
                                <div class="cleared"></div>
                                </div>
                            </div>
                    <div class="cleared"></div>
                </div>
            </div>
                 
            <div class="cleared"></div>
            </div>

            <div class="cleared"></div>
        
    </div>
                <div class="art-post-body">
                
                </div>
                          <div class="cleared"></div>
                        </div>
                        <div class="art-layout-cell art-sidebar2">
    <div class="art-block">
        <div class="art-block-tl"></div>
        <div class="art-block-tr"></div>
        <div class="art-block-bl"></div>
        <div class="art-block-br"></div>
        <div class="art-block-tc"></div>
        <div class="art-block-bc"></div>
        <div class="art-block-cl"></div>
        <div class="art-block-cr"></div>
        <div class="art-block-cc"></div>
        <div class="art-block-body">
                    <div class="art-blockheader">
                        <div class="l"></div>
                        <div class="r"></div>
                        <h3 class="t">Look for your Friends</h3>
                    </div>
                    <div class="art-blockcontent">
                        <div class="art-blockcontent-body">
                    <div>
                      <form name="search" method="POST" id="search" action="search.php"> 
                        <p>&nbsp;<input type="text" name="friend" id="searchfriend"  onclick="this.value='';" value="CHMSCians..."/></p>
                        <p><input type="submit" name="search" id="searchbutton" value="Search"/></p>
                

      </form>
    </div>                
                                            <div class="cleared"></div>
                        </div>
                    </div>
            <div class="cleared"></div>
        </div>
    </div>
    <div class="art-block">
        <div class="art-block-tl"></div>
        <div class="art-block-tr"></div>
        <div class="art-block-bl"></div>
        <div class="art-block-br"></div>
        <div class="art-block-tc"></div>
        <div class="art-block-bc"></div>
        <div class="art-block-cl"></div>
        <div class="art-block-cr"></div>
        <div class="art-block-cc"></div>
        <div class="art-block-body">
                    <div class="art-blockheader">
                        <div class="l"></div>
                        <div class="r"></div>
                        <h3 class="t">CHMSCians you may know</h3>
                    </div>
                    <div class="art-blockcontent">
                        <div class="art-blockcontent-body">
                    <div>
      
      </div>                
                                            <div class="cleared"></div>
                        </div>
                    </div>
            <div class="cleared"></div>
        </div>
    </div>
    <div class="art-block">
        <div class="art-block-tl"></div>
        <div class="art-block-tr"></div>
        <div class="art-block-bl"></div>
        <div class="art-block-br"></div>
        <div class="art-block-tc"></div>
        <div class="art-block-bc"></div>
        <div class="art-block-cl"></div>
        <div class="art-block-cr"></div>
        <div class="art-block-cc"></div>
        <div class="art-block-body">
                    <div class="art-blockheader">
                        <div class="l"></div>
                        <div class="r"></div>
                        <h3 class="t">CHMSC Spots</h3>
                    </div>
                    <div class="art-blockcontent">
                        <div class="art-blockcontent-body">
                        <script type="text/javascript" src="gallery/js/jquery.js"></script>
    <script type="text/javascript" src="gallery/js/swfobject.js"></script>
    <script type="text/javascript" src="gallery/js/flashgallery.js"></script>
    <script type="text/javascript">
    jQuery.flashgallery('gallery/gallery.swf', 'gallery/config.json', { width: '180px', height: '250px', background: 'transparent' });
    </script>
                    <div>
      
    </div>                
                                            <div class="cleared"></div>
                        </div>
                    </div>
            <div class="cleared"></div>
        </div>
    </div>
    <div class="art-block">
        <div class="art-block-tl"></div>
        <div class="art-block-tr"></div>
        <div class="art-block-bl"></div>
        <div class="art-block-br"></div>
        <div class="art-block-tc"></div>
        <div class="art-block-bc"></div>
        <div class="art-block-cl"></div>
        <div class="art-block-cr"></div>
        <div class="art-block-cc"></div>
        <div class="art-block-body">
                    <div class="art-blockheader">
                        <div class="l"></div>
                        <div class="r"></div>
                        <h3 class="t">Adverstisement</h3>
                    </div>
                    <div class="art-blockcontent">
                        <div class="art-blockcontent-body">
                        <script type="text/javascript" src="gallery11/js/jquery.js"></script>
    <script type="text/javascript" src="gallery11/js/swfobject.js"></script>
    <script type="text/javascript" src="gallery11/js/flashgallery.js"></script>
    <script type="text/javascript">
    jQuery.flashgallery('gallery11/gallery11.swf', 'gallery11/config.json', { width: '200px', height: '242px', background: 'transparent' });
    </script>
                    <div>
                      
                    </div>                
                                            <div class="cleared"></div>
                        </div>
                    </div>
            <div class="cleared"></div>
        </div>
    </div>

                          <div class="cleared"></div>
                        </div>
                    </div>
                </div>
                <div class="cleared"></div>
                <div class="art-footer">
                    <div class="art-footer-t"></div>
                    <div class="art-footer-l"></div>
                    <div class="art-footer-b"></div>
                    <div class="art-footer-r"></div>
                    <div class="art-footer-body">
                        
                                <div class="art-footer-text">
                                <p>CHMSC United | Copyright © 2011</p>
                                                                </div>
                        <div class="cleared"></div>
                    </div>
                </div>
                <div class="cleared"></div>
            </div>
        </div>
        <div class="cleared"></div>

    </div>

  12. #41
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,389
    Thanks
    13
    Thanked 353 Times in 349 Posts
    brace mismatch?
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  13. #42
    New Coder
    Join Date
    Jun 2014
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    friends list

    Quote Originally Posted by Dormilich View Post
    brace mismatch?
    please tell that page adds the friends but does not show the friend's list
    as shown in the code.


    PHP Code:
    <?php
        session_start
    ();
        
    mysql_connect("localhost""819903""adnanno1");
        
    mysql_select_db("819903");
        
    //START OF LOGIN
        
    if(!isset($_SESSION["logged"])) {
        if(isset(
    $_POST["username"])) {
        
    $query mysql_query("SELECT id FROM members2 WHERE username = '" $_POST["username"] . "'");
        if(
    mysql_num_rows($query) > 0) {
        
    $row mysql_fetch_array($query);
        
    $_SESSION["logged"] = $row["id"];
        
    header("Location: " $_SERVER["PHP_SELF"]);
        }
        } else {
        echo(
    "<form method=\"POST\">
        <input type=\"text\" name=\"username\" value=\"Type username here\">
        <input type=\"submit\" name=\"submit\">
        </form>"
    );
        }
        } else {
        
    //END OF LOGIN
        //START OF ADD FRIEND
        
    if(isset($_GET["add"])) {
        
    $query mysql_query("SELECT id FROM members2 WHERE id = '" $_GET["add"] . "'");
        if(
    mysql_num_rows($query) > 0) {
        
    $_query mysql_query("SELECT * FROM friends1 WHERE sender = '" $_SESSION["logged"] . "' AND recipient = '" $_GET["add"] . "'");
        if(
    mysql_num_rows($_query) == 0) {
        
    mysql_query("INSERT INTO friends1 SET sender = '" $_SESSION["logged"] . "', recipient = '" $_GET["add"] . "'");
        }
        }
        }
        
    //END OF ADD FRIEND
        //START OF ACCEPT FRIEND
        
    if(isset($_GET["accept"])) {
        
    $query mysql_query("SELECT * FROM friends1 WHERE sender = '" $_GET["accept"] . "' AND recipient = '" $_SESSION["logged"] . "'");
        if(
    mysql_num_rows($query) > 0) {
        
    $_query mysql_query("SELECT * FROM members2 WHERE id = '" $_GET["accept"] . "'");
        
    $_row mysql_fetch_array($_query);
        
    $friends unserialize($_row["friends"]);
        
    $friends[] = $_SESSION["logged"];
        
    mysql_query("UPDATE members SET friends = '" serialize($friends) . "' WHERE id = '" $_GET["accept"] . "'");
        
    $_query mysql_query("SELECT * FROM members2 WHERE id = '" $_SESSION["logged"] . "'");
        
    $_row mysql_fetch_array($_query);
        
    $friends unserialize($_row["friends"]);
        
    $friends[] = $_GET["accept"];
        
    mysql_query("UPDATE members2 SET friends = '" serialize($friends) . "' WHERE id = '" $_SESSION["logged"] . "'");
        }
        
    mysql_query("DELETE FROM friends1 WHERE sender = '" $_GET["accept"] . "' AND recipient = '" $_SESSION["logged"] . "'");
        }
        
    //END OF ACCEPT FRIEND
        //START OF SHOW FRIEND REQUESTS
        
    $query mysql_query("SELECT * FROM friends1 WHERE recipient = '" $_SESSION["logged"] . "'");
        if(
    mysql_num_rows($query) > 0) {
        while(
    $row mysql_fetch_array($query)) {
        
    $_query mysql_query("SELECT * FROM members2 WHERE id = '" $row["sender"] . "'");
        while(
    $_row mysql_fetch_array($_query)) {
        echo 
    $_row["username"] . " wants to be your friend. <a href=\"" $_SERVER["PHP_SELF"] . "?accept=" $_row["id"] . "\">Accept?</a>";
        }
        }
        }
        
    //END OF SHOW FRIEND REQUESTS
        //START OF MEMBERLIST
        
    echo "<h2>Member List:</h2>";
        
    $query mysql_query("SELECT * FROM members2 WHERE id != '" $_SESSION["logged"] . "'");
        while(
    $row mysql_fetch_array($query)) {
        
    $alreadyFriend false;
        
    $friends unserialize($row["friends"]);
        if(isset(
    $friends[0])) {
        foreach(
    $friends as $friend) {
        if(
    $friend == $_SESSION["logged"]) $alreadyFriend true;
        }
        }
        echo 
    $row["username"];
        
    $_query mysql_query("SELECT * FROM friends1 WHERE sender = '" $_SESSION["logged"] . "' AND recipient = '" $row["id"] . "'");
        if(
    mysql_num_rows($_query) > 0) {
        echo 
    " - Friendship requested.";
        } elseif(
    $alreadyFriend == false) {
        echo 
    " - <a href=\"" $_SERVER["PHP_SELF"] . "?add=" $row["id"] . "\">Add as friend</a>";
        } else {
        echo 
    " - Already friends.";
        }
        echo 
    "";
        }
        
    //END OF MEMBERLIST
        //START OF FRIENDLIST
        
    echo "<h2>Friend List:</h2>";
        
    $query mysql_query("SELECT friends FROM members2 WHERE id = '" $_SESSION["logged"] . "'");
        while(
    $row mysql_fetch_array($query)) {
        
    $friends unserialize($row["friends"]);
        if(isset(
    $friends[0])) {
        foreach(
    $friends as $friend) {
        
    $_query mysql_query("SELECT username FROM members2 WHERE id = '" $friend "'");
        
    $_row mysql_fetch_array($_query);
        echo 
    $_row["username"] . "";
        }
        }
        }
        
    //END OF FRIENDLIST
        
    }
        
    ?>

  14. #43
    New Coder
    Join Date
    Jun 2014
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts
    one screenshot here.
    http://tbf.me/a/BPSwDw

  15. #44
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,389
    Thanks
    13
    Thanked 353 Times in 349 Posts
    well, obviously your first query from the friends list does not contain any results.

    PS. you should indent your code, makes it readable.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  16. #45
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Please use the code/php tags when showing code, it makes it a hell of a lot easier to read..


 
Page 3 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •