Member Avatar for ugogo

Hi I came across your website today and was excited to see how much people help each other here.

I would really appreciate some help. I don't know html that well so use a combination of editors and online sites to try figure it out.

I have made an online form, but it keeps redirecting to my gmail login page instead of the redirect page that I setup in the code.

I am using Linux Ubuntu Operating System and Firefox browser.

The code is:

<form method="post" action="mailto:support@ugogo.info" enctype="text/plain">



  <table border="0" cellpadding="0" width="1121">

    <tr>

      <td width="420" valign="top">

        <p align="center"><font face="Verdana"><b>CONTACT FORM:&nbsp; </b> </font></p>

        <p align="center"><font face="Verdana"><b>Your Name:<br>

        <input type="text" name="T1" size="37" style="font-family: Verdana; color: #FF0000; font-size: 10pt; font-weight: bold"></b></font></p>

        <p align="center"><font face="Verdana"><b>Your Email Address:<br>

        <input type="text" name="T2" size="37" style="font-family: Verdana; font-size: 10pt; color: #FF0000; font-weight: bold"></b></font></p>

        <p align="center"><font face="Verdana"><b>Your Message:</b><br>

        <textarea rows="5" name="S1" cols="36" style="font-family: Verdana; font-size: 10pt; color: #FF0000; font-weight: bold"></textarea></font></td>

      <td width="691" rowspan="2" valign="top"><font face="Verdana"><b>OUR

        CONTACT DETAILS:</b></font>

        <p><font face="Verdana">Tel:</font></p>

        <p><font face="Verdana">Fax:</font></p>

        <p><font face="Verdana">Email:</font></p>

        <p><font face="Verdana">Address:</font></td>

    </tr>

    <tr>

      <td width="420" valign="top">
       <input type="hidden" name="redirect" value="messagesent.htm"> 
       <INPUT NAME="NEXT_URL" TYPE="hidden" VALUE="messagesent.htm">

        <p align="center"><font face="Verdana">
        <input type="submit" value="Submit" name="B3" style="font-family: Verdana; font-size: 10pt; color: #FFFFFF; font-weight: bold; background-color: #FF0000"></font></td>

    </tr>

  </table>

</form>

You can view the online form here:

http://www.cityfin.co.za/contactdev.htm

Thanks very much, any help would be appreciated.

I'll be honest with you, i dont really know where to even start... So i re-wrote your code (dont usually do it, but i HAD to)

Below is 'contactdev.htm'

<style type="text/css">
	
	.container {
		width: 1121px;
		font-family: Verdana;
	}
	
	
	.contact_form {
		width:420px;
		float:left;
	}
	
		.contact_form p {
			text-align: center;
		}
		
		.contact_form input, .contact_form textarea {
			color: #FF0000;
			font-weight: bold;
			font-size: 10pt;
		}
		
		input.submit_button {
			color: #FFF; font-weight: bold; background: #FF0000; margin-top:10px;
		}
		
	.our_details {
		float:left;
		width: 691px;
	}
</style>
<div class="container">
	<div class="contact_form">
			<form method="post" action="processmail.php">
		        <p><b>CONTACT FORM: </b></p>
		
				<p>
				<b>Your Name:</b><br />
		        <input type="text" id="name" name="name" size="37">
				</p>
		
		        <p>
				<b>Your Email Address:</b><br />
		        <input type="text" id="email" name="email" size="37">
				</p>
				
				<p>
		        <b>Your Message:</b><br />
		        <textarea rows="5" id="msg" name="msg" cols="36"></textarea><br/>
				<input type="submit" value="Submit" name="B3" class="submit_button">
				</p>
				

			</form>		
	</div>
	<div class="our_details">
	        <p><b>OUR CONTACT DETAILS:</b></p>
	
	        <p>Tel</p>
	
	        <p>Fax:</p>
	
	        <p>Email:</p>
	
	        <p>Address:</p>		
	</div>
</div>

Here is what we using to process your mail note it is a php file. Name it (processmail.php) for now.

<?php

	// CLIENT INFORMATION
	$name = $_POST['name'];
	$emailaddress= $_POST['email'];
	$message= $_POST['msg'];
	
	// Send email to
	$recemail = 'support@ugogo.info';

$msg = "<html>
			<body>
				<p><strong>Name:</strong> ". $name ." </p>
				<p><strong>Email:</strong> ". $emailaddress ." </p>
				<p><strong>Message:</strong> ". $message ." </p>
			</body>
		</html>";
$subject = "You have an email from your website ";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . $name . "\r\n";

mail($recemail, $subject,$msg,$headers);

//Redirect

$URL="messagesent.htm";

header ("Location: $URL");


 


?>

Make sure they both in the same folder, or just change the form action src. The reason why gmail was popping up, is because mailto, does not process a form, it just launches the users default mail client, I'm guessing yours was Gmail.

Any way, hope this helps

Member Avatar for ugogo

Thanks wow, I'm amazed!!

Really!

I understand exactly what you are saying - and the method you are using is posting the data the user typed in, into the processmail.php file you made.

Wow. I really am impressed.

Well I did it all, and even entered my code for the eye candy part of the it, as you will see if you try type in the form.

Anyway, it gave me this message:

Warning: Cannot modify header information - headers already sent by (output started at /home/cityfinc/public_html/processmail.php:2) in /home/cityfinc/public_html/processmail.php on line 56

But there is no line 56 on the file, I think there is only around 32 files!

You can view the actual files here:

http://www.cityfin.co.za/contactdev2.htm

and

http://www.cityfin.co.za/processmail.php


What did I do wrong, and how can I fix it? Any help would be appreciated.

Thanks!

Try updating processmail.php to

<?php
	// CLIENT INFORMATION
	$name = $_POST['name'];
	$emailaddress= $_POST['email'];
	$message= $_POST['msg'];
	
	// Send email to
	$recemail = 'marcjae@gmail.com';

$msg = "<html>
			<body>
				<p><strong>Name:</strong> ". $name ." </p>
				<p><strong>Email:</strong> ". $emailaddress ." </p>
				<p><strong>Message:</strong> ". $message ." </p>
			</body>
		</html>";
$subject = "You have an email from your website ";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . $name . "\r\n";

mail($recemail, $subject,$msg,$headers);
?>

<?php
//Redirect
$URL="messagesent.htm";
header ("Location: $URL");
?>

Could do the trick. Let me know

Member Avatar for ugogo

Hi there

Thanks again, but I'm still getting an error message instead of the redirect page:

Warning: Cannot modify header information - headers already sent by (output started at /home/cityfinc/public_html/processmail.php:45) in /home/cityfinc/public_html/processmail.php on line 51

Also, I did get the email - but there was no data sent = the data I typed did not appear:

from
to (deleted for privacy reasons)
date Tue, May 11, 2010 at 4:32 PM
subject You have an email from your website

hide details 4:32 PM (2 minutes ago)


Name:

Email:

Message:

Any help would be appreciated.

Thanks!

Lets add the redirect before we post the info

<?php
$URL="http://www.cityfin.co.za/messagesent.htm";
header ("Location: $URL");


	// CLIENT INFORMATION
	$name = $_POST['name'];
	$emailaddress= $_POST['email'];
	$message= $_POST['msg'];
	
	// Send email to
	$recemail = 'support@ugogo.info';

$msg = "<html>
			<body>
				<p><strong>Name:</strong> ". $name ." </p>
				<p><strong>Email:</strong> ". $emailaddress ." </p>
				<p><strong>Message:</strong> ". $message ." </p>
			</body>
		</html>";
$subject = "You have an email from your website ";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . $name . "\r\n";

mail($recemail, $subject,$msg,$headers);

?>

If it still causing problems, please upload a file called "info.php" and add the following code:

<?php

phpinfo();

?>
Member Avatar for ugogo

Thanks. This time, the next page is blank, and the url is the processmail.php file, so it;'s not giving the error message, and its not redirecting either.

I did, however, receive the email with the data I typed.

I uploaded info.php to see if it would change the redirect problem.

But it still did not redirect, just sent to processmail.php. And when it emailed the data, it did not insert the data I typed.

Member Avatar for ugogo

P.S. how do I add to your reputation, sorry, newbie here

Member Avatar for ugogo

pls ingore previous comment, I see how to do the rep thing.

Ok I'm stumped, everything seems to be in order. Lets try using meta tags

<?php
// CLIENT INFORMATION
$name = $_POST['name'];
$emailaddress= $_POST['email'];
$message= $_POST['msg'];	
// Send email to
$recemail = 'support@ugogo.info';
$msg = "<html>
			<body>
				<p><strong>Name:</strong> ". $name ." </p>
				<p><strong>Email:</strong> ". $emailaddress ." </p>
				<p><strong>Message:</strong> ". $message ." </p>
			</body>
		</html>";
$subject = "You have an email from your website ";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . $name . "\r\n";
mail($recemail, $subject,$msg,$headers);
</script>
<META HTTP-EQUIV="Refresh" Content="0; URL=http://www.cityfin.co.za/messagesent.htm"> 
?>

info.php was just so i can see what php you using, you can remove it now.

Member Avatar for ugogo

Thanks - this time it redirect to the next page perfectly.

But I haven't received any email yet with the data. I'll wait about 20 mins in case it is a slow server issue, then report back.

Thanks so much for trying so many times. This is a very friendly place, Daniweb.

Member Avatar for ugogo

I changed the email address to a gmail email address and reuploaded the file, just in case it was the domain server creating the delay. So far still no email, but will check in 20 mins.

Member Avatar for ugogo

The gmail email has arrived, but there is no data. I typed in test10 in the fields, but got this email:

from
to bizfundi@gmail.com
date Thu, May 13, 2010 at 11:34 AM
subject You have an email from your website
mailed-by micra.websitewelcome.com

hide details 11:34 AM (4 minutes ago)


Name:

Email:

Message:

Member Avatar for ugogo

So the next step is to figure out why it is not passing the data into the mail. Any help would be appreciated. Thanks again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.