2010-02-04, 06:08 AM
i was trying to make a script to generate a bunch of links
so the $imax value becomes a string even
didn't work
and then it won't echo anything except the $i value
anyone who can spot what i've obviously missed
<?php
if($_POST['gen'] == "gen")
{
$_POST['filename'] = $name;
$_POST['url'] = $url;
$_POST['imax'] = $imax;
$_POST['ext'] = $ext;
$_POST['pre'] = $pre;
$i = 0;
while($i < $imax )
{
if($i > 9 && ($pre == "0" ||$pre == "00"))
{
if($pre == "00" && $i > 99)
{
$pre = "0";
}
else
{
$pre = "";
}
}
echo $url.$pre.$name.$i.$ext;
echo "<br/>";
$i++;
}
}
else
{
print '
<html>
<head>
<title>Generate Links</title>
</head>
<body><form action="gen.php" method="POST" />
<table border="0">
<tr>
<td>Input Name:</td><td style="padding-left: 50px;"><input type="text" name="filename" /></td>
</tr>
<tr>
<td>Input Maximum i:</td><td style="padding-left: 50px;"><input type="text" name="imax" /></td>
</tr>
<tr>
<td>Input Maximum Pre:</td><td style="padding-left: 50px;"><input type="text" name="pre" /></td>
</tr>
<tr>
<td>Input Url:</td><td style="padding-left: 50px;"><input type="text" name="url" size="50" /></td>
</tr>
<tr>
<td>Input Extension:</td><td style="padding-left: 50px;"><input type="text" name="ext" /></td>
</tr>
<tr>
<td colspan="2"></td><td style="padding-left: 50px;"><input type="submit" name="submit" value="Go" /></td>
</tr>
</table>
<input type="hidden" name="gen" value="gen" />
</form>
</body>
</html>
';
}
?>
so the $imax value becomes a string even
<input type="integer" ....
didn't work
and then it won't echo anything except the $i value
anyone who can spot what i've obviously missed