I'm having some issues with some functions within PHP/HTML. I'm generally a VBA guy, so this is a bit odd to me. I'm trying to create a form that a user can fill in, and have the submit button either:
- Send the data to a SQL table to be called later, or
- Send the data to a text or Excel file located on a shared drive or folder
So far, this is the code I've managed to put together. I also have no clue if there is code in there that is completely useless.
<!DOCTYPE html>
<html>
<head>
<style>
.error {
color: #FF0000;
}
</style>
</head>
<body>
<?php function test_input($data) { $data=t rim($data); $data=s tripslashes($data); $data=h tmlspecialchars($data); return $data; } ?>
<align left></align>
Name:</br>
<input type="text" select name="Name" placeholder="Name">
<br>
<br>
<input type="checkbox" name="Alergy" value="Alergy">Alergy
<input type="checkbox" name="Gluten" value="Gluten">Gluten Free</br>
</br>
<text>City</text>
</br>
<Align Center>
<select name="City">
<option value=""></option>
<option value="Arvada">Arvada</option>
<option value="Boulder">Boulder</option>
<option value="Ft. Collins">Ft. Collins</option>
<option value="Greeley">Greeley</option>
<option value="Littleton">Littleton</option>
<option value="Longmont">Longmont</option>
<option value="Loveland">Loveland</option>
<option value="Thornton">Thornton</option>
<option value="Out of State">Out of State</option>
</select>
</br>
<Text>Prefered Meal</Text>
</br>
<Align Center>
<select name="Meal">
<option value=""></option>
<option value="Chicken">Chicken</option>
<option value="Beef">Beef</option>
<option value="Fish">Fish</option>
<option value="vegetarian">vegetarian</option>
</select>
<Align Center>
</br>
<text></text>
</br>
<input type="checkbox" name="RSVP" value="RSVP">RSVP
<br>
</form>
<input type="submit" value="Submit">
</br>
</form>
</Align>
</body>
</html>