Loading ...
Sorry, an error occurred while loading the content.

Re: [phpXperts] Creating Dynamic ANCHORS!!!

Expand Messages
  • Raisul Kabir
    Hi Mynul, There is no problem with this code, it should work perfect. Can you please past the code of the total file? Also, I would suggest you please check
    Message 1 of 7 , Jan 31, 2007
    • 0 Attachment
      Hi Mynul,
      There is no problem with this code, it should work perfect. Can you please past the code of the total file? Also, I would suggest you please check the generated output of the php file.

      Thanks.
      Raisul

      On 2/1/07, Mynul Islam <mynul9280@...> wrote:

      Hello everyone,

      I'm developing a system where i'm uploading Profiles of different
      famous persons. Now i need to create ANCOHORS inside the page so that
      i can jump to different sections form the top of the page, all my data
      are coming from the database. My main page is a dynamic page, which
      comes depending on the Profile Id (GjProfId). and inside that page I'm
      trying to call these Anchors. All these are the different parts of
      that profile. lets say- Birth, Childhood, Education, Working Life,
      Achievements, Death these are some section to display. I want to
      display all these as links at the top of the page and make anchors to
      the sections where they are in the page. I hope i could make myself clear!

      The top links are created nicely but when i click them it does not
      navigate to the section in that page. Say, i want to go to "education
      " who's ID is 108, in the address bar I get some location like ::
      http://localhost/gj_new/pagelink.php?GjProfId=5#108 (This page is
      Dynamically generated ofcourse)

      I tried one idea -- I had put the link in the different Titles of
      sections and then put a NAME Anchor by that Title name near the main
      Section. but it is not working. (This matter works in Static pages.)
      here is a sample of my code....

      $sql="SELECT * FROM gjprof WHERE GjProfId='$GjProfId' ORDER BY GProfId
      ASC";
      $resultlnk=mysql_query($sql);
      while($rowlnk=mysql_fetch_array($resultlnk))
      {
      $GProfIdlnk=$rowlnk['GProfId'];
      $GjProfHeadinglnk=$rowlnk['GjProfHeading'];

      <a href="#<? echo $GProfIdlnk ; ?>"><? echo $GjProfHeadinglnk; ?></a>

      Some other stuffs ........... .. .. . . . .. ...... ... ..........and
      then the anchor beside the Main Heading of the Section .......

      <a name="<? echo $GProfIdlnk;?>"></a><? echo $GjProfHeading; ?>

      Will someone please help me with it!!!!

      Thank you.


    • kazi abdullah al mamun
      You can concat as a string. then explode in the name tag. This may work. ... From: Mynul Islam
      Message 2 of 7 , Feb 1, 2007
      • 0 Attachment
        You can concat <? echo $GProfIdlnk ; ?>"><? echo $GjProfHeadinglnk; ?> as a string. then explode in the name tag. This may work.

        ----- Original Message ----
        From: Mynul Islam <mynul9280@...>
        To: phpexperts@yahoogroups.com
        Sent: Wednesday, January 31, 2007 7:39:51 PM
        Subject: [phpXperts] Creating Dynamic ANCHORS!!!

        Hello everyone,

        I'm developing a system where i'm uploading Profiles of different
        famous persons. Now i need to create ANCOHORS inside the page so that
        i can jump to different sections form the top of the page, all my data
        are coming from the database. My main page is a dynamic page, which
        comes depending on the Profile Id (GjProfId). and inside that page I'm
        trying to call these Anchors. All these are the different parts of
        that profile. lets say- Birth, Childhood, Education, Working Life,
        Achievements, Death these are some section to display. I want to
        display all these as links at the top of the page and make anchors to
        the sections where they are in the page. I hope i could make myself clear!

        The top links are created nicely but when i click them it does not
        navigate to the section in that page. Say, i want to go to "education
        " who's ID is 108, in the address bar I get some location like ::
        http://localhost/ gj_new/pagelink. php?GjProfId= 5#108 (This page is
        Dynamically generated ofcourse)

        I tried one idea -- I had put the link in the different Titles of
        sections and then put a NAME Anchor by that Title name near the main
        Section. but it is not working. (This matter works in Static pages.)
        here is a sample of my code....

        $sql="SELECT * FROM gjprof WHERE GjProfId='$GjProfId ' ORDER BY GProfId
        ASC";
        $resultlnk=mysql_ query($sql) ;
        while($rowlnk= mysql_fetch_ array($resultlnk ))
        {
        $GProfIdlnk= $rowlnk[' GProfId'] ;
        $GjProfHeadinglnk= $rowlnk[' GjProfHeading' ];

        <a href="#<? echo $GProfIdlnk ; ?>"><? echo $GjProfHeadinglnk; ?></a>

        Some other stuffs ........... .. .. . . . .. ...... ... ..........and
        then the anchor beside the Main Heading of the Section .......

        <a name="<? echo $GProfIdlnk; ?>"></a>< ? echo $GjProfHeading; ?>

        Will someone please help me with it!!!!

        Thank you.




        Don't be flakey. Get Yahoo! Mail for Mobile and
        always stay connected to friends.
      • Mynul Islam
        There is no Output!!! No ERROR also. all the links are generated properly but when i CLICK them nothing happens!!!!! That is my problem!!! What to do???? ...
        Message 3 of 7 , Feb 1, 2007
        • 0 Attachment
          There is no Output!!! No ERROR also. all the links are generated
          properly but when i CLICK them nothing happens!!!!! That is my
          problem!!! What to do????




          --- In phpexperts@yahoogroups.com, "Raisul Kabir" <raisulk@...> wrote:
          >
          > Hi Mynul,
          > There is no problem with this code, it should work perfect. Can you
          please
          > past the code of the total file? Also, I would suggest you please
          check the
          > generated output of the php file.
          >
          > Thanks.
          > Raisul
          >
          > On 2/1/07, Mynul Islam <mynul9280@...> wrote:
          > >
          > > Hello everyone,
          > >
          > > I'm developing a system where i'm uploading Profiles of different
          > > famous persons. Now i need to create ANCOHORS inside the page so that
          > > i can jump to different sections form the top of the page, all my data
          > > are coming from the database. My main page is a dynamic page, which
          > > comes depending on the Profile Id (GjProfId). and inside that page I'm
          > > trying to call these Anchors. All these are the different parts of
          > > that profile. lets say- Birth, Childhood, Education, Working Life,
          > > Achievements, Death these are some section to display. I want to
          > > display all these as links at the top of the page and make anchors to
          > > the sections where they are in the page. I hope i could make
          myself clear!
          > >
          > > The top links are created nicely but when i click them it does not
          > > navigate to the section in that page. Say, i want to go to "education
          > > " who's ID is 108, in the address bar I get some location like ::
          > > http://localhost/gj_new/pagelink.php?GjProfId=5#108 (This page is
          > > Dynamically generated ofcourse)
          > >
          > > I tried one idea -- I had put the link in the different Titles of
          > > sections and then put a NAME Anchor by that Title name near the main
          > > Section. but it is not working. (This matter works in Static pages.)
          > > here is a sample of my code....
          > >
          > > $sql="SELECT * FROM gjprof WHERE GjProfId='$GjProfId' ORDER BY GProfId
          > > ASC";
          > > $resultlnk=mysql_query($sql);
          > > while($rowlnk=mysql_fetch_array($resultlnk))
          > > {
          > > $GProfIdlnk=$rowlnk['GProfId'];
          > > $GjProfHeadinglnk=$rowlnk['GjProfHeading'];
          > >
          > > <a href="#<? echo $GProfIdlnk ; ?>"><? echo $GjProfHeadinglnk; ?></a>
          > >
          > > Some other stuffs ........... .. .. . . . .. ...... ... ..........and
          > > then the anchor beside the Main Heading of the Section .......
          > >
          > > <a name="<? echo $GProfIdlnk;?>"></a><? echo $GjProfHeading; ?>
          > >
          > > Will someone please help me with it!!!!
          > >
          > > Thank you.
          > >
        • Mynul Islam
          Does not WORK....tried already! Anything else...???? ... ? as a string. then explode in the name tag. This may work. ... clear! ...
          Message 4 of 7 , Feb 1, 2007
          • 0 Attachment
            Does not WORK....tried already! Anything else...????




            --- In phpexperts@yahoogroups.com, kazi abdullah al mamun
            <sumon029@...> wrote:
            >
            > You can concat <? echo $GProfIdlnk ; ?>"><? echo $GjProfHeadinglnk;
            ?> as a string. then explode in the name tag. This may work.
            >
            > ----- Original Message ----
            > From: Mynul Islam <mynul9280@...>
            > To: phpexperts@yahoogroups.com
            > Sent: Wednesday, January 31, 2007 7:39:51 PM
            > Subject: [phpXperts] Creating Dynamic ANCHORS!!!
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            > Hello everyone,
            >
            >
            >
            > I'm developing a system where i'm uploading Profiles of different
            >
            > famous persons. Now i need to create ANCOHORS inside the page so that
            >
            > i can jump to different sections form the top of the page, all my data
            >
            > are coming from the database. My main page is a dynamic page, which
            >
            > comes depending on the Profile Id (GjProfId). and inside that page I'm
            >
            > trying to call these Anchors. All these are the different parts of
            >
            > that profile. lets say- Birth, Childhood, Education, Working Life,
            >
            > Achievements, Death these are some section to display. I want to
            >
            > display all these as links at the top of the page and make anchors to
            >
            > the sections where they are in the page. I hope i could make myself
            clear!
            >
            >
            >
            > The top links are created nicely but when i click them it does not
            >
            > navigate to the section in that page. Say, i want to go to "education
            >
            > " who's ID is 108, in the address bar I get some location like ::
            >
            > http://localhost/ gj_new/pagelink. php?GjProfId= 5#108 (This page is
            >
            > Dynamically generated ofcourse)
            >
            >
            >
            > I tried one idea -- I had put the link in the different Titles of
            >
            > sections and then put a NAME Anchor by that Title name near the main
            >
            > Section. but it is not working. (This matter works in Static pages.)
            >
            > here is a sample of my code....
            >
            >
            >
            > $sql="SELECT * FROM gjprof WHERE GjProfId='$GjProfId ' ORDER BY GProfId
            >
            > ASC";
            >
            > $resultlnk=mysql_ query($sql) ;
            >
            > while($rowlnk= mysql_fetch_ array($resultlnk ))
            >
            > {
            >
            > $GProfIdlnk= $rowlnk[' GProfId'] ;
            >
            > $GjProfHeadinglnk= $rowlnk[' GjProfHeading' ];
            >
            >
            >
            > <a href="#<? echo $GProfIdlnk ; ?>"><? echo $GjProfHeadinglnk; ?></a>
            >
            >
            >
            > Some other stuffs ........... .. .. . . . .. ...... ... ..........and
            >
            > then the anchor beside the Main Heading of the Section .......
            >
            >
            >
            > <a name="<? echo $GProfIdlnk; ?>"></a>< ? echo $GjProfHeading; ?>
            >
            >
            >
            > Will someone please help me with it!!!!
            >
            >
            >
            > Thank you.
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            > <!--
            >
            > #ygrp-mlmsg
            {font-size:13px;font-family:arial,helvetica,clean,sans-serif;}
            > #ygrp-mlmsg table {font-size:inherit;font:100%;}
            > #ygrp-mlmsg select, input, textarea {font:99%
            arial,helvetica,clean,sans-serif;}
            > #ygrp-mlmsg pre, code {font:115% monospace;}
            > #ygrp-mlmsg * {line-height:1.22em;}
            > #ygrp-text{
            > font-family:Georgia;
            > }
            > #ygrp-text p{
            > margin:0 0 1em 0;
            > }
            > #ygrp-tpmsgs{
            > font-family:Arial;
            > clear:both;
            > }
            > #ygrp-vitnav{
            > padding-top:10px;
            > font-family:Verdana;
            > font-size:77%;
            > margin:0;
            > }
            > #ygrp-vitnav a{
            > padding:0 1px;
            > }
            > #ygrp-actbar{
            > clear:both;
            > margin:25px 0;
            > white-space:nowrap;
            > color:#666;
            > text-align:right;
            > }
            > #ygrp-actbar .left{
            > float:left;
            > white-space:nowrap;
            > }
            > .bld{font-weight:bold;}
            > #ygrp-grft{
            > font-family:Verdana;
            > font-size:77%;
            > padding:15px 0;
            > }
            > #ygrp-ft{
            > font-family:verdana;
            > font-size:77%;
            > border-top:1px solid #666;
            > padding:5px 0;
            > }
            > #ygrp-mlmsg #logo{
            > padding-bottom:10px;
            > }
            >
            > #ygrp-vital{
            > background-color:#e0ecee;
            > margin-bottom:20px;
            > padding:2px 0 8px 8px;
            > }
            > #ygrp-vital #vithd{
            > font-size:77%;
            > font-family:Verdana;
            > font-weight:bold;
            > color:#333;
            > text-transform:uppercase;
            > }
            > #ygrp-vital ul{
            > padding:0;
            > margin:2px 0;
            > }
            > #ygrp-vital ul li{
            > list-style-type:none;
            > clear:both;
            > border:1px solid #e0ecee;
            > }
            > #ygrp-vital ul li .ct{
            > font-weight:bold;
            > color:#ff7900;
            > float:right;
            > width:2em;
            > text-align:right;
            > padding-right:.5em;
            > }
            > #ygrp-vital ul li .cat{
            > font-weight:bold;
            > }
            > #ygrp-vital a {
            > text-decoration:none;
            > }
            >
            > #ygrp-vital a:hover{
            > text-decoration:underline;
            > }
            >
            > #ygrp-sponsor #hd{
            > color:#999;
            > font-size:77%;
            > }
            > #ygrp-sponsor #ov{
            > padding:6px 13px;
            > background-color:#e0ecee;
            > margin-bottom:20px;
            > }
            > #ygrp-sponsor #ov ul{
            > padding:0 0 0 8px;
            > margin:0;
            > }
            > #ygrp-sponsor #ov li{
            > list-style-type:square;
            > padding:6px 0;
            > font-size:77%;
            > }
            > #ygrp-sponsor #ov li a{
            > text-decoration:none;
            > font-size:130%;
            > }
            > #ygrp-sponsor #nc {
            > background-color:#eee;
            > margin-bottom:20px;
            > padding:0 8px;
            > }
            > #ygrp-sponsor .ad{
            > padding:8px 0;
            > }
            > #ygrp-sponsor .ad #hd1{
            > font-family:Arial;
            > font-weight:bold;
            > color:#628c2a;
            > font-size:100%;
            > line-height:122%;
            > }
            > #ygrp-sponsor .ad a{
            > text-decoration:none;
            > }
            > #ygrp-sponsor .ad a:hover{
            > text-decoration:underline;
            > }
            > #ygrp-sponsor .ad p{
            > margin:0;
            > }
            > o {font-size:0;}
            > .MsoNormal {
            > margin:0 0 0 0;
            > }
            > #ygrp-text tt{
            > font-size:120%;
            > }
            > blockquote{margin:0 0 0 4px;}
            > .replbq {margin:4;}
            > -->
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            ____________________________________________________________________________________
            > Never Miss an Email
            > Stay connected with Yahoo! Mail on your mobile. Get started!
            > http://mobile.yahoo.com/services?promote=mail
            >
          • Elie Zedeck RANDRIAMIANDRIRAY
            Hi Mynul, I m not going to really help you, but just provide you some tips, that will save from having this types of problem. See this code below, and please
            Message 5 of 7 , Feb 1, 2007
            • 0 Attachment
              Hi Mynul,

              I'm not going to really help you, but just provide you some tips, that will save from having this types of problem.
              See this code below, and please read what I think would help you in some way:

              <?php
              
              /**
               * I don't really understand your explanation, but there are stuffs that I think
               * you could fix, and start practicing.
               * 
               * First of all, try to make your codes more clearer, by using spaces, tabs and
               * other techniques. Use Editors such as Eclipse (use plugin PHPEclipse), or
               * third-party softwares to format your code.
               * 
               * Secondly, try to follow the conventions that most people use. Try also to
               * adhere to the Program's recommendations.
               * 
               * Third, try to spend enough time to Organize and Visually desing the flows of
               * your program. I usually do this when comes to hard projects, but for piece of
               * cake projects, just start coding from your head.
               * 
               * By following these, you will be able to avoid many headache. And yes, that's
               * TRUE I tell you ! It's some of my experiences.
               */
              
              // Make sure that Error is being display when you develop your application
              ini_set('display_errors', 'On');
              
              $sql = "SELECT * FROM `gjprof` WHERE `gjprof`.GjProfId = '$GjProfId' ORDER BY `GProfId` ASC";
              $resultlnk = mysql_query($sql);
              while ($rowlnk = mysql_fetch_array($resultlnk)) {
              	// I'm sure that's not all the variables that are needed, since there are
              	// more here !
              	$GProfIdlnk = $rowlnk['GProfId'];
              	$GjProfHeadinglnk = $rowlnk['GjProfHeading'];
              
              	// Try not embed it, and see what it's got to show
              	// For codes that usually switches from Embedded HTML and PHP codes, try to
              	// only put them with PHP codings, not Embedded.
              	echo '<a href="#' . $GProfIdlnk . '">' . $GjProfHeadinglnk . '</a>';
              }
              ?>

              Hope that will enhance your work.
              Elie Zedeck.

              Mynul Islam wrote:
              Hello everyone,
              
              I'm developing a system where i'm uploading Profiles of different
              famous persons. Now i need to create ANCOHORS inside the page so that
              i can jump to different sections form the top of the page, all my data
              are coming from the database. My main page is a dynamic page, which
              comes depending on the Profile Id (GjProfId). and inside that page I'm
              trying to call these Anchors. All these are the different parts of
              that profile. lets say- Birth, Childhood, Education, Working Life,
              Achievements, Death these are some section to display. I want to
              display all these as links at the top of the page and make anchors to
              the sections where they are in the page. I hope i could make myself clear!
              
              The top links are created nicely but when i click them it does not
              navigate to the section in that page. Say, i want to go to "education
              " who's ID is 108, in the address bar I get some location like ::
              http://localhost/gj_new/pagelink.php?GjProfId=5#108 (This page is
              Dynamically generated ofcourse)
              
              I tried one idea -- I had put the link in the different Titles of
              sections and then put a NAME Anchor by that Title name near the main
              Section. but it is not working. (This matter works in Static pages.)
              here is a sample of my code....
              
              $sql="SELECT * FROM gjprof WHERE GjProfId='$GjProfId' ORDER BY GProfId
              ASC";
              $resultlnk=mysql_query($sql);
              while($rowlnk=mysql_fetch_array($resultlnk))
              {
              $GProfIdlnk=$rowlnk['GProfId'];
              $GjProfHeadinglnk=$rowlnk['GjProfHeading'];
              
              <a href="#<? echo $GProfIdlnk ; ?>"><? echo $GjProfHeadinglnk; ?></a>
              
              Some other stuffs ........... .. .. . . . .. ...... ... ..........and
              then the anchor beside the Main Heading of the Section .......
              
              <a name="<? echo $GProfIdlnk;?>"></a><? echo $GjProfHeading; ?>
              
              
              Will someone please help me with it!!!!
              
              Thank you.
              
              
              
              Visit phpXperts website at www.phpxperts.com 
              Yahoo! Groups Links
              
              <*> To visit your group on the web, go to:
                  http://groups.yahoo.com/group/phpexperts/
              
              <*> Your email settings:
                  Individual Email | Traditional
              
              <*> To change settings online go to:
                  http://groups.yahoo.com/group/phpexperts/join
                  (Yahoo! ID required)
              
              <*> To change settings via email:
                  mailto:phpexperts-digest@yahoogroups.com 
                  mailto:phpexperts-fullfeatured@yahoogroups.com
              
              <*> To unsubscribe from this group, send an email to:
                  phpexperts-unsubscribe@yahoogroups.com
              
              <*> Your use of Yahoo! Groups is subject to:
                  http://docs.yahoo.com/info/terms/
               
              
              
                
            • Mynul Islam
              Thanks for your suggestions!!!!
              Message 6 of 7 , Feb 2, 2007
              • 0 Attachment
                Thanks for your suggestions!!!!
              Your message has been successfully submitted and would be delivered to recipients shortly.