Another Q regarding Href

Reply

Join Date: Oct 2008
Posts: 5
Reputation: Gonzo10 is an unknown quantity at this point 
Solved Threads: 0
Gonzo10's Avatar
Gonzo10 Gonzo10 is offline Offline
Newbie Poster

Another Q regarding Href

 
0
  #1
Oct 10th, 2008
Hello everyone,
I am trying to put a value into $value['count'];
after the value is clicked the count stays at one or it resets itself any help will be awesome

Thank you.
  1. <table width="61%" border="1" align="center" cellpadding="4">
  2. <?php
  3.  
  4. $count = 1;
  5. if (isset($_GET['value'])) {
  6. $count++;
  7. $value[$count] = $_GET['value'];
  8. print "<tr><td><big>You clicked: $value[$count]</big></td></tr>";
  9. }
  10. $data = 10;
  11. for ($i=1; $i<=$data; $i++) {
  12. print "<tr><td><a href=\"?value=$i\">Data: $i</a></td></tr>";
  13. }
  14. ?>
  15. </table>
Last edited by cscgal; Oct 10th, 2008 at 4:19 pm. Reason: Added code tags
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Another Q regarding Href

 
0
  #2
Oct 10th, 2008
Seems to work fine for me, I modified it a little so you could see the value of $value[$count] at the bottom of the script
  1. <table width="61%" border="1" align="center" cellpadding="4">
  2. <?php
  3.  
  4. $count = 1;
  5. if (isset($_GET['value'])) {
  6. $count++;
  7. $value[$count] = $_GET['value'];
  8. print "<tr><td><big>You clicked: $value[$count]</big></td></tr>";
  9. }
  10. $data = 10;
  11. for ($i=1; $i<=$data; $i++) {
  12. print "<tr><td><a href=\"?value=$i\">Data: $i</a></td></tr>";
  13. }
  14. ?>
  15. </table>
  16. <br />value of $value[$count] = <?php echo $value[$count]; ?>
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 5
Reputation: Gonzo10 is an unknown quantity at this point 
Solved Threads: 0
Gonzo10's Avatar
Gonzo10 Gonzo10 is offline Offline
Newbie Poster

Re: Another Q regarding Href

 
0
  #3
Oct 11th, 2008
Thanks R0bb0b,
I added this at then very end of the code and count doesn't seem to increase, please help thank yo

<br />value $count = <?php echo $count ?>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC