^ You'll end up going back to your code to always change your "IF" to match something available. FAIL.
I think what Mr. Emoticon is trying to say is to get the date values from the system using something like the date("Y") function to set the drop down, after concatenating it with the semester code, i.e. $dropDownOpt="SU" . date("Y"); Then comparing it with values from table values. That way you won't have to change the code every year.
True, but it'll only take 10 seconds and he'll only have to do it every 4 months. A quick and easy solution will cost him 30 seconds a year. And, I'm pretty sure theres a way to make the if statements dynamic using date functions.
This is my thinking. It seems the easiest way to do it right now and then I can delve further into it in the future.
No, not "date functions". Make a table of only available semester codes and search that one to give them the choice... and then... WAIT A MINUTE, I already explained that before... NO. But, yea, if you want to be Lil Lazy and not work your mind into it now and not have to fix it later, go ahead and HARD-CODE them. It's not efficient, but it's the easy way out. FURTHER EXPLANATION: Let's say you enter a bunch of records... where all these students attended in semester with code SU2011. OK, so you put "SU2011" on your IF statement. You enter a bunch MORE records. Now you have to go and edit your PHP to hard code "SU2011", "SU2010", "FA2010", etc. What if you get more records? Ooops, with your "if this and if that" solution, you have to (yet again) edit your PHP to include an if statement that's BIGGER than the original that's what she said IF statement. ¿Comprende? With a dynamically built drop-down menu that gathers only the available ones, you get to check everyone's available, then check to see if that person has one graduation request in that semester. Done.
I get what you're saying. Populate the drop downs with values from the table with something like "select distinct semester from table order by date". Mine will work also without constant updating, except you might get values semesters not in the table. In which case just echo out "no records found".
^ Exactly, brother. Who likes "records not found"? No one. So don't even let them choose if there's none for them. Another approach is to not let them choose the semester code at all, but only until they've logged in. This way, you save processing time to find out. OR, just list the ones they have available without even asking them to click anything.
Guys, I am still a novice at coding PHP. I think hard-code is all I really know how to do. Haven't really had time to explore other avenues. Hopefully soon but not yet.....
^ If there's one thing I hate, is when someone wants to RUN instead of learning first how to CRAWL, then how to STAND UP, then how to WALK, then how to RUN. I find it difficult to believe that someone can learn so much in so little time, and that real-time problems can be dealt with by people who already know how to RUN... but that the people who are now barely standing up or walking can see how they can get there by RUNning. Meh, it's just my way of saying "make sure you have a good grasp of what you CAN do before you try to do it." That's all. I am hoping you completely know HTML before you learn scripting PHP, is what I'm saying. We're here to help, yo. There's many ways to skin a cat... cat.
anyone else getting this kinda stuff in some of the threads here today? <a target='_blank' title='ImageShack - Image And Video Hosting' href='http://imageshack.us/photo/my-images/194/picture3qmi.png/'><img src='http://img194.imageshack.us/img194/8823/picture3qmi.png' border='0'/></a> Uploaded with <a target='_blank' href='http://imageshack.us'>ImageShack.us</a>
Sorry, that's me. Read post #4. I was pointing out why you should sanitize (or clean your code). Unfortunately, I can't edit it out now.
Can anybody help me with this section of coding: I keep getting the following error: Parse error: parse error, unexpected '>' in D:\webroot\registrar.astate.edu\web\gradtrack\index-main.php on line 362 But when I test my code here: http://writecodeonline.com/php/ it works. EDIT: I added those first two line in the previous website and received the parse error. Line 362 is this one: HTML: echo "<p />The date of commencement is Saturday, May 7, 2011. Commencement will be broken into two ceremonies as shown below. HTML: { echo "<hr /><p /><b><div align='left'>Commencement Time and Location</div></b> <p />Your major is in the college of <b>".$myCollegeD."; echo "<p />The date of commencement is Saturday, May 7, 2011. Commencement will be broken into two ceremonies as shown below. <p><b><u>10:00 AM Ceremony</u></b></p> <p>College of Communications </p> <p>College of Education </p> <p>College of Engineering </p> <p>College of Humanities/Social Sciences </p> <p>University College </p> <p><b><u>2:30 PM Ceremony</u></b></p> <p>College of Agriculture </p> <p>College of Business </p> <p>College of Fine Arts </p> <p>College of Nursing/Health Professions </p> <p>University Science/Mathematics </p> <p></p> <p><b><font color='red'> ***UPDATE*** <a href='http://registrar.astate.edu/convolayoutspring2011.pdf' target='blank'>Click here</a> to see the tentative layout for your college. This will help your families and friends determine where to sit on your special day!</p></b></font> Please remember to be at the Convocation Center one hour early to prepare for the procession lineup. <p />Ample parking is available in all areas with special reserved sections. Reserved parking for the disabled is near the yellow entrance. <p />Disabled and hearing-impaired students should contact Beverly at <a href='mailto:fake@fakeemail.com'>fake@fakeemail.com</a> for special accommodations.<p />Not attending the ceremony? <a href='http://registrar.astate.edu/graduation/trackingyou.php' target='blank'>Let us know.</a>";
HTML Paragraph Tag You appear to be doing some <i>alternate</i> things with the Paragraph tag in a few places.
Swoly-D is right. I recommend you pick up an HTML for Dummies book before you continue much farther. It just takes about a day to learn. HTML is a mark-up language, meaning most of the code is just to define how the webpage looks, color, size, position etc. There's no algorithms involved so it should not be that hard. Then pick up a CSS book since most of the tags you are using have been deprecated. It looks a little bad if you're doing this for a college (I work for a university myself). Colleges should (or attempt) to be 508 compliant (accessibility). P.S. I think your problem is that the quotes aren't closed off properly. And you need to close off the code section with ?> to tell the server the rest of the code is html and not php. Good luck.
The font, b and u tags are "deprecated", meaning you shouldn't use them because they are in the process of being phased out. Future browsers doesn't have to support them, when in compliance with the W3C conventions (the group that standardize html). Use CSS for the fonts and u, and the strong tag instead.