PHP - Help With Drupal?
I recently tried to start using drupal as a CMS for my site but their handbook is almost useless since I'm pretty much learning this stuff new. Can I use HTML or do I have to use PHP? Does anyone have any other useful guides they could show me?
Similar TutorialsNewbie question, sorry. I have a Drupal custom content type - "EXIF Image" that is posting metadata. It works, but I'd like to speed up the posting process by autopopulating the node title with metadata as well. I've enabled auto_nodetitle, but I'm stuck on the correct syntax for the PHP. I'm not a PHP progrmmer, and I don't even play one on TV. Could someone direct me to the correct syntax? I have a field__iptc_headline that I'm trying to reference. Not sure where the extra underscore came from, but it's working with EXIF module.
<?php print render($content['field__iptc_headline']); ?> This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=311125.0 hmmmm my last post got deleted due to my naughty url:-( Anyway its not spam :-( hear is my real problem. I HAVE this form in a iframe in a drupal site.....I followed many tutorials but it seems fine? It keeps downloading the actual php file instead of posting to my email? form code/////////////// <form action="EnquirySend.php" method="post" enctype="application/x-www-form-urlencoded" name="Enquiry_Form" target="_self" id="Enquiry_Form"> <div class="demo"> <div id="Col1"> <p>Date Departing:</p> <p>Date Returning</p> <p>Name<span style="font-size: 16px; "><span style="color: rgb(255, 0, 0); ">*</span></span> : </p> <p>Phone<span style="font-size: 16px; "><span style="color: rgb(255, 0, 0); ">*</span></span> : </p> <p>Email:<span style="font-size: 16px; "><span style="color: rgb(255, 0, 0); ">*</span></span> : </p> <input name="button" type="submit" class="demo" id="button" value="Submit your Enquiry"> </div> <div id="fieldsAline"> <input name="departing_Date" type="text" id="departingDate"></p> <p> <input type="text" id="returnDate"></p> <p> <input maxlength="20" name="name" size="20" style="cursor: default; " type="text" /></p> <p> <input maxlength="20" name="phone" size="20" style="cursor: default; " type="text" /></p> <p> <input maxlength="30" name="email" size="20" style="cursor: default; " type="text" /></p> </div> <p><div id="Col2"> <div id="topCol2"><p>Number Travelling: <span style="font-size: 16px; "><span style="color: rgb(255, 0, 0); ">*</span> <input maxlength="2" name="number" size="3" type="text" value="1" /> PostCode :<input name="postcode" type="text" id="postcode" size="5" maxlength="5"> </p> <p>Can we help you with any extras?</p> <p> <textarea name="extras" id="extras" cols="45" rows="3">Are you interested in 5 star accommodation? </textarea> </p> <p> Which Holiday Package are you interested in <span style="font-size: 16px; "><span style="color: rgb(255, 0, 0); ">*</span></span> ? <br><br> <label> <input type="radio" name="package" value="radio" id="manila"> <span style="color:#0CF">Manila</span></label> <label> <input type="radio" name="package" value="radio" id="manila_boracay"> <span style="color:#0CF">Manila & Boacay</span></label> <br> <label> <input type="radio" name="package" value="radio" id="Manila_angeles"> <span style="color:#0CF">Manila & Angeles</span></label> <label> <input type="radio" name="package" value="radio" id="Manila_Cebu"> <span style="color:#0CF">Manila & Cebu</span></label> <br> <br><br> </p></div></div></div> </form> HERE IS THE RESPONDER PHP FILE CODE/////////// <?php //--------------------------Set these paramaters-------------------------- // Subject of email sent to you. $subject = 'Enquiry_Form '; // Your email address. This is where the form information will be sent. $emailadd = 'sales@hotasiantour.com'; // Where to redirect after form is processed. $url = 'www.hotasiantour.com'; $departing_Date = $_REQUEST['departingDate'] ; $returning_Date = $_REQUEST['returningDate'] ; $Name = $_REQUEST['name'] ; $Phone = $_REQUEST['phone'] ; $Email = $_REQUEST['email'] ; $Number_comming = $_REQUEST['number'] ; $postcode = $_REQUEST['postcode'] ; $Any_extras = $_REQUEST['extras'] ; $holiday_package = $_REQUEST ['package'] ; // Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty. $req = '0'; // --------------------------Do not edit below this line-------------------------- $text = "Results from form:\n\n"; $space = ' '; $line = ' '; foreach ($_POST as $key => $value) { if ($req == '1') { if ($value == '') {echo "$key is empty";die;} } $j = strlen($key); if ($j >= 20) {echo "Name of form element $key cannot be longer than 20 characters";die;} $j = 20 - $j; for ($i = 1; $i <= $j; $i++) {$space .= ' ';} $value = str_replace('\n', "$line", $value); $conc = "{$key}:$space{$value}$line"; $text .= $conc; $space = ' '; } mail($emailadd, $subject, $text, 'From: '.$emailadd.''); echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">'; // -----------------------auto responder-------------------------- $responseSubject = "Your request has been received"; $responseMessage = "Hello,\n\nThanks for submitting your request. One of our agents will be in contact with you shortly.\n\nKind regards,\nYour Company"; $responseFromName = "Hot Asian Tours"; $responseFromEmail = "sales@hotasiantour.com"; mail($fromEmail, $responseSubject, $responseMessage, "From: ".$responseFromName." <".$responseFromEmail.">"); ?> This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=348274.0 |