NameSilo

Can any one tell me what is wrong with this Form

NamecheapNamecheap
Watch

jecn100

Established Member
Impact
0
Hi there

Can any one tell me what is wrong with this form. I only sim to recive the person name and email address and the message they have type in but nothing else in the form shows up.

This is what I am putting into the web site page.

<form method="post" action="advertise.php">
<table border="0" cellpadding="8" cellspacing="8" summary="advertise form">
<input type="text" name="name" size="25" ><br />
<br>
<input type="text" name="email" size="25" ><br />
<br>
<input type="text" name="message/a" size="25" ><br />
<br>
<input type="text" name="message/b" size="25" ><br />
<br>
<input type="text" name="message/c" size="25" ><br />
<td align="center" colspan="2">
<input type="submit" value="Submit Form" />
</form>


This is the php code I am using.

<?
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message/a'] ;
$message = $_REQUEST['message/b'] ;
$message = $_REQUEST['message/c'] ;

mail( "[email protected]", "advertise form",
"$name $message/a $message/b $message/c", "From: $name <$email>" );
header( "Location:http://www.book-scotland-direct.com/advertisecomfirmed.html" );
?>


Thanks for looking

Justin
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
what kind of erros are you getting?


plus try removing the / form the form names and php coding

also change $_REQUEST to $_POST


then try again :)
 
0
•••
I think you need to escape the '/' from the code in the variable names.
 
0
•••
Hi There,

You can use this:

PHP:
<?

$To = "[b][email protected][/b]";

$From = "[b]Whoever You Want Here <[email protected]>[/b]";

$Date = date("d/m/Y");

if (!$Subject) {
        $Subject = "[b]An eMail on $Date from Your Website[/b]";
}

$Body = "On $Date, an enquirey was made at the Your Website\n".
        "The following information was submitted:\n\n";

foreach ( $HTTP_POST_VARS as $key => $value ) {
        if ($key=="Submit") continue;
        $Body .= "$key: $value\n";
}

if (mail($To,$Subject,$Body,"From: $name <$email>")) {
        header("location: [b]your-thank-you-page.htm[/b]");
} else {
        echo("Could not process your order.<br>".
             "Please try again later<br>".
             "We are sorry for any inconvenience");
        exit();
}
?>

Save this as a .php file and set your action in your form to go to this page. It will process the fields you have with their name you give them for example here is an eMail from that code:

On 23/03/2004, an enquirey was made at the Total Host contact page
The following information was submitted:


name: john weare
eMail: edited for client safety
subject: Multiple Domain Hosting
if_other:
message: Wanted to ask two questions. 1.) my client wants to have hisdomain.co.nz and hisDomain.com come to the same web address. Would there be additional charges for this usned the basic $10.00/mo plan 2.) Second question, what would be the domain registration and renewal costs for .co.nz and .com domains.


Cheers,
John Weare
send: Send eMail

Just name your submit button send and your away, it will process unlimited fields in your form, send it to the address specified and then go to the page you configure above when you press submit, I have bolded the main text you will need to change to suit, hope this helps. B-)

Warm Wishes,
 
0
•••
Thanks for that code, it was helpful. ;)
 
0
•••
No probs :D Should I also go put it in the CODE forum, just found it, least I can do to contribute to the community for all the new domain name knowledge :D Lemme know if thats double posting or what not on these boards,

Warm Wishes,
 
Last edited:
0
•••
Appraise.net
Spaceship
Domain Recover
CatchDoms
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back