mrkarter77 Posted May 14, 2006 Share Posted May 14, 2006 I have my contact forms and driver profile submit forms on my website but whenever a user or myself tries to use them they ask what to do with the php script eg save or open. why is this happening.this can be found at [a href=\"http://media.mackaykarting.com/Profiles/\" target=\"_blank\"]http://media.mackaykarting.com/Profiles/[/a]P.S. i am new to php and dont really know much about thisthe code i have is<?php// Website Contact Form Generator // [a href=\"http://www.tele-pro.co.uk/scripts/contact_form/\" target=\"_blank\"]http://www.tele-pro.co.uk/scripts/contact_form/[/a] // This script is free to use as long as you // retain the credit link // get posted data into local variables$EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); $EmailTo = "adam@mackaykarting.com";$Subject = "Driver_profile";$Name = Trim(stripslashes($_POST['Name'])); $classes_raced = Trim(stripslashes($_POST['classes_raced'])); $Age = Trim(stripslashes($_POST['Age'])); $Make_of_kart = Trim(stripslashes($_POST['Make_of_kart'])); $racing_number = Trim(stripslashes($_POST['racing_number'])); $Most_respected_competitor = Trim(stripslashes($_POST['Most_respected_competitor'])); $career_highlights = Trim(stripslashes($_POST['career_highlights'])); $driving_ambitions = Trim(stripslashes($_POST['driving_ambitions'])); $how_long_karting = Trim(stripslashes($_POST['how_long_karting'])); $other_comments = Trim(stripslashes($_POST['other_comments'])); $agree = Trim(stripslashes($_POST['agree'])); // validation$validationOK=true;if (Trim($EmailFrom)=="") $validationOK=false;if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit;}// prepare email body text$Body = "";$Body .= "Name: ";$Body .= $Name;$Body .= "\n";$Body .= "classes_raced: ";$Body .= $classes_raced;$Body .= "\n";$Body .= "Age: ";$Body .= $Age;$Body .= "\n";$Body .= "Make_of_kart: ";$Body .= $Make_of_kart;$Body .= "\n";$Body .= "racing_number: ";$Body .= $racing_number;$Body .= "\n";$Body .= "Most_respected_competitor: ";$Body .= $Most_respected_competitor;$Body .= "\n";$Body .= "career_highlights: ";$Body .= $career_highlights;$Body .= "\n";$Body .= "driving_ambitions: ";$Body .= $driving_ambitions;$Body .= "\n";$Body .= "how_long_karting: ";$Body .= $how_long_karting;$Body .= "\n";$Body .= "other_comments: ";$Body .= $other_comments;$Body .= "\n";$Body .= "agree: ";$Body .= $agree;$Body .= "\n";// send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");// redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";}else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";}?> Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/ Share on other sites More sharing options...
redbullmarky Posted May 14, 2006 Share Posted May 14, 2006 hiyou either don't have php installed on your server or it is installed incorrectly. try out this:[code]<?phpphp info();?>[/code]([b]nb[/b]: take the space out of php and info in the code above so that it's one word - phpfreaks forum wouldnt let me post it as it was sposed to be)if it works, i was wrong. if it doesnt, then you need to install php correctly.cheersMark Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/#findComment-35674 Share on other sites More sharing options...
mrkarter77 Posted May 15, 2006 Author Share Posted May 15, 2006 I have done this but am not sure what is supposed to happen Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/#findComment-35895 Share on other sites More sharing options...
jeremywesselman Posted May 15, 2006 Share Posted May 15, 2006 You should see a page that displays all the info about your php installation. Version, modules, etc.If it didn't work, you will see the code of your actual php file.[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--] Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/#findComment-35899 Share on other sites More sharing options...
mrkarter77 Posted May 15, 2006 Author Share Posted May 15, 2006 i dont see the code or any thing else you can see for yourself at [a href=\"http://media.mackaykarting.com/test.htm\" target=\"_blank\"]http://media.mackaykarting.com/test.htm[/a] Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/#findComment-35903 Share on other sites More sharing options...
jeremywesselman Posted May 15, 2006 Share Posted May 15, 2006 If you need to use php in ANY file, it must be named .php. Not .htm or .html.Change the filename to .php[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--] Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/#findComment-35907 Share on other sites More sharing options...
mrkarter77 Posted May 15, 2006 Author Share Posted May 15, 2006 yes how clumsy of menow thats back to basicsnow back to the saving thing[a href=\"http://media.mackaykarting.com/Profiles/test.php\" target=\"_blank\"]http://media.mackaykarting.com/Profiles/test.php[/a] Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/#findComment-35908 Share on other sites More sharing options...
jeremywesselman Posted May 15, 2006 Share Posted May 15, 2006 It is trying to make me download the php file which tells me that PHP is NOT installed on the server. You need to check with your hosting company. It looks like you're gonna need a different hosting package. One that has php installed.[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--] Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/#findComment-35909 Share on other sites More sharing options...
mrkarter77 Posted May 15, 2006 Author Share Posted May 15, 2006 but i do have php installed by them, allthough google is apparently using my bandwidth but they wont give me a proper report so i can show google and make them stop so i am going way over my 2gb limit by almost triplebut thanks for the help you guys are great Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/#findComment-35910 Share on other sites More sharing options...
wildteen88 Posted May 15, 2006 Share Posted May 15, 2006 I think your hosting company may have a special setup of PHP which might require a special line called a shebang line, I think thats what it is called, it goes something like this:[code]#!user/cgi-bin/php[/code]That goes right at the top of your PHP file. However I would check with your webhost how to execute and where to store your PHP scripts, also you might want to ask whether they have configured the server to parse .php files with the PHP Interpreter correctly. Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/#findComment-35919 Share on other sites More sharing options...
mrkarter77 Posted May 16, 2006 Author Share Posted May 16, 2006 This form has worked before yet it is only recently sincs i have been getting the google bots crawling my site and using 5gb of bandwidth in the first day of the month and me having no bandwidth left that i have been getting thiswould that have anything to do with it Quote Link to comment https://forums.phpfreaks.com/topic/9648-simple-error-i-cant-fix-though/#findComment-36184 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.