Log in

View Full Version : Need Help With Contact Flash Form



Ronni
11-01-2007, 10:29 PM
:confused: can any one telle me whats wrong with my script? :confused: The flash contact form can be found on my website ...http://tistrup-poker-klub.dk/pokerclub.swf
under the KONTAKT link

this is the script for the "send Button"
on (rollOver)
{
this.gotoAndPlay("s1");
}
on (rollOut)
{
this.gotoAndPlay("s2");
}
on (release)
{
_parent.getURL("contact.php","_blank","GET");
_parent.name = "Navn:";
_parent.email = "E_mail:";
_parent.phone = "Telefon:";
_parent.message = "Besked:";
}

And this is for the "Clear button"
on (rollOver)
{
this.gotoAndPlay("s1");
}
on (rollOut)
{
this.gotoAndPlay("s2");
}
on (release)
{
_parent.name = "Navn:";
_parent.email = "E-mail:";
_parent.phone = "Telefon:";
_parent.message = "besked:";
}

AND THIS IS THE main "contact.php" script
<?php

$Navn = $_GET['name'];
$E-mail = $_GET['email'];
$Telefon = $_GET['phone'];
$Besked = $_GET['message'];

$recipient_email = "info@tistrup-poker-klub.dk";

$subject = "from" . $E-mail;
$headers = "From" . $Navn; . "<" . $E-mail . ">\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1';

$content = "<html><head><title>Contact letter</title></head><body><br>";
$content .= "name: <b>" . $Navn . "</b><br>";
$content .= "email: <b>" . $E-mail . "</b><br>";
$content .= "Phone: <b>" . $Telefon . "</b><br><hr><br>";
$content .= "message: <b>" . $Besked;
$content .= "<br></body></html>";

mail($recipient_email,$subject,$content,$headers);
?>
<html>
<body bgcolor="#282E2C">
<div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">
Your message was sent. Thank you.
</div>
</body>
</html>
<script>resizeTo(300, 300)</script>

You can test it on my website http://tistrup-poker-klub.dk/pokerclub.swf
on the (KONTAKT) link

When i push the send button, all it dos is is opning HTTP 500 server fault

HELP PLEASE i have been trying to figur out what is wrong for 3 days now :eek:

regards Ronni

Ronni
11-02-2007, 02:13 AM
BTW :eek: i have found out that the server my website is running on...runs PHP in safe mode.. so now i complety lost..:confused:

Heres the URL for the servers PHP configuretion...http://one-docs.com/php5/

keeping my fingers crossed and hoping for theres any help to get out there Folks:rolleyes:

BLiZZaRD
11-02-2007, 02:22 AM
Your Flash looks fine. The php may be wrong, although I am not the one to ask about that. I will message Twey to have a gander.

And you really need to put the Flash in an html or php file and not directly link to the swf. There are parameters in the HTML that you need to display the swf properly.

Twey
11-02-2007, 02:42 AM
Since - is an operator in PHP, $E-mail is not a valid identifier. Also, the convention for variable names is that they should be all lower-case, with multiple words separated by underscores.

BLiZZaRD
11-02-2007, 02:44 AM
Thanks for checking Twey :D

Ronni
11-02-2007, 10:25 AM
Hey thx guy for looking into to my problem.

First of all, (not to be cocky or something):D Twey, but i mean all my variablenames is lowere cases names and no multiple names eighter...eg. name,email, phone & message. :rolleyes:

And to you Blizzard i have of cuz made a readymade html witch have the *.pokerclub.sfw file implented in it. This was only to testing purpos i up loaded it in SWF only...:p

So all theres left to do as far i can see is that the indintifier $Navn, $E-mail, $Telefon and $Besked that it is wrong, but im sure i have seen some scripts witch the indintifier was with an $E-mail as the identifier.
But i try looking into this when i come homme from work today

Anyway thx alot for all the help guys, as i can see u two guy sare doing a super duper job at helping guys like me, at this forum. thxthxthx
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Twey
11-02-2007, 10:35 AM
all my variablenames is lowere cases namesNo they aren't. They start with a capital letter ($Telefon rather than $telefon). You're right that none of them have multiple words, I was just stating the convention in that case.
im sure i have seen some scripts witch the indintifier was with an $E-mail as the identifier.If you did, it was as broken as yours.

Ronni
11-02-2007, 11:12 AM
Okay sorry about that Twey!:rolleyes:

But i thought u ment the english names (name, message, phone & email):D
The names (Navn, Telefon, E-mail & Besked) are the danish names for (name, phone, Email & message) so now you lerned somthing today too and not just me... haha :D

Ronni
11-02-2007, 01:48 PM
Sorry Twey, but i think i have done everything right :( (no capital letters and such in the php.script).... but i still get a HTTP 500 server fault when i push the send button

but try an look at the following picture on this sample html
http://www.tistrup-poker-klub.dk/jpgpicture.html

There are 4 text boxes (Navn, witch have the variable name t1_2)....and next one (Email adresse, witch have the variable name t2_2).... and the next (Telefon, witch have the variable name t3_2) and the last text....(Besked, witch have the variable name t4_2)

Thes are the variable name i be using from now on..

Now the script i have wrote in the Adobe CS3... first the clear button
on (rollOver)
{
this.gotoAndPlay("s1");
}
on (rollOut)
{
this.gotoAndPlay("s2");
}
on (release)
{
_parent.t1_2 = "Navn:";
_parent.t2_2 = "Email adresse:";
_parent.t3_2 = "Telefon:";
_parent.t4_2 = "Besked:";
}

Next the send button
on (rollOver)
{
this.gotoAndPlay("s1");
}
on (rollOut)
{
this.gotoAndPlay("s2");
}
on (release)
{
_parent.getURL("kontakt.php","_blank","GET");
_parent.t1_2 = "Navn:";
_parent.t2_2 = "Email adresse:";
_parent.t3_2 = "Telefon:";
_parent.t4_2 = "Besked:";
}

And last my kontakt.php script.. ( its the same as contact.php just in danish):D
<?php

$navn = $_GET['t1_2'];
$email_adresse = $_GET['t2_2'];
$telefon = $_GET['t3_2'];
$besked = $_GET['t4_2'];

$recipient_email = "info@tistrup-poker-klub.dk";

$subject = "from" . $email_adresse;
$headers = "from" . $navn; . "<" . $email_adresse . ">\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1';

$content = "<html><head><title>Contact letter</title></head><body><br>";
$content .= "t1_2: <b>" . $navn . "</b><br>";
$content .= "t2_2: <b>" . $email_adresse . "</b><br>";
$content .= "t3_2: <b>" . $telefon . "</b><br><hr><br>";
$content .= "t4_2: <b>" . $besked;
$content .= "<br></body></html>";

mail($recipient_email,$subject,$content,$headers);
?>
<html>
<body bgcolor="#282E2C">
<div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">
Your message was sent. Thank you.
</div>
</body>
</html>
<script>resizeTo(300, 300)</script>

Hope you can figure it out Twey

Ronni
11-02-2007, 01:50 PM
maybe it have something to do with the server im posting my kontakt.php on is using php in safe mode??

Twey
11-02-2007, 02:38 PM
Hm, looks OK to me. Safe mode doesn't usually affect mail usage. What are the permissions on your script? This is the most common cause of server errors I know. Set it to 0755.

Ronni
11-02-2007, 03:17 PM
I dont know how to set it to 0755.:confused:
all i know is that the hosting server had php in safe mode, and here are what they linked to me when i asked what php i safe mode ment ...
servers PHP configuretion...http://one-docs.com/php5/

But i'm glad to here u think my script looks okay now:)

Ronni
11-02-2007, 03:29 PM
or can it be becuz ther ons was a a htaccess file in the list were i could see all the files i had uploaded to my site, and now there isnt one of thos?

BLiZZaRD
11-02-2007, 05:55 PM
Using an FTP client (filezilla, cuteFTP, etc..) you can right click on the file and choose "attributes" or "file settings" to CHMOD from 644 (or whatever it may be) to 755.

This is what Twey was referring too. You can also do it through your web host Admin panel or if you have nice web hosts you can ask them to chmod that file for you.

Ronni
11-02-2007, 11:06 PM
the file sitting on my kontakt.php file was allready set to 755

BLiZZaRD
11-03-2007, 03:47 PM
Was just looking over it again...

Is your submit button inside another movie clip? I went to the kontact page but found no forms or buttons there (first post link).

If so you are using _parent.MCname to give the var's for.

You would need to use _ParentMC._childMC, etc.

Also, if you are using multiple frames and multiple instances use _root. instead of _parent.