Jump to content

ringartdesign

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ringartdesign's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I seem to be having some cross browser problems with my dynamic navigation. I have a 2-tiered navigation (parent and child pages) and have formatted the standard dynamic nav code to highlight the parent page and subcategory page in the navigation to visually let the viewer know where they are in the site. It seems to be working correctly for most computers in Firefox, but not in Safari. I've used the code in my header: //*to display the parent page*// <?php wp_list_pages('title_li=&depth=1');?> //*to display the child page within selected parent page*// <?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <ul id="subnav"> <?php echo $children; ?> <?php } else { ?> <?php } ?> Any ideas on how to correct this code to be uniform across all browser platforms?
  2. How can I integrate the most recent wordpress blog entry into php page? Here is my page: http://halfpricewinenight.com/blog.php Here is the php code I'm using to pull in the blog content. It works well, showing the title and "read post" button, but does not show the blog content (or full body of the blog). Any ideas: <?php /* Example #1: php to pull and publish wordpress 2 post data on an external page NO CACHE. http://www.roccanet.com */ define('WP_USE_THEMES', false); require('blog/wp-blog-header.php'); $how_many=100; //How many posts do you want to show require_once("blog/wp-config.php"); // Change this for your path to wp-config.php file $news=$wpdb->get_results("SELECT ID,post_title, post_excerpt FROM $wpdb->posts WHERE post_status= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many); foreach($news as $np){ //NOTE: get other post data by selecting different //data in the posts table... $permalink=get_permalink($np->ID); $html= "<a href=\"". $permalink . "\">$np->post_title $np->post_excerpt <a href=\"" . $permalink . "\">read post \n"; //NOTE: you can easily alter the HTML above to suit echo $html; } ?>
  3. This may not be a php question or simply a html form question, but thought I'd try. I have a html form: https://2stephealth.com/get_quote.html That directs to a php page that calculates a quote based on their age, gender, etc. This works perfectly as is, however, if a person is 65 or older the form returns $0 on quote.php. How can I have the form return a brand new quote page (quote_seniors.php) if the person enters an age of 65 or older? Here is my php processing: <?php if (($_POST['age'] >= 18) && ($_POST['age'] <= 25) && ($_POST['sex'] =="male")) $quote=31.44; elseif (($_POST['age'] >= 18) && ($_POST['age'] <= 25) && ($_POST['sex'] =="female")) $quote=44.65; elseif (($_POST['age'] >= 26) && ($_POST['age'] <= 30) && ($_POST['sex'] =="male")) $quote=35.91; elseif (($_POST['age'] >= 26) && ($_POST['age'] <= 30) && ($_POST['sex'] =="female")) $quote=50.33; elseif (($_POST['age'] >= 31) && ($_POST['age'] <= 35) && ($_POST['sex'] =="male")) $quote=40.78; elseif (($_POST['age'] >= 31) && ($_POST['age'] <= 35) && ($_POST['sex'] =="female")) $quote=62.11; elseif (($_POST['age'] >= 36) && ($_POST['age'] <= 40) && ($_POST['sex'] =="male")) $quote=51.33; elseif (($_POST['age'] >= 36) && ($_POST['age'] <= 40) && ($_POST['sex'] =="female")) $quote=76.72; elseif (($_POST['age'] >= 41) && ($_POST['age'] <= 45) && ($_POST['sex'] =="male")) $quote=65.95; elseif (($_POST['age'] >= 41) && ($_POST['age'] <= 45) && ($_POST['sex'] =="female")) $quote=92.55; elseif (($_POST['age'] >= 46) && ($_POST['age'] <= 50) && ($_POST['sex'] =="male")) $quote=87.87; elseif (($_POST['age'] >= 46) && ($_POST['age'] <= 50) && ($_POST['sex'] =="female")) $quote=108.38; elseif (($_POST['age'] >= 51) && ($_POST['age'] <= 60) && ($_POST['sex'] =="male")) $quote=117.51; elseif (($_POST['age'] >= 51) && ($_POST['age'] <= 60) && ($_POST['sex'] =="female")) $quote=126.65; elseif (($_POST['age'] >= 61) && ($_POST['age'] <= 64) && ($_POST['sex'] =="male")) $quote=184.07; elseif (($_POST['age'] >= 61) && ($_POST['age'] <= 64) && ($_POST['sex'] =="female")) $quote=168.87; //add spouse if (($_POST['spouse_age'] >= 18) && ($_POST['spouse_age'] <= 25) && ($_POST['spouse_sex'] =="male")) $quote+=31.44; elseif (($_POST['spouse_age'] >= 18) && ($_POST['spouse_age'] <= 25) && ($_POST['spouse_sex'] =="female")) $quote+=44.65; elseif (($_POST['spouse_age'] >= 26) && ($_POST['spouse_age'] <= 30) && ($_POST['spouse_sex'] =="male")) $quote+=35.91; elseif (($_POST['spouse_age'] >= 26) && ($_POST['spouse_age'] <= 30) && ($_POST['spouse_sex'] =="female")) $quote+=50.33; elseif (($_POST['spouse_age'] >= 31) && ($_POST['spouse_age'] <= 35) && ($_POST['spouse_sex'] =="male")) $quote+=40.78; elseif (($_POST['spouse_age'] >= 31) && ($_POST['spouse_age'] <= 35) && ($_POST['spouse_sex'] =="female")) $quote+=62.11; elseif (($_POST['spouse_age'] >= 36) && ($_POST['spouse_age'] <= 40) && ($_POST['spouse_sex'] =="male")) $quote+=51.33; elseif (($_POST['spouse_age'] >= 36) && ($_POST['spouse_age'] <= 40) && ($_POST['spouse_sex'] =="female")) $quote+=76.72; elseif (($_POST['spouse_age'] >= 41) && ($_POST['spouse_age'] <= 45) && ($_POST['spouse_sex'] =="male")) $quote+=65.95; elseif (($_POST['spouse_age'] >= 41) && ($_POST['spouse_age'] <= 45) && ($_POST['spouse_sex'] =="female")) $quote+=92.55; elseif (($_POST['spouse_age'] >= 46) && ($_POST['spouse_age'] <= 50) && ($_POST['spouse_sex'] =="male")) $quote+=87.87; elseif (($_POST['spouse_age'] >= 46) && ($_POST['spouse_age'] <= 50) && ($_POST['spouse_sex'] =="female")) $quote+=108.38; elseif (($_POST['spouse_age'] >= 51) && ($_POST['spouse_age'] <= 60) && ($_POST['spouse_sex'] =="male")) $quote+=117.51; elseif (($_POST['spouse_age'] >= 51) && ($_POST['spouse_age'] <= 60) && ($_POST['spouse_sex'] =="female")) $quote+=126.65; elseif (($_POST['spouse_age'] >= 61) && ($_POST['spouse_age'] <= 64) && ($_POST['spouse_sex'] =="male")) $quote+=184.07; elseif (($_POST['spouse_age'] >= 61) && ($_POST['spouse_age'] <= 64) && ($_POST['spouse_sex'] =="female")) $quote+=168.87; ?>
  4. I have a form that takes about 5-10 seconds on average to process the php math and return the math answer. The form and php math work perfectly, but while the php math is being processed, the page goes blank for the 5-10 seconds and then starts loading the page design and math solution. I was wondering if there is a way to program this so that there is an intermediate page, kinda like the way airline ticket price searches use, telling the user that their information is being processed and to hold on?
  5. I have a simple math formula that works beautifully (see code below) However, on some occasions where there is a second zero after the decimal point, it does not show up (ie-$100.1 should be $100.10). Is there a way to ensure that the second number displays even if it is zero? <?php if (($_POST['age'] >= 18) && ($_POST['age'] <= 25) && ($_POST['sex'] =="male")) $quote=31.44; elseif (($_POST['age'] >= 18) && ($_POST['age'] <= 25) && ($_POST['sex'] =="female")) $quote=44.65; elseif (($_POST['age'] >= 26) && ($_POST['age'] <= 30) && ($_POST['sex'] =="male")) $quote=35.91; elseif (($_POST['age'] >= 26) && ($_POST['age'] <= 30) && ($_POST['sex'] =="female")) $quote=50.33; elseif (($_POST['age'] >= 31) && ($_POST['age'] <= 35) && ($_POST['sex'] =="male")) $quote=40.78; elseif (($_POST['age'] >= 31) && ($_POST['age'] <= 35) && ($_POST['sex'] =="female")) $quote=62.11; elseif (($_POST['age'] >= 36) && ($_POST['age'] <= 40) && ($_POST['sex'] =="male")) $quote=51.33; elseif (($_POST['age'] >= 36) && ($_POST['age'] <= 40) && ($_POST['sex'] =="female")) $quote=76.72; elseif (($_POST['age'] >= 41) && ($_POST['age'] <= 45) && ($_POST['sex'] =="male")) $quote=65.95; elseif (($_POST['age'] >= 41) && ($_POST['age'] <= 45) && ($_POST['sex'] =="female")) $quote=92.55; elseif (($_POST['age'] >= 46) && ($_POST['age'] <= 50) && ($_POST['sex'] =="male")) $quote=87.87; elseif (($_POST['age'] >= 46) && ($_POST['age'] <= 50) && ($_POST['sex'] =="female")) $quote=108.38; elseif (($_POST['age'] >= 51) && ($_POST['age'] <= 60) && ($_POST['sex'] =="male")) $quote=117.51; elseif (($_POST['age'] >= 51) && ($_POST['age'] <= 60) && ($_POST['sex'] =="female")) $quote=126.65; elseif (($_POST['age'] >= 61) && ($_POST['age'] <= 64) && ($_POST['sex'] =="male")) $quote=184.07; elseif (($_POST['age'] >= 61) && ($_POST['age'] <= 64) && ($_POST['sex'] =="female")) $quote=168.87; //add spouse if (($_POST['spouse_age'] >= 18) && ($_POST['spouse_age'] <= 25) && ($_POST['spouse_sex'] =="male")) $quote+=31.44; elseif (($_POST['spouse_age'] >= 18) && ($_POST['spouse_age'] <= 25) && ($_POST['spouse_sex'] =="female")) $quote+=44.65; elseif (($_POST['spouse_age'] >= 26) && ($_POST['spouse_age'] <= 30) && ($_POST['spouse_sex'] =="male")) $quote+=35.91; elseif (($_POST['spouse_age'] >= 26) && ($_POST['spouse_age'] <= 30) && ($_POST['spouse_sex'] =="female")) $quote+=50.33; elseif (($_POST['spouse_age'] >= 31) && ($_POST['spouse_age'] <= 35) && ($_POST['spouse_sex'] =="male")) $quote+=40.78; elseif (($_POST['spouse_age'] >= 31) && ($_POST['spouse_age'] <= 35) && ($_POST['spouse_sex'] =="female")) $quote+=62.11; elseif (($_POST['spouse_age'] >= 36) && ($_POST['spouse_age'] <= 40) && ($_POST['spouse_sex'] =="male")) $quote+=51.33; elseif (($_POST['spouse_age'] >= 36) && ($_POST['spouse_age'] <= 40) && ($_POST['spouse_sex'] =="female")) $quote+=76.72; elseif (($_POST['spouse_age'] >= 41) && ($_POST['spouse_age'] <= 45) && ($_POST['spouse_sex'] =="male")) $quote+=65.95; elseif (($_POST['spouse_age'] >= 41) && ($_POST['spouse_age'] <= 45) && ($_POST['spouse_sex'] =="female")) $quote+=92.55; elseif (($_POST['spouse_age'] >= 46) && ($_POST['spouse_age'] <= 50) && ($_POST['spouse_sex'] =="male")) $quote+=87.87; elseif (($_POST['spouse_age'] >= 46) && ($_POST['spouse_age'] <= 50) && ($_POST['spouse_sex'] =="female")) $quote+=108.38; elseif (($_POST['spouse_age'] >= 51) && ($_POST['spouse_age'] <= 60) && ($_POST['spouse_sex'] =="male")) $quote+=117.51; elseif (($_POST['spouse_age'] >= 51) && ($_POST['spouse_age'] <= 60) && ($_POST['spouse_sex'] =="female")) $quote+=126.65; elseif (($_POST['spouse_age'] >= 61) && ($_POST['spouse_age'] <= 64) && ($_POST['spouse_sex'] =="male")) $quote+=184.07; elseif (($_POST['spouse_age'] >= 61) && ($_POST['spouse_age'] <= 64) && ($_POST['spouse_sex'] =="female")) $quote+=168.87; //add children if (($_POST['children'] >= 3)) $quote+=90.12; elseif (($_POST['children'] == 1)) $quote+=30.04; elseif (($_POST['children'] == 2)) $quote+=60.08; elseif (($_POST['children'] == 3)) $quote+=90.12;?> //quote value echo "<p style='font-size:60px; color:#b7cd2d;'>$".$quote."<br />"; echo "<span style='font-size:16px;'>per month*</span></p>"; ?>
  6. This may be a simple question, but how can I format the color and size of the font that the echo outputs? Basically, I'd like to change the size and color of the phone number listed below... echo "$".$quote."/month</p> <p>CALL NOW: 1-877-123-4567<br> Thanks in advance!!
  7. That worked! Thank You! 2 more questions... How could I add the spouse's quote to it? All values would be exactly the same except "age" would be "spouse_age" and "sex" would be "spouse_sex"? Also, I added children by doing this: $quote+=($_POST['children']*30.04); But I need it to stop adding 30.04 for 4+ children. (ie - 1 child = 30.04, 2 children = 60.08, 3 children = 90.12, {more than 3 remains the same} 4 children = 90.12) Thanks!!!
  8. I've got a website I'm putting together for my small insurance agency. Basically I want to give the viewer a quote based on their age and sex. I'd like to be able to add their spouses age and sex to the equation as well as up to 3 children (anything over 4+ children are free). The php code below that works for the age range but does not give a different quote based on the sex. My question is: Can you advise on how to edit this PHP code below to factor in the sex of the person? PHP CODE <?php //page display after form submission echo "<p><CENTER>Thank you, <b>$_POST[name]</b>, for requesting a quote.<br> Your are eligable for heatlh insurance rates as low as:</p>"; if (($_POST['age'] >= 18) && ($_POST['age'] <= 25) && ($_POST['sex'] ="male")) $quote=31.44; elseif (($_POST['age'] >= 18) && ($_POST['age'] <= 25) && ($_POST['sex'] ="female")) $quote=44.65; elseif (($_POST['age'] >= 26) && ($_POST['age'] <= 30) && ($_POST['sex'] ="male")) $quote=35.91; elseif (($_POST['age'] >= 26) && ($_POST['age'] <= 30) && ($_POST['sex'] ="female")) $quote=35.91; elseif (($_POST['age'] >= 31) && ($_POST['age'] <= 35) && ($_POST['sex'] ="male")) $quote=40.78; elseif (($_POST['age'] >= 31) && ($_POST['age'] <= 35) && ($_POST['sex'] ="female")) $quote=62.11; elseif (($_POST['age'] >= 36) && ($_POST['age'] <= 40) && ($_POST['sex'] ="male")) $quote=51.33; elseif (($_POST['age'] >= 36) && ($_POST['age'] <= 40) && ($_POST['sex'] ="female")) $quote=76.72; elseif (($_POST['age'] >= 41) && ($_POST['age'] <= 45) && ($_POST['sex'] ="male")) $quote=65.95; elseif (($_POST['age'] >= 41) && ($_POST['age'] <= 45) && ($_POST['sex'] ="female")) $quote=92.55; elseif (($_POST['age'] >= 46) && ($_POST['age'] <= 50) && ($_POST['sex'] ="male")) $quote=87.87; elseif (($_POST['age'] >= 46) && ($_POST['age'] <= 50) && ($_POST['sex'] ="female")) $quote=108.38; elseif (($_POST['age'] >= 51) && ($_POST['age'] <= 60) && ($_POST['sex'] ="male")) $quote=117.50; elseif (($_POST['age'] >= 51) && ($_POST['age'] <= 60) && ($_POST['sex'] ="female")) $quote=126.65; elseif (($_POST['age'] >= 61) && ($_POST['age'] <= 64) && ($_POST['sex'] ="male")) $quote=184.07; elseif (($_POST['age'] >= 61) && ($_POST['age'] <= 64) && ($_POST['sex'] ="female")) $quote=168.87; //add children $quote+=($_POST['children']*30.04); echo "$".$quote."/month</p> <p>CALL NOW: 1-877-123-4567<br> TO START YOUR HEALTH INSURANCE COVERAGE!</p>"; //start building the mail string $msg = "Name: $_POST[name]\n"; $msg .= "Age: $_POST[age]\n"; $msg .= "Sex: $_POST[sex]\n"; $msg .= "Children: $_POST[children]\n"; $msg .= "E-Mail: $_POST\n"; $msg .= "Message: $_POST[message]\n"; //set up the mail to company $recipient = "info@company.com"; $subject = "Health Insurance Quote"; $mailheaders = "From: 2 Step Health <info@company.com> \n"; //send the mail to company mail($recipient, $subject, $msg, $mailheaders); ?>
×
×
  • 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.