Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

jjjacas

New Member
Messages
18
Reaction score
0
Points
0
I have taken a jist of the coding and posted here.

while ($mess = current($post_vars)) {
if ((key($post_vars)!="i") && (key($post_vars)!="your email here") && (key($post_vars)!="your name here")) {

$message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
}
next($post_vars);
}
/***************************************************************/
mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

Now do you see a line like this
/*****************************************/

now that the place which i meant. Now instead of that line
put this statement first.

echo $mess;

Now get the message that is printed on your browser when you execute this script.

Now use this statement and do as i have said for the other statement.
echo current($post_vars);

Get me the message that is being displayed on the screen, so that i can analyse the problem better and come out with a solution.
Ok ok, i went back and read what he posted, i noticed the
PHP:
mail($_REQUEST['recipient'], $subject, "
So i added it, but look at my current code, is it correct so far? I'm sorry I am a bit confused...

Code:
<?
Error_Reporting(E_ALL & ~E_NOTICE);
 while ($request = current($_REQUEST)) {
     if (key($_REQUEST)!='recipient') {
        $pre_array=split ("&777&",  $request);
        $post_vars[key($_REQUEST)][0]=$pre_array[0];
        $post_vars[key($_REQUEST)][1]=$pre_array[1];
    }
    next($_REQUEST);
}
 
reset($post_vars);
$subject="From ".$post_vars['your_name'][0] ; 
$headers = "MIME-Version: 1.0\r\n"; 
$headers.= "Content-Type: text/html;"; 
$headers.= "Charset=iso-8859-1\r\n"; 
$headers.= "From: ".$post_vars['your_email'][0]; 
$message=''; 
while ($mess = current($post_vars))  
{ 
    if ((key($post_vars)!="i") && (key($post_vars)!="your email here") && (key($post_vars)!="your name here"))  
    { 
         $message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";   
    } 
        next($post_vars); 
}
mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>"; 
[u][b]mail("shigerumiyamoto1@yahoo.com", $subject, $message, $headers);[/b][/u] 
echo ("Your message was successfully sent!");  
?>
<script>
    resizeTo(300, 300);
</script>

Compare the QWOTED code that sunil posted with my surrect contact.php code... the BOLD and underlined line is not in the code that sunil posted, but it is still present in my contact.php, what should i do with it?

And then, what do i do next? Testing that code, which code, where exactly? please repeat the specific instructions please, I'm really 0% expereince with php or any coding language... :/ again thanks for understanding.
 
Last edited:

easykey

New Member
Messages
45
Reaction score
0
Points
0
Try the following. This is your original contact.php code from your first post but with your email address instead of what was there originally and the addition of the command to tell us what message is to be sent.

Send an email and copy what was in the contact.php that is displayed.

PHP:
<?
Error_Reporting(E_ALL & ~E_NOTICE);

 while ($request = current($_REQUEST)) {
     if (key($_REQUEST)!='recipient') {
        $pre_array=split ("&777&",  $request);
        $post_vars[key($_REQUEST)][0]=$pre_array[0];
        $post_vars[key($_REQUEST)][1]=$pre_array[1];
    }
    next($_REQUEST);
}



reset($post_vars);


$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
 $headers.='Content-type: text/html; charset=iso-8859-1';
 $message='';
  while ($mess = current($post_vars)) {
      if ((key($post_vars)!="i") && (key($post_vars)!="your email here") && (key($post_vars)!="your name here")) {

         $message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
    }
    next($post_vars);
 }

print_r($mess);

mail("shigerumiyamoto1@yahoo.com", $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>
<br>
  ".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>
<script>
    resizeTo(300, 300);
</script>
 

jjjacas

New Member
Messages
18
Reaction score
0
Points
0
Ok, i replaced my current contact.php with the one you posted and this is what displayed when the e-mail is sent:


Here is what it sent:


Here is the first(top) email:


Here is the second(bottom) email:


Is that the info that you requested? If not, please explain it so i can understand and cooperate better. :)
 

easykey

New Member
Messages
45
Reaction score
0
Points
0
Well that didn't work... It should've displayed the message in a different format before printing "Your message was successfully sent".

Try this instead to see what info comes from the email form - as before just send one email and post the contents of contact.php. You don't need to post the email content since this won't have changed.

PHP:
<?
Error_Reporting(E_ALL & ~E_NOTICE);

print_r($_REQUEST);

 while ($request = current($_REQUEST)) {
     if (key($_REQUEST)!='recipient') {
        $pre_array=split ("&777&",  $request);
        $post_vars[key($_REQUEST)][0]=$pre_array[0];
        $post_vars[key($_REQUEST)][1]=$pre_array[1];
    }
    next($_REQUEST);
}

reset($post_vars);

$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
 $headers.='Content-type: text/html; charset=iso-8859-1';
 $message='';
  while ($mess = current($post_vars)) {
      if ((key($post_vars)!="i") && (key($post_vars)!="your email here") && (key($post_vars)!="your name here")) {

         $message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
    }
    next($post_vars);
 }

mail("shigerumiyamoto1@yahoo.com", $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>
<br>
  ".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>
<script>
    resizeTo(300, 300);
</script>

The characters seem to be some sort of cookie information so I am guessing its coming from the form. Why you would need it I don't know and seems a bit odd to me. If you do the above we might be able to change the code to show only the info you want.
 

sunils

New Member
Messages
2,266
Reaction score
0
Points
0
Can you just post all the field name i meant the name of each text boxes in you contact form ?
 

jjjacas

New Member
Messages
18
Reaction score
0
Points
0
Well that didn't work... It should've displayed the message in a different format before printing "Your message was successfully sent".

Try this instead to see what info comes from the email form - as before just send one email and post the contents of contact.php. You don't need to post the email content since this won't have changed.

PHP:
<?
Error_Reporting(E_ALL & ~E_NOTICE);
 
print_r($_REQUEST);
 
 while ($request = current($_REQUEST)) {
     if (key($_REQUEST)!='recipient') {
        $pre_array=split ("&777&",  $request);
        $post_vars[key($_REQUEST)][0]=$pre_array[0];
        $post_vars[key($_REQUEST)][1]=$pre_array[1];
    }
    next($_REQUEST);
}
 
reset($post_vars);
 
$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
 $headers.='Content-type: text/html; charset=iso-8859-1';
 $message='';
  while ($mess = current($post_vars)) {
      if ((key($post_vars)!="i") && (key($post_vars)!="your email here") && (key($post_vars)!="your name here")) {
 
         $message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
    }
    next($post_vars);
 }
 
mail("shigerumiyamoto1@yahoo.com", $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>
<br>
  ".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
 
?>
<script>
    resizeTo(300, 300);
</script>

The characters seem to be some sort of cookie information so I am guessing its coming from the form. Why you would need it I don't know and seems a bit odd to me. If you do the above we might be able to change the code to show only the info you want.
I copied that exact php you asked and overwrote the old contact.php, i sent an emial and this is what is shows:

Is that what you needed?

Can you just post all the field name i meant the name of each text boxes in you contact form ?
Is this what you need to know?




EDIT: Also when i sent the email, in th contact firm i never recieved any email... for some reason? Is that what that code you told me to use suppoessed to do?
 
Last edited:

sunils

New Member
Messages
2,266
Reaction score
0
Points
0
Is that the name for the fields or is it that you entered to send the email....

Check the source code for that contact form. or please post it here.
 

easykey

New Member
Messages
45
Reaction score
0
Points
0
Try this now.


PHP:
<?
Error_Reporting(E_ALL & ~E_NOTICE);

 while ($request = current($_REQUEST)) {
     if (key($_REQUEST)!='recipient') {
        $pre_array=split ("&777&",  $request);
        $post_vars[key($_REQUEST)][0]=$pre_array[0];
        $post_vars[key($_REQUEST)][1]=$pre_array[1];
    }
    next($_REQUEST);
}



reset($post_vars);


$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
 $headers.='Content-type: text/html; charset=iso-8859-1';

$mess=$_REQUEST['message'];
$message=substr($mess,0,strlen($mess)-5);

mail("shigerumiyamoto1@yahoo.com", $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>
<br>
  ".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>
<script>
    resizeTo(300, 300);
</script>

There's a lot of other info coming from the form which seems unnecessary but just the basic info should be enough for most people!
 

jjjacas

New Member
Messages
18
Reaction score
0
Points
0
Is that the name for the fields or is it that you entered to send the email....

Check the source code for that contact form. or please post it here.
I posted the contact.php many times... if its not in there, then go to the FIRST page on ym FIRST post and check out teh contents (source code) of contact.ASP... maybe that is what you mean?

Try this now.


PHP:
<?
Error_Reporting(E_ALL & ~E_NOTICE);
 
 while ($request = current($_REQUEST)) {
     if (key($_REQUEST)!='recipient') {
        $pre_array=split ("&777&",  $request);
        $post_vars[key($_REQUEST)][0]=$pre_array[0];
        $post_vars[key($_REQUEST)][1]=$pre_array[1];
    }
    next($_REQUEST);
}
 
 
 
reset($post_vars);
 
 
$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
 $headers.='Content-type: text/html; charset=iso-8859-1';
 
$mess=$_REQUEST['message'];
$message=substr($mess,0,strlen($mess)-5);
 
mail("shigerumiyamoto1@yahoo.com", $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>
<br>
  ".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
 
?>
<script>
    resizeTo(300, 300);
</script>

There's a lot of other info coming from the form which seems unnecessary but just the basic info should be enough for most people!
I copied and pasted over my old contact.php and overwrote it with what you posted.

This is what i got:
 
Last edited:

jjjacas

New Member
Messages
18
Reaction score
0
Points
0
Um i didn't get ANY email that time or the last two times i think... nope no emails received... what happened this time?

remember that the contact.php is tied together with the flash site and the contact.asp as well, so changing too much might cause discrepancies..?
 

easykey

New Member
Messages
45
Reaction score
0
Points
0
Strange - I just tested this on my system and it works!!

I used the data I got you to print out using the print_r($_REQUEST) line - put that into an identical copy of your contact.php form (except for changing the email address to mine) and it worked fine. No dodgy characters etc... So the code must be OK.

I did it again using your email address - let me know if it got through.

Note that the mail() function is totally independent of the flash template. The flash template passes some info to the contact.php page which is why I wanted that print of $_REQUEST. This is what comes from the flash template. After that it is just a case of taking what you want and putting it in the mail() function.
 

jjjacas

New Member
Messages
18
Reaction score
0
Points
0
Strange - I just tested this on my system and it works!!

I used the data I got you to print out using the print_r($_REQUEST) line - put that into an identical copy of your contact.php form (except for changing the email address to mine) and it worked fine. No dodgy characters etc... So the code must be OK.

I did it again using your email address - let me know if it got through.

Note that the mail() function is totally independent of the flash template. The flash template passes some info to the contact.php page which is why I wanted that print of $_REQUEST. This is what comes from the flash template. After that it is just a case of taking what you want and putting it in the mail() function.

It got through...! it landed in the spam forlder though... automaticallly... hm.. what iss the code for my contact.php that you used to work? so i can use it and get it to work? Wow, i can't belive it actually workded!

so what was it that was giving that wierd extra jumbled up data...?
 

easykey

New Member
Messages
45
Reaction score
0
Points
0
I used exactly the same code but went through my mail server. So the contact.php that I last posted works... If it doesn't work still then there must be another problem not related to the code - mail server or spam checker etc.

The extra data was deliberately sent by the Flash template - why, I don't know. It might be useful to some people but seems over the top to me.
 

jjjacas

New Member
Messages
18
Reaction score
0
Points
0
I used exactly the same code but went through my mail server. So the contact.php that I last posted works... If it doesn't work still then there must be another problem not related to the code - mail server or spam checker etc.

The extra data was deliberately sent by the Flash template - why, I don't know. It might be useful to some people but seems over the top to me.

Ok, i added and replaced the contact.php code with the one that you last posted on page 3.

And i don't receive any email at all? What happened?

It worked last week, but over the weekend,now it just doesn't seem to send any mail to my email at all...

Is the following information that you posted:
Strange - I just tested this on my system and it works!!

I used the data I got you to print out using the print_r($_REQUEST) line - put that into an identical copy of your contact.php form (except for changing the email address to mine) and it worked fine. No dodgy characters etc... So the code must be OK.
contained withing the last contact.php code that you posted on page 3 that you told me to use?

Please help.
 

jjjacas

New Member
Messages
18
Reaction score
0
Points
0
well now with that last contact.php code you posted(which you told me to use, because it works), i wont receive any emails at all.... here it is...

PHP:
<?
Error_Reporting(E_ALL & ~E_NOTICE);

 while ($request = current($_REQUEST)) {
     if (key($_REQUEST)!='recipient') {
        $pre_array=split ("&777&",  $request);
        $post_vars[key($_REQUEST)][0]=$pre_array[0];
        $post_vars[key($_REQUEST)][1]=$pre_array[1];
    }
    next($_REQUEST);
}



reset($post_vars);


$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
 $headers.='Content-type: text/html; charset=iso-8859-1';

$mess=$_REQUEST['message'];
$message=substr($mess,0,strlen($mess)-5);

mail("admin@myframeshopgallery.com", $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>
<br>
  ".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>
<script>
    resizeTo(300, 300);
</script>
 

easykey

New Member
Messages
45
Reaction score
0
Points
0
This is why I thought it was strange. I tried the exact same code on my mailserver and it worked fine! I'll try again but on my x10hosting website and see if it still works. If it does you should get a mail from my test. I will use adminATmyframeshopgalleryDOTcom and shigerumiyamoto1ATyahooDOTcom to test...
Edit:
.
Done - I got the email to my address so the contact.php page works and my test proves that there are no problems with the x10 mail server.

We know the flash template is passing information to contact.php from the print_r($_REQUEST) command you did before.

So that leaves either a problem with your mail address or there is something else happening when the flash template runs.

I'm not sure what else I can do for you short of hosting your flash template and testing it again then!!
 
Last edited:
Top