Hey, I have these forms for my site. There like a contact form, request graphic form, and an Enlistment form.
Well, I am using XHTML, and I got all of the forms working but one. The one that isn't working is the enlistment form. I have been trying to figure out the problem, but I really have no clue on how to fix the problem.
Here is the link to the problem
http://www.mfr.frih.net/template/matches.html
Just scroll down just a little bit and you will see something like this
Your Application Has Been Sent!
"); } else { echo("
Your Application Failed To Be Sent...
"); } } else { echo ("You Didn't Fill Out The Form!"); } ?>
So if anyone knows how to fix this, please let me know.
| hexkid wrote: |
| Rename it to matches.php |
Rename what to matches.php? If your talking about the file, it already is. And both of those forms are in the same file.
| Ghost Rider103 wrote: |
| hexkid wrote: | | Rename it to matches.php |
Rename what to matches.php? If your talking about the file, it already is. And both of those forms are in the same file. |
--------> http://www.mrf.frih.net/template/matches.php
-----------------------------------------------------------------^^
That didn't work. It got rid of some of the code stuff, but "You didn't fill out the form" stayed there, and the form isn't there still.
| Ghost Rider103 wrote: |
| That didn't work. |
Maybe it's time to switch forums?
| hexkid wrote: |
| Ghost Rider103 wrote: | | That didn't work. |
Maybe it's time to switch forums? |
What would that have to do with anything? The link I sent you is a template I am working on for the future, that's isn't the actual site yet. I still have to do a custom forum for it after I get the enlistment form working.
And I said "FORM" incase you just got that mixed up, and not "forum"
Why is the page .html and you are using php on it?
Does it really make that big of a difference? It seems to work the same when I use each one, so the layout is in HTML, so I just left the pages HTML.
| Ghost Rider103 wrote: |
| hexkid wrote: | | Ghost Rider103 wrote: | | That didn't work. |
Maybe it's time to switch forums? |
What would that have to do with anything? The link I sent you is a template I am working on for the future, that's isn't the actual site yet. I still have to do a custom forum for it after I get the enlistment form working.
And I said "FORM" incase you just got that mixed up, and not "forum" |
He means, this may be a PHP code issue, not an HTML issue, therefor this topic MIGHT belong in the PHP forum.
Lets get one thing clear:
NO PHP SCRIPT CAN RUN OFF OF .HTML EXTENSION!
Heres how you can fix it.. change the file name to matches.php!
You cannot have a <?php and ?> script a page that has the extension of .html, or .htm. Its impossible.
Hope this helps.
| Diablosblizz wrote: |
| NO PHP SCRIPT CAN RUN OFF OF .HTML EXTENSION! |
Not by default but php can be parse any file, even .frihost if you tell apache to do so.
Anyway, if as claimed, the error still exists when renamed to .php it is more likely than not the php code that is the problem. If you just post the code we can all help you. 
the errror happens to be in your code.... coz changing extension didnt work...so its a "Duh !"
well if you post your code here... some1 will definetly be able to help you out with it..
we cant help you without the code... (and remeber to use code tags)
make sure that you have <?php ?> tags around all the php. without it the php will just be displayed in the file and not been preprocsessed
I found one problem, but correct me if I'm wrong.
In your code it says
| Quote: |
echo("<p>Your Application Has Been Sent!</p>");
} else {
echo("<p>Your Application Failed To Be Sent...</p>");
}
} else {
echo ("You Didn't Fill Out The Form!"); |
there's an extra }
| chastise wrote: |
I found one problem, but correct me if I'm wrong.
In your code it says
| Quote: | echo("<p>Your Application Has Been Sent!</p>");
} else {
echo("<p>Your Application Failed To Be Sent...</p>");
}
} else {
echo ("You Didn't Fill Out The Form!"); |
there's an extra } |
I just tried that, did not work.
Sorry it took so long to respond, but here is the code.
| Code: |
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$age = $_POST['age'];
$aim = $_POST['aim'];
$games = $_POST['games'];
$xbox = $_POST['xbox'];
$graphics = $_POST['graphics'];
$online = $_POST['online'];
$hearfrom = $_POST['hearfrom'];
$assume = $_POST['assume'];
$comments = $_POST['comments'];
$position = $_POST['position'];
if($assume==true){
$to = "mfrmarineforcerecon@hotmail.com";
$subject = "Clan Application";
$body = "You Have Been Sent A Clan Application!
Here it is:
Name: $name
Age: $age
Email: $email
AIM Screen Name: $aim
Games They Play:
$games
Position:
$position
What Type Of Xbox Do They Have?
$xbox
Do They Have Graphics Skills?
$graphics
How Often Are They Online?
$online
Where Did They Hear About War Hawks?
$hearfrom
Comments:
$comments";
if (mail($to, $subject, $body)) {
echo("<p>Your Application Has Been Sent!</p>");
} else {
echo("<p>Your Application Failed To Be Sent...</p>");
}
} else {
echo ("You Didn't Fill Out The Form!");
}
?></p>
<hr />
</div>
<div class="clear"></div>
</div>
</div>
</body>
</html>
|
That is from where the form starts, to the end of the page.
I used other forms if you look around on the site, there is more on there that work, and the guy who gave them to me I belive are made the same, but this one will not seem to work.
| Code: |
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$age = $_POST['age'];
$aim = $_POST['aim'];
$games = $_POST['games'];
$xbox = $_POST['xbox'];
$graphics = $_POST['graphics'];
$online = $_POST['online'];
$hearfrom = $_POST['hearfrom'];
$assume = $_POST['assume'];
$comments = $_POST['comments'];
$position = $_POST['position'];
if($assume==true){
$to = "mfrmarineforcerecon@hotmail.com";
$subject = "Clan Application";
$body = "You Have Been Sent A Clan Application!
Here it is:
Name: $name
Age: $age
Email: $email
AIM Screen Name: $aim
Games They Play:
$games
Position:
$position
What Type Of Xbox Do They Have?
$xbox
Do They Have Graphics Skills?
$graphics
How Often Are They Online?
$online
Where Did They Hear About War Hawks?
$hearfrom
Comments:
$comments";
if (mail($to, $subject, $body)) {
echo("<p>Your Application Has Been Sent!</p>");
} else {
echo("<p>Your Application Failed To Be Sent...</p>");
}//THIS IS NOT NEEDED AND IS PROBABLY WHERE YOUR SCRIPT IS //BREAKING
} else {
echo ("You Didn't Fill Out The Form!");
}
?></p>
<hr />
</div>
<div class="clear"></div>
</div>
</div>
</body>
</html> |
I put a comment where there is an extra } take this out and see if this fixes the problem.
Where are you testing to see if the values are being submitted?? Are you doing any error checking on the information from the form?
Do you have the code for the form as well? There could be a varible problem on the form.
Good luck.