reating a background image
Posted on
16th Feb 2014 07:03 pm by
admin
I am building a site in drupal and have a php form in it, due to certain annoyances with module building I need to generate a background image and margin for my form in PHP and, whilst i imagine this is basic, I do not know how to put this in or where! The code is as follows:
<?php
function fidelity_website_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$blocks[0]['info'] = t('Apply Now');
return $blocks;
case 'configure':
$form['form_email'] = array(
'#type' => 'textfield',
'#title' => t('Email address to send the form when it is filled out.'),
'#default_value' => variable_get('apply_now_email', 'yfreeman@fidelitypayment.com'),
);
return $form;
case 'save':
variable_set('apply_now_email', $edit['form_email']);
break;
case 'view':
$block['subject'] = t('Apply Now');
// We theme our array of links as an unordered list.
$output .= drupal_get_form('fidelitywebsite_applynowform');
$block['content'] = $output;
return $block;
break;
}
}
function fidelitywebsite_applynowform($args){
$form = array();
$form['name'] = array(
'#title' => t('Name'),
'#size' => 15,
'#type' => 'textfield',
);
$form['company'] = array(
'#title' => t('Company'),
'#size' => 15,
'#type' => 'textfield',
);
$form['email'] = array(
'#title' => t('Email'),
'#size' => 15,
'#type' => 'textfield',
);
$form['phone'] = array(
'#title' => t('Phone'),
'#size' => 15,
'#type' => 'textfield',
);
$form['process'] = array(
'#type' => 'submit',
'#value' => t('Apply Now!')
);
return $form;
}
function fidelitywebsite_applynowform_submit($form, &$form_state){
$values = $form_state["values"];
$subject = "Fidelitypayment.com Apply Now Form";
$name = check_plain($values["name"]);
$company = check_plain($values["company"]);
$email = check_plain($values["email"]);
$phone = check_plain($values["phone"]);
$body = "Name: $name
Company: $company
Phone: $phone
Email: $email";
ini_set("sendmail_from", "donotreply@fidelitypayment.com");
ini_set("SMTP", "smtp.fidelitypayment.com");
$mssg_from = "From: Fidelity Payment Services <donotreply@fidelitypayment.com>";
mail(variable_get('apply_now_email', 'yfreeman@fidelitypayment.com'), $subject, $body, $mssg_from);
drupal_set_message("Thank you very much for your application, a Fidelity representative will be in touch with you shortly.", "status");
$form_state["redirect"] = "node";
}
and I would like a margin of 5 and an image behind everything, many thanks to anyone that can help with this!!!
No comments posted yet
Your Answer:
Login to answer
69
14
Other forums
Stumped by Third Day of Month problem
I am trying to build an algorithm that will essentially do this:
Code: [Select]$this_month = Oct
Syntax Help
I'm trying to make a form that edits a php file which contains config settings. I'm using strings t
Form a inline view based on the results of the previous query?
Hi Experts,
Can we form a inline view on the results of a previous query (another inline view)?
How to kill asynchronous postback / current postback?
Hi,here is my problem:I have a web site with many pages of which some may take time to process resul
Last Weeks sDate and eDate.
sDate - Start Date
eDate - End Date
I need to pull two dates for "Last Week" whi
Help with Contact Form
I have this Form on an html page and the associated code on page.php (below).
I keep getting the
Most basic form question ever?
Hello,
I want to use this snippet to make sure the fields in a form are ok before processing
str_replace help
Hey there,
I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean
Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :
Help pulling in 'id' with "read more" link
I'm trying to create snippets of my articles in the cms I'm creating, and then have them redirect to