Need a very small PHP script.

Discussion in 'Web Programming' started by Angelmax, Sep 15, 2009.

Need a very small PHP script.
  1. Unread #1 - Sep 15, 2009 at 4:41 AM
  2. Angelmax
    Joined:
    Jul 10, 2009
    Posts:
    2,193
    Referrals:
    0
    Sythe Gold:
    0

    Angelmax Grand Master
    $25 USD Donor Retired Sectional Moderator

    Need a very small PHP script.

    Hey.

    I'm really new to web scripting and not very good.

    I'd be very appreciative if someone could make a small script that prints a random 8 digit number when a button is pressed.

    I'd need to be able to put this on an HTML page.

    Could anyone do this? Thanks =D
     
  3. Unread #2 - Sep 16, 2009 at 7:08 AM
  4. DaGreatEvil
    Joined:
    Jan 23, 2008
    Posts:
    74
    Referrals:
    0
    Sythe Gold:
    0

    DaGreatEvil Member
    Banned

    Need a very small PHP script.

    PHP:
    <?php
    echo mt_rand(10000000,99999999);
    ?>
     
  5. Unread #3 - Sep 17, 2009 at 8:14 AM
  6. Matthew
    Joined:
    Nov 12, 2005
    Posts:
    5,153
    Referrals:
    42
    Sythe Gold:
    5,377
    Wait, do you not have an Archer rank? (5) Doge (3) Smashing Why is there BACON in the SOAP!? Literally nothing I saw Matthew Live Free or Die (3) Cool Kid (6) Poképedia Homosex (4)

    Matthew Probably breaking stuff

    Need a very small PHP script.

    Code:
    <html>
    <head>
    	<script type="text/javascript">
    		function genNum()
    		{
    			alert(Math.ceil((Math.random() * 100000001)));
    		}
    	</script>
    </head>
    <body>
    	<input type="button" name="someButton" id="someButton" value="Generate =O" onClick="genNum()" />
    </body>
    </html>
    You could also do it this way using JavaScript if you want... The number can be popped up (using alert like in the example) or you can put it pretty much anywhere on a page using:
    Code:
    document.getElementById('someElement').value/.text/etc
     
< Help please | Attention Flash Designers/javascript designers >

Users viewing this thread
1 guest


 
 
Adblock breaks this site