| View previous topic :: View next topic |
| Author |
Message |
Fed Site Admin

Joined: 12 Aug 2005 Posts: 176
|
Posted: Mon Jan 09, 2006 11:59 am Post subject: |
|
|
try this way ( I am not sure of the php syntax as I wrote it right now ) | Code: |
<?PHP
$to = "you@xyz.com";
$subject = "Order";
$headers = "Order";
$forward = 0;
$location = "";
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Message Date: $date Time: $time.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
foreach ($_POST as $key => $value)
{
if (empty($value))
{
if ($value!=0)
{
echo "Please go back and fill all the required fields.";
Die();
}
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
}
else
{
foreach ($_GET as $key => $value)
{
if (empty($value))
{
if ($value!=0)
{
echo "Please go back and fill all the required fields.";
Die();
}
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for your order!";
}
?> |
I am absolutely not sure it works....also if the syntax was correct [/code] |
|
| Back to top |
|
 |
pappszaby
Joined: 21 Nov 2005 Posts: 30
|
Posted: Mon Jan 09, 2006 12:10 pm Post subject: |
|
|
This way is working only if the entered value is 0
If you write anything else than 0 it goes trough I mean the mail has been procesed but the mail is empty only were you have entered 0 is being sent to the email address provided. |
|
| Back to top |
|
 |
Fed Site Admin

Joined: 12 Aug 2005 Posts: 176
|
Posted: Mon Jan 09, 2006 12:59 pm Post subject: |
|
|
LOL you're right
you might try with the previous php code and altering this:
| Code: |
<script type="text/javascript">
function boxChecked(form)
{
if(!document.myform.C1.checked)
{
alert("Please check the checkbox and smile ;)");
return false;
}
counter.value = OK;
return true;
}
</script> |
this is a bit lamer solution but it's the first thing that came into my mind  |
|
| Back to top |
|
 |
pappszaby
Joined: 21 Nov 2005 Posts: 30
|
Posted: Mon Jan 09, 2006 1:19 pm Post subject: |
|
|
still not succes!
Can we stop the counter at "1"?
 |
|
| Back to top |
|
 |
Fed Site Admin

Joined: 12 Aug 2005 Posts: 176
|
Posted: Mon Jan 09, 2006 1:27 pm Post subject: |
|
|
uhm, why not
try if this work
| Code: |
<script language="Javascript" type="text/javascript">
function countAreaChars(areaName,counter,limit)
{
if (areaName.value.length>limit)
areaName.value=areaName.value.substring(0,limit);
else
if($counter!=1)
{
counter.value = limit - areaName.value.length;
}
}
</script>
|
|
|
| Back to top |
|
 |
pappszaby
Joined: 21 Nov 2005 Posts: 30
|
Posted: Mon Jan 09, 2006 1:37 pm Post subject: |
|
|
I'we got an error!
Is not working |
|
| Back to top |
|
 |
Fed Site Admin

Joined: 12 Aug 2005 Posts: 176
|
Posted: Mon Jan 09, 2006 1:39 pm Post subject: |
|
|
lol....I used a php variable into the javascript code
| Code: |
<script language="Javascript" type="text/javascript">
function countAreaChars(areaName,counter,limit)
{
if (areaName.value.length>limit)
areaName.value=areaName.value.substring(0,limit);
else
if(counter.value!=1)
{
counter.value = limit - areaName.value.length;
}
}
</script>
|
|
|
| Back to top |
|
 |
pappszaby
Joined: 21 Nov 2005 Posts: 30
|
Posted: Mon Jan 09, 2006 1:48 pm Post subject: |
|
|
| NOw I donT get an error but still goes under 1 so I get a 0 |
|
| Back to top |
|
 |
pappszaby
Joined: 21 Nov 2005 Posts: 30
|
Posted: Mon Jan 09, 2006 1:58 pm Post subject: |
|
|
Sorry for the false alarm is working it stops at 1
 |
|
| Back to top |
|
 |
|