Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help with password textarea code
Old 03-04-2010, 01:45 PM Help with password textarea code
Novice Talker

Posts: 5
Name: Shona Holmes
Trades: 0
This is probably a very simple question to answer, but I am not sure if this is the correct code and where i need to put it.
What I want to do is issue my customers with a password that they have to put in the password text area of my survey form.ie. "humptydumpty" If they enter it incorrectly they will not be able to submit the form, and will be informed to retry password. do I need to make textarea3 a variable ie $textarea3 and an if statement if $textarea3 == "humptydumty" submit else echo "please retry password"
If this is action is correct could you let me know how to right the code correctly, cos I still haven't got the hang of the {} () stuff. Thanks.
Part of my HTML code is as follows, and my PHP is below.

<label>Password
<input type="password" name="textfield3" />
</label>
</p>
<p align="center">
<input type="submit" name="Submit" value="Submit" />
</p>
</form>
<p class="style1">&nbsp;</p>

<?php
$Questiona = $_POST['Questiona'] ;
$Questionb = $_POST['Questionb'] ;
$Questionc = $_POST['Questionc'] ;
$Questiond = $_POST['Questiond'] ;
$Questione = $_POST['Questione'] ;
$textfield = $_POST['textfield'] ;
$textfield2 = $_POST['textfield2'] ;
$textfield3 = $_POST['textfield3'] ;
$message = "Questiona: $Questiona.\n Questionb: $Questionb.\n Questionc: $Questionc.\n Questiond: $Questiond.\n Questione: $Questione.\n textfield: $textfield.\n textfield2: $textfield2.\n textfield3: $textfield3";
mail( "shonah@shonah.fslife.co.uk", "Feedback Form Results",
$message, "From: $textfield2" );
header( "Location: http://www.mywebsitename.com/thankyou.php" );
?>
shrek64 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-04-2010, 01:49 PM Re: Help with password textarea code
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
PHP Code:

if ($textfield3 == "humptydumpty") {

$message "Questiona: $Questiona.\n Questionb: $Questionb.\n Questionc: $Questionc.\n Questiond: $Questiond.\n Questione: $Questione.\n textfield: $textfield.\n textfield2: $textfield2.\n textfield3: $textfield3"
mail"shonah@shonah.fslife.co.uk""Feedback Form Results",
$message"From: $textfield2);
header"Location: http://www.mywebsitename.com/thankyou.php" );
}else{
header"Location: http://www.mywebsitename.com/badpassword.php" );

__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 03-05-2010, 05:33 PM Re: Help with password textarea code
Novice Talker

Posts: 5
Name: Shona Holmes
Trades: 0
Thanks Lynxus, this works perfectly. I knew it had to be something very very simple, but I still get confused with the brackets.
shrek64 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with password textarea code
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11737 seconds with 12 queries