Jump to content

tomstirling1979

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tomstirling1979's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, this ALMOST did exactly what I wanted it to do.... <?php query_posts(array('category__and&showposts=10&offset=0' => array(3,7))); ?> The feed did show a mix of the 2 categories, BUT! - it didn't show any more than the most recent and the next one, thr part where I have it saying showposts=10 didnt seem to register. Any ideas? :'(
  2. Do I need to give more information, I am a total newbie to php this "complex" - The only thing I use it for on a regular basis is include/require files and thats straight forward, I feel I just dont have the synthax down here for this to work the way I need it to. And again, any help at all would be really appreciated. Sorry for being impatient, but as I said its a time sensitive issue and help sooner than later can make all the difference. i normally wouldn't try and bump my post up.......
  3. I have taken over a wordpress site that a web developer set up and he is no longer working with me so I cant get his help with it, I have a custom front page that has been pulling press releases that where posted previously and categorized as "press" I was asked to add a blog which I did by categorizing the post as "blog" In a nutshell, I now need the front page code to pull a mixture of both the "press" and "blog" each category has a numerical id so blog is 7 and press is 3 This is the current code that is in the page <?php query_posts('category_name=press&showposts=10&offset=0'); ?> I looked up wordpress support for this, and found this query_posts(array('category__in' => array(2,6))); How can I integrate this if possible with the top line so it pulls the newest posts from both categories? Any suggestions could REALLY help me out! Thanks!
  4. I am trying to create a form on my website that sends an email to the specific email address of my choice. I also need to create a "success message" that displays when the user submits there information, but that the message simply appears under the form on the same page, and not on a new page. I had this working before, and then I had to switch the site to goDaddy and then I no longer got the success message. I am a total novice and just need some advice to get this fixed fast. The code is below for people to examine. <?php $email = 'thomas_stirling@hotmail.com'; // email who you're sending to $subject = $_POST['subject']; //email subject $headers = 'From: Clearly Creative Homepage Leads' . "\r\n" . 'Reply-To: thomas_stirling@hotmail.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $message = ''; $errorStr = ''; if(isset($_POST['submit'])) { /* define required fields */ $requiredFields = array( 'Company Name' => 'companyname', 'Name' => 'name', 'EMail' => 'email', 'Message' =>'message' ); /* valudate required fields */ foreach($requiredFields as $key => $value) { if($_POST[$value] == '') { $errorStr .= "Error: Field $key is required <br />"; } } /* if all fields validated, send the email */ if($errorStr == '') { /* Create Message */ $messageFields = array( 'Company Name' => $_POST['companyname'], 'Name' => $_POST['name'], 'E-Mail' => $_POST['email'], 'Message' => $_POST['message'] ); foreach($messageFields as $key => $value) { $message .= "$key : $value \n"; } mail($email, $subject, $message, $headers); $sent = 1; } } ?> <!-- this is the form starting--> <form action="index_sidebar_test.php" method="POST"> <font class="sidebarDate">Company Name *</font><br /> <input width="200" name="companyname" type="text"/><br /> <font class="sidebarDate">Full Name *</font><br /> <input width="200" name="name" type="text" /><br /> <font class="sidebarDate">Email Address *</font><br /> <input width="200" name="email" type="text" /> <br /> <font class="sidebarDate">Message *</font><br /> <textarea cols=20 rows=4 name="message" /></textarea> <br /><br /> <input type="submit" value="Submit" name="submit"/></form> <?php if($sent == 1 && isset($_POST['submit']) ) {\ ?> <span class="Main_HeadingText">Thanks for your submission.<br /> We’ll get back to you within one business day.</span> <? } elseif ($errorStr != '') { print $errorStr; } ?> <!-- this is the form ending -->
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.