Tangentina Posted August 28, 2011 Share Posted August 28, 2011 Hi everyone, I have two email forms I designed with CSS and HTML which I want to use on two of the domains I have on my shared hosting account with GoDaddy. I have tried a few sample scripts with the accompanying html files but with this shared hosting the form won’t work with the php file in the same directory as the html form. It has to work from the root directory. Go Daddy cannot give me custom scripting advice for the obvious reasons but have informed me that some customers have managed to get their php files working for their different domains by looking at the script that GoDaddy supply in the root directory and working it out. I am able to configure my html form to work with the basic php mailform scripts I can get free online but do not know php and wouldn’t have a clue how to customise it so that it works on that page from my root directory. I imagine that I may need two separate scripts for the two domains I want the forms to work on. The php script that GoDaddy supply which apparently only works with the main domain (for which I do not need an email form) is as follows: <?php $request_method = $_SERVER["REQUEST_METHOD"]; if($request_method == "GET"){ $query_vars = $_GET; } elseif ($request_method == "POST"){ $query_vars = $_POST; } reset($query_vars); $t = date("U"); $file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t; $fp = fopen($file,"w"); while (list ($key, $val) = each ($query_vars)) { fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n"); fputs($fp,"$val\n"); fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n"); if ($key == "redirect") { $landing_page = $val;} } fclose($fp); if ($landing_page != ""){ header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page"); } else { header("Location: http://".$_SERVER["HTTP_HOST"]."/"); } ?> Can anyone help me with this please? Quote Link to comment https://forums.phpfreaks.com/topic/245877-help-needed-for-email-form-script-with-godaddy/ Share on other sites More sharing options...
jcbones Posted August 28, 2011 Share Posted August 28, 2011 There is most likely a simple solution as to why your script isn't working. Post it up, and we could help out, as there is no reason a script has to reside in the root directory to work. GoDaddy is horrible (IMHO), but even they wouldn't do that. Quote Link to comment https://forums.phpfreaks.com/topic/245877-help-needed-for-email-form-script-with-godaddy/#findComment-1262902 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.