Jump to content

Form gives Internal Server error


Jayfromsandiego

Recommended Posts

I am trying to get this form to submit, but it doesn't go anywhere.

I checked the browser console and I see "Failed to load resource: the server responded with a status of 500 (Internal Server Error)". Can someone help me resolve this error?

 

CODE:

<html>
<head>
<title>PICK 5 :: 13 Ticket System (3 of 5 WHEEL)</title>
<style>
.wrap{
text-align:center;
width:900px;
margin: 0 auto;
}

.row{
margin: 18px 0;
}

.input{
border:1px solid #ccc;
width:800px;
float:left;
margin:10px;
}

.output{
width:700px;
margin:0 auto;
text-align:left;
}

.output .str{
}

.output .number{
font-weight:bold;
margin-right:5px;
}

.clear{
clear:both;
}
</style>
</head>
<body bgcolor="#F5F5F5">

<div class="wrap">
<form method="post" action="">

<div class="row"><p><span style="font-weight: bold; color: #0000FF;">PICK 5 :: 13 Ticket System (3 of 5 WHEEL)</span></p>
<p>(Guaranteed <span style="font-weight: bold; color: #0080ff;">3-WIN</span>, if 5 of the numbers drawn are in your set of 15 numbers)</p>
<label>Please enter 15 numbers and separate them with a comma ","<br></label>
<input type="text" name="num" value="<?= isset($_POST['num'])?$_POST['num']:'1,2,3,4,5,6,7,8,9,10,11,12,13,14,15' ?>" />
</div>

<div class="row"><input type="submit" name="submit" value="Go" /> </div><br>

<?php

if(isset($_POST['submit'])){
$num = $_POST['num'];
$num_array = explode(',',$num);
$alpha_array = array('A',  'B',  'C',  'D',  'E',  'F',  'G',  'H',  'I',  'J', 'K', 'L', 'M', 'N', 'O');

$array1 = array();

for($i=0; $i<15; $i++)
{
$array1[$alpha_array[$i]] = trim($num_array[$i]);
}


$array2 = array(

array('A', 'B', 'C', 'L', 'M'), // Start 15# (3if5 Wheel) - 13 Lines
array('A', 'B', 'D', 'H', 'I'), // Where .. (A1, B2, C3, D4, E5, F6, G7, H8, I9, J10, K11, L12, M13, N14, O15)
array('A', 'C', 'G', 'H', 'O'),
array('A', 'E', 'K', 'N', 'O'),
array('A', 'F', 'G', 'J', 'L'), // LINE 5
array('B', 'D', 'F', 'L', 'O'),
array('B', 'E', 'F', 'G', 'I'),
array('B', 'H', 'J', 'K', 'N'),
array('C', 'D', 'E', 'F', 'J'),
array('C', 'I', 'K', 'L', 'N'), // LINE 10
array('D', 'G', 'K', 'M', 'N'),
array('E', 'F', 'H', 'L', 'M'),
array('F', 'I', 'J', 'M', 'O'), // LINE 13


);

$data = "";
foreach($array2 as $arr){
$data1 = "";
foreach($arr as $a){
$data1 .=  $array1[$a] . ', ';
}

$data[] = rtrim($data1,', ');
}
?>

<div class="output">
<?php
foreach($data as $k=>$v){
echo '<span class="number">'.($k+1) . '.</span><span class="str">' . $v . '</span><br>';
}

}

?>
</div>

<div class="clear"></div>

</form>
</div>

</body>
</html>

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.