JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 16th, 2011, 08:44 PM
bigandrewgold bigandrewgold is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 3 bigandrewgold User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 35 sec
Reputation Power: 0
Add a counter to main page

So I need some help with adding a counter to my script.

So i have 2 files,

A index.php(I deleted some stuff for sake of privacy)
PHP Code:
<?php
$number 
0;
echo <<<END
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html> 
<body>
<form action ="send.php" method= "post">
<center> <p>
<label><b><big><big><big><big><big><big><big>SMS Killer</big></big></big></big></big></big></big></b></label>

</p>
        <p>
            <p>
           <label><strong><u>mn</u></label>
            </p>
           <input name = "mn"

           type = "text"

            value = ""/>

        </p>
        
        <p>
            <p>
           <label><strong><u>Amount</u></label>
            </p>
           <input name = "count"

           type = "text"

            value = "1"/>
            </p>
            
            <p>
                <p>
                <label><strong><u>Provider</u></label>
                </p>
    <select name="provider">

           

          </select>
          
        </p>
        
        <p>
        <input name = "Submit" type = "submit"

           value = "Send"></a>
        </p>
       <p>
       <div id="number">
        This has happened <span id="counter">
{$number}</span> times.
       </div>
       </p>
        </center>
</body> </html>


    </style>
</head>
<style type="text/css">
<!--
body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-style: normal;
    line-height: normal;
    color: #FF0000;
    background-color: #000000;
}
.style7 {color: #FF0000}

END;
?>


and send.php

PHP Code:
<?php

$mn 
$_POST['mn'];

$count $_POST['count'];

$provider $_POST['provider'];


for (
$i 0$i $count$i++) {

    
$m rand(10e1610e20);
    
    
$n base_convert($m1036);

    $
$m;

    $
=  $n;

}

?>


So what happens is the user fills in info in the index file then clicks submit, it then takes this info to send.php and completes a loop with it.

What I want to happen is the number variable in
Code:
This has happened <span id="counter">{$number}</span> times.
to add 1 to itself everytime the loop in send.php happens. I have been told that this code
Code:
var ctr=parseInt($('#counter').text())+1;
$('#counter').text(ctr);
could accomplish this by putting it in the loop but i cant figure out how to get it to work.

Any help?

Reply With Quote
  #2  
Old May 17th, 2011, 09:37 PM
bigandrewgold bigandrewgold is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 3 bigandrewgold User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 35 sec
Reputation Power: 0
Come on, someone has to know

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Add a counter to main page

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap