hello again,
Having a prob with a form. Here is the error that I am getting:
Notice: Undefined index: submit in c:\program files\blah blah blah\rpgname.php on line 3
Here is the code:
<h2>Roleplaying Name Generator</h2>
<?php
$submit = $_POST['submit'];
if($submit){
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$mothersmaiden = $_POST['mothersmaiden'];
$citybornin = $_POST['citybornin'];
$firstpart1 = substr($lastname, 0, 3);
$firstpart2 = strtolower(substr($firstname, 0, 2));
$lastpart1 = substr($mothersmaiden, 0, 2);
$lastpart2 = strtolower(substr($citybornin, 0, 3));
$swfirstname = $firstpart1.$firstpart2;
$swlastname = $lastpart1.$lastpart2;
print("Your roleplaying name is:<p>");
print("$swfirstname $swlastname");
} else {
?>
Enter your information below and get your roleplaying name.<p>
<form action="rpgname.php" method="post">
<input type="hidden" name="submit" value="submit">
<table>
<tr>
<td>Your First Name</td>
<td><input type="text" name="firstname"></td>
</tr>
<tr>
<td>Your Last name</td>
<td><input type="text" name="lastname"></td>
</tr>
<tr>
<td>Your Mother's Maiden Name</td>
<td><input type="text" name="mothersmaiden"></td>
</tr>
<tr>
<td>The name of the city in which you were born</td>
<td><input type="text" name="citybornin"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Generate Your Name">
</table>
</form>
<?
}
?>
I think it has something to do with my phpini setting. If this is the case, which one would it be and what should the setting be?
Thanks a mil,
Todd