Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tyilo
Forum Newbie
Posts: 3
Joined: Sat Mar 07, 2009 8:02 am

Help

Post by Tyilo »

why isnt this working?

Code: Select all

 
<?php
$a = 1;
echo "<script type='text/javascript'>
document.getElementById('message').innerHTML = 'Sending: " . $a . "/" . $_POST["emails"] . " emails...';
document.getElementById('blue').width = " . floor($a / $_POST["emails"] * 200) . ";
document.getElementById('black').width = " . 200 - floor($a / $_POST["emails"] * 200) . ";
</script>";
?>
 
Tyilo
Forum Newbie
Posts: 3
Joined: Sat Mar 07, 2009 8:02 am

Re: Help

Post by Tyilo »

It is the part above that isnt working and here is the full code:

Code: Select all

<?php
include("http://tyilo.jbusers.com/top.php?title=Email%20spam%20anyone&icon=spam.ico");
?>
<h1>Email spam anyone!*</h1>
<?php
if(!$_POST["to"])
{
echo "<form action='/spam/' method='POST'>
<div class='text'>
<table>
<tr>
<td class='r'>
To:
</td>
<td class='l'>
<input type='text' name='to'>
</td>
</tr>
<tr>
<td class='r'>
Emails to send:
</td>
<td class='l'>
<input type='text' name='emails'>
</td>
</tr>
<tr>
<td class='r'>
From:
</td>
<td class='l'>
<input type='text' name='from'>
</td>
</tr>
<tr>
<td class='r'>
Subject:
</td>
<td class='l'>
<input type='text' name='subject'>
</td>
</tr>
<tr>
<td class='r'>
Body:
</td>
<td class='l'>
<textarea cols='25' rows='10' name='body'></textarea>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type='submit' value='Spam!'>
</td>
</tr>
</table>
<br>
<br>
*Note: i am not taking any responsibility for illegal email-spamming.
</div>
</form>";
include("http://tyilo.jbusers.com/bottom.php");
}
else
{
echo "<h2 id='message'>
Sending: 0/" . $_POST["emails"] . " emails...
<br>
</h2>
<table style='border-width: 1px; border-color: #00ff00'>
<tr>
<td>
<img id='blue' src='blue.png' width='0' height='25'>
<img id='black' src='black.png' width='200' height='25'>
</td>
</tr>
</table>";
include("http://tyilo.jbusers.com/bottom.php");
for($a = 1; $a <= $_POST["emails"]; $a++)
{
mail($_POST["to"], $_POST["subject"], $_POST["body"], "From: " . $_POST["from"]);
echo "<script type='text/javascript'>
document.getElementById('message').innerHTML = 'Sending: " . $a . "/" . $_POST["emails"] . " emails...';
document.getElementById('blue').width = " . floor($a / $_POST["emails"] * 200) . ";
document.getElementById('black').width = " . 200 - floor($a / $_POST["emails"] * 200) . ";
</script>";
}
echo "<script type='text/javascript'>
document.getElementById('message').innerHTML += '<br><a href=\"/spam/\">Back to spamming</a>';
</script>";
}
?>

8O
Tyilo
Forum Newbie
Posts: 3
Joined: Sat Mar 07, 2009 8:02 am

Re: Help

Post by Tyilo »

Fixed it with

Code: Select all

(200 - floor($a / $_POST["emails"] * 200))
/*
instead of
200 - floor($a / $_POST["emails"] * 200)
*/
Post Reply