Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I hava a list of data pulled in from a mysql database and displayed using the 'while' statement; which all works great.

When a user clicks on the 'email' link, next to one of the displayed items, a popup form appears, with the idea of emailing/sending the item details to a friend.

Now this all works great, but I can't seem to send the correct items' data to the form when the link is pressed. I'm guessing it could be because it's outside of the php but I don't want multiple instances of the same form being included in the while statement. As it is, there is only one form, I just need to be able to send the items id to it when the email link is pressed.

Any help greatly appreciated, S.

(stripped down code below)

<?php                   
    $query = mysql_query("select * from istable where categoryID = '1'");       
    while ($result = mysql_fetch_array($query)) {               
    echo '<h4>'.$result['title'].'</h4>
    <p>'.substr($result['descrip'],0,408).'... <a href="'.$wwwUrl.'/p/'.$result['categoryID'].'-'.$result['title'].'.php""><strong>Read more</strong></a></p>

    <div class="details">       
        <a href="#" rel="#sheet" class="see"><img src="'.$wwwUrl.'/images/email-icon.gif" width="23" height="23" alt="Email" /> Email</a>
        </div>';        
    } 
?> 

      <div id="sheet" class="rounded">
      <!--{{{ pane1 -->
          <div class="pane" id="pane1">

          <h4>Email Property Details to a Friend</h4>            
          <p>You have selected to forward the details of <?php echo $_GET['title']; ?> to a friend.</p>
          <p>Please fill out the following form</p>

              <form class="rounded" id="email-form" method="post" action="<?php echo $pageLink; ?>"> 
              <!-- form goes in here -->                 
              </form>   
          </div>
          <!--}}}-->                
      </div>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
229 views
Welcome To Ask or Share your Answers For Others

1 Answer

<?php $pageLink; ?>

Should be

<?php echo $pageLink ?>

<?php $_GET['title'] ?> should be <?php echo $_GET['title']; ?>

And everywhere else. You need to echo the value to the output (HTML) :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...