Jump to content

digibucc

Members
  • Posts

    142
  • Joined

  • Last visited

Everything posted by digibucc

  1. $query = 'SELECT from tableb WHERE manufacturer = $tablea_manuf'; JOINS would not be right nodral, as he is not simultaneously getting data from two dbs, he needs a value from the first to find the required record in the second.
  2. hello i would test a simple send with mail() before debugging that: http://php.net/manual/en/function.mail.php bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) <?php mail('caffeinated@example.com', 'My Subject', $message); ?> that will confirm that php smtp is working, and then you can debug phpmailer
  3. mysql is more common and doesn't need ODBC, so unless you need ODBC to connect to an access, etc db i would use mysql.
  4. i said if else in heredoc because that is what you need info on, a google search returned this: http://stackoverflow.com/questions/7187226/if-else-with-heredoc-not-behaving-as-expected along with a few others. it's not possible to do your if statement inside your heredoc (EOL) the code i gave you WILL work if you put it BEFORE the heredoc starts (<<<EOL). honestly heredoc is not the best way to do this project, but if you're set on that you need to do it differently. the link i posted has an example that shows how it must be done. sorry bud ;(
  5. so you are using heredoc? that's why the code looked wrong to me, as i couldn't see that. i have never used an if inside a heredoc statement, so i'm at a bit of a loss. i would think you need to end the heredoc for the if statement, but i don't know. i'd venture that's where your problem lies though. "if else in heredoc"
  6. not according to what you posted. that is a weird mixture of php and html and should not work at all. <?php if(file_exists($md_sig)) { ?> <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">$md_sig<hr />Psychiatrist: $md_name_string</td> <td valign="bottom">$md_date_string<hr />Date:</td> </tr> <tr> <td valign="bottom">$case_manager_sig<hr />Case Manager: $case_manager_name_string</td> <td valign="bottom">$case_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom">$therapist_sig<hr />Therapist: $therapist_name_string</td> <td valign="bottom">$therapist_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom">$activity_therapist_sig<hr />Activity Therapist: $activity_therapist_name_string</td> <td valign="bottom">$activity_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom">$other_sig<hr />Other: $other_name_string</td> <td valign="bottom">$other_date_string <hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr> <?php } else { ?> <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom"><hr />Psychiatrist: $md_name_string</td> <td valign="bottom">$md_date_string<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Case Manager: $case_manager_name_string</td> <td valign="bottom">$case_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Therapist: $therapist_name_string</td> <td valign="bottom">$therapist_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Activity Therapist: $activity_therapist_name_string</td> <td valign="bottom">$activity_date_string <hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Other: $other_name_string</td> <td valign="bottom">$other_date_string <hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr> <?php } ?> would work assuming it's actually html it just has that php in it. otherwise you would need an echo or print in there somewhere. you have html and php mixed with nothing to tell it what's what. <?php <td valign="bottom">$md_date_string<hr />Date:</td> ?> same thing here. you need an echo or print there. </tr> } else { <tr> something like this instead: <?php if(file_exists($md_sig)) { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">'. $md_sig. '<hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $case_manager_sig. '<hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $case_date_string. '<hr />Date:</td> </tr> </table> </td> </tr>'; } ?> i'd say you are seeing it twice because it is not parsing it as php at all. so it sees two tables and ignored the if statement.
  7. both of those should have worked, i think you need to show us your code var_dump($mp_sig); //before the if statement, so you know it is in fact empty. also copy and post the if else you made in regards to the post before mine, as that should have worked and there's probably something in the code wrong.
  8. this will grab each entry in the array, and then you pull the named key (url) for that entry and do what you want, along with any other keys. it is best if your keys are always the same. <?php foreach ($array as $entry){ echo $entry['url']; // named array key in nested array } ?> or this will cycle through each entry, and then each value in the entry. it's cumbersome and not recommended unless you need to process each value THE SAME, separately. <?php foreach ($array as $entry){ foreach ($entry as info) { // do something with each piece of info, in each entry } } ?>
  9. are there not any because it's not performing the query properly, or are there actually no rows to be pulled? either way, they are still right. you need error handling to move forward. something to say "if row is empty, don't grab it"
  10. if i understand you properly, and all you want is to blank the info if the md_sig is not there, then you could <?php if (empty($md_sig)) { $case_manager_sig = ''; $therapist_sig = ''; $activity_therapist_sig = ''; $other_sig = ''; } ?> you could also throw the dates in there if those need to be unset. this way you do it before the html and you don't have to if anything there , the strings will just be blank if md_sig was blank.
  11. agreed with drummin - switch assuredly has it's uses but for this i'd use an array. also, you can set your var as such: <?php $to = $county = $_POST['county']; ?>
  12. where's the registration page where the password is created/inserted? you've got to compare what gets inserted with the query results, and obviously what you are typing.
  13. why single quotes on the bottom link? the image loads fine on the top? what if you type a static link there, with no php, does that work?
  14. i was just reading about that today... understand it but guess i haven't learned it yet huh
  15. you want to echo the whole input if: <?php if(!empty($value)) { echo '<input name="First Name" type="text" maxlength="50" size="50" value="'. $value. '" />'; } else { echo '<input name="First Name" type="text" maxlength="50" size="50" />'; } ?>
  16. here's what i did: <?php foreach ($entry as $key=>$value){ if ($value != '' && $value != 'Submit'){ $cols .= mysql_real_escape_string($key). ', '; $vals .= '\''. mysql_real_escape_string($value). '\', '; } } $columns = substr($cols,0,-2); // trim trailing "'," , $values = substr($vals,0,-2); $sql="INSERT INTO table ( $columns )VALUES ( $values )"; i'm sure there are other ways to handle the trailing "',", but this works for me
  17. there is no limit to case. here's a snip from one of my scripts: <?php switch($stl_type){ default:$type = 'other-trucks';break; case 'car carrier truck':$type = 'auto-carrier';break; case 'van trucks / box trucks':$type = 'box-vans';break; case 'bucket truck / boom truck':$type = 'bucket-truck';break; case 'dump truck': case 'dump bodies only': case 'dump chassis truck': case 'dump/transfer': case 'flatbed-dump truck':$type = 'dump-trucks';break; case 'tow trucks': case 'roll-back tow truck': case 'wrecker tow truck': case 'tow truck':$type = 'tow-trucks ';break; } ?> notice: <?php case 'dump truck': case 'dump bodies only': case 'dump chassis truck': case 'dump/transfer': case 'flatbed-dump truck': $type = 'dump-trucks'; break;?> so you can set multiple matches for an action. my statement is 3x that long, and i don't believe there is a functional limit. maybe there error is elsewhere, or syntax? you could also put them in arrays: <?php $region1 = array('county1', 'county2', 'county3', 'etc'; $region2 = array('county4', 'county5', 'county6', 'etc'; if (in_array($needle, $region1) { do_something(); // found your county in region 1 } else if (in_array($needle, $region2) { do_something(); // found your county in region 2 }?> if you do more, you may consider making them array keys and using array_key_exists, as that's faster than searching array values. but for 10 counties each region this works fine.
  18. similar text and/or levenshtein int similar_text ( string $first , string $second [, float &$percent ] ) int levenshtein ( string $str1 , string $str2 ) http://php.net/manual/en/function.similar-text.php http://www.php.net/manual/en/function.levenshtein.php
×
×
  • 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.