தமிழ் கேள்வி பதில் தளம். தமிழ் கணினி சார்ந்த கேள்விகளை இங்கே கேட்கவும்.

Ask a Tamil Question & Get answers in Tamil. Ask in tamil computer questions and get answers by tamil computer experts online.

1k questions

1.1k answers

35 comments

323 users

தங்களின் தொழில்நுட்பம் மற்றும் ஏனைய கேள்விகளை இங்கே கேட்கவும். TECHதமிழ் வாசகர்கள் மற்றும் பிற வல்லுநர்கள் உங்களுக்கு தீர்வுகளைத் தருவார்கள்.

Categories

இலவச மின்னஞ்சல் சந்தா
+1 vote
வணக்கம் நண்பரே,

         எனது பெயர் கார்த்தி.

form action - ஐ பயன்படுத்தி send  செய்யும்  போது  வரும் பிழைகள் மற்றும் success msg  அனைத்தும் புதிய பக்கத்தில் வருகிறது.  இவைகள் எனக்கு include செய்யப்பட்ட பக்கத்திலேயே  வரவேண்டும்.  அதற்கு எப்படி code செய்ய வேண்டும்.  முடிந்ததால் sample code அனுப்பி உதவவும்.

நன்றி,
in PHP by

Please log in or register to answer this question.

6 Answers

0 votes
How to use ajex with this code with validation
by
0 votes
Step 1:

Your form action field must be empty.

<form action="" method="POST">

Step 2:
Submit பட்டனை கிளிக் செய்யப்பட்டுள்ள நிலையில் மட்டும் , கொடுக்கப்பட்டுள்ள தரவுகளை (data)  செயல்படுத்த வேண்டும்.

<?php
if(isset($_POST['submit']))
{
    echo "Form posted data is here".$_POST['name'];
    if(!empty($_POST['name']))
    echo "Please enter your name";
}
else
{
?>
<form action="" method="POST">
<input type="text" name="name" />
<input type="submit" name="submit" value="submit">
</form>
<?php
}
?>

Step 3:

இப்போது submit பட்டன் கிளிக் செய்யப்பட்டு இருந்தால் முதல் பகுதியில் இருக்கும் code  செயல்படும்.  இல்லையென்றால் (form முதன் முதலில் load ஆகும்போது ) பின் வரும் பகுதி செய்யல்படுதபடும் , அதாவது form டிஸ்ப்ளே ஆகும்.
by வல்லுநர் (12.9k points)
0 votes
thankyou sir it's working.

I am using this code for mail sending purpose.   

If i display validation error  message,  how to go previous page with out losing entered data?

After sending mail i displayed success message,   in that case,  நான் F5
key press செய்தால் திரும்பவும் மெயில் செல்கிறது.  இதை எப்படி தவிர்ப்பது?

மேலும் இந்த message page - ஐ  refresh செய்தால் form டிஸ்ப்ளே செய்ய வைக்க முடியுமா?
by
0 votes
you have to set a flag variable or session variable for this purpose
<?php
session_start();
//first line

if($_SESSION['mailsent']=="no")
if(mail($to, $subject, $message))
$_SESSION['mailsent']=="yes";
else
$_SESSION['mailsent']=="no";

?>
இந்த முறையிலான வழி உங்களுக்கு உதவும் என்று நான் நினைக்கிறன்.
by
0 votes
line 47 : session_start();
line 48 : if($_SESSION['mailsent']=="no") {

it was displayed following errors.
=====================================
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at G:inetpubxyz.comhttpdocsdemoquote.php:16) in G:inetpubxyz.comhttpdocsdemofunctionsquotemail.php on line 47

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at G:inetpubxyz.comhttpdocsdemoquote.php:16) in G:inetpubxyz.comhttpdocsdemofunctionsquotemail.php on line 47

Warning: Cannot modify header information - headers already sent by (output started at G:inetpubxyz.comhttpdocsdemoquote.php:16) in G:inetpubxyz.comhttpdocsdemofunctionsquotemail.php on line 202
===================================
in else part
line 202 : header ('quote.php');    \ for redirect page
by
0 votes
session_start();

function call உங்களது PHP file இன்  முதல் வரியில் எழுதப்பட்டு இருக்க வேண்டும்.

மேலும் விவரங்களுக்கு http://php.net/manual/en/function.session-start.php
by

Related questions

0 votes
0 answers
asked Dec 11, 2014 in PHP by புதியவர் (120 points)
0 votes
0 answers
asked Aug 15, 2014 in PHP by புதியவர் (120 points)
0 votes
0 answers
asked Aug 2, 2014 in PHP by புதியவர் (120 points)
0 votes
0 answers
asked Oct 21, 2013 in PHP by புதியவர் (120 points)
0 votes
0 answers
asked Apr 5, 2013 in PHP by புதியவர் (120 points)
...