PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
melindaSA
Forum Commoner
Posts: 99 Joined: Thu Oct 02, 2003 7:34 am
Post
by melindaSA » Mon Feb 16, 2004 11:59 am
My problem is the following: I have an open jobs database that the user seleclts the open job and the results are shown. However, I would like the heading "Experience" to show only if there is info in "Required Experience" or "Preferred Experience" or "Other Experience" fields (true in one or all)
Here is my code that I cannot get to work:
Code: Select all
<?php
if ($positions['r_experience' || 'p_experience' || 'o_experience']) {
echo '<b>Experience </b><br><br> ';
}
if ($positions['r_experience']) {
echo '<blockquote><b>Required:<br></b> ' .$positions['r_experience'] . '<br></blockquote>';
}
if ($positions['p_experience']) {
echo '<blockquote><b>Preferred:<br></b> ' .$positions['p_experience'] . '<br></blockquote>';
}
if ($positions['o_experience']) {
echo '<blockquote><b>Other:<br></b> ' .$positions['o_experience'] . '<br></blockquote>';
}
?>
I would appreciate some help on this, as I have been trying to get this to work for days!!!
Thank you!
Last edited by
melindaSA on Mon Feb 16, 2004 12:48 pm, edited 1 time in total.
AVATAr
Forum Regular
Posts: 524 Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:
Post
by AVATAr » Mon Feb 16, 2004 12:08 pm
first.. it will be something like this:
if ($positions['r_experience'] || $positions['p_experience'] || $positions['o_experience']) {
what is stored in $positions['r_experience'] and those vars?
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Mon Feb 16, 2004 12:13 pm
damn u, i was just writing a big piece of code
AVATAr
Forum Regular
Posts: 524 Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:
Post
by AVATAr » Mon Feb 16, 2004 12:21 pm
ups.. sorry
melindaSA
Forum Commoner
Posts: 99 Joined: Thu Oct 02, 2003 7:34 am
Post
by melindaSA » Mon Feb 16, 2004 12:21 pm
Thank you AVATAr, it now works!
melindaSA
Forum Commoner
Posts: 99 Joined: Thu Oct 02, 2003 7:34 am
Post
by melindaSA » Mon Feb 16, 2004 12:25 pm
malcomboston -- ??
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Mon Feb 16, 2004 12:32 pm
my code was identical in outcome to avatar but slightly different
but it works now so no need to type it again
also can you please change the topic name to [SOLVED]if then show problem
thanx