Jump to content

gmcalp

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by gmcalp

  1. Ok, I figured it out (with a little help from my brother-in-law). Here is what we did: <?php foreach ($row as $key => $val) { if ($key == "added") break; // because that means we past the last line we wanted displayed this way. if ($val != "") { if (! strcmp($key,'url')) { echo "<div class=\"trow-jobs\"><div class=\"tcell_1\"><strong>" . replaceTableTitle($key) . ":</strong></div><div class=\"tcell_2\"><a href=\"http://$val\" target=\"_blank\" class=\"popup\">http://$val</a></div></div>\n"; } elseif (! strcmp($key,'contactemail')) { echo "<div class=\"trow-jobs\"><div class=\"tcell_1\"><strong>" . replaceTableTitle($key) . ":</strong></div><div class=\"tcell_2\"><a href=\"mailto:$val\">$val</a></div></div>\n"; } else { echo "<div class=\"trow-jobs\"><div class=\"tcell_1\"><strong>" . replaceTableTitle($key) . ":</strong></div><div class=\"tcell_2\">".$val."</div></div>\n"; } ?>
  2. I understand I could do it that way, but I would like it parsed automatically with the rest of the script, within the foreach loop so each of the two rows are displayed in order like it is now. <?php foreach ($row as $key => $val) { if ($key == "added") break; // because that means we past the last line we wanted displayed this way. if ($val != "") echo "<div class=\"trow-jobs\"><div class=\"tcell_1\"><strong>" . replaceTableTitle($key) . ":</strong></div><div class=\"tcell_2\">".$val."</div></div>\n"; } ?> Here is the output of that script: http://www.bmet.org/job-listings/ . As you can see, the two fields (URL and Contact Email) are not click-able links as I would like them to be.
  3. Good evening all, I hope your Friday is going well. A few months back premiso helped me out with a script in this thread. His help was greatly appreciated, and it got me up and running with a better script. Now I am back with one question, can anyone help me figure out a way to parse two of the database fields to automatically output as click-able links? I am hoping to be able to do this without REGEX, but if that's the only way to go, then I guess that'll have to do. The two fields would be: row['url] and row['contactemail']. Here is the code of the script: else { while ($row = mysql_fetch_assoc($result)) { $row['added'] = date("m/d/y", strtotime($row['added'])); // convert newline characters to HTML break tag ( <br /> ) $row['description'] = nl2br($row['description']); $row['qualifications'] = nl2br($row['qualifications']); $row['preferred'] = nl2br($row['preferred']); $row['howtoapply'] = nl2br($row['howtoapply']); echo "<h3>".$row['title']."</h3>\n"; //table format echo "<div class=\"table\">\n"; echo "<div class=\"trow-jobs\">\n"; echo "<div class=\"tcell_1\"><strong>Title:</strong></div><div class=\"tcell_2\">".$row['title']."</div>\n"; echo "</div>\n"; echo "<div class=\"trow-jobs\">\n"; echo "<div class=\"tcell_1\"><strong>Employer:</strong></div><div class=\"tcell_2\">".$row['employer']."</div>\n"; echo "</div>\n"; foreach ($row as $key => $val) { if ($key == "added") break; // because that means we past the last line we wanted displayed this way. if ($val != "") echo "<div class=\"trow-jobs\"><div class=\"tcell_1\"><strong>" . replaceTableTitle($key) . ":</strong></div><div class=\"tcell_2\">".$val."</div></div>\n"; } echo "</div>\n"; echo "<div>(Added on: " .$row['added']. ")</div>\n"; echo "<br/><br/>\n"; } } function replaceTableTitle($title) { switch (strtolower($title)) { case 'fte': return "FTE"; case 'howtoapply': return "How To Apply"; case 'url': return "URL"; case 'contactname': return "Contact Name"; case 'contactphone': return "Contact Phone"; case 'contactemail': return "Contact E-mail"; break; } // if we get here just upercase the first word return ucfirst($title); } mysql_close(); As always, any help is much appreciated.
  4. gmcalp

    /cpanel

    that should be http://forums.cpanel.net
  5. an example: mail("yourname@yourdomain.com","Subject Line Text Here",$message,"From: ".$email.",$headers,");
  6. Here's the delete from table that I have in one of my scripts: while ($row = mysql_fetch_array($result)) { $jobid = $row['id']; $jobtitle = $row['title']; $added = $row['added']; $empl = $row['employer']; echo '<p>' . $jobtitle . ", " . $empl . ": " . $added . ' <a href="' . $_SERVER['PHP_SELF'] . '?deletejob=' . $jobid . '">' . 'Delete this job</a></p>';} } // If a job has been deleted, // remove it from the database. if (isset($_GET['deletejob'])) { $jobid = $_GET['deletejob']; $sql = "DELETE FROM jobs WHERE id=$jobid"; if (@mysql_query($sql)) { echo "<b>Job Deleted!<br>You'll be redirected to Home Page after (4) Seconds"; #header("location: deleted.php"); echo "<meta http-equiv=Refresh content=4;url=".$_SERVER['PHP_SELF'].">"; # $_SERVER['PHP_SELF']; Edit it as you need.
  7. nl2br means: new line (carriage return) to <br/> here's an example of how I have used it: // convert newline characters to HTML break tag ( <br /> ) $desc = nl2br($desc);
  8. Here's a contact form that I use on one of my websites, maybe you could modify yours to work with this code: The HTML (just take out the CSS, unless you would like me to send that to you as well): <form action='forms/contact/process.php' method='post' enctype='multipart/form-data' name="Contact" id="Contact" class="cmxform"> <p>Please complete the form below. Mandatory fields marked <em>*</em></p> <fieldset> <legend>Contact Information</legend> <ol> <li><label for="First">First:<em>*</em></label> <input type="text" name='First' id='First' tabindex='1' /></li> <li><label for="Last">Last:<em>*</em></label> <input type="text" name='Last' id='Last' tabindex='2' /></li> <li><label for="Email">E-Mail:<em>*</em></label> <input type="text" name='Email' id='Email' tabindex='3' /></li> <li><label for="Phone">Phone:</label> <input type="text" name='Phone' id='Phone' tabindex='4' /></li> <li><label for="Address">Address:</label> <input type="text" name='Address' id='Address' tabindex='5' /></li> <li><label for="City">City:</label> <input type="text" name='City' id='City' tabindex='6' /></li> <li><label for="State">State:</label> <select size='1' name='State' id='State' tabindex='7'> <option value="">Select Below</option><option value="AL">Alabama</option> <option value="AK">Alaska</option><option value="AZ">Arizona</option> <option value="AR">Arkansas</option><option value="CA">California</option> <option value="CO">Colorado</option><option value="CT">Connecticut</option> <option value="DE">Delaware</option><option value="FL">Florida</option> <option value="GA">Georgia</option><option value="HI">Hawaii</option> <option value="ID">Idaho</option><option value="IL">Illinois</option> <option value="IN">Indiana</option><option value="IA">Iowa</option> <option value="KS">Kansas</option><option value="KY">Kentucky</option> <option value="LA">Louisiana</option><option value="ME">Maine</option> <option value="MD">Maryland</option><option value="MA">Massachusetts</option> <option value="MI">Michigan</option><option value="MN">Minnesota</option> <option value="MS">Mississippi</option><option value="MO">Missouri</option> <option value="MT">Montana</option><option value="NE">Nebraska</option> <option value="NV">Nevada</option><option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option><option value="NM"> New Mexico </option> <option value="NY">New York</option><option value="NC">North Carolina</option> <option value="ND">North Dakota</option><option value="OH">Ohio</option> <option value="OK">Oklahoma</option><option value="OR">Oregon</option> <option value="PA">Pennsylvania</option><option value="PR">Puerto Rico</option> <option value="RI">Rhode Island</option><option value="SC">South Carolina</option> <option value="SD"> South Dakota </option><option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option><option value="VA">Virginia</option> <option value="WA">Washington</option><option value="DC">Washington, D.C.</option> <option value="WV">West Virginia</option><option value="WI">Wisconsin</option> <option value="WY">Wyoming </option></select></li> <li><label for="Zip">Zip: <em>*</em></label> <input type="text" name='Zip' id='Zip' tabindex="8" /></li> <li> <fieldset> <legend>Please leave your comments below:<em>*</em></legend> <label for="Comments">Comments:</label> <textarea name='comments' id='Comments' rows="7" cols="45" tabindex='9'></textarea> </fieldset> </li> </ol> <p class="small">By submitting this form with your telephone number you are consenting for xxxxxxx and all authorized representatives to contact you even if your name is on a Federal or State "Do not call List".</p> <p class="small">Thank you for submitting your information. I will be in contact with you by phone or email.</p> <p><input name="submit" type="submit" value='Submit Form' /> <input name="reset" type="reset" value='Reset Form' /></p> </fieldset> </form> Here's the processor.php: <?php include("db_config.php"); function pt_register() { $num_args = func_num_args(); $vars = array(); if ($num_args >= 2) { $method = strtoupper(func_get_arg(0)); if (($method != 'SESSION') && ($method != 'GET') && ($method != 'POST') && ($method != 'SERVER') && ($method != 'COOKIE') && ($method != 'ENV')) { die('The first argument of pt_register must be one of the following: GET, POST, SESSION, SERVER, COOKIE, or ENV'); } $varname = "HTTP_{$method}_VARS"; global ${$varname}; for ($i = 1; $i < $num_args; $i++) { $parameter = func_get_arg($i); if (isset(${$varname}[$parameter])) { global $$parameter; $$parameter = ${$varname}[$parameter]; } } } else { die('You must specify at least two arguments'); } } $errors=0; $error="The following errors occured while processing your form input.<ul>"; pt_register('POST','First'); pt_register('POST','Last'); pt_register('POST','Email'); pt_register('POST','Phone'); pt_register('POST','Address'); pt_register('POST','City'); pt_register('POST','State'); pt_register('POST','Zip'); pt_register('POST','comments'); $comments=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $comments);if($First=="" || $Last=="" || $Email=="" || $comments=="" ){ $errors=1; $error.="<li>You did not enter one or more of the required fields. Please go back and try again."; } if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){ $error.="<li>Invalid email address entered"; $errors=1; } $email = 'yourname@yourdomain.com'; $ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if($errors==1) echo $error; else{ $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/")); $message="Name: ".$First." ".$Last." Email: ".$Email." Phone: ".$Phone." Address: ".$Address." City: ".$City." State: ".$State." Zip: ".$Zip." Comments: ".$comments." Submitted from IP: ".$ip." "; $First = mysql_escape_string($_POST['First']); $Last = mysql_escape_string($_POST['Last']); $Email = mysql_escape_string($_POST['Email']); $Phone = mysql_escape_string($_POST['Phone']); $Address = mysql_escape_string($_POST['Address']); $City = mysql_escape_string($_POST['City']); $State = mysql_escape_string($_POST['State']); $Zip = mysql_escape_string($_POST['Zip']); $comments = mysql_escape_string($_POST['comments']); $message = htmlspecialchars($message); $headers = "MIME-Version: 1.0"; $headers .= "Content-type: text/plain"; mail("yourname@yourdomain.com","New contact information submitted at your website",$message,"From: ".$email.",$headers,"); $link = mysql_connect("$DHost","$DUser","$DPass"); mysql_select_db("$DBase",$link); $query="insert into contacts (First,Last,Email,Phone,Address,City,State,Zip) values ('".$First."','".$Last."','".$Email."','".$Phone."','".$Address."','".$City."','".$State."','".$Zip."')"; mysql_query($query); header("Refresh: 0;url=http://www.yourdomain.com/sent.htm"); ?> <?php } ?>
  9. It seems kinda risky to be using a shared host for government websites, don't you think? I have been with Dreamhost for 4 years now and couldn't be happier (I know a lot of people haven't been). It's only 10.95/mo and they have lots of great features... Now, to get back on topic, it could be your contact forms, but it's kinda hart to tell if you don't post the code for us to see.
  10. I know that my host has had that problem in the past, so, yeah... it could be the reason.
  11. I went ahead and used the first one and it works fabulously! Thank you sir for all your help!
  12. Sure it does: http://www.google.com/search?hl=en&q=CRON+Jobs&btnG=Google+Search&aq=f&oq=
  13. So, for subsequent changes, would it be like this? function replaceTableTitle($title) { switch (strtolower($title)) { case 'howtoapply': return "How To Apply"; case 'url': return "URL"; //ETC break; // etc } OR like this: function replaceTableTitle($title) { switch (strtolower($title)) { case 'howtoapply': return "How To Apply"; break; case 'url': return "URL"; break; // etc
  14. from your first example, this should work: <?php echo "Username: ".$whateverdatayouwant."\n"; ?>
  15. Excellent... we're getting there. Now, is there a way to format the last few Titles (Howtoapply, Url, Contactname, Contactphone, Contactemail) so that they are like this: URL, How To Apply, Contact Name, Contact Phone, Contact Email; without having to rename the rows in my DB?
  16. Here's the output of that test (the second go didn't work): Array ( [0] => Seattle, WA [location] => Seattle, WA [1] => Full Time [fte] => Full Time [2] => Day [shift] => Day [3] => $3438 - $4924 Per Month [salary] => $3438 - $4924 Per Month [4] => As the region's only Level I Trauma center, Harborview Medical Center (HMC) is well known for innovations and excellence in trauma care and its centers of emphasis: Trauma, Burn, Neurosciences, AIDS/STD CARER, and mentally-and medically- vulnerable populations. In addition to the centers of emphasis, HMC serves a mission population for King County. Harborview employees are committed to the vital role the institution plays in the immediate community, as well as the entire Northwest region. HMC is owned by King County and managed by the University of Washington (UW) and serves as a training site for UW's School of Medicine. The UW is proud to be one of the nation's premier educational and research institutions. Our people are the most important asset in our pursuit of achieving excellence in education, research, and community service. Our staff not only enjoys outstanding benefits and professional growth opportunities, but also an environment noted for diversity, community involvement, intellectual excitement, artistic pursuits, and natural beauty. Harborview Medical Center received the prestigious 2007 Foster G. McGaw Prize for Excellence in Community Service, one of the most esteemed honors of excellence in community service in healthcare. Our CLINICAL ENGINEERING department has an outstanding opportunity for a BIOMEDICAL TECHNICIAN 1. This position performs entry-level biomedical electronics work to troubleshoot, repair, maintain, install, test and calibrate a variety of analog and/or digital biomedical electronic instruments, apparatus, and equipment used in a healthcare facility. This will involve maintaining, troubleshooting, and repairing mechanical electromechanical and electronic equipment and apparatus used in Patient Care; calibrating and testing mechanical, electromechanical and electronic equipment or apparatus used in patient care, and constructing simple electrical circuits or assemblies designed by others for use in patient care. Additionally, the person in this role will prepare reports, documentation and data entry in accordance with hospital procedures, and establish and maintain good customer relationships. [description] => As the region's only Level I Trauma center, Harborview Medical Center (HMC) is well known for innovations and excellence in trauma care and its centers of emphasis: Trauma, Burn, Neurosciences, AIDS/STD CARER, and mentally-and medically- vulnerable populations. In addition to the centers of emphasis, HMC serves a mission population for King County. Harborview employees are committed to the vital role the institution plays in the immediate community, as well as the entire Northwest region. HMC is owned by King County and managed by the University of Washington (UW) and serves as a training site for UW's School of Medicine. The UW is proud to be one of the nation's premier educational and research institutions. Our people are the most important asset in our pursuit of achieving excellence in education, research, and community service. Our staff not only enjoys outstanding benefits and professional growth opportunities, but also an environment noted for diversity, community involvement, intellectual excitement, artistic pursuits, and natural beauty. Harborview Medical Center received the prestigious 2007 Foster G. McGaw Prize for Excellence in Community Service, one of the most esteemed honors of excellence in community service in healthcare. Our CLINICAL ENGINEERING department has an outstanding opportunity for a BIOMEDICAL TECHNICIAN 1. This position performs entry-level biomedical electronics work to troubleshoot, repair, maintain, install, test and calibrate a variety of analog and/or digital biomedical electronic instruments, apparatus, and equipment used in a healthcare facility. This will involve maintaining, troubleshooting, and repairing mechanical electromechanical and electronic equipment and apparatus used in Patient Care; calibrating and testing mechanical, electromechanical and electronic equipment or apparatus used in patient care, and constructing simple electrical circuits or assemblies designed by others for use in patient care. Additionally, the person in this role will prepare reports, documentation and data entry in accordance with hospital procedures, and establish and maintain good customer relationships. [5] => Competitive candidates will: * Have knowledge of calibrating/testing equipment, such as oscilloscopes, digital millimeters, function generators, calibrators, electro surgery and safety analyzers, defibrillator testers, and FR watt meters. * Have the ability to perform preventative maintenance and/or electrical safety inspections on basic patient care and clinical laboratory equipment: Test, adjust, and calibrate to federal, state, and local electrical and fire safety standards. * Have the ability to construct simple electrical circuits or assemblies designed by others for use in patient care. * Skilled in connecting boards to power supplies and fabricating enclosures. * Have the ability to connect boards to power supplies and fabricating enclosures. This position provides opportunities to work in a fast-paced environment, and work with a friendly group of people. As an employee you will enjoy generous benefits and work/life programs. As an employee you will enjoy generous benefits and work/life programs. For a complete description of our benefits for this position, please view this page. Requirements: An Associate's Degree in Biomedical Technology OR equivalent education/experience OR Certification by the Association for the Advancement of Medical Instrumentation (AAMI) as a candidate. Condition of Employment: * Monday through Friday work schedule- 8:30 a.m. - 5:00 p.m. * May have some on-call duties. [qualifications] => Competitive candidates will: * Have knowledge of calibrating/testing equipment, such as oscilloscopes, digital millimeters, function generators, calibrators, electro surgery and safety analyzers, defibrillator testers, and FR watt meters. * Have the ability to perform preventative maintenance and/or electrical safety inspections on basic patient care and clinical laboratory equipment: Test, adjust, and calibrate to federal, state, and local electrical and fire safety standards. * Have the ability to construct simple electrical circuits or assemblies designed by others for use in patient care. * Skilled in connecting boards to power supplies and fabricating enclosures. * Have the ability to connect boards to power supplies and fabricating enclosures. This position provides opportunities to work in a fast-paced environment, and work with a friendly group of people. As an employee you will enjoy generous benefits and work/life programs. As an employee you will enjoy generous benefits and work/life programs. For a complete description of our benefits for this position, please view this page. Requirements: An Associate's Degree in Biomedical Technology OR equivalent education/experience OR Certification by the Association for the Advancement of Medical Instrumentation (AAMI) as a candidate. Condition of Employment: * Monday through Friday work schedule- 8:30 a.m. - 5:00 p.m. * May have some on-call duties. [6] => * Very high mechanical aptitude. * Computer and networking skills * Maintenance skills in electronics, mechanical or electromechanical device repair. * Ability to read color codes on wiring and electrical components. * Ability to comprehend and follow both written and oral instructions. * Ability to establish and maintain working relationships with co-workers, clinical and medical staff, and the general public. * An elementary knowledge of e-mail, database management, spreadsheet, and word processor applications. * Ability to work nights, weekends, and holidays if necessary. * Ability to function in a sterile environment if necessary. * Ability to keep neat and accurate records. * Must be willing to be multi-task trained. [preferred] => * Very high mechanical aptitude. * Computer and networking skills * Maintenance skills in electronics, mechanical or electromechanical device repair. * Ability to read color codes on wiring and electrical components. * Ability to comprehend and follow both written and oral instructions. * Ability to establish and maintain working relationships with co-workers, clinical and medical staff, and the general public. * An elementary knowledge of e-mail, database management, spreadsheet, and word processor applications. * Ability to work nights, weekends, and holidays if necessary. * Ability to function in a sterile environment if necessary. * Ability to keep neat and accurate records. * Must be willing to be multi-task trained. [7] => Apply via the following URL: https://uwhires.admin.washington.edu/eng/candidates/default.cfm?szCategory=candidatepaste&szOrderID=48979 [howtoapply] => Apply via the following URL: https://uwhires.admin.washington.edu/eng/candidates/default.cfm?szCategory=candidatepaste&szOrderID=48979 [8] => [url] => [9] => [contactname] => [10] => [contactphone] => [11] => [contactemail] => [12] => 2008-11-12 [added] => 11/12/08 [13] => 46 [id] => 46 [14] => BIOMEDICAL ELECTRONICS TECHNICIAN 1 [title] => BIOMEDICAL ELECTRONICS TECHNICIAN 1 [15] => Harborview Medical Center [employer] => Harborview Medical Center )
  17. Thanks for your help. I tried your suggestions but none of the values except for that of the Title and Employer are showing up (see the previously posted URL). I had to change a few of the row names (that's why I defined them, to have shorter names). Here is the code with the updated names... not sure why it's not displaying the things it should: <?php $result = @mysql_query("SELECT id, title, employer, location, fte, shift, salary, description, qualifications, preferred, howtoapply, url, contactname, contactphone, contactemail, added FROM $db_table ORDER BY id DESC"); // I usually define columns I want out but yea, this will ensure the proper order you want them displayed later on. if (!$result) { exit("<p>Error performing query: " . mysql_error() . "</p>"); } elseif (mysql_num_rows($result) == 0){ echo "<h4>Sorry, there are no job listings at this time.</h4>"; } else { while ($row = mysql_fetch_array($result)) { // no clue why you define these, I would just access them as needed. $row['added'] = date("m/d/y", strtotime($row['added'])); // convert newline characters to HTML break tag ( <br /> ) $row['description'] = nl2br($row['description']); $row['qualifications'] = nl2br($row['qualifications']); $row['preferred'] = nl2br($row['preferred']); $row['howtoapply'] = nl2br($row['howtoapply']); echo "<h3>".$row['title']."</h3>"."\n"; //table format echo "<table width=\"600\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\" class=\"jobs\" summary=\"This table lists all of the available jobs listed with the Washington State Biomedical Association in the Northwestern region of the United States.\">"."\n"; echo "<tr class=\"jobs\" valign=\"top\"><td width=\"110\"><strong>Title:</strong></td><td width=\"490\">".$row['title']."</td></tr>"."\n"; echo "<tr class=\"jobs\" valign=\"top\"><td><strong>Employer:</strong></td><td class=\"jobs\">".$row['employer']."</td></tr>"."\n"; foreach ($row as $key => $val) { if ($key == "added") // edit changed this to key over val like it should be. break; // because that means we past the last line we wanted displayed this way. if ($val != "") echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>" . replaceTableTitle($key) . ":</strong></td><td class=\"jobs\">".$val."</td></tr>"."\n"; } echo "</table>"."\n"; echo "<div>(Added on: " .$row['added']. ")</div>"."\n"; echo "<br/><br/>"."\n"; } } // add the titles here. function replaceTableTitle($tabletitle) { $replaceArray = array("location" => "Location", "fte" => "FTE", "shift" => "Shift", "salary" => "Salary", "description" => "Description", "qualifications" => "Qualifications", "preferred" => "Preferred", "howtoapply" => "How To Apply", "url" => "URL", "contactname" => "Contact Name", "contactphone" => "Contact Phone", "contactemail" => "Contact Email"); return $replaceArray[$tabletitle]; } mysql_close(); ?>
  18. Hi there, I am a new poster but have found several answers to questions that I've had by reading the forums for a while. Anyway, I wrote a script and I was just thinking that it could be optimized or reworked to be a little more efficient with less code. The biggest thing is there are a lot of conditional 'if' statements that I was hoping could be done in a different way. Also, I would like to change the format of the page (which I can do). What I would like to do is to make the row names from the database to become part of the output instead of hard-coding them (Title, Employer, etc) and have the data in those rows output next to them in the next cell (and if there is no data in that row to not even print the row name, just how it works now). Any help would be appreciated. Here's an example of the page as it is now: http://www.bmet.org/employment.html Here's the code: $result = @mysql_query("SELECT * FROM $db_table ORDER BY id DESC"); if (!$result) { exit("<p>Error performing query: " . mysql_error() . "</p>"); } elseif (mysql_num_rows($result) == 0){ echo "<h4>Sorry, there are no job listings at this time.</h4>"; } else { while ($row = mysql_fetch_array($result)) { $id = $row['id']; $jobtitle = $row['title']; $empl = $row['employer']; $loc = $row['location']; $fte = $row['fte']; $shift = $row['shift']; $salary = $row['salary']; $desc = $row['description']; $quals = $row['qualifications']; $prefd = $row['preferred']; $howto = $row['howtoapply']; $url = $row['url']; $contName = $row['contactname']; $contPhone = $row['contactphone']; $contEmail = $row['contactemail']; $added = date("m/d/y", strtotime($row['added'])); // convert newline characters to HTML break tag ( <br /> ) $desc = nl2br($desc); $quals = nl2br($quals); $prefd = nl2br($prefd); $howto = nl2br($howto); echo "<h3>".$jobtitle."</h3>"."\n"; //table format echo "<table width=\"600\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\" class=\"jobs\" summary=\"This table lists all of the available jobs listed with the Washington State Biomedical Association in the Northwestern region of the United States.\">"."\n"; echo "<tr class=\"jobs\" valign=\"top\"><td width=\"110\"><strong>Title:</strong></td><td width=\"490\">".$jobtitle."</td></tr>"."\n"; echo "<tr class=\"jobs\" valign=\"top\"><td><strong>Employer:</strong></td><td class=\"jobs\">".$empl."</td></tr>"."\n"; if ($loc !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>Location:</strong></td><td class=\"jobs\">".$loc."</td></tr>"."\n"; } if ($fte !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>FTE:</strong></td><td class=\"jobs\">".$fte."</td></tr>"."\n"; } if ($shift !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>Shift:</strong></td><td class=\"jobs\">".$shift."</td></tr>"."\n"; } if ($salary !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>Salary:</strong></td><td class=\"jobs\">".$salary."</td></tr>"."\n"; } echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>Description:</strong></td><td class=\"jobs\">".$desc."</td></tr>"."\n"; if ($quals !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>Qualifications:</strong></td><td class=\"jobs\">" .$quals. "</td></tr>"."\n"; } if ($prefd !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>Preferred:</strong></td><td class=\"jobs\">" .$prefd. "</td></tr>"."\n"; } if ($howto !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>How To Apply:</strong></td><td class=\"jobs\">".$howto."</td></tr>"."\n"; } if ($url !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>Website:</strong></td><td class=\"jobs\"><a href=\"http://".$url."\" target=\"_blank\" class=\"popup\">http://".$url."</a></td></tr>"."\n"; } if ($contName !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>Contact Name:</strong></td><td class=\"jobs\">".$contName."</td></tr>"."\n"; } if ($contPhone !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>Contact Phone:</strong></td><td class=\"jobs\">".$contPhone."</td></tr>"."\n"; } if ($contEmail !=''){ echo "<tr class=\"jobs\" valign=\"top\"><td class=\"jobs\"><strong>Contact E-mail:</strong></td><td class=\"jobs\">".$contEmail."</td></tr>"."\n"; } echo "</table>"."\n"; echo "<div>(Added on: " .$added. ")</div>"."\n"; echo "<br/><br/>"."\n";}; }; mysql_close(); Thanks again!
×
×
  • 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.