Jump to content

String Help


mike1313

Recommended Posts

Does this help?

 

Send your form --

<form action = "bob_franklin_process.php" method = "post">
<table id = "First_and_Last_name_Table">
<tr>
<td class = "left"><b>first name:</b> </td>
<td class = "right"><input type = "text" name = "first_name" size = "30"  maxlength = "30" /></td>
</tr>
<tr>
<td class = "left"><b>last name:</b> </td>
<td class = "right"><input type = "text" name = "last_name" size = "30"  maxlength = "30" /></td>
</tr>
</table>
</form>

 

to a processor script like this:

 

 

<?php
include_once ("connect2database.php"); // database connection

//query database 
if ($_POST[submit]) {

// php validation 
if ($_POST[first_name] <> "") {
	$a = TRUE;
} else {
	$a = FALSE;
	$content .= "<p>Please click your browser's BACK button and enter your first name.</p>\n";
}
if ($_POST[last_name] <> "") {
	$b = TRUE;
} else {
	$b = FALSE;
	$content .= "<p>Please click your browser's BACK button and enter your last name.</p>\n";
}
}

if($a && $b )
{ //if required fields are true

	// do insert here
			$query = "INSERT INTO table VALUES 
			('0', '$_POST[first_name]', '$_POST[last_name]',
}
?>

Link to comment
Share on other sites

Really it is impossible to do that without knowing something constant.

 

IE: if they will ALWAYS do it like hello Bob Franklin, we can help. But if they can enter in Jack and coke = Bob Franklin, well thats a little tougher. Or even Hello my name is Bob and my last name is Franklin. How do you Do?

 

Can you provide anymore information on the matter?

Link to comment
Share on other sites

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.