I ran into a problem and I need help.
I am working with a form using php where users supply information. Its basically a job posting form. I need to post the jobs in another page which will basically be running queries to load these postings.
However, the person filling out the form has the following options as checkboxes.
- I do not want my phone number listed in the posting.
- I do not want my fax number listed in the posting.
- I do not want my e-mail listed in the posting.
Is there a way to post this information so that checked information doesn't show but still be saved in the database using queries?
Thank you in advance.
Help with Job Posting From plz
Moderator: General Moderators
Re: Help with Job Posting From plz
What's stored in the database and what gets displayed are quite separate. You could have flags in your database table for fields that can be hidden (ie. phone_show) and then display them based on the value of said flag.
Re: Help with Job Posting From plz
Thank you so much for your prompt response. I had not thought of having flags.
I'm not sure if that might bring another problem. I forgot to mention that every postings needs to be viewed by an administrator before it goes public, because postings need to be approved before they actually go public. So basically I'm having two pages where the jobs will be posted.
One page will be public and the other only for the admin with all the columns shown. (The admin page will just be a query of every column with a checkbox to approve it or not )
Will having the flags affect the administrator page? It shouldn't right, I can just ignore the flags for the admin, correct?
I'm not sure if that might bring another problem. I forgot to mention that every postings needs to be viewed by an administrator before it goes public, because postings need to be approved before they actually go public. So basically I'm having two pages where the jobs will be posted.
One page will be public and the other only for the admin with all the columns shown. (The admin page will just be a query of every column with a checkbox to approve it or not )
Will having the flags affect the administrator page? It shouldn't right, I can just ignore the flags for the admin, correct?
Re: Help with Job Posting From plz
You don't even need to display them on the administrator page.malakiahs wrote:Will having the flags affect the administrator page? It shouldn't right, I can just ignore the flags for the admin, correct?
Re: Help with Job Posting From plz
So the way I see it is having 3 flag columns in the database with these values
column1 = no_phone_flag = 0 , column2 = no_fax_flag = 0, column3 = no_email_flag = 0
When the user marks a box, the value changes to 1.
Assuming that the user selected not to show phone only
How could I code the query so that when I run something like the following:
$query = SELECT company_name, company_address, (skip company_phone) company_fax, company_email... FROM table1 WHERE no_phone_flag = 1
It doesn't post all jobs without phone numbers of every posting? by using loops?
column1 = no_phone_flag = 0 , column2 = no_fax_flag = 0, column3 = no_email_flag = 0
When the user marks a box, the value changes to 1.
Assuming that the user selected not to show phone only
How could I code the query so that when I run something like the following:
$query = SELECT company_name, company_address, (skip company_phone) company_fax, company_email... FROM table1 WHERE no_phone_flag = 1
It doesn't post all jobs without phone numbers of every posting? by using loops?
Re: Help with Job Posting From plz
Probably the easiest way to do it would be to include the flag columns in your query and choose whether or not to display the associated fields based on their value.
Code: Select all
echo ($row['no_phone'] == 1) ? "" : $row['phone'];Re: Help with Job Posting From plz
Yes! I can see it now!
Thank you, it is alot less coding your way!!
I really appreciate your help!! I was about to code many ifs and many elseif for all the possible queries....
I appreciate it, you saved me from many lines of unnecessary coding.
Thank you, it is alot less coding your way!!
I really appreciate your help!! I was about to code many ifs and many elseif for all the possible queries....
I appreciate it, you saved me from many lines of unnecessary coding.