Jump to content

I will pay someone to help me with PHP! i'm that desperate.


shawnm

Recommended Posts

Hey guys,

 

Well, I've taken everyone's suggestions on how to use sessions and the like and I've had zero success. What I want to be able to do is have customers enter information on three forms on three different pages. On the last page, when they click submit, I want the info from all three pages sent to me in a single email. The info entered is different on each page/each form. I think I've discovered that I'm simply php stupid. If somebody can spell out for me exactly what I have to do (form names, coding, etc.) and I can get it to work I will pay them $25. No joke. I'll transfer if to a paypal account. I have a deadline for this website and am desperate.

 

Thanks.

Shawn

Hey as a noob to php myself i figured you may want to take a look at this page here before going too far.. I have learned a great deal from this page..

http://www.w3schools.com  click the learn php link..

 

Also maybe i can be of some assistance, please post the code you are using so we can see whats happening.

 

 

http://www.kirupa.com/web/php_contact_form.htm

 

This should do what you want

 

Edit: It doesn't seem to check user input, so I'd wait for someone else to post because I don't know anything about regex

Form 1

 

<?php
session_start();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="form2.php">
 <p>Field 1 
   <input type="text" name="field1" id="textfield" />
</p>
 <p>
   <input type="submit" name="button" id="button" value="Submit" />
</p>
</form>
</body>
</html>

 

Form 2

<?php
session_start();
$_SESSION['field1'] = $_POST['field1'];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="form3.php">
 <p>Field 2
   <input type="text" name="field2" id="textfield" />
 </p>
 <p>
   <input type="submit" name="button" id="button" value="Submit" />
 </p>
</form>
</body>
</html>

 

Form 3

<?php
session_start();
$_SESSION['field2'] = $_POST['field2'] 
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="sendMail.php">
 <p>Field 3
   <input type="text" name="field3" id="textfield" />
 </p>
 <p>
   <input type="submit" name="button" id="button" value="Submit" />
 </p>
</form>
</body>
</html>

 

sendMail

<?php
session_start();
$_SESSION['field3'] = $_POST['field3'];
$message = "Field 1: ".$_SESSION['field1']."\n";
$message .= "Field 2: ".$_SESSION['field2']."\n";
$message .= "Field 3: ".$_SESSION['field3']."\n";
mail('youremail', 'test', $message);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
</body>
</html>

 

Hope that helps :)

 

I'm not interested in the money, but simple example:

 

page1.php

<form action="page2.php" method="post">
<p>Name:</p><input type="text" name="name" />
<input type="submit" value="Proceed to next page" />
</form>

 

page2.php

<?php
session_start();
$_SESSION['name'] = $_POST['name'];
?>
<form action="page3.php" method="post">
<p>Age:</p><input type="text" name="age" />
<input type="submit" value="Proceed to next page" />
</form>

 

page3.php

<?php
session_start();
$_SESSION['age'] = $_POST['age'];
?>
<form action="final.php" method="post">
<p>Profession:</p><input type="text" name="pro" />
<input type="submit" value="Send mail" />
</form>

 

final.php

<?php
session_start();
$name = $_SESSION['name'];
$age = $_SESSION['age'];
$pro = $_POST['pro'];
//send mail containing above info, using mail() or whatever you prefer
?>
<p>Mail send successfully!</p>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.