| | |
Another Q regarding Href
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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.
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.
php Syntax (Toggle Plain Text)
<table width="61%" border="1" align="center" cellpadding="4"> <?php $count = 1; if (isset($_GET['value'])) { $count++; $value[$count] = $_GET['value']; print "<tr><td><big>You clicked: $value[$count]</big></td></tr>"; } $data = 10; for ($i=1; $i<=$data; $i++) { print "<tr><td><a href=\"?value=$i\">Data: $i</a></td></tr>"; } ?> </table>
Last edited by cscgal; Oct 10th, 2008 at 4:19 pm. Reason: Added code tags
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
php Syntax (Toggle Plain Text)
<table width="61%" border="1" align="center" cellpadding="4"> <?php $count = 1; if (isset($_GET['value'])) { $count++; $value[$count] = $_GET['value']; print "<tr><td><big>You clicked: $value[$count]</big></td></tr>"; } $data = 10; for ($i=1; $i<=$data; $i++) { print "<tr><td><a href=\"?value=$i\">Data: $i</a></td></tr>"; } ?> </table> <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.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
![]() |
Similar Threads
- a href and marker problems (HTML and CSS)
- how to call a function in href? (ASP.NET)
- How can i get href="mailto.. to work in a function. (HTML and CSS)
- Load URL / automate A HREF Click (JavaScript / DHTML / AJAX)
- HREF Buttons have the blue border..yuk! (HTML and CSS)
Other Threads in the PHP Forum
- Previous Thread: Multiple SQL Queries in PHP page
- Next Thread: I wanna learn How To use VB to make a keylogger
| Thread Tools | Search this Thread |
.htaccess action ajax apache api array auto beginner binary bounce broken cakephp checkbox class cms code cron curl database date display dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla limit link login loop mail malfunctioning masterthesis menu mlm mod_rewrite multiple mysql nodes oop paypal pdf php popup problem query radio ram random recursion reference regex remote return script search server sessions sms soap source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform xml youtube





