Page 1 of 1

I am new to PHP and need some help

Posted: Wed Oct 18, 2006 9:13 am
by riptheriper
Hi,

I am new to PHP and need some help regarding some issues which I am facing in development of the contact form. Please look at the diagram at http://www.Photo-Host.org/view/392565untitled-1.gif for the exact problem which I am facing. I have tried header() for that issue but it didn’t worked maybe I haven’t used it correctly. I think that could be done by using if and elseif. That’s what I think; I will be grateful to you for any solution about that problem.

Thanks in advance

Posted: Wed Oct 18, 2006 9:28 am
by Obadiah
sup mann, welcome to the boards....post us some code we can definately help you more then...that way we know exactly where the problem lies in your particular application

Posted: Wed Oct 18, 2006 9:43 am
by riptheriper
Hi,

Thanks for reply; I am a designer and making a contact form for my website. That form is now working fine, now I like to forward user to the thank you page, which is within contact.php. I like to know how can I make it, do I have to use if elseif statements or another method. You can found the code at the following link:

http://pastebin.ca/208265

Posted: Wed Oct 18, 2006 10:02 am
by Obadiah
firstly...have you made your thank you page...a bad question but it always helps to ask...secondly ill show you how i did it

Code: Select all

<?php
$next_program = "thankyou.php";
?>
then later i just called the variable...i guess for you i would put it here

Code: Select all

include("cHTTP.php");
        $http = new cHTTP();
                $http->addField ( 'FirstName' , $_POST["FirstName"] );
                $http->addField ( 'LastName' , $_POST["LastName"] );
                $http->addField ( 'Email' , $_POST["Email"] );
                $http->addField ( 'Address' , $_POST["Address"] );
                $http->addField ( 'City' , $_POST["City"] );
                $http->addField ( 'SPC' , $_POST["SPC"] );
                $http->addField ( 'ZPCode' , $_POST["ZPCode"] );
                $http->addField ( 'Country' , $_POST["Country"] );
                $http->addField ( 'Subject' , $_POST["Subject"] );
                $http->addField ( 'Content' , $_POST["Content"] );

header("Location: $next_program");

Posted: Wed Oct 18, 2006 10:05 am
by webdeconstruction
if you are using mail(), just echo your thank you message below mail();
something like this:

Code: Select all

mail( "youremail@somwhere.com", "your email subject",
			$yourmessage, "From: $personsemail" );

echo '<table width="800" align="center">
		  <tr>
			<td><div align="center">Thank You For Your E-mail!! </div></td>
		  </tr>
		</table>';

Posted: Wed Oct 18, 2006 10:13 am
by riptheriper
Thanks guys, I really appreciate that you replied to my post. I am using the single page PHP contact form, which is working all the stuff. I am not using any other page to redirect user, I have to forwarded person within that page. Because I have to set the script to clear all form fields in the first stage “form” from “thank you page” while “data post” will send the data to my email address trough another PHP page. I know it sounds bit complicated but that’s the way I am trying to do it. That email is working over SMTP and HTML mime-based system.