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
Echoing If Function?
A script I am using has If statements in the comments form to basically tell the form what to do. Cu
TinyMCE / Ajax Postback Problem
Hiya all,
I have a page which loads the TinyMCE editor. On the postback I obviously want to f
Request.UrlReferrer
I need to make it so that a page can only be loaded when a button is clicked on a specific page. I d
Multiple arrays inside data
Hi,
Simple question. I have a column called "array" in my database, and inserted in
Simple Variable Question
Hi everyone.... again,
I am really getting into php still. Learning more every day. I love it
Contact Form Not Working When I Add Validation Codes
So I built my first working PHP "Contact Us" like form. But, I have been trying to now mak
Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website
Basic Forum Tutorial
Hi, I'm new to PHP. I want to build a basic forum for my site using PHP and MySQL. I've searched t
Restricted access to sub-folder in iis6 doesn't work?
Basically I'm trying to add restriction to sub-folder (which contains pdf) in web.config for iis6 as
Insert numbers from Barcode scanner into online php page
I have a real big problem, Here is what I'm trying to do. I have a Intermec CN3 handheld computer th