I am new to PHP and need some help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
riptheriper
Forum Newbie
Posts: 3
Joined: Wed Oct 18, 2006 9:02 am

I am new to PHP and need some help

Post 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
User avatar
Obadiah
Forum Regular
Posts: 580
Joined: Mon Jul 31, 2006 9:13 am
Location: Ashland, KY
Contact:

Post 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
riptheriper
Forum Newbie
Posts: 3
Joined: Wed Oct 18, 2006 9:02 am

Post 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
User avatar
Obadiah
Forum Regular
Posts: 580
Joined: Mon Jul 31, 2006 9:13 am
Location: Ashland, KY
Contact:

Post 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");
webdeconstruction
Forum Newbie
Posts: 2
Joined: Wed Oct 18, 2006 9:36 am

Post 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>';
riptheriper
Forum Newbie
Posts: 3
Joined: Wed Oct 18, 2006 9:02 am

Post 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.
Post Reply