/    Sign up×
Community /Pin to ProfileBookmark

Form Problem – Please Help

Hi to all!

I have the followings:

HTML FORM CODE:
<form name=”cnbform” action=cnbform.php method=post>
<table width=”375″ border=”0″ cellpadding=”0″ cellspacing=”0″ summary=””>
<tr>
<td class=”formtxttd style3 style1 small”><strong>Full name:</strong></td>
<td width=”241″><INPUT size=30 name=fullname value=”Enter your name here” onclick=”document.cnbform.fullname.value=”;”></td>
</tr>
<tr>
<td class=”formtxttd style3 style1 small”><strong>Company:</strong></td>
<td><INPUT size=30 name=company value=”Enter your company name here” onclick=”document.cnbform.company.value=”;”></td>
</tr>
<tr>
<td class=”formtxttd style3 style1 small”><strong>Your email:</strong></td>
<td><INPUT size=30 name=youremail value=”Enter your email address here” onclick=”document.cnbform.youremail.value=”;”></td>
</tr>
<tr>
<td class=”formtxttd style3 style1 small”><strong>Contact number:</strong></td>
<td><INPUT size=30 name=contactnumber value=”Enter your contact number here” onclick=”document.cnbform.contactnumber.value=”;”></td>
</tr>
<tr>
<td class=”formtxttd style3 style1 small”><strong>Subject:</strong></td>
<td><INPUT size=30 name=subject value=”Enter the subject here” onclick=”document.cnbform.subject.value=”;”></td>
</tr>
<tr>
<td colspan=”2″ class=”formtxttd style3 style1 small”><strong>Your message:</strong></td>
</tr>
<tr>
<td colspan=”2″><textarea style=”WIDTH:369px;HEIGHT:150px;overflow:hidden” name=yourmessage rows=8 cols=30></textarea></td>
</tr>
<tr>
<td colspan=”2″ class=”formtxttd style3 style1 small”><a href=”javascript:submitform()”>send</a> | <a href=”javascript:resetform()”>reset</a></td>
</tr>
</table> </form>

######################################
cnbform.php code:
<?
$message=

Name: “.$fullname.”
Company: “.$company.”
eMail: “.$youremail.”
Contact number: “.contactnumber.”
Subject: “.$subject.”
Message: “.$yourmessage.”
“;

$message = stripslashes($message);
mail(“[email protected]“,”Subject: “.$subject.””,$message,”From: “.$youremail.””);
header( “Location: http://www.catapultnewbusiness.com/formsnt.php” );
?>

################
On my domain is working fine… but on my client’s domain I get these errors:
Notice: Undefined variable: fullname in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 4

Notice: Undefined variable: company in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 5

Notice: Undefined variable: youremail in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 6

Notice: Use of undefined constant contactnumber – assumed ‘contactnumber’ in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 7

Notice: Undefined variable: subject in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 8

Notice: Undefined variable: yourmessage in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 9

Notice: Undefined variable: subject in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 13

Notice: Undefined variable: youremail in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 13

Warning: Cannot modify header information – headers already sent by (output started at C:inetpubcatapultnewbusiness.comwwwrootcnbform.php:4) in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 14

Please help me ? ? ?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@chazzyJan 23.2006 — you need to get the variable's values of the post array. So if you want to get the form field named "message" you could do $message = $_POST['message']; (you use post because your form's action is post.)
Copy linkTweet thisAlerts:
@bokehJan 23.2006 — [B]Off topic:[/B] Why not use CSS instead of a table for your form layout? It would render quicker especially in IE which seems to be really slow rendering them.
Copy linkTweet thisAlerts:
@alexmosauthorJan 24.2006 — What about "header" warning?

Warning: Cannot modify header information - headers already sent by (output started at C:inetpubcatapultnewbusiness.comwwwrootcnbform.php:4) in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 14
Copy linkTweet thisAlerts:
@che_rishJan 24.2006 — What about "header" warning?

Warning: Cannot modify header information - headers already sent by (output started at C:inetpubcatapultnewbusiness.comwwwrootcnbform.php:4) in C:inetpubcatapultnewbusiness.comwwwrootcnbform.php on line 14[/QUOTE]

Hello. Try adding exit(); right after the header() function. ?
Copy linkTweet thisAlerts:
@NogDogJan 24.2006 — You get the header error message when something in your page sends output to the browser before the header() function is executed. This output can include any spaces or newlines before the opening <?php tag.
Copy linkTweet thisAlerts:
@bokehJan 24.2006 — The header error is not an error at all. If you sort out the other errors the header error will go away by itself. The header error "output started" is being raised by the preceeding error messages being sent.
×

Success!

Help @alexmos spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...