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!!!
Hyperlink is adding an extra gap to variable
Hi, here's my problem..I have a php generated page with a hyperlink which opens in a new windowecho "<tr><td><a
Unable to retreve the values from Mysql Query
Hi, Here is the php code that I have, Query is running properly in phpmyadmin and is resulting 5 which is correct but when i try to get tht in php its not printing the value $sql_query=
Mail form doesn't send Russian/Cyrillic characters correctly?
When someone enters foreign characters (like Cyrillic text, and Japanese/Chinese probably gives the same problem) into the mail form, the email that arrives is all gibberish. For example this should
Forum tutorial
Im a beginner in PHP. Im making a forum(previous questbook, counter and few others) to learn. For now I know something. I started making the forum from this
Fatal error: Call to a member function fetchrow() on a non-object in C:xamppht
okay i have this query and everytime i add `item_id`=? to it... it gives me the error in the title...Code: $query = $db->execute("select * from items where `player_id`=?,
How do I use ValidatorCallout extender in Login control?
Hi,I'd like to customize the look and feel of the login control a little bit. One thing I'd love to do is to use the ValidatorCallout extender in AJAX controls toolkit so that I can display nicer
need help about
i store the value of my select statement result to an array and stored it to a variable named $fname the i used it as the value of:<input type='text' name='fname' value=<?php echo $fname
Help with PHP Email Script
Hi guys,I'm a newbie to php and need help with the script below:At the moment when I receive the automated email of data, I'm not receiving any information with the form field names I receive blank
need to apply an if/else statement to Tim Thumb script
Not sure how to work this. I essentially want to call a variety of image sizes based on which stylesheet a user chooses from the administration backend of a wordpress theme. The sizes of the images
Unexpected T_Variable ?
Hi all,I dont really know what I am doing!! I know I'm doing something wrong, and I know its on line 42 "$sql="select pname, award, aw_year" but I dont know why its a problem?? Can