Jump to content

Recommended Posts

Ok so i dont know why this statement isnt working..

<?php
if(!empty($_POST['name'])){
	$insert = mysql_query("INSERT INTO `servicerequested` 
	(serviceName, description) 
	VALUES 
	(
	'".$_POST['name']."',
	'".$_POST['desc']."'
	)")or die(mysql_error());
	}
?>
<form action="" method="post" enctype="text/plain">
<table>
<tr>
<td>Service Name:</td><td><input name="name" value="" type="text" /></td>
</tr>
<tr>
<td>Description:</td><td><textarea name="desc" ></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="Add" /></td>
</tr>
</table>
</form>

Link to comment
https://forums.phpfreaks.com/topic/83867-solved-wtf-easy-but-wtf/
Share on other sites

enctype = content-type [CI]

This attribute specifies the content type used to submit the form to the server (when the value of method is "post"). The default value for this attribute is "application/x-www-form-urlencoded". The value "multipart/form-data" should be used in combination with the INPUT element, type="file".

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.