Script Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jamesadrian
Forum Newbie
Posts: 2
Joined: Sat Feb 06, 2016 4:25 pm

Script Question

Post by jamesadrian »

I have had the following script on my site at http://www.futurebeacon.com for many years:

Code: Select all

<form action="/gdform.php" method="post">
<input type="hidden" name="subject" value="Form From Future Beacon" />
<input type="hidden" name="redirect" value="index.html" />

Name: &nbsp; <input type="text" name="Name" />

Email Address: &nbsp; <input type="text" name="email" />

<input type="submit" name="submit" value="submit"/>
</form>

I wrote it after studying PHP for only a short time. I don't know how it knows what email address to send the data to. It sends it now to jim@futurebeacon.com, but I want to use it for another one of my sites with a different email address.

Can anybody suggest a course of action?

Thank you for your help.

James Adrian
jim@futurebeacon.com
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Script Question

Post by Celauran »

Nothing in the HTML above dictates where the email gets sent, or even that an email gets sent. I would start by looking at gdform.php and working from there.
jamesadrian
Forum Newbie
Posts: 2
Joined: Sat Feb 06, 2016 4:25 pm

Re: Script Question

Post by jamesadrian »

This is the gdform file:

***** Please use PHP Code syntax tag *****

Code: Select all

<?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"]."/");
    }


?>
James Adrian
jim@futurebeacon.com
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Script Question

Post by requinix »

gdform.php is a GoDaddy hosting thing. If you want to use it on another site, it needs to be a GoDaddy hosted site, and you would change the email address somewhere in their configuration (or it may go to your account's email or something automatic like that).
Post Reply