Jump to content


  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender
    Not Telling

gum1982's Achievements


Member (2/5)



  1. Hi People I have got the following code which querys the db $tsql = $wpdb->prepare( "SELECT sd.user_id FROM {$specialisms_data_table} sd WHERE sd.field_id = {$specialising_field_id} AND sd.value LIKE %s", $specialism); $data = $wpdb->get_results( $tsql ); echo "<pre>"; print_r($data); echo "</pre>"; The output for the print_r($data); Array ( [0] => stdClass Object ( [user_id] => 42 ) [1] => stdClass Object ( [user_id] => 46 ) ) I then want to loop through these ids and then outputs some off the required db fields. So i am trying to do this with a foreach loop but its not returning me with anything. <?php foreach( $data as $value ) { ?> <?php echo $value; ?> <?php } ?> I am not getting any results any help what am i doing wrong?
  2. Brilliant thanks guys worked a treat
  3. Hi Guys Ive got a form as follows, <form method="post" action="<?php bloginfo("template_url"); ?>/process-discounted.php"> <table width="320" border="1"> <tr> <td><input type="checkbox" class="small" value=".co.uk" name="dom[]" />.co.uk</td> <td><input type="checkbox" class="small" value=".com" name="dom[]" />.com</td> <td><input type="checkbox" class="small" value=".org" name="dom[]" />.org</td> <td><input type="checkbox" class="small" value=".org.uk" name="dom[]" />.org.uk</td> </tr> <tr> <td><input type="checkbox" class="small" value=".net" name="dom[]" />.net</td> <td><input type="checkbox" class="small" value=".tv" name="dom[]" />.tv</td> <td><input type="checkbox" class="small" value=".biz" name="dom[]" />.biz</td> <td><input type="checkbox" class="small" value=".mobi" name="dom[]" />.mobi</td> </tr> <tr> <td><input type="checkbox" class="small" value=".me" name="dom[]" />.me</td> <td><input type="checkbox" class="small" value=".me.uk" name="dom[]" />.me.uk</td> <td><input type="checkbox" class="small" value=".eu" name="dom[]" />.eu</td> <td><input type="checkbox" class="small" value=".info" name="dom[]" />.info</td> </tr> </table> <p> <input class="submit" type="submit" id="submit" name="submit" value="submit"/> </p> </fieldset> </form> This is my process.php $aDoor = $_POST['dom']; $N = count($aDoor); for($i=0; $i < $N; $i++) { $domains = ($aDoor[$i] . " "); } include "MIME.class"; $to = 'example@hotmail.com'; $str = "Domains ".date('M Y', time()); $html_data = '<html lang="en"> <head> <title>Template 2 :: Versatile Newsletter</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" bgcolor="#F0F0F0"> <table cellpadding="0" cellspacing="0" width="720" align="center"> <tr> <td width="250">Domains:</td> <td width="250">'.$domains.'</td> </tr> </table> <br /> <br><br></td></tr> </table> </td></tr></table><!-- end wrapper table--> </body> </html>'; $mime = new MIME_mail("Discounted Hosting", $to, $str); $mime->attach($html_data, "", HTML, BASE64); $mime->send_mail(); } ?> This echos out the boxes checked which is fine but i need to send all the values in a email. how can i send these value in the email currently i only always get one value i need them to be broken up. any help please
  4. Hi ym_chaitu thanks for the reply i wanted to form to validate first, then if their is no validation errors it will run the simple header redirect at the top off the header.php, <?php if(isset($_POST['submit'])){ header("http://gponeclick.users32.interdns.co.uk/thankyou.php"); } ?> Obviously i will be running more than this but i would like to get it working up to this point???
  5. Hi ym_chaitu This is the sidebar code. <h2 class="donate">donate <span>online today</span></h2> <form id="formID" class="formular" method="post" action=""> <fieldset> <ol> <li> <input value="First Name:" onfocus="this.value = (this.value=='First Name:')? '' : this.value;" class="validate[required,custom[onlyLetter],length[0,100]] text-input" type="text" name="firstname" id="firstname" /> </li> <li> <input value="Last Name:" onfocus="this.value = (this.value=='Last Name:')? '' : this.value;" class="validate[required,custom[onlyLetter],length[0,100]] text-input" type="text" name="lastname" id="lastname" /> </li> <li> <input value="Email address:" onfocus="this.value = (this.value=='Email address:')? '' : this.value;" class="validate[required,custom[email]] text-input" type="text" name="email" id="email" /> </li> <li> <input type="text" value="Address 1:" onfocus="this.value = (this.value=='Address 1:')? '' : this.value;" class="validate[required,custom[onlyLetter],length[0,100]] text-input" name="address1" id="address1" /> </li> <li> <input type="text" name="address2" value="Address 2:" onfocus="this.value = (this.value=='Address 2:')? '' : this.value;" class="text"/> </li> <li> <input type="text" value="Town:" onfocus="this.value = (this.value=='Town:')? '' : this.value;" class="validate[required,custom[onlyLetter],length[0,100]] text-input" name="town" id="town" /> </li> <li> <input type="text" value="Postcode:" onfocus="this.value = (this.value=='Postcode:')? '' : this.value;" name="postcode"/> </li> <li> <input value="Telephone:" onfocus="this.value = (this.value=='Telephone:')? '' : this.value;" class="validate[required,custom[telephone]] text-input" type="text" name="phone" id="phone" /> </li> </ol> </fieldset> <fieldset class="check"> <div class="campaign"> <input class="validate[required] radio" type="radio" name="data[user][preferedColor]" id="radio1" value="5"/> <label><span>£1</span><br /> a month</label> </div> <div class="campaign"> <input class="validate[required] radio" type="radio" name="data[user][preferedColor]" id="radio2" value="3"/> <label><span>one-off</span> donation</label> </div> <div class="campaign"> <input class="validate[required] radio" type="radio" name="data[user][preferedColor]" id="radio3" value="9"/> <label><span>regular</span> donation</label> </div> </fieldset> <div id="onelife"> <div class="container2"> thankyou you for choosing our one life campaign click next step to proceed to payment.</div> </div> <div id="monthly"> <div class="container2"> <h4>Please select a monthly amount from list</h4> <label class="monthly">£5 Monthly</label> <input class="monthly" type="checkbox" name="five" /> <div class="clear"></div> <br /> <label class="monthly">£10 Monthly</label> <input class="monthly" type="checkbox" name="first" /> <div class="clear"></div> <br /> <label class="monthly">£20 Monthly</label> <input class="monthly" type="checkbox" name="second" /> <div class="clear"></div> <br /> <label class="monthly">£30 Monthly</label> <input class="monthly" type="checkbox" name="30" /> <div class="clear"></div> <br /> <label class="monthly">£40 Monthly</label> <input class="monthly" type="checkbox" name="40" /> </div> </div> <div id="oneoff"> <div class="container2">Thanks for choosing to make a one off donation click next step to proceed to payment.</div> </div> <img class="gift" src="http://gponeclick.users32.interdns.co.uk/wp-content/themes/Going-Public/images/gift-aid.png" width="300" height="38" alt="gift aid" /> <fieldset class="giftaid"> <input type="checkbox" id="giftaid" title="Please agree to our policy!" name="giftaid" class="{validate:{required:false}}" /> <p class="giftaid"> I would like Going Public to reclaim the tax I have paid on this donation, any donation I have made in the six years prior to this year, and any donations I may make in the future. I am a UK taxpayer.</p> <br /> </fieldset> <fieldset class="terms"> <input title="Please agree to our policy!" class="validate[required] checkbox" type="checkbox" id="agree" name="agree"/> <p class="giftaid">I agree to be added to the Going Public email database.</p> </fieldset> <fieldset class="submit"> <input class="submit" type="submit" value="Validate & Send the form!"/> </fieldset> </form> </div> And here is the main header.php. <?php if(isset($_POST['submit'])){ header("http://gponeclick.users32.interdns.co.uk/thankyou.php"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php bloginfo('description') ?></title> <meta name="description" content="<?php bloginfo('description') ?>" /> <?php if(is_search()) { ?> <meta name="robots" content="noindex, nofollow" /> <?php }?> <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" /> <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/style/css/validationEngine.jquery.css" /> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script src="<?php bloginfo("template_url"); ?>/js/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="<?php bloginfo("template_url"); ?>/js/jquery.validationEngine.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { //Hide div w/id extra $("#onelife").css("display","none"); // Add onclick handler to checkbox w/id checkme $("#radio-1").click(function(){ // If checked if ($("#radio-1").is(":checked")) { //show the hidden div $("#onelife").show("fast"); } else { //otherwise, hide it $("#onelife").hide("fast"); } }); $("#monthly").css("display","none"); // Add onclick handler to checkbox w/id checkme $("#radio-2").click(function(){ // If checked if ($("#radio-2").is(":checked")) { //show the hidden div $("#monthly").show("fast"); } else { //otherwise, hide it $("#monthly").hide("fast"); } }); $("#oneoff").css("display","none"); // Add onclick handler to checkbox w/id checkme $("#radio-3").click(function(){ // If checked if ($("#radio-3").is(":checked")) { //show the hidden div $("#oneoff").show("fast"); } else if ($("#radio-3").is(":unchecked")) { //otherwise, hide it $("#oneoff").hide("fast"); } }); }); </script> <script src="<?php bloginfo("template_url"); ?>/jquery.easing.1.3.js" type="text/javascript"></script> <script src="<?php bloginfo("template_url"); ?>/js/coda-slider-condensed.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript"> $(function() { $('.scrollButtons.left').hover(function() { var currentImg = $(this).attr('src'); $(this).attr('src', $(this).attr('hover')); $(this).attr('hover', currentImg); }, function() { var currentImg = $(this).attr('src'); $(this).attr('src', $(this).attr('hover')); $(this).attr('hover', currentImg); }); $('.scrollButtons.right').hover(function() { var currentImg = $(this).attr('src'); $(this).attr('src', $(this).attr('hover')); $(this).attr('hover', currentImg); }, function() { var currentImg = $(this).attr('src'); $(this).attr('src', $(this).attr('hover')); $(this).attr('hover', currentImg); }); }); </script> <?php wp_head(); ?> <script type="text/javascript"> $(document).ready(function() { // SUCCESS AJAX CALL, replace "success: false," by: success : function() { callSuccessFunction() }, $("#formID").validationEngine() //$.validationEngine.loadValidation("#date") //alert($("#formID").validationEngine({returnIsValid:true})) //$.validationEngine.buildPrompt("#date","This is an example","error") // Exterior prompt build example // input prompt close example //$.validationEngine.closePrompt(".formError",true) // CLOSE ALL OPEN PROMPTS }); </script> </head> <body> <div id="header" class="large"> <h1><a href="<?php echo get_option('home'); ?>/"> <?php bloginfo('name'); ?> </a></h1> <div id="search_box"> <?php get_search_form(); ?> </div> <!-- end search box --> <a class="sign" href="#">Sign</a> </div> <div id="menu" class="large"> <ul> <?php wp_list_pages('title_li='); ?> </ul> </div>
  6. Hi I have got a problem with the validation on my site. I cant seem to solve the problem. Every time i hit submit on my form, the form starts to validate but then refreshes. You can see my problem here. http://gponeclick.users32.interdns.co.uk/ I have got a form on my site that is submitting to an action of nothing. <form id="formID" class="formular" method="post" action=""> Has anyone had a similar problem or can give me some sort off reason why it would be doing this. The form is in a sidebar_all.php and is included in the index.php <div class="column"> <?php include (TEMPLATEPATH . "/sidebar_all.php"); ?> </div> I have deleted this and inserted all the form code into the index.php and it is still causing the problem. Anyone help please???
  7. Ok thanks WolfRage for the reply i will look into this first. because its a charity im trying to figure out the following. Originator's Identification Number: Giftaid: UK taxpayer: Anyone done any stuff for charities that could help? thanks
  8. Hi Really need some help please, im was setting up a donation form for a charity which went to paypal for them to setup a direct debit payment which was fine. My problem is they don't want to use paypal anymore they want people to be able to set-up a direct debit directly through the website. I have never done this before and have nearly always used paypal does anyone now any good resources on setup a direct debit payment. Any help would be great just looking for a starting point. Could i make it from scratch with php?
  9. Hello can someone please help me im running a foreach loop that is pulling the prices value out off my database as follows. this is the function function one_life() { db_connect(); $query = "SELECT * FROM paypal_payment_info order by paypal_payment_info.mc_gross DESC"; $result = mysql_query($query); if(!$result) { echo mysql_error(); } $result = db_result_to_array($result); return $result; } $one_lifes = one_life(); This is my foreach loop <?php foreach($one_lifes as $one_life) { ?> <?php echo $one_life['mc_gross']; ?> <?php } ?> So this gives me the values i have a list like this. 200 10 30 200 350 What i need to do is add all these values together and echo one overall amount which would be say 790 for the example. Any Help Please?
  10. thanks for the reply So if i add this ("^[[a-zA-Z]{2}\s[0-9]{4}]$") does this mean that both possible codes would work? ie as1233 or as 1233
  11. Can someone please help me. Ive done this regular expression which works out as any code that starts with two letters and ends with four numbers. i.e as1233 Im not very good with regular expressions all i want is it to allow spaces because the company has hand out the code to every as two letters SPACE and ends with four numbers. ie as 1233 Here my regular expression ("^[[a-zA-Z]{2}[0-9]{4}]$") i see that \s strips whitespace but dont now how to implement this. Any help Please?
  12. Hey that did the job good for what i needed thanks premiso
  13. Ok thanks cheers for the reply.
  14. Hello i am not sure if this is a JavaScript question or a php question so sorry first. Here is my problem i have a survey which is really long so you have to scroll down the page right to the bottom after filling it out and then clicking submit, the survey scrolls all the way to the top again i really don't want this to happen. After it has been submited i want it to scroll dynamically to the bottom. here is some of my code. <FORM METHOD="post" ACTION="" id="check"> <table> //whole survey form here// </table> <table> <input type="submit" name="signup" id="submit_btn" value="" /> </table> if(isset($_POST[signup])){ /////////////////////////////////////////////////////////////////////////// echo "<script langauge=\"javascript\">alert(\"Thank you We've received your Business Check. We will get back to you shortly!\");</script>"; } How can i run some code after the alert to send the user to the bottom off the page can someone please tell me what is the best way to do this????
  • 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.