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
https://forums.phpfreaks.com/topic/43619-string-help/#findComment-211816
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
https://forums.phpfreaks.com/topic/43619-string-help/#findComment-211990
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.