• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding Form Coding

#1
I have a form on the home page.  

The form is posting data correctly to the MySQL Database.  The confirmation email is being sent to the person's email address who is filling out the form.  The notifications of a new inquiry are being received.

Using Google Chrome I can use inspect and see the HTML coding.  Where is the coding for the form actually located?  I want to check to make sure the email address in the notification is correct or that notification are enabled.

Any help to point me in the right direction would be greatly appreciated.

Thank you!
Reply

#2
Usually in the view file for the page. Where that is depends on your file structure, and on the view being called from the relevant page controller. The relevant controller depends on the routing being used.

The routing is conventionally controller/method. Can you post the url of the page (without the domain name for your privacy) and we will make some suggestions of where to look.

Best wishes,

Paul.

PS on re-reading your post the email address could be stored in the database, in an email configuration file, or hard-coded into the controller.
Reply

#3
Paul,

Thank you for your time.  I am not sure I understand the question.  Would the home page be www.domain.com/index.php?

I blanked out only the domain, and eliminated the long list of Options.

--- Begin Code ---
<form name="learners_form" id="learners_form" method="post" action="http://www.mydomain.com/pages/subscribers" onsubmit="return false">
                   <input type="text" placeholder="First Name" name="fname" id="fname" value="" onkeypress="remove_class_learner();">
                        <input type="text" placeholder="Last Name" name="lname" id="lname" value="" onkeypress="remove_class_learner();">
                       <input type="text" name="email_address" id="email_address" placeholder="Your Email Address" value="" onkeypress="remove_class_learner();">
                    <input type="text" placeholder="Contact Number" name="contact_id" id="contact_id" value="" onkeypress="remove_class_learner();">
                       
                       <select name="country" id="country" onchange="remove_class_learner();">
                       <option value="">Select Country</option>
                                              <option value="52"> Omitted</option>
                        </select>
                       
                      
<input style=" float:left; width:150px;" placeholder="Captcha" type="text" id="captcha1" name="captcha1" class="text-field" onpaste="return false" onkeypress="remove_class_learner();">
                           <div style="float:right; margin: 4px 0 0 0;" class="captcha-home">  <span class="captchacode" style="position:absolute; margin: -38px 0 0 62px; font-size:25px; font:monofont.ttf; color:#fff; font-weight:bold; ">2c8m6</span></div>
                       
                        <input type="hidden" name="type" id="type" value="3">
                        <input type="hidden" name="hid_code_1" id="hid_code_1" value="2c8m6">
                        <input type="submit" value="submit" onclick="beAlearner();">
                        </form>
--- End Code ---

Is this what you need?

Thank you again.
Reply

#4
The following is the code I copied from the index.php file which I think is related to the form on the home page.  I added MYDOMAIN to any place where the domain name was mentioned.

There is a reference to query db atabase and admin_users and admin_email.

--- Begin Code ---

  function subscribers(){
  $datestring = "%Y-%m-%d %H:%i:%s";
$time = time();
$now = mdate($datestring, $time);

$id_box=$this->input->post('type');
$this->db->where('id',$id_box);
$query_response=$this->db->get('subscriptions_response');
foreach($query_response->result() as $row_contact)
{
$from_mail = $row_contact->from;
$title=$row_contact->subject;
$content=html_entity_decode($row_contact->description);
}

 $this->db->where('id', 1);
$query=$this->db->get("admin_users");
foreach ($query->result() as $row)
{
$admin_email = $row->email;

}

if($this->input->post('type') == "1"){
$country = $this->home_model->getCountryName($this->input->post('country1'));
$to = $this->input->post('email_address1');
$from =  $from_mail;
$message = $content;
$subject = $title;
$headers = "From:".$from_mail."\n";
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$send=mail($to,$subject,$message,$headers);

$coaches_data = array(
'type'        => $this->input->post('type'),
'first_name'  => $this->input->post('fname1'),
'last_name'   => $this->input->post('lname1'),
'email'       => $this->input->post('email_address1'),
'country'     => $this->input->post('country1'),
'number'      => $this->input->post('contact_id1'),
'datentime'   => $now
);
$this->db->insert('subscriptions', $coaches_data);


$name1 = $this->input->post('fname1').' '.$this->input->post('lname1');
$subject1 =  'Subscription request about becoming a XXXXXXXXXX';
$from1 = $this->input->post('email_address1');
$to1 = $from_mail;
$msg1 = 'Dear Admin,'.'<br><br>';
$msg1 .= $this->input->post('fname1').' '.$this->input->post('lname1').' has subscribed to become a XXXXXXXXXX.'.'<br><br>';
$msg1 .='Please <a href="'.base_url().'admin/subscriptions">click here</a> to see more details.'.'<br><br>';
$msg1 .= 'MYDOMAIN Team'.'<br>';
$headers1 = "From: info@MYDOMAIN.org\n";
$headers1 .= "MIME-Version: 1.0" . "\r\n";
$headers1 .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$send1=mail($to1,$subject1,$msg1,$headers1);

if($this->home_model->getNumofRows($this->input->post('email_address1')) == 0)
{
$data_insert = array(
'first_name'  => $this->input->post('fname1'),
'last_name'   => $this->input->post('lname1'),
'email'     => $this->input->post('email_address1'),
'buss_phone'  => $this->input->post('contact_id1'),
'country'     => $this->input->post('country1'),
'date_created'=>date('Y-m-d H:iConfused'),
'affiliate'   => 'MYDOMAIN Affiliate'
);
$this->db->insert('coaches_db', $data_insert);
}
return true;
}
if($this->input->post('type') == "2"){
$country = $this->home_model->getCountryName($this->input->post('country2'));

$to = $this->input->post('email_address2');
$from =  $from_mail;
$message = $content;
$subject = $title;
$headers = "From:".$from_mail."\n";
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$send=mail($to,$subject,$message,$headers);

$partners_data = array(
'type'         => $this->input->post('type'),
'first_name'   => $this->input->post('fname2'),
'last_name'    => $this->input->post('lname2'),
'email'        => $this->input->post('email_address2'),
'country'      => $this->input->post('country2'),
'number'   => $this->input->post('contact_id2'),
'datentime'    => $now
);
$this->db->insert('subscriptions', $partners_data);

$name1 = $this->input->post('fname2').' '.$this->input->post('lname2');
$subject1 =  'Subscription request about becoming a MYDOMAIN Affiliate';
$from1 = $this->input->post('email_address2');
$to1 = $from_mail;
$msg1 = 'Dear Admin,'.'<br><br>';
$msg1 .= $this->input->post('fname2').' '.$this->input->post('lname2').' has subscribed to become a  MYDOMAIN Affiliate.'.'<br><br>';
$msg1 .='Please <a href="'.base_url().'admin/subscriptions">click here</a> to see more details.'.'<br><br>';
$msg1 .= 'MYDOMAIN Team'.'<br>';
$headers1 = "From: info@MYDOMAIN.org\n";
$headers1 .= "MIME-Version: 1.0" . "\r\n";
$headers1 .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$send1=mail($to1,$subject1,$msg1,$headers1);

if($this->home_model->getNumofRows($this->input->post('email_address2')) == 0)
{
$data_insert = array(
'first_name'  => $this->input->post('fname2'),
'last_name'   => $this->input->post('lname2'),
'email'     => $this->input->post('email_address2'),
'buss_phone'  => $this->input->post('contact_id2'),
'country'     => $this->input->post('country2'),
'date_created'=>date('Y-m-d H:iConfused'),
'affiliate'   => 'MYDOMAIN Affiliate'
);
$this->db->insert('coaches_db', $data_insert);
}
return true;
}
if($this->input->post('type') == "3"){
$country = $this->home_model->getCountryName($this->input->post('country'));

$to = $this->input->post('email_address');
$from =  $from_mail;
$message = $content;
$subject = $title;
$headers = "From:".$from_mail."\n";
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$send=mail($to,$subject,$message,$headers);

$learners_data = array(
'type'         => $this->input->post('type'),
'first_name'   => $this->input->post('fname'),
'last_name'    => $this->input->post('lname'),
'email'        => $this->input->post('email_address'),
'country'      => $this->input->post('country'),
'number'       => $this->input->post('contact_id'),
'datentime'    => $now
);
$this->db->insert('subscriptions', $learners_data);


$name1 = $this->input->post('fname').' '.$this->input->post('lname');
$subject1 =  "Subscription request to Know More about XXXXXXXXXX";
$from1 = $this->input->post('email_address');
$to1 = $from_mail;
$msg1 = 'Dear Admin,'.'<br><br>';
$msg1 .= $this->input->post('fname').' '.$this->input->post('lname').' has subscribed to know more about XXXXXXXXXX.'.'<br><br>';
$msg1 .='Please <a href="'.base_url().'admin/subscriptions">click here</a> to see more details.'.'<br><br>';
$msg1 .= 'MYDOMAIN Team'.'<br>';
$headers1 = "From: info@MYDOMAIN.org\n";
$headers1 .= "MIME-Version: 1.0" . "\r\n";
$headers1 .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$send1=mail($to1,$subject1,$msg1,$headers1);
if($this->home_model->getNumofRows($this->input->post('email_address')) == 0)
{
$data_insert = array(
'first_name'  => $this->input->post('fname'),
'last_name'   => $this->input->post('lname'),
'email'     => $this->input->post('email_address'),
'buss_phone'  => $this->input->post('contact_id'),
'country'     => $this->input->post('country'),
'date_created'=> date('Y-m-d H:iConfused'),
'affiliate'   => 'MYDOMAIN Affiliate'
);
$this->db->insert('coaches_db', $data_insert);
  }


return true;
}


}

--- End Code ---
Reply

#5
I guess the follow on question is, "If this is the code, where do I find the admin_email?"
Reply

#6
So it looks like from this code that the $from_email (used also as the $to_email for admin emails) is being called from the database. So you need to look in the database. It is being read from a table called 'subscriptions_response', so access your database via your host, find the table, take a look at the emails in there.

Hope that helps,

Best wishes,

Paul.

PS Looking at the form from the first bit of code it might be calling a page on pages/subscribers which is either a method called subscribers in pages.php or more likely the index method in subscribers.php in a folder called pages.

PPS The homepage is defined in the config file and can be any controller in the root of the controllers folder. That controller can be calling any view, in any subfolder structure, so again, it is not possible to say if this is the code that you posted or if it is some old unused code that was left, and the actual code could be hidden away somewhere else. This all sounds far more complicated than it actually is, just impossible to say as I am in the dark. Anyway, good luck with it.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.